本文整理汇总了PHP中vam_db_num_rows函数的典型用法代码示例。如果您正苦于以下问题:PHP vam_db_num_rows函数的具体用法?PHP vam_db_num_rows怎么用?PHP vam_db_num_rows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vam_db_num_rows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vam_get_tax_description
function vam_get_tax_description($class_id, $country_id = -1, $zone_id = -1)
{
if ($country_id == -1 && $zone_id == -1) {
if (!isset($_SESSION['customer_id'])) {
$country_id = STORE_COUNTRY;
$zone_id = STORE_ZONE;
} else {
$country_id = $_SESSION['customer_country_id'];
$zone_id = $_SESSION['customer_zone_id'];
}
} else {
$country_id = $country_id;
$zone_id = $zone_id;
}
$tax_query = vamDBquery("select tax_description from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . $country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . $zone_id . "') and tr.tax_class_id = '" . $class_id . "' order by tr.tax_priority");
if (vam_db_num_rows($tax_query, true)) {
$tax_description = '';
while ($tax = vam_db_fetch_array($tax_query, true)) {
$tax_description .= $tax['tax_description'] . ' + ';
}
$tax_description = substr($tax_description, 0, -3);
return $tax_description;
} else {
return TEXT_UNKNOWN_TAX_RATE;
}
}
示例2: permissions_check_for_install
function permissions_check_for_install()
{
foreach ($this->req as $id => $require) {
if (strtolower($require) == 'jos_commerce') {
if (!$this->isJoscom()) {
$this->error('This CIP is only for Jos-Commerce environment!');
return $this->error;
}
continue;
}
if (strtolower($require) == 'os_commerce') {
if ($this->isJoscom()) {
$this->error('This CIP is only for OSCommerce environment!');
return $this->error;
}
continue;
}
$query = 'select * from ' . TABLE_CIP . ' where cip_ident="' . $require . '"' . ($this->ver[$id] != NULL ? ' and cip_version="' . $this->ver[$id] . '"' : '') . ' and cip_installed=1';
$result = cip_db_query($query, 'return');
if (vam_db_num_rows($result) == 0) {
//required CIP not installed
$this->error('CIP ' . $require . ' is not installed and is required !');
return $this->error;
}
}
return $this->error;
}
示例3: get_data_from_xml_parser
function get_data_from_xml_parser($xml_data = '')
{
$this->data['cip_ident'] = $this->getTagText($xml_data, 'cip', 0);
$this->data['cip_version'] = $this->getTagAttr($xml_data, 'cip', 0, 'version');
$active = false;
if ($this->data['cip_ident'] == 'jos_commerce') {
if ($this->isJoscom()) {
$active = true;
}
} else {
$query = 'select * from ' . TABLE_CIP . ' where cip_ident="' . $this->data['cip_ident'] . '"' . ($this->data['cip_version'] == NULL ? '' : ' and cip_version="' . $this->data['cip_version'] . '"') . ' and cip_installed=1';
$result = cip_db_query($query, 'return');
$active = vam_db_num_rows($result) > 0;
}
if ($active) {
//if cip installed
$obj = $xml_data->getElementsByTagName('active');
if (is_object($obj)) {
$mtag = $obj->item(0);
}
} else {
$obj = $xml_data->getElementsByTagName('inactive');
if (is_object($obj)) {
$mtag = $obj->item(0);
}
}
if (is_object($mtag)) {
$this->getSubTags($mtag);
}
}
示例4: vam_display_banner
function vam_display_banner($action, $identifier)
{
if ($action == 'dynamic') {
$banners_query = vam_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
$banners = vam_db_fetch_array($banners_query);
if ($banners['count'] > 0) {
$banner = vam_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
} else {
return '<b>VaM Shop ERROR! (vam_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</b>';
}
} elseif ($action == 'static') {
if (is_array($identifier)) {
$banner = $identifier;
} else {
$banner_query = vam_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . $identifier . "'");
if (vam_db_num_rows($banner_query)) {
$banner = vam_db_fetch_array($banner_query);
} else {
return '<b>VaM Shop ERROR! (vam_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive</b>';
}
}
} else {
return '<b>VaM Shop ERROR! (vam_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'</b>';
}
if (vam_not_null($banner['banners_html_text'])) {
$banner_string = $banner['banners_html_text'];
} else {
$banner_string = '<a href="' . vam_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" onclick="window.open(this.href); return false;">' . vam_image(DIR_WS_IMAGES . 'banner/' . $banner['banners_image'], $banner['banners_title']) . '</a>';
}
vam_update_banner_display_count($banner['banners_id']);
return $banner_string;
}
示例5: query
function query($order_id)
{
$order_query = vam_db_query("select customers_name,\n customers_cid,\n customers_id,\n customers_vat_id,\n customers_company,\n customers_street_address,\n customers_suburb,\n customers_city,\n customers_postcode,\n customers_state,\n customers_country,\n customers_telephone,\n customers_email_address,\n customers_address_format_id,\n delivery_name,\n delivery_company,\n delivery_street_address,\n delivery_suburb,\n delivery_city,\n delivery_postcode,\n delivery_state,\n delivery_country,\n delivery_address_format_id,\n billing_name,\n billing_company,\n billing_street_address,\n billing_suburb,\n billing_city,\n billing_postcode,\n billing_state,\n billing_country,\n billing_address_format_id,\n payment_method,\n payment_class,\n\t\t\t\t shipping_class,\n\t\t\t\t cc_type,\n cc_owner,\n cc_number,\n cc_expires,\n cc_cvv,\n comments,\n currency,\n currency_value,\n date_purchased,\n orders_status,\n last_modified,\n orig_reference, \n login_reference,\n customers_status,\n customers_status_name,\n customers_status_image,\n customers_ip,\n language,\n customers_status_discount\n from " . TABLE_ORDERS . " where\n orders_id = '" . vam_db_input($order_id) . "'");
$order = vam_db_fetch_array($order_query);
$totals_query = vam_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . vam_db_input($order_id) . "' order by sort_order");
while ($totals = vam_db_fetch_array($totals_query)) {
$this->totals[] = array('title' => $totals['title'], 'text' => $totals['text']);
}
$this->info = array('currency' => $order['currency'], 'currency_value' => $order['currency_value'], 'payment_method' => $order['payment_method'], 'payment_class' => $order['payment_class'], 'shipping_class' => $order['shipping_class'], 'status' => $order['customers_status'], 'status_name' => $order['customers_status_name'], 'status_image' => $order['customers_status_image'], 'status_discount' => $order['customers_status_discount'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], 'cc_cvv' => $order['cc_cvv'], 'comments' => $order['comments'], 'language' => $order['language'], 'date_purchased' => $order['date_purchased'], 'orders_status' => $order['orders_status'], 'last_modified' => $order['last_modified']);
$this->customer = array('name' => $order['customers_name'], 'company' => $order['customers_company'], 'csID' => $order['customers_cid'], 'vat_id' => $order['customers_vat_id'], 'shop_id' => $order['shop_id'], 'ID' => $order['customers_id'], 'cIP' => $order['customers_ip'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address'], 'orig_reference' => $order['orig_reference'], 'login_reference' => $order['login_reference']);
$this->delivery = array('name' => $order['delivery_name'], 'company' => $order['delivery_company'], 'street_address' => $order['delivery_street_address'], 'suburb' => $order['delivery_suburb'], 'city' => $order['delivery_city'], 'postcode' => $order['delivery_postcode'], 'state' => $order['delivery_state'], 'country' => $order['delivery_country'], 'format_id' => $order['delivery_address_format_id']);
$this->billing = array('name' => $order['billing_name'], 'company' => $order['billing_company'], 'street_address' => $order['billing_street_address'], 'suburb' => $order['billing_suburb'], 'city' => $order['billing_city'], 'postcode' => $order['billing_postcode'], 'state' => $order['billing_state'], 'country' => $order['billing_country'], 'format_id' => $order['billing_address_format_id']);
$index = 0;
$orders_products_query = vam_db_query("select\n orders_products_id,products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price,allow_tax, products_discount_made\n from\n " . TABLE_ORDERS_PRODUCTS . "\n where\n orders_id ='" . vam_db_input($order_id) . "'");
while ($orders_products = vam_db_fetch_array($orders_products_query)) {
$this->products[$index] = array('qty' => $orders_products['products_quantity'], 'name' => $orders_products['products_name'], 'id' => $orders_products['products_id'], 'opid' => $orders_products['orders_products_id'], 'model' => $orders_products['products_model'], 'tax' => $orders_products['products_tax'], 'price' => $orders_products['products_price'], 'discount' => $orders_products['products_discount_made'], 'final_price' => $orders_products['final_price'], 'allow_tax' => $orders_products['allow_tax']);
$subindex = 0;
$attributes_query = vam_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . vam_db_input($order_id) . "' and orders_products_id = '" . $orders_products['orders_products_id'] . "'");
if (vam_db_num_rows($attributes_query)) {
while ($attributes = vam_db_fetch_array($attributes_query)) {
$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price']);
$subindex++;
}
}
$index++;
}
}
示例6: vam_get_tax_rate
function vam_get_tax_rate($class_id, $country_id = -1, $zone_id = -1)
{
if ($country_id == -1 && $zone_id == -1) {
if (!isset($_SESSION['customer_id'])) {
$country_id = STORE_COUNTRY;
$zone_id = STORE_ZONE;
} else {
$country_id = $_SESSION['customer_country_id'];
$zone_id = $_SESSION['customer_zone_id'];
}
} else {
$country_id = $country_id;
$zone_id = $zone_id;
}
$tax_query = vamDBquery("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . $country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . $zone_id . "') and tr.tax_class_id = '" . $class_id . "' group by tr.tax_priority");
if (vam_db_num_rows($tax_query, true)) {
$tax_multiplier = 1.0;
while ($tax = vam_db_fetch_array($tax_query, true)) {
$tax_multiplier *= 1.0 + $tax['tax_rate'] / 100;
}
return ($tax_multiplier - 1.0) * 100;
} else {
return 0;
}
}
示例7: check
function check()
{
if (!isset($this->_check)) {
$check_query = vam_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TOTAL_STATUS'");
$this->_check = vam_db_num_rows($check_query);
}
return $this->_check;
}
示例8: vam_expire_specials
function vam_expire_specials()
{
$specials_query = vam_db_query("select specials_id from " . TABLE_SPECIALS . " where status = '1' and now() >= expires_date and expires_date > 0");
if (vam_db_num_rows($specials_query)) {
while ($specials = vam_db_fetch_array($specials_query)) {
vam_set_specials_status($specials['specials_id'], '0');
}
}
}
示例9: vam_get_address_format_id
function vam_get_address_format_id($country_id)
{
$address_format_query = vam_db_query("select address_format_id as format_id from " . TABLE_COUNTRIES . " where countries_id = '" . $country_id . "'");
if (vam_db_num_rows($address_format_query)) {
$address_format = vam_db_fetch_array($address_format_query);
return $address_format['format_id'];
} else {
return '1';
}
}
示例10: db_query
function db_query($blz)
{
$blz_query = vam_db_query("SELECT * from " . TABLE_BANKTRANSFER . " WHERE blz = '" . $blz . "'");
if (vam_db_num_rows($blz_query)) {
$data = vam_db_fetch_array($blz_query);
} else {
$data = -1;
}
return $data;
}
示例11: vam_get_zone_name
function vam_get_zone_name($country_id, $zone_id, $default_zone)
{
$zone_query = vam_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . $country_id . "' and zone_id = '" . $zone_id . "'");
if (vam_db_num_rows($zone_query)) {
$zone = vam_db_fetch_array($zone_query);
return $zone['zone_name'];
} else {
return $default_zone;
}
}
示例12: query
function query($order_id)
{
global $shipping;
$order_query = vam_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
$order = vam_db_fetch_array($order_query);
$totals_query = vam_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' order by sort_order");
while ($totals = vam_db_fetch_array($totals_query)) {
$this->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class'], 'value' => $totals['value'], 'sort_order' => $totals['sort_order'], 'orders_total_id' => $totals['orders_total_id']);
}
$this->info = array('currency' => $order['currency'], 'currency_value' => $order['currency_value'], 'payment_method' => $order['payment_method'], 'payment_class' => $order['payment_class'], 'shipping_class' => $order['shipping_class'], 'status' => $order['customers_status'], 'status_name' => $order['customers_status_name'], 'status_image' => $order['customers_status_image'], 'status_discount' => $order['customers_status_discount'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], 'cc_cvv' => $order['cc_cvv'], 'comments' => $order['comments'], 'language' => $order['language'], 'date_purchased' => $order['date_purchased'], 'orders_status' => $order['orders_status'], 'last_modified' => $order['last_modified'], 'shipping_method' => $shipping['title'], 'shipping_cost' => $shipping['cost'], 'shipping_id' => $order['shipping_module'], 'subtotal' => 0, 'tax' => 0, 'tax_groups' => array());
$this->customer = array('name' => $order['customers_name'], 'company' => $order['customers_company'], 'csID' => $order['customers_cid'], 'vat_id' => $order['customers_vat_id'], 'shop_id' => $order['shop_id'], 'ID' => $order['customers_id'], 'cIP' => $order['customers_ip'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'country_id' => oe_get_country_id($order['customers_country']), 'zone_id' => oe_get_zone_id(oe_get_country_id($order['customers_country']), $order['customers_state']), 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address'], 'orig_reference' => $order['orig_reference'], 'login_reference' => $order['login_reference']);
$this->delivery = array('name' => $order['delivery_name'], 'company' => $order['delivery_company'], 'street_address' => $order['delivery_street_address'], 'suburb' => $order['delivery_suburb'], 'city' => $order['delivery_city'], 'postcode' => $order['delivery_postcode'], 'state' => $order['delivery_state'], 'country' => $order['delivery_country'], 'country_id' => oe_get_country_id($order['delivery_country']), 'zone_id' => oe_get_zone_id(oe_get_country_id($order['delivery_country']), $order['delivery_state']), 'format_id' => $order['delivery_address_format_id']);
$this->billing = array('name' => $order['billing_name'], 'company' => $order['billing_company'], 'street_address' => $order['billing_street_address'], 'suburb' => $order['billing_suburb'], 'city' => $order['billing_city'], 'postcode' => $order['billing_postcode'], 'state' => $order['billing_state'], 'country' => $order['billing_country'], 'country_id' => oe_get_country_id($order['billing_country']), 'zone_id' => oe_get_zone_id(oe_get_country_id($order['billing_country']), $order['billing_state']), 'format_id' => $order['billing_address_format_id']);
$index = 0;
$orders_products_query = vam_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $order_id . "' order by orders_products_id");
while ($orders_products = vam_db_fetch_array($orders_products_query)) {
$orders_products_tax_query = vam_db_query("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = " . $orders_products['products_id'] . "");
$orders_products_tax = vam_db_fetch_array($orders_products_tax_query);
$this->products[$index] = array('qty' => $orders_products['products_quantity'], 'name' => $orders_products['products_name'], 'model' => $orders_products['products_model'], 'tax' => $orders_products['products_tax'], 'tax_description' => vam_get_tax_description($orders_products_tax['products_tax_class_id'], $this->delivery["country_id"], $this->delivery["zone_id"]), 'price' => $orders_products['products_price'], 'final_price' => $orders_products['products_price'] * $orders_products['products_quantity'], 'products_id' => $orders_products['products_id'], 'orders_products_id' => $orders_products['orders_products_id']);
$subindex = 0;
$attributes_query = vam_db_query("select products_options, products_options_values, options_values_price, price_prefix, orders_products_attributes_id from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $order_id . "' and orders_products_id = '" . (int) $orders_products['orders_products_id'] . "'");
if (vam_db_num_rows($attributes_query)) {
while ($attributes = vam_db_fetch_array($attributes_query)) {
$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price'], 'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
$subindex++;
}
}
$shown_price = vam_add_tax($this->products[$index]['price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
$this->info['subtotal'] += $shown_price;
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->info['tax'] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
if (isset($this->info['tax_groups']["{$products_tax_description}"])) {
$this->info['tax_groups']["{$products_tax_description}"] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
} else {
$this->info['tax_groups']["{$products_tax_description}"] = $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
}
} else {
$this->info['tax'] += $products_tax / 100 * $shown_price;
if (isset($this->info['tax_groups']["{$products_tax_description}"])) {
$this->info['tax_groups']["{$products_tax_description}"] += $products_tax / 100 * $shown_price;
} else {
$this->info['tax_groups']["{$products_tax_description}"] = $products_tax / 100 * $shown_price;
}
}
$index++;
}
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
} else {
$this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
}
}
示例13: vam_get_tax_class_rate
function vam_get_tax_class_rate($tax_class_id)
{
$tax_multiplier = 0;
$tax_query = vam_db_query("select SUM(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " WHERE tax_class_id = '" . $tax_class_id . "' GROUP BY tax_priority");
if (vam_db_num_rows($tax_query)) {
while ($tax = vam_db_fetch_array($tax_query)) {
$tax_multiplier += $tax['tax_rate'];
}
}
return $tax_multiplier;
}
示例14: vam_get_spsr_zone_id
function vam_get_spsr_zone_id($zone_id)
{
$spsr_zone_query = vam_db_query("select spsr_zone_id from " . TABLE_SPSR_ZONES . " where zone_id = '" . $zone_id . "'");
if (vam_db_num_rows($spsr_zone_query)) {
$spsr_zone = vam_db_fetch_array($spsr_zone_query);
$spsr_zone_id = $spsr_zone['spsr_zone_id'];
return $spsr_zone_id;
} else {
return false;
}
}
示例15: vam_activate_banners
function vam_activate_banners()
{
$banners_query = vam_db_query("select banners_id, date_scheduled from " . TABLE_BANNERS . " where date_scheduled != ''");
if (vam_db_num_rows($banners_query)) {
while ($banners = vam_db_fetch_array($banners_query)) {
if (date('Y-m-d H:i:s') >= $banners['date_scheduled']) {
vam_set_banner_status($banners['banners_id'], '1');
}
}
}
}