本文整理汇总了PHP中vamDBquery函数的典型用法代码示例。如果您正苦于以下问题:PHP vamDBquery函数的具体用法?PHP vamDBquery怎么用?PHP vamDBquery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vamDBquery函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:25,代码来源:vam_get_tax_rate.inc.php
示例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;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:32,代码来源:ship2pay.php
示例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;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:30,代码来源:sitemap.php
示例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;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:34,代码来源:vam_get_path.inc.php
示例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'];
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:7,代码来源:vam_get_products_image.inc.php
示例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;
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:26,代码来源:vam_get_tax_description.inc.php
示例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'];
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:7,代码来源:vam_get_vpe_name.inc.php
示例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']);
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:9,代码来源:main.php
示例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'];
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:10,代码来源:vam_get_products_name.inc.php
示例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;
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:11,代码来源:vam_has_product_attributes.inc.php
示例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;
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:11,代码来源:vam_has_category_subcategories.inc.php
示例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;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:11,代码来源:vam_get_manufacturers.inc.php
示例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']);
}
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:11,代码来源:vam_get_subcategories.inc.php
示例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'];
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:13,代码来源:vam_check_categories_status.inc.php
示例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;
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:13,代码来源:vam_get_products_mo_images.inc.php
示例16: vam_get_parent_categories
function vam_get_parent_categories(&$categories, $categories_id)
{
$parent_categories_query = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . $categories_id . "'";
$parent_categories_query = vamDBquery($parent_categories_query);
while ($parent_categories = vam_db_fetch_array($parent_categories_query, true)) {
if ($parent_categories['parent_id'] == 0) {
return true;
}
$categories[sizeof($categories)] = $parent_categories['parent_id'];
if ($parent_categories['parent_id'] != $categories_id) {
vam_get_parent_categories($categories, $parent_categories['parent_id']);
}
}
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:14,代码来源:vam_get_parent_categories.inc.php
示例17: vam_get_categories
function vam_get_categories($categories_array = '', $parent_id = '0', $indent = '')
{
$parent_id = vam_db_prepare_input($parent_id);
if (!is_array($categories_array)) {
$categories_array = array();
}
$categories_query = "select\n c.categories_id,\n cd.categories_name\n from " . TABLE_CATEGORIES . " c,\n " . TABLE_CATEGORIES_DESCRIPTION . " cd\n where parent_id = '" . vam_db_input($parent_id) . "'\n and c.categories_id = cd.categories_id\n and c.categories_status != 0\n and cd.language_id = '" . $_SESSION['languages_id'] . "'\n order by sort_order, cd.categories_name";
$categories_query = vamDBquery($categories_query);
while ($categories = vam_db_fetch_array($categories_query, true)) {
$categories_array[] = array('id' => $categories['categories_id'], 'text' => $indent . $categories['categories_name']);
if ($categories['categories_id'] != $parent_id) {
$categories_array = vam_get_categories($categories_array, $categories['categories_id'], $indent . ' ');
}
}
return $categories_array;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:16,代码来源:vam_get_categories.inc.php
示例18: vam_get_product_path
function vam_get_product_path($products_id)
{
$cPath = '';
$category_query = "select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int) $products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id != 0 limit 1";
$category_query = vamDBquery($category_query);
if (vam_db_num_rows($category_query, true)) {
$category = vam_db_fetch_array($category_query);
$categories = array();
vam_get_parent_categories($categories, $category['categories_id']);
$categories = array_reverse($categories);
$cPath = implode('_', $categories);
if (vam_not_null($cPath)) {
$cPath .= '_';
}
$cPath .= $category['categories_id'];
}
return $cPath;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:18,代码来源:vam_get_product_path.inc.php
示例19: vam_customer_greeting
function vam_customer_greeting()
{
if (isset($_SESSION['customer_last_name']) && isset($_SESSION['customer_id'])) {
if (!isset($_SESSION['customer_gender'])) {
$check_customer_query = "select customers_gender FROM " . TABLE_CUSTOMERS . " where customers_id = '" . $_SESSION['customer_id'] . "'";
$check_customer_query = vamDBquery($check_customer_query);
$check_customer_data = vam_db_fetch_array($check_customer_query, true);
$_SESSION['customer_gender'] = $check_customer_data['customers_gender'];
}
if ($_SESSION['customer_gender'] == 'f') {
$greeting_string = sprintf(TEXT_GREETING_PERSONAL, FEMALE . ' ' . $_SESSION['customer_first_name'] . ' ' . $_SESSION['customer_last_name'], vam_href_link(FILENAME_PRODUCTS_NEW));
} else {
$greeting_string = sprintf(TEXT_GREETING_PERSONAL, MALE . ' ' . $_SESSION['customer_first_name'] . ' ' . $_SESSION['customer_last_name'], vam_href_link(FILENAME_PRODUCTS_NEW));
}
} else {
$greeting_string = sprintf(TEXT_GREETING_GUEST, vam_href_link(FILENAME_LOGIN, '', 'SSL'), vam_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
}
return $greeting_string;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:19,代码来源:vam_customer_greeting.inc.php
示例20: vam_count_products_in_category
function vam_count_products_in_category($category_id, $include_inactive = false)
{
$products_count = 0;
if ($include_inactive == true) {
$products_query = "select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . $category_id . "'";
} else {
$products_query = "select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . $category_id . "'";
}
$products_query = vamDBquery($products_query);
$products = vam_db_fetch_array($products_query, true);
$products_count += $products['total'];
$child_categories_query = "select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . $category_id . "'";
$child_categories_query = vamDBquery($child_categories_query);
if (vam_db_num_rows($child_categories_query, true)) {
while ($child_categories = vam_db_fetch_array($child_categories_query, true)) {
$products_count += vam_count_products_in_category($child_categories['categories_id'], $include_inactive);
}
}
return $products_count;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:20,代码来源:vam_count_products_in_category.inc.php
注:本文中的vamDBquery函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论