当前位置: 首页>>代码示例>>PHP>>正文


PHP smn_db_num_rows函数代码示例

本文整理汇总了PHP中smn_db_num_rows函数的典型用法代码示例。如果您正苦于以下问题:PHP smn_db_num_rows函数的具体用法?PHP smn_db_num_rows怎么用?PHP smn_db_num_rows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了smn_db_num_rows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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++;
     }
 }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:28,代码来源:order.php

示例2: 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');
        }
    }
}
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:9,代码来源:specials.php

示例3: check

 function check()
 {
     global $store_id;
     if (!isset($this->_check)) {
         $check_query = smn_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS' and store_id = '" . $store_id . "'");
         $this->_check = smn_db_num_rows($check_query);
     }
     return $this->_check;
 }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:9,代码来源:ot_loworderfee.php

示例4: smn_get_languages_directory

function smn_get_languages_directory($code)
{
    global $languages_id;
    $language_query = smn_db_query("select languages_id, directory from " . TABLE_LANGUAGES . " where code = '" . smn_db_input($code) . "'");
    if (smn_db_num_rows($language_query)) {
        $language = smn_db_fetch_array($language_query);
        $languages_id = $language['languages_id'];
        return $language['directory'];
    } else {
        return false;
    }
}
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:12,代码来源:languages.php

示例5: smn_get_affiliate_tax_rate

function smn_get_affiliate_tax_rate($class_id, $country_id, $zone_id)
{
    $tax_query = smn_db_query("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 (smn_db_num_rows($tax_query)) {
        $tax_multiplier = 0;
        while ($tax = smn_db_fetch_array($tax_query)) {
            $tax_multiplier += $tax['tax_rate'];
        }
        return $tax_multiplier;
    } else {
        return 0;
    }
}
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:13,代码来源:affiliate_functions.php

示例6: query

 function query($order_id)
 {
     global $languages_id, $shipping_store;
     $order_id = smn_db_prepare_input($order_id);
     $order_query = smn_db_query("select customers_id, 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 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']);
     }
     $order_total_query = smn_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' and class = 'ot_total'");
     $order_total = smn_db_fetch_array($order_total_query);
     $shipping_method_query = smn_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' and class = 'ot_shipping'");
     $shipping_method = smn_db_fetch_array($shipping_method_query);
     $order_status_query = smn_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order['orders_status'] . "' and language_id = '" . (int) $languages_id . "'");
     $order_status = smn_db_fetch_array($order_status_query);
     $order_store_query = smn_db_query("select store_id from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
     $order_store = smn_db_fetch_array($order_store_query);
     $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_status['orders_status_name'], 'last_modified' => $order['last_modified'], 'total' => strip_tags($order_total['text']), 'shipping_method' => substr($shipping_method['title'], -1) == ':' ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']));
     $this->info_store[$order_store[store_id]] = array('shipping_cost' => $shipping_store[$order_store[store_id]]['cost'], 'shipping_method' => $shipping_store[$order_store[store_id]]['title']);
     $this->customer = array('id' => $order['customers_id'], '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' => array('title' => $order['customers_country']), 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address']);
     $this->delivery = array('name' => trim($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' => array('title' => $order['delivery_country']), 'format_id' => $order['delivery_address_format_id']);
     if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) {
         $this->delivery = false;
     }
     $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' => array('title' => $order['billing_country']), 'format_id' => $order['billing_address_format_id']);
     $index = 0;
     $orders_products_query = smn_db_query("select op.orders_products_id, op.products_id,o.store_id, op.products_name, op.products_model, op.products_price, op.products_tax, op.products_quantity, op.final_price from " . TABLE_ORDERS_PRODUCTS . " op," . TABLE_ORDERS . " o where op.orders_id = '" . (int) $order_id . "' and op.orders_id=o.orders_id");
     while ($orders_products = smn_db_fetch_array($orders_products_query)) {
         $this->products[$index] = array('qty' => $orders_products['products_quantity'], 'id' => $orders_products['products_id'], 'products_store_id' => $orders_products['store_id'], '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++;
             }
         }
         $this->info['tax_groups']["{$this->products[$index]['tax']}"] = '1';
         $index++;
     }
 }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:42,代码来源:order.php

示例7: mall_setup

 function mall_setup($store_id = 1)
 {
     $this->set_store_id((int) $store_id);
     $store_query = smn_db_query("select sm.*, sd.store_description, sd.store_name, a.admin_groups_id from " . TABLE_STORE_MAIN . " sm, " . TABLE_STORE_DESCRIPTION . " sd, " . TABLE_ADMIN . " a WHERE sm.store_id = '" . $this->store_id . "' and sd.store_id = '" . $this->store_id . "' and a.store_id = '" . $this->store_id . "'");
     if (smn_db_num_rows($store_query) == 0) {
         $this->store_id = 1;
         $store_query = smn_db_query("select sm.*, sd.store_description, sd.store_name, a.admin_groups_id from " . TABLE_STORE_MAIN . " sm, " . TABLE_STORE_DESCRIPTION . " sd, " . TABLE_ADMIN . " a WHERE sm.store_id = '1' and sd.store_id = '1' and a.store_id = '1' LIMIT 1");
     }
     $store_array = smn_db_fetch_array($store_query);
     $store_info_query = smn_db_query("select c.*, ab.* from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab WHERE c.customers_id = '" . $store_array['customer_id'] . "' and c.customers_id = ab.customers_id and c.customers_default_address_id = ab.address_book_id LIMIT 1");
     $store_info_array = smn_db_fetch_array($store_info_query);
     $this->set_store_customer_id($store_array['customer_id']);
     $this->set_store_group_id($store_array['admin_groups_id']);
     $this->set_store_company($store_info_array['entry_company']);
     $this->set_store_dob($store_info_array['customers_dob']);
     $this->set_store_telephone($store_info_array['customers_telephone']);
     $this->set_store_fax($store_info_array['customers_fax']);
     $this->set_store_name(stripslashes($store_array['store_name']));
     $this->set_store_logo($store_array['store_image']);
     $this->set_store_zone($store_info_array['entry_zone_id']);
     $this->set_store_owner_email_address($store_info_array['customers_email_address']);
     $this->set_email_from($this->get_store_name() . '<' . $this->get_store_owner_email_address() . '>');
     $this->set_store_country($store_info_array['entry_country_id']);
     $state_name_query = smn_db_query("select zone_name from " . TABLE_ZONES . " where zone_id = '" . (int) $store_info_array['entry_zone_id'] . "' LIMIT 1");
     $state_name_value = smn_db_fetch_array($state_name_query);
     $state = $state_name_value['zone_name'];
     $country_query = smn_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int) $store_info_array['entry_country_id'] . "' LIMIT 1");
     $country_name = smn_db_fetch_array($country_query);
     $country = $country_name['countries_name'];
     $this->set_store_name_address($this->get_store_name() . "<br />" . $store_info_array['entry_street_address'] . "<br />" . $store_info_array['entry_city'] . "<br />" . $state . "<br />" . $country . "<br />" . $store_info_array['entry_postcode'] . "<br />");
     $this->set_shipping_origin_country($store_info_array['entry_country_id']);
     $this->set_shipping_origin_zip($store_info_array['entry_postcode']);
     $this->set_store_type((int) $store_array['store_type']);
     $this->set_store_description($store_array['store_description']);
     $this->set_store_status((int) $store_array['store_status']);
 }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:36,代码来源:mall_setup.php

示例8: customers_csv

function customers_csv($search_string_start, $search_string_end, $export_file_name, $status_filter = '')
{
    if (file_exists(DIR_FS_ADMIN . "order/" . $export_file_name . ".csv")) {
        unlink(DIR_FS_ADMIN . "order/" . $export_file_name . ".csv");
    }
    touch(DIR_FS_ADMIN . "order/" . $export_file_name . ".csv");
    $filter_string = "";
    if ($status_filter != '') {
        $filter_string = " and o.orders_status = '" . $status_filter . "' ";
    }
    $SeparatorString = '|';
    $customers_query = smn_db_query("SELECT o.customers_id FROM " . TABLE_ORDERS . " o WHERE o.customers_id >= '" . (int) $search_string_start . "'\n                                    and o.customers_id <= '" . (int) $search_string_end . "'\n                                    " . $filter_string . "\n                                    GROUP BY o.customers_id ORDER BY o.customers_id");
    if (smn_db_num_rows($customers_query)) {
        while ($cust = smn_db_fetch_array($customers_query)) {
            $sql = "SELECT * FROM " . TABLE_ORDERS . " o WHERE customers_id=" . $cust['customers_id'] . " " . $filter_string . " ORDER BY orders_id DESC LIMIT 1";
            $orders_query = smn_db_query($sql);
            while ($customers = smn_db_fetch_array($orders_query)) {
                switch ($customers['delivery_country']) {
                    case 'Austria':
                        $service = 130;
                        break;
                    case 'Belgium':
                        $service = 131;
                        break;
                    case 'Denmark':
                        $service = 133;
                        break;
                    case 'Finland':
                        $service = 135;
                        break;
                    case 'France':
                        $service = 136;
                        break;
                    case 'Germany':
                        $service = 145;
                        break;
                    case 'Ireland':
                        $service = 212;
                        break;
                    case 'Italy':
                        $service = 137;
                        break;
                    case 'Luxembourg':
                        $service = 139;
                        break;
                    case 'Netherlands':
                        $service = 140;
                        break;
                    case 'Northern Ireland':
                        $service = 212;
                        break;
                    case 'Portugal':
                        $service = 142;
                        break;
                    case 'Spain':
                        $service = 134;
                        break;
                    case 'Sweden':
                        $service = 143;
                        break;
                    default:
                        $service = 212;
                        break;
                }
                $fp = fopen(DIR_FS_ADMIN . "order/" . $export_file_name . ".csv", "a") or die("can not open file!");
                $export_data = array(sprintf("%05d", $customers['customers_id']), sizeof($customers['customers_name']) > 35 ? sprintf("%35s", $customers['customers_name']) : $customers['customers_name'], sizeof($customers['delivery_street_address']) > 35 ? sprintf("%35s", $customers['delivery_street_address']) : $customers['delivery_street_address'], sizeof($customers['delivery_city']) > 35 ? sprintf("%35s", $customers['delivery_city']) : $customers['delivery_city'], sizeof($customers['delivery_state']) > 35 ? sprintf("%35s", $customers['delivery_state']) : $customers['delivery_state'], sizeof($customers['delivery_postcode']) > 20 ? sprintf("%20s", $customers['delivery_postcode']) : $customers['delivery_postcode'], $service, sizeof($customers['customers_telephone']) > 15 ? sprintf("%15s", $customers['customers_telephone']) : $customers['customers_telephone'], sizeof($customers['customers_email_address']) > 50 ? sprintf("%50s", $customers['customers_email_address']) : $customers['customers_email_address']);
                $count = 1;
                foreach ($export_data as $val) {
                    if ($count == 11) {
                        $count = 1;
                    }
                    if ($count == 10) {
                        $insert = '';
                        $insert = $val . "\n";
                    } else {
                        $insert = '';
                        $insert = $val . $SeparatorString;
                    }
                    $count += 1;
                    fwrite($fp, $insert);
                }
                fclose($fp);
            }
        }
    }
    if (file_exists(DIR_FS_ADMIN . "order/" . $export_file_name . ".csv")) {
        return 'true';
    } else {
        return 'false';
    }
}
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:91,代码来源:customers_csv.php

示例9: Copyright

  Copyright (c) 2002 - 2005 SystemsManager.Net
  SystemsManager Technologies
  oscMall System Version 4
  http://www.systemsmanager.net
  
  Portions Copyright (c) 2002 osCommerce
  
  This source file is subject to version 2.0 of the GPL license,   
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately. 
*/
if ($_GET['products_id']) {
    $xsell_query = smn_db_query("select distinct p.store_id, p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.store_id = '" . $store_id . "' and  xp.products_id = '" . $_GET['products_id'] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1' order by xp.products_id asc limit " . MAX_DISPLAY_ALSO_PURCHASED);
    $num_products_xsell = smn_db_num_rows($xsell_query);
    if ($num_products_xsell >= MIN_DISPLAY_XSELL) {
        ?>
 
<!-- xsell_products //-->
<?php 
        $info_box_contents = array();
        $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS);
        new contentBoxHeading($info_box_contents);
        $row = 0;
        $col = 0;
        $info_box_contents = array();
        while ($xsell = smn_db_fetch_array($xsell_query)) {
            $xsell['specials_new_products_price'] = smn_get_products_special_price($xsell['products_id']);
            $store_images = 'images/' . $xsell['store_id'] . '_images/';
            if ($xsell['specials_new_products_price']) {
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:xsell_products.php

示例10: smn_session_register

        }
    } else {
        $super_user = 'false';
        if (!smn_session_is_registered('super_user')) {
            smn_session_register('super_user');
        }
        if (intval($_GET['ID']) != intval($switch_store_id)) {
            smn_redirect(smn_href_link(FILENAME_LOGOFF));
        }
        $store_id = $check['store_id'];
        smn_session_register('store_id');
    }
    $filename = basename($PHP_SELF);
    if ($filename != FILENAME_DEFAULT && $filename != FILENAME_FORBIDEN && $filename != FILENAME_LOGOFF && $filename != FILENAME_ADMIN_ACCOUNT && $filename != FILENAME_POPUP_IMAGE && $filename != 'packingslip.php' && $filename != 'invoice.php') {
        $db_file_query = smn_db_query("select admin_files_name, admin_groups_id from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_name = '" . $filename . "'");
        if (!smn_db_num_rows($db_file_query)) {
            //smn_redirect(smn_href_link(FILENAME_FORBIDEN));
        } else {
            $db_file = smn_db_fetch_array($db_file_query);
        }
    }
}
// Check login and file access
if (basename($PHP_SELF) != FILENAME_LOGOFF && basename($PHP_SELF) != FILENAME_LOGIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN) {
    if (!smn_session_is_registered('login_id')) {
        smn_session_unregister('store_id');
        smn_session_unregister('login_id');
        if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
            echo '{
                success: false,
                errorType: "login",
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:application_top.php

示例11: smn_redirect

  license@systemsmanager.net so we can mail you a copy immediately.
*/
global $page_name;
// include validation functions (right now only email address)
require DIR_WS_FUNCTIONS . 'validations.php';
// include the mail classes
require DIR_WS_CLASSES . 'mime.php';
require DIR_WS_CLASSES . 'email.php';
if (!smn_session_is_registered('customer_id') && ALLOW_GUEST_TO_TELL_A_FRIEND == 'false') {
    $navigation->set_snapshot();
    smn_redirect(smn_href_link(FILENAME_LOGIN, '', 'NONSSL'));
}
$valid_product = false;
if (isset($_GET['products_id'])) {
    $product_info_query = smn_db_query("select p.store_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int) $_GET['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'");
    if (smn_db_num_rows($product_info_query)) {
        $valid_product = true;
        $product_info = smn_db_fetch_array($product_info_query);
    }
}
if ($valid_product == false) {
    smn_redirect(smn_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']));
}
if (isset($_GET['action']) && $_GET['action'] == 'process') {
    $error = false;
    $to_email_address = smn_db_prepare_input($_POST['to_email_address']);
    $to_name = smn_db_prepare_input($_POST['to_name']);
    $from_email_address = smn_db_prepare_input($_POST['from_email_address']);
    $from_name = smn_db_prepare_input($_POST['from_name']);
    $message = smn_db_prepare_input($_POST['message']);
    if (empty($from_name)) {
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:tell_a_friend.php

示例12: array_reverse

if (isset($cPath) && $cPath != '') {
    if (strpos('_', $cPath)) {
        // check to see if there are deeper categories within the current category
        $category_links = array_reverse($cPath_array);
        for ($i = 0, $n = sizeof($category_links); $i < $n; $i++) {
            $categories_query = smn_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.store_id= '" . $store->get_store_id() . "' and c.parent_id = '" . (int) $category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "'");
            $categories = smn_db_fetch_array($categories_query);
            if ($categories['total'] < 1) {
                // do nothing, go through the loop
            } else {
                $categories_query = smn_db_query("select c.categories_id, cd.categories_description, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.store_id= '" . $store->get_store_id() . "' and c.parent_id = '" . (int) $category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' order by sort_order, cd.categories_name");
                break;
                // we've found the deepest category the customer is in
            }
        }
    }
} else {
    $categories_query = smn_db_query("select c.categories_id, cd.categories_description, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.store_id= '" . $store->get_store_id() . "' and c.parent_id = '" . (int) $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' order by sort_order, cd.categories_name");
}
$number_of_categories = smn_db_num_rows($categories_query);
$rows = 0;
while ($categories = smn_db_fetch_array($categories_query)) {
    $rows++;
    $cPath_new = smn_get_path($categories['categories_id']);
    $width = (int) (100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
    echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . smn_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . smn_image(DIR_WS_IMAGES . $categories['categories_image'], '', SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, 'onmouseover=\'toolTip("' . ($categories['categories_description'] == '' ? $categories['categories_name'] : $categories['categories_description']) . '",this)\'') . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
    if ($rows / MAX_DISPLAY_CATEGORIES_PER_ROW == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) && $rows != $number_of_categories) {
        echo '              </tr>' . "\n";
        echo '              <tr>' . "\n";
    }
}
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:product_catagories.php

示例13: smn_get_zone_name

     $L_state = smn_get_zone_name($_POST['country'], $zone_id, '');
     $profile_edit->set_zone_id($zone_id);
     $profile_edit->set_state($L_state);
 } else {
     $profile_edit->set_zone_id('0');
     $profile_edit->set_state($_POST['state']);
 }
 $customer_id = $profile_edit->create($customer_id);
 if ($store->is_store_owner($customer_id)) {
     // file uploading class
     require DIR_WS_CLASSES . 'upload.php';
     if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
         $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
     }
     $store_query = smn_db_query("select store_name from " . TABLE_STORE_DESCRIPTION . " WHERE store_name like '" . $_POST['store_edit_name'] . "'");
     if (smn_db_num_rows($store_query)) {
         $error = true;
         $messageStack->add('account_edit', ENTRY_STORE_NAME_ERROR);
     } else {
         $store_edit->set_store_name($_POST['store_edit_name']);
     }
     $store_edit->set_store_description($_POST['store_description']);
     $store_edit->update_store_info();
     $store_edit->set_store_logo('store_image');
     $error_text = $store_edit->put_logo_image('update');
     if ($error_text != '') {
         smn_session_register('error_text');
     }
 }
 $customer_first_name = $firstname;
 $messageStack->add_session('account_edit', SUCCESS_ACCOUNT_UPDATED, 'success');
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:account_edit_orig.php

示例14: smn_count_store_in_category

 function smn_count_store_in_category($store_category_id, $include_inactive = false)
 {
     $store_count = 0;
     if ($include_inactive == true) {
         $store_query = smn_db_query("select count(*) as total from " . TABLE_STORE_MAIN . " p, " . TABLE_STORE_TO_CATEGORIES . " p2c where p.store_id = p2c.store_id and p2c.store_categories_id = '" . (int) $store_category_id . "'");
     } else {
         $store_query = smn_db_query("select count(*) as total from " . TABLE_STORE_MAIN . " p, " . TABLE_STORE_TO_CATEGORIES . " p2c where p.store_id = p2c.store_id and p.store_status = '1' and p2c.store_categories_id = '" . (int) $store_category_id . "'");
     }
     $store = smn_db_fetch_array($store_query);
     $store_count += $store['total'];
     $child_store_categories_query = smn_db_query("select store_categories_id from " . TABLE_STORE_CATEGORIES . " where store_parent_id = '" . (int) $store_category_id . "'");
     if (smn_db_num_rows($child_store_categories_query)) {
         while ($child_store_categories = smn_db_fetch_array($child_store_categories_query)) {
             $store_count += smn_count_store_in_category($child_store_categories['store_categories_id'], $include_inactive);
         }
     }
     return $store_count;
 }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:18,代码来源:spath_setup.php

示例15: smn_redirect

             smn_redirect(smn_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $_GET['gID'] . '&gName=used&action=edit_group'));
         } else {
             $admin_groups_id = $_GET['gID'];
             smn_db_perform(TABLE_ADMIN_GROUPS, $sql_data_array, 'update', "admin_groups_id = '" . $admin_groups_id . "'");
             smn_redirect(smn_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $admin_groups_id));
         }
     }
     break;
 case 'group_new':
     $admin_groups_name = ucwords(strtolower(smn_db_prepare_input($_POST['admin_groups_name'])));
     $name_replace = ereg_replace(" ", "%", $admin_groups_name);
     if ($admin_groups_name == '' || NULL || strlen($admin_groups_name) <= 5) {
         smn_redirect(smn_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $_GET[gID] . '&gName=false&action=new_group'));
     } elseif ($_GET['gID'] != 'edit_group') {
         $check_groups_name_query = smn_db_query("select admin_groups_name as group_name_new from " . TABLE_ADMIN_GROUPS . " where admin_groups_name like '%" . $name_replace . "%'");
         $check_duplicate = smn_db_num_rows($check_groups_name_query);
         if ($check_duplicate > 0) {
             smn_redirect(smn_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $_GET['gID'] . '&gName=used&action=new_group'));
         } else {
             $sql_product_data_array = array('products_quantity' => '1000', 'products_model' => 'mem_6_', 'products_price' => smn_db_prepare_input($_POST['admin_groups_cost']), 'products_date_available' => date('Y-m-d'), 'store_id' => 1, 'products_weight' => '0', 'products_status' => '1', 'products_tax_class_id' => '', 'products_date_added' => 'now()', 'products_image' => '', 'manufacturers_id' => '');
             smn_db_perform(TABLE_PRODUCTS, $sql_product_data_array);
             $products_id = smn_db_insert_id();
             smn_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int) $products_id . "', '1')");
             $languages = smn_get_languages();
             for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                 $language_id = $languages[$i]['id'];
                 $sql_data_array = array('products_id' => $products_id, 'products_name' => smn_db_prepare_input($admin_groups_name), 'language_id' => $language_id, 'products_url' => HTTP_CATALOG_SERVER);
                 smn_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
             }
             $sql_data_array = array('admin_groups_name' => $admin_groups_name, 'admin_groups_store_type' => smn_db_prepare_input($_POST['admin_groups_store_types']), 'admin_groups_products_id' => $products_id, 'admin_sales_cost' => smn_db_prepare_input($_POST['admin_sales_cost']), 'admin_groups_max_products' => smn_db_prepare_input($_POST['admin_groups_max_products']));
             smn_db_perform(TABLE_ADMIN_GROUPS, $sql_data_array);
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:admin_members.php


注:本文中的smn_db_num_rows函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。