本文整理汇总了PHP中vamDBquery函数的典型用法代码示例。如果您正苦于以下问题:PHP vamDBquery函数的具体用法?PHP vamDBquery怎么用?PHP vamDBquery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vamDBquery函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}
示例2: ship2pay
function ship2pay()
{
global $order;
$shipping = $_SESSION['shipping'];
$shipping_module = substr($shipping['id'], 0, strpos($shipping['id'], '_')) . '.php';
$q_ship2pay = vamDBquery("SELECT payments_allowed, zones_id FROM " . TABLE_SHIP2PAY . " where shipment = '" . $shipping_module . "' and status=1");
$check_flag = false;
while ($mods = vam_db_fetch_array($q_ship2pay, true)) {
if ($mods['zones_id'] > 0) {
$check_query = vamDBquery("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . $mods['zones_id'] . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while ($check = vam_db_fetch_array($check_query, true)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break 2;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break 2;
}
}
} else {
$check_flag = true;
break;
}
}
if ($check_flag) {
$modules = $mods['payments_allowed'];
} else {
$modules = MODULE_PAYMENT_INSTALLED;
}
$modules = explode(';', $modules);
return $modules;
}
示例3: get_category_tree
function get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false, $cPath = '')
{
if ($parent_id == 0) {
$cPath = '';
} else {
$cPath .= $parent_id . '_';
}
if (!is_array($category_tree_array)) {
$category_tree_array = array();
}
if (sizeof($category_tree_array) < 1 && $exclude != '0') {
$category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
}
if ($include_itself) {
$category_query = "select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . $_SESSION['languages_id'] . "' and c.categories_status = '1' and cd.categories_id = '" . $parent_id . "'";
$category_query = vamDBquery($category_query);
$category = vam_db_fetch_array($category_query, true);
$category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
}
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $_SESSION['languages_id'] . "' and c.parent_id = '" . $parent_id . "' and c.categories_status = '1' order by c.sort_order, cd.categories_name";
$categories_query = vamDBquery($categories_query);
while ($categories = vam_db_fetch_array($categories_query, true)) {
$SEF_link = vam_href_link(FILENAME_DEFAULT, vam_category_link($categories['categories_id'], $categories['categories_name']));
if ($exclude != $categories['categories_id']) {
$category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name'], 'link' => $SEF_link);
}
$category_tree_array = get_category_tree($categories['categories_id'], $spacing . ' ', $exclude, $category_tree_array, false, $cPath);
}
return $category_tree_array;
}
示例4: vam_get_path
function vam_get_path($current_category_id = '')
{
global $cPath_array;
if (vam_not_null($current_category_id)) {
$cp_size = sizeof($cPath_array);
if ($cp_size == 0) {
$cPath_new = $current_category_id;
} else {
$cPath_new = '';
$last_category_query = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . $cPath_array[$cp_size - 1] . "'";
$last_category_query = vamDBquery($last_category_query);
$last_category = vam_db_fetch_array($last_category_query, true);
$current_category_query = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'";
$current_category_query = vamDBquery($current_category_query);
$current_category = vam_db_fetch_array($current_category_query, true);
if ($last_category['parent_id'] == $current_category['parent_id']) {
for ($i = 0; $i < $cp_size - 1; $i++) {
$cPath_new .= '_' . $cPath_array[$i];
}
} else {
for ($i = 0; $i < $cp_size; $i++) {
$cPath_new .= '_' . $cPath_array[$i];
}
}
$cPath_new .= '_' . $current_category_id;
if (substr($cPath_new, 0, 1) == '_') {
$cPath_new = substr($cPath_new, 1);
}
}
} else {
$cPath_new = vam_not_null($cPath_array) ? implode('_', $cPath_array) : '';
}
return 'cPath=' . $cPath_new;
}
示例5: vam_get_products_image
function vam_get_products_image($products_id = '')
{
$product_query = "select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'";
$product_query = vamDBquery($product_query);
$products_image = vam_db_fetch_array($product_query, true);
return $products_image['products_image'];
}
示例6: 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;
}
}
示例7: vam_get_vpe_name
function vam_get_vpe_name($vpeID)
{
$vpe_query = "SELECT products_vpe_name FROM " . TABLE_PRODUCTS_VPE . " WHERE language_id='" . (int) $_SESSION['languages_id'] . "' and products_vpe_id='" . $vpeID . "'";
$vpe_query = vamDBquery($vpe_query);
$vpe = vam_db_fetch_array($vpe_query, true);
return $vpe['products_vpe_name'];
}
示例8: main
function main()
{
$this->SHIPPING = array();
// prefetch shipping status
$status_query = vamDBquery("SELECT\n shipping_status_name,\n shipping_status_image,shipping_status_id\n FROM " . TABLE_SHIPPING_STATUS . "\n where language_id = '" . (int) $_SESSION['languages_id'] . "'");
while ($status_data = vam_db_fetch_array($status_query, true)) {
$this->SHIPPING[$status_data['shipping_status_id']] = array('name' => $status_data['shipping_status_name'], 'image' => $status_data['shipping_status_image']);
}
}
示例9: vam_get_products_name
function vam_get_products_name($product_id, $language = '')
{
if (empty($language)) {
$language = $_SESSION['languages_id'];
}
$product_query = "select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $product_id . "' and language_id = '" . $language . "'";
$product_query = vamDBquery($product_query);
$product = vam_db_fetch_array($product_query, true);
return $product['products_name'];
}
示例10: vam_has_product_attributes
function vam_has_product_attributes($products_id)
{
$attributes_query = "select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "'";
$attributes_query = vamDBquery($attributes_query);
$attributes = vam_db_fetch_array($attributes_query, true);
if ($attributes['count'] > 0) {
return true;
} else {
return false;
}
}
示例11: vam_has_category_subcategories
function vam_has_category_subcategories($category_id)
{
$child_category_query = "select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '" . $category_id . "'";
$child_category_query = vamDBquery($child_category_query);
$child_category = vam_db_fetch_array($child_category_query, true);
if ($child_category['count'] > 0) {
return true;
} else {
return false;
}
}
示例12: vam_get_manufacturers
function vam_get_manufacturers($manufacturers_array = '')
{
if (!is_array($manufacturers_array)) {
$manufacturers_array = array();
}
$manufacturers_query = vamDBquery("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
while ($manufacturers = vam_db_fetch_array($manufacturers_query, true)) {
$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']);
}
return $manufacturers_array;
}
示例13: vam_get_subcategories
function vam_get_subcategories(&$subcategories_array, $parent_id = 0)
{
$subcategories_query = "select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . $parent_id . "'";
$subcategories_query = vamDBquery($subcategories_query);
while ($subcategories = vam_db_fetch_array($subcategories_query, true)) {
$subcategories_array[sizeof($subcategories_array)] = $subcategories['categories_id'];
if ($subcategories['categories_id'] != $parent_id) {
vam_get_subcategories($subcategories_array, $subcategories['categories_id']);
}
}
}
示例14: vam_get_categoriesstatus_for_product
function vam_get_categoriesstatus_for_product($product_id)
{
$categorie_query = "SELECT\n\t categories_id\n\t FROM " . TABLE_PRODUCTS_TO_CATEGORIES . "\n\t WHERE products_id='" . $product_id . "'";
$categorie_query = vamDBquery($categorie_query);
while ($categorie_data = vam_db_fetch_array($categorie_query, true)) {
if (vam_check_categories_status($categorie_data['categories_id']) >= 1) {
return 1;
} else {
return 0;
}
echo $categorie_data['categories_id'];
}
}
示例15: vam_get_products_mo_images
function vam_get_products_mo_images($products_id = '')
{
$mo_query = "select image_id, image_nr, image_name from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . $products_id . "' ORDER BY image_nr";
$products_mo_images_query = vamDBquery($mo_query);
while ($row = vam_db_fetch_array($products_mo_images_query, true)) {
$results[$row['image_nr'] - 1] = $row;
}
if (is_array($results)) {
return $results;
} else {
return false;
}
}