本文整理汇总了PHP中smn_db_fetch_array函数的典型用法代码示例。如果您正苦于以下问题:PHP smn_db_fetch_array函数的具体用法?PHP smn_db_fetch_array怎么用?PHP smn_db_fetch_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smn_db_fetch_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfigValue
function getConfigValue($gID, $cID)
{
global $filter;
$configuration_query = smn_db_query("select configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . $cID . "' and configuration_group_id = '" . (int) $gID . "'" . $filter . " order by sort_order");
$configuration = smn_db_fetch_array($configuration_query);
if (smn_not_null($configuration['use_function'])) {
$use_function = $configuration['use_function'];
if (ereg('->', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include DIR_WS_CLASSES . $class_method[0] . '.php';
${$class_method[0]} = new $class_method[0]();
}
$cfgValue = smn_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
} else {
$cfgValue = smn_call_function($use_function, $configuration['configuration_value']);
}
} else {
$cfgValue = $configuration['configuration_value'];
}
if (empty($cfgValue) && !is_numeric($cfgValue)) {
$cfgValue = ' ';
}
return $cfgValue;
}
示例2: ups
function ups()
{
global $store_id, $order;
$this->code = 'ups';
$this->title = MODULE_SHIPPING_UPS_TEXT_TITLE;
$this->description = MODULE_SHIPPING_UPS_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_UPS_SORT_ORDER;
$this->icon = DIR_WS_ICONS . 'shipping_ups.gif';
$this->tax_class = MODULE_SHIPPING_UPS_TAX_CLASS;
$this->enabled = MODULE_SHIPPING_UPS_STATUS == 'True' ? true : false;
if ($this->enabled == true && (int) MODULE_SHIPPING_UPS_ZONE > 0) {
$check_flag = false;
$check_query = smn_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' and store_id = '" . $store_id . "' order by zone_id");
while ($check = smn_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
$this->types = array('1DM' => 'Next Day Air Early AM', '1DML' => 'Next Day Air Early AM Letter', '1DA' => 'Next Day Air', '1DAL' => 'Next Day Air Letter', '1DAPI' => 'Next Day Air Intra (Puerto Rico)', '1DP' => 'Next Day Air Saver', '1DPL' => 'Next Day Air Saver Letter', '2DM' => '2nd Day Air AM', '2DML' => '2nd Day Air AM Letter', '2DA' => '2nd Day Air', '2DAL' => '2nd Day Air Letter', '3DS' => '3 Day Select', 'GND' => 'Ground', 'GNDCOM' => 'Ground Commercial', 'GNDRES' => 'Ground Residential', 'STD' => 'Canada Standard', 'XPR' => 'Worldwide Express', 'XPRL' => 'worldwide Express Letter', 'XDM' => 'Worldwide Express Plus', 'XDML' => 'Worldwide Express Plus Letter', 'XPD' => 'Worldwide Expedited');
}
示例3: smn_get_header_tag_products_desc
function smn_get_header_tag_products_desc($product_id)
{
global $languages_id, $_GET;
$product_header_tags = smn_db_query("select products_head_desc_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . (int) $languages_id . "' and products_id = '" . (int) $_GET['products_id'] . "'");
$product_header_tags_values = smn_db_fetch_array($product_header_tags);
return $product_header_tags_values['products_head_desc_tag'];
}
示例4: usps
function usps()
{
global $order, $store_id;
$this->code = 'usps';
$this->title = MODULE_SHIPPING_USPS_TEXT_TITLE;
$this->description = MODULE_SHIPPING_USPS_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_USPS_SORT_ORDER;
$this->icon = DIR_WS_ICONS . 'shipping_usps.gif';
$this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS;
$this->enabled = MODULE_SHIPPING_USPS_STATUS == 'True' ? true : false;
if ($this->enabled == true && (int) MODULE_SHIPPING_USPS_ZONE > 0) {
$check_flag = false;
$check_query = smn_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' and store_id = '" . $store_id . "' order by zone_id");
while ($check = smn_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
$this->types = array('Express' => 'EXPRESS', 'First Class' => 'First-Class Mail', 'Priority' => 'Priority', 'Parcel' => 'Parcel', 'BPM' => 'Bound Printed Material', 'Library' => 'Library', 'Media' => 'Media Mail');
$this->intl_types = array('GXG Document' => 'Global Express Guaranteed Document Service', 'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service', 'Express' => 'Global Express Mail (EMS)', 'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (Large)', 'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (Small)', 'Priority Var' => 'Global Priority Mail - Variable Weight (Single)', 'Airmail Letter' => 'Airmail Letter Post', 'Airmail Parcel' => 'Airmail Parcel Post', 'Surface Letter' => 'Economy (Surface) Letter Post', 'Surface Post' => 'Economy (Surface) Parcel Post');
$this->countries = $this->country_list();
}
示例5: affiliate_insert
function affiliate_insert($sql_data_array, $affiliate_parent = 0)
{
// LOCK TABLES
smn_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
if ($affiliate_parent > 0) {
$affiliate_root_query = smn_db_query("select affiliate_root, affiliate_rgt, affiliate_lft�from " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate_parent . "' ");
// Check if we have a parent affiliate
if ($affiliate_root_array = smn_db_fetch_array($affiliate_root_query)) {
smn_db_query("update " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_lft > " . $affiliate_root_array['affiliate_rgt'] . " AND affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
smn_db_query("update " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
$sql_data_array['affiliate_root'] = $affiliate_root_array['affiliate_root'];
$sql_data_array['affiliate_lft'] = $affiliate_root_array['affiliate_rgt'];
$sql_data_array['affiliate_rgt'] = $affiliate_root_array['affiliate_rgt'] + 1;
smn_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = smn_db_insert_id();
}
// no parent -> new root
} else {
$sql_data_array['affiliate_lft'] = '1';
$sql_data_array['affiliate_rgt'] = '2';
smn_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = smn_db_insert_id();
smn_db_query("update " . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' ");
}
// UNLOCK TABLES
smn_db_query("UNLOCK TABLES");
return $affiliate_id;
}
示例6: freeshipper
function freeshipper()
{
global $order, $cart, $store_id;
$this->code = 'freeshipper';
$this->title = MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE;
$this->description = MODULE_SHIPPING_FREESHIPPER_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_FREESHIPPER_SORT_ORDER;
$this->icon = DIR_WS_ICONS . 'shipping_free_shipper.jpg';
$this->tax_class = MODULE_SHIPPING_FREESHIPPER_TAX_CLASS;
$this->enabled = MODULE_SHIPPING_FREESHIPPER_STATUS == 'True' ? true : false;
// Only show if weight is 0
$this->enabled = MODULE_SHIPPING_FREESHIPPER_STATUS;
if ($this->enabled == true && (int) MODULE_SHIPPING_FREESHIPPER_ZONE > 0) {
$check_flag = false;
$check_query = smn_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FREESHIPPER_ZONE . "' and store_id = '" . $store_id . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while ($check = smn_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
}
示例7: smn_update_whos_online
function smn_update_whos_online()
{
global $customer_id;
if (smn_session_is_registered('customer_id')) {
$wo_customer_id = $customer_id;
$customer_query = smn_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
$customer = smn_db_fetch_array($customer_query);
$wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
} else {
$wwo_full_name = 'Guest';
}
$wo_session_id = smn_session_id();
$wo_ip_address = getenv('REMOTE_ADDR');
$wo_last_page_url = getenv('REQUEST_URI');
$current_time = time();
$xx_mins_ago = $current_time - 900;
// remove entries that have expired
smn_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
$stored_customer_query = smn_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . smn_db_input($wo_session_id) . "'");
$stored_customer = smn_db_fetch_array($stored_customer_query);
if ($stored_customer['count'] > 0) {
smn_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int) $wo_customer_id . "', full_name = '" . smn_db_input($wo_full_name) . "', ip_address = '" . smn_db_input($wo_ip_address) . "', time_last_click = '" . smn_db_input($current_time) . "', last_page_url = '" . smn_db_input($wo_last_page_url) . "' where session_id = '" . smn_db_input($wo_session_id) . "'");
} else {
smn_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . (int) $wo_customer_id . "', '" . smn_db_input($wo_full_name) . "', '" . smn_db_input($wo_session_id) . "', '" . smn_db_input($wo_ip_address) . "', '" . smn_db_input($current_time) . "', '" . smn_db_input($current_time) . "', '" . smn_db_input($wo_last_page_url) . "')");
}
}
示例8: splitPageResults
function splitPageResults(&$current_page_number, $max_rows_per_page, &$sql_query, &$query_num_rows)
{
if (empty($current_page_number)) {
$current_page_number = 1;
}
if (!isset($query_num_rows)) {
$pos_to = strlen($sql_query);
$pos_from = strpos($sql_query, ' from', 0);
$pos_group_by = strpos($sql_query, ' group by', $pos_from);
if ($pos_group_by < $pos_to && $pos_group_by != false) {
$pos_to = $pos_group_by;
}
$pos_having = strpos($sql_query, ' having', $pos_from);
if ($pos_having < $pos_to && $pos_having != false) {
$pos_to = $pos_having;
}
$pos_order_by = strpos($sql_query, ' order by', $pos_from);
if ($pos_order_by < $pos_to && $pos_order_by != false) {
$pos_to = $pos_order_by;
}
$reviews_count_query = smn_db_query("select count(*) as total " . substr($sql_query, $pos_from, $pos_to - $pos_from));
$reviews_count = smn_db_fetch_array($reviews_count_query);
$query_num_rows = $reviews_count['total'];
}
$num_pages = ceil($query_num_rows / $max_rows_per_page);
if ($current_page_number > $num_pages) {
$current_page_number = $num_pages;
}
$offset = max($max_rows_per_page * ($current_page_number - 1), 0);
// systemsmanager begin - Dec 1, 2005 security patch
// $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
$sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;
// systemsmanager end
}
示例9: table
function table()
{
global $store_id, $order;
$this->code = 'table';
$this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
$this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
$this->enabled = MODULE_SHIPPING_TABLE_STATUS == 'True' ? true : false;
if ($this->enabled == true && (int) MODULE_SHIPPING_TABLE_ZONE > 0) {
$check_flag = false;
$check_query = smn_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' and store_id = '" . $store_id . "' order by zone_id");
while ($check = smn_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
}
示例10: query
function query($order_id)
{
global $store_id;
$order_query = smn_db_query("select customers_name, customers_company, customers_street_address, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where store_id = '" . $store_id . "' and orders_id = '" . (int) $order_id . "'");
$order = smn_db_fetch_array($order_query);
$totals_query = smn_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' order by sort_order");
while ($totals = smn_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'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], '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'], 'street_address' => $order['customers_street_address'], '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']);
$this->delivery = array('name' => $order['delivery_name'], 'company' => $order['delivery_company'], 'street_address' => $order['delivery_street_address'], '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'], '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 = smn_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $order_id . "'");
while ($orders_products = smn_db_fetch_array($orders_products_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'], 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price']);
$subindex = 0;
$attributes_query = smn_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $order_id . "' and orders_products_id = '" . (int) $orders_products['orders_products_id'] . "'");
if (smn_db_num_rows($attributes_query)) {
while ($attributes = smn_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++;
}
}
示例11: update_status
function update_status()
{
global $order, $store_id;
if ($this->enabled == true && (int) MODULE_PAYMENT_COD_ZONE > 0) {
$check_flag = false;
$check_query = smn_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_COD_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' and store_id = '" . $store_id . "' order by zone_id");
while ($check = smn_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
// disable the module if the order only contains virtual products
if ($this->enabled == true) {
if ($order->content_type == 'virtual') {
// $this->enabled = false;
}
}
}
示例12: smn_get_category_description
function smn_get_category_description($category_id, $language_id)
{
global $store_id;
$category_query = smn_db_query("select categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $language_id . "' and store_id = '" . $store_id . "'");
$category = smn_db_fetch_array($category_query);
return $category['categories_description'];
}
示例13: currencies
function currencies()
{
$this->currencies = array();
$currencies_query = smn_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);
while ($currencies = smn_db_fetch_array($currencies_query)) {
$this->currencies[$currencies['code']] = array('title' => $currencies['title'], 'symbol_left' => $currencies['symbol_left'], 'symbol_right' => $currencies['symbol_right'], 'decimal_point' => $currencies['decimal_point'], 'thousands_point' => $currencies['thousands_point'], 'decimal_places' => $currencies['decimal_places'], 'value' => $currencies['value']);
}
}
示例14: smn_delete_store
function smn_delete_store($prefix)
{
global $languages;
if ($prefix != '') {
$DB_tables = array(TABLE_ADMIN, TABLE_CATEGORIES, TABLE_CATEGORIES_DESCRIPTION, TABLE_CONFIGURATION, TABLE_LANGUAGES, TABLE_NEWSLETTERS, TABLE_ORDERS_TRACKING, TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD, TABLE_PRODUCTS_NOTIFICATIONS, TABLE_PRODUCTS_OPTIONS, TABLE_PRODUCTS_OPTIONS_VALUES, TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS, TABLE_REVIEWS, TABLE_REVIEWS_DESCRIPTION, TABLE_TAX_CLASS, TABLE_TAX_RATES, TABLE_GEO_ZONES, TABLE_ZONES_TO_GEO_ZONES, TABLE_ARTICLES, TABLE_WEB_SITE_CONTENT, TABLE_DYNAMIC_PAGE_INDEX, TABLE_SPECIALS, TABLE_STORE_MAIN, TABLE_STORE_COSTS, TABLE_STORE_TO_CATEGORIES, TABLE_STORE_DESCRIPTION, TABLE_STORE_REVIEWS, TABLE_MEMBER_ORDERS);
//delete all DB table rows associated with the store....
foreach ($DB_tables as $table_name) {
smn_db_query("delete from " . $table_name . " WHERE store_id = '" . $prefix . "'");
}
//remove products from system
$product_categories_query = smn_db_query("select products_id from " . TABLE_PRODUCTS . " where store_id = '" . (int) $prefix . "'");
while ($product_categories = smn_db_fetch_array($product_categories_query)) {
$product_id = (int) $product_categories['products_id'];
smn_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . $product_id . "' and store_id = '" . (int) $prefix . "'");
smn_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . $product_id . "' and store_id = '" . (int) $prefix . "'");
smn_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $product_id . "' and store_id = '" . (int) $prefix . "'");
smn_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $product_id . "'");
smn_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $product_id . "' and store_id = '" . (int) $prefix . "'");
smn_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . $product_id . "' and store_id = '" . (int) $prefix . "'");
smn_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . $product_id . "' and store_id = '" . (int) $prefix . "'");
$product_reviews_query = smn_db_query("select reviews_id from " . TABLE_REVIEWS . " where products_id = '" . $product_id . "'");
while ($product_reviews = smn_db_fetch_array($product_reviews_query)) {
smn_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . $product_reviews['reviews_id'] . "' and store_id = '" . (int) $prefix . "'");
}
smn_db_query("delete from " . TABLE_REVIEWS . " where products_id = '" . $product_id . "' and store_id = '" . (int) $prefix . "'");
if (USE_CACHE == 'true') {
smn_reset_cache_block('categories');
smn_reset_cache_block('also_purchased');
}
}
//remove orders from system
$store_orders_query = smn_db_query("select orders_id from " . TABLE_ORDERS . " where store_id = '" . (int) $prefix . "'");
while ($store_orders = smn_db_fetch_array($store_orders_query)) {
smn_db_query("delete from " . TABLE_ORDERS_TRACKING . " WHERE orders_id = '" . (int) $store_orders['orders_id'] . "'");
smn_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " WHERE orders_id = '" . (int) $store_orders['orders_id'] . "'");
smn_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " WHERE orders_id = '" . (int) $store_orders['orders_id'] . "'");
smn_db_query("delete from " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " WHERE orders_id = '" . (int) $store_orders['orders_id'] . "'");
smn_db_query("delete from " . TABLE_ORDERS_STATUS_HISTORY . " WHERE orders_id = '" . (int) $store_orders['orders_id'] . "'");
smn_db_query("delete from " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int) $store_orders['orders_id'] . "'");
}
//delete the stores image directory and files from the system
$dir = DIR_FS_CATALOG . 'images/' . $prefix . '_images';
smn_deldir($dir);
/*
//delete any saved orders in the DB tables associated with this store
$saved_store_order_query = smn_db_query("select saved_order_id from " . TABLE_SAVED_ORDERS . " WHERE saved_store_id = '". $prefix_id ."'");
if (smn_db_num_rows($store_query)){
while ($saved_store_order = smn_db_fetch_array($saved_store_order_query)){
smn_db_query("delete from " . TABLE_SAVED_ORDERS_PRODUCTS . " where saved_order_id = '" . $saved_store_order['saved_order_id'] . "'");
smn_db_query("delete from " . TABLE_SAVED_ORDERS_PRODUCTS_ATTRIBUTES . " where saved_order_id = '" . $saved_store_order['saved_order_id'] . "'");
}
smn_db_query("delete from " . TABLE_SAVED_ORDERS . " where saved_store_id = '". $prefix_id ."'");
}*/
}
return $store_deleted = 'true';
}
示例15: smn_expire_specials
function smn_expire_specials()
{
$specials_query = smn_db_query("select specials_id from " . TABLE_SPECIALS . " where status = '1' and now() >= expires_date and expires_date > 0");
if (smn_db_num_rows($specials_query)) {
while ($specials = smn_db_fetch_array($specials_query)) {
smn_set_specials_status($specials['specials_id'], '0');
}
}
}