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


PHP tep_db_query函数代码示例

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


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

示例1: __construct

 function __construct(&$current_page_number, $max_rows_per_page, &$sql_query, &$query_num_rows)
 {
     if (empty($current_page_number)) {
         $current_page_number = 1;
     }
     // # scrub any white space found in incoming queries!
     if ($sql_query) {
         $sql_query = preg_replace("/\\s+/", " ", $sql_query);
     }
     //error_log(print_r($sql_query,1));
     $pos_to = strlen($sql_query);
     $pos_from = strripos($sql_query, ' from', 0);
     $pos_order_by = strripos($sql_query, ' order by', $pos_from);
     if ($pos_order_by < $pos_to && $pos_order_by != false) {
         $pos_to = $pos_order_by;
     }
     $pos_limit = strripos($sql_query, ' limit', $pos_from);
     if ($pos_limit < $pos_to && $pos_limit != false) {
         $pos_to = $pos_limit;
     }
     $pos_procedure = strripos($sql_query, ' procedure', $pos_from);
     if ($pos_procedure < $pos_to && $pos_procedure != false) {
         $pos_to = $pos_procedure;
     }
     $offset = $max_rows_per_page * ($current_page_number - 1);
     $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
     $reviews_count_query = tep_db_query("select 0 " . substr($sql_query, $pos_from, $pos_to - $pos_from));
     //$reviews_count = tep_db_fetch_array($reviews_count_query);
     $query_num_rows = (int) tep_db_num_rows($reviews_count_query);
     $this->current_page_number = $current_page_number;
     $this->max_rows_per_page = $max_rows_per_page;
     $this->query_num_rows = $query_num_rows;
 }
开发者ID:rrecurse,项目名称:IntenseCart,代码行数:33,代码来源:split_page_results.php

示例2: remove

 function remove()
 {
     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
     tep_db_query("alter table " . TABLE_CUSTOMERS . " drop `customers_guest`");
     tep_db_query("alter table " . TABLE_ORDERS . " drop `customers_guest`");
     tep_db_query("alter table " . TABLE_ADDRESS_BOOK . " drop `customers_guest`");
 }
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:7,代码来源:cm_pwa_login.php

示例3: tep_get_configuration_key_value

function tep_get_configuration_key_value($lookup)
{
    $configuration_query_raw = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key='" . $lookup . "'");
    $configuration_query = tep_db_fetch_array($configuration_query_raw);
    $lookup_value = $configuration_query['configuration_value'];
    return $lookup_value;
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:7,代码来源:indvship_status.php

示例4: tep_update_whos_online

function tep_update_whos_online()
{
    global $customer_id;
    if (tep_session_is_registered('customer_id')) {
        $wo_customer_id = $customer_id;
        $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
        $customer = tep_db_fetch_array($customer_query);
        $wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
    } else {
        $wo_customer_id = '';
        $wo_full_name = 'Guest';
    }
    $wo_session_id = tep_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
    tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
    $stored_customer_query = tep_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . tep_db_input($wo_session_id) . "'");
    $stored_customer = tep_db_fetch_array($stored_customer_query);
    if ($stored_customer['count'] > 0) {
        tep_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int) $wo_customer_id . "', full_name = '" . tep_db_input($wo_full_name) . "', ip_address = '" . tep_db_input($wo_ip_address) . "', time_last_click = '" . tep_db_input($current_time) . "', last_page_url = '" . tep_db_input($wo_last_page_url) . "' where session_id = '" . tep_db_input($wo_session_id) . "'");
    } else {
        tep_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 . "', '" . tep_db_input($wo_full_name) . "', '" . tep_db_input($wo_session_id) . "', '" . tep_db_input($wo_ip_address) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($wo_last_page_url) . "')");
    }
}
开发者ID:laiello,项目名称:hotel-os,代码行数:27,代码来源:whos_online.php

示例5: query

 function query($order_id)
 {
     global $languages_id;
     $order_query = tep_db_query("select o.*, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.orders_id = '" . (int) $order_id . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int) $languages_id . "'");
     $order = tep_db_fetch_array($order_query);
     $totals_query = tep_db_query("select title, text, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' order by sort_order");
     while ($totals = tep_db_fetch_array($totals_query)) {
         $this->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class']);
     }
     $this->info = array('total' => null, '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'], 'status' => $order['orders_status_name'], 'orders_status' => $order['orders_status'], 'last_modified' => $order['last_modified']);
     foreach ($this->totals as $t) {
         if ($t['class'] == 'ot_total') {
             $this->info['total'] = $t['text'];
             break;
         }
     }
     $this->customer = array('name' => $order['customers_name'], 'company' => $order['customers_company'], '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']);
     $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 = tep_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 = tep_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 = tep_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 (tep_db_num_rows($attributes_query)) {
             while ($attributes = tep_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:tiansiyuan,项目名称:oscommerce2,代码行数:34,代码来源:order.php

示例6: generateDesignsId

function generateDesignsId($month)
{
    //    $dateObj = DateTime::createFromFormat('!m', $month);
    //    $month_name = $dateObj->format('F');
    $month_name = date('F', mktime(0, 0, 0, $month, 10));
    echo "<h3>{$month_name}</h3>";
    $query = "SELECT designs_id, status_time FROM designs_status_history";
    $query .= " WHERE status=9 AND YEAR(FROM_UNIXTIME(status_time)) = '2014' AND MONTH(FROM_UNIXTIME(status_time)) = '{$month}'";
    $result = tep_db_query($query);
    $c = array();
    $c['no'] = 'No.';
    $c['id'] = 'Designs ID';
    $c['date'] = 'Finalized Date';
    $table_des[] = $c;
    while ($row = tep_db_fetch_array($result)) {
        $no++;
        $date = date('d-m-Y', $row['status_time']);
        $c = array();
        $c['no'] = $no;
        $c['id'] = $row['designs_id'];
        $c['date'] = $date;
        $table_des[] = $c;
    }
    $table = tep_draw_table('main_center', $table_des, true);
    echo $table;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:26,代码来源:temp-generate-designs-id-set-done.php

示例7: fetchProduct

 /**
  * Fetches the product and adds it as an article to the klarna class. No need to return any data.
  * Articles need to be set for fraud purpose, incorrect article means no_risk invoice. Hereby klarna will not take any risks.
  *
  * @param mixed $mProductId The product identified. Either int or string. Adapted according shop functionality
  * @param Klarna $oKlarna The Klarna class object. Used to set any articles
  * @return void
  */
 protected function fetchProduct($mProductId)
 {
     global $currencies, $currency;
     include DIR_WS_CLASSES . 'language.php';
     $lng = new language();
     if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
         $lng->set_language($HTTP_GET_VARS['language']);
     } else {
         $lng->get_browser_language();
     }
     $language = $lng->language['directory'];
     $languages_id = $lng->language['id'];
     $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int) $mProductId . "' and pd.products_id = p.products_id and pd.language_id = '" . (int) $languages_id . "'");
     $aProduct_info = tep_db_fetch_array($product_info_query);
     $sArtNo = MODULE_PAYMENT_KLARNA_ARTNO == 'id' || MODULE_PAYMENT_KLARNA_ARTNO == '' ? $aProduct_info['id'] : $aProduct_info['name'];
     $iTax = tep_get_tax_rate($aProduct_info['products_tax_class_id']);
     if (DISPLAY_PRICE_WITH_TAX == 'true') {
         $iPrice_with_tax = $currencies->get_value($currency) * $aProduct_info['products_price'];
     } else {
         $iPrice_with_tax = $currencies->get_value($currency) * $aProduct_info['products_price'] * ($iTax / 100 + 1);
     }
     // Add goods
     $this->oKlarna->addArticle(1, $sArtNo, $aProduct_info['products_name'], $iPrice_with_tax, $iTax, 0, KlarnaFlags::INC_VAT);
     $this->iSum += $iPrice_with_tax;
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:33,代码来源:klarnamobile.php

示例8: getSetField

    function getSetField()
    {
        global $languages_id;
        $statuses_array = array();
        $flags_query = tep_db_query("describe orders_status public_flag");
        if (tep_db_num_rows($flags_query) == 1) {
            $statuses_query = tep_db_query("select orders_status_id, orders_status_name from orders_status where language_id = '" . (int) $languages_id . "' and public_flag = '0' order by orders_status_name");
        } else {
            $statuses_query = tep_db_query("select orders_status_id, orders_status_name from orders_status where language_id = '" . (int) $languages_id . "' order by orders_status_name");
        }
        while ($statuses = tep_db_fetch_array($statuses_query)) {
            $statuses_array[] = array('id' => $statuses['orders_status_id'], 'text' => $statuses['orders_status_name']);
        }
        $input = tep_draw_pull_down_menu('transactions_order_status_id', $statuses_array, OSCOM_APP_PAYPAL_TRANSACTIONS_ORDER_STATUS_ID, 'id="inputTransactionsOrderStatusId"');
        $result = <<<EOT
<div>
  <p>
    <label for="inputTransactionsOrderStatusId">{$this->title}</label>

    {$this->description}
  </p>

  <div>
    {$input}
  </div>
</div>
EOT;
        return $result;
    }
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:29,代码来源:transactions_order_status_id.php

示例9: getConfig

 function getConfig($cfg)
 {
     global $db;
     $config = tep_db_query("SELECT configuration_value FROM configuration WHERE configuration_key='{$cfg}'");
     $config = mysql_fetch_assoc($config);
     return $config["configuration_value"];
 }
开发者ID:digitaldevelopers,项目名称:smartsend-creloaded,代码行数:7,代码来源:addcustomfields.php

示例10: setProductDescription2

function setProductDescription2($products_id, $focus = null)
{
    use_class('element');
    $q = tep_db_query("SELECT * FROM products_description2 WHERE products_id={$products_id}");
    $pd2 = tep_db_fetch_array($q);
    $elements_used = $this->retrieveElementsUsed($products_id);
    if (!is_null($focus) && !is_array($focus)) {
        $focus = explode(',', $focus);
    }
    $need_tobe_filled_c = is_null($focus) || in_array('c', $focus) && ($pd2['clasp_type'] == '' || $pd2['clasp_type'] == 0) ? true : false;
    $need_tobe_filled_s = is_null($focus) || in_array('s', $focus) && ($pd2['setting_type'] == '' || $pd2['setting_type'] == 0) ? true : false;
    if ($need_tobe_filled_c || $need_tobe_filled_s) {
        $sda = array();
        foreach ($elements_used as $eid) {
            $el = new element($eid);
            if ($need_tobe_filled_c && !isset($sda['clasp_type']) && $sda['clasp_type'] == '') {
                $sda['clasp_type'] = $el->attributes['clasp']['id'];
            }
            if ($need_tobe_filled_s && !isset($sda['setting_type']) && $sda['setting_type'] == '') {
                $sda['setting_type'] = $el->attributes['setting']['id'];
            }
        }
        if (count($sda) > 0) {
            if (tep_db_num_rows($q) > 0) {
                tep_db_perform('products_description2', $sda, 'update', "products_id={$products_id}");
            } else {
                $sda['products_id'] = $products_id;
                tep_db_perform('products_description2', $sda);
            }
        }
    }
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:32,代码来源:seProductDescription2.php

示例11: get_subcategories

 private function get_subcategories($parent_id)
 {
     if (tep_has_category_subcategories($parent_id)) {
         global $languages_id;
         $categories_data = array();
         // Retrieve the data on the subcategories
         $categories_query_raw = "\n\t\t\t\tselect\n\t\t\t\t  c.categories_id,\n\t\t\t\t  c.parent_id,\n\t\t\t\t  cd.categories_name\n\t\t\t\tfrom " . TABLE_CATEGORIES_DESCRIPTION . " cd\n\t\t\t\t  join " . TABLE_CATEGORIES . " c\n\t\t\t\t\ton (c.categories_id = cd.categories_id)\n\t\t\t\twhere\n\t\t\t\t  c.parent_id = '" . (int) $parent_id . "'\n\t\t\t\t  and cd.language_id = '" . (int) $languages_id . "'\n\t\t\t\torder by\n\t\t\t\t  c.sort_order,\n\t\t\t\t  cd.categories_name\n\t\t\t  ";
         //print 'Categories Query: ' . $categories_query_raw . '<br />';
         $categories_query = tep_db_query($categories_query_raw);
         // Load the subcategory data into an array
         $index = 0;
         while ($categories = tep_db_fetch_array($categories_query)) {
             $categories_id = (int) $categories['categories_id'];
             $path_string = $this->get_category_path($categories_id);
             if ($categories_id != 0) {
                 $categories_data[$index] = array('id' => $categories_id, 'name' => $categories['categories_name'], 'parent_id' => $categories['parent_id'], 'path' => $path_string);
                 // If the category has subcats, add them to the array
                 if (tep_has_category_subcategories($categories_id)) {
                     $categories_data[$index]['subcat'] = $this->get_subcategories($categories_id);
                 } else {
                     $categories_data[$index]['subcat'] = false;
                 }
             }
             // if( $categories_id
             $index++;
         }
         //while ($categories
         return $categories_data;
     } else {
         return false;
     }
 }
开发者ID:templatemonster,项目名称:oscommerce,代码行数:32,代码来源:bm_categories.php

示例12: datasCountByStatus

function datasCountByStatus()
{
    global $tabs, $filter_type, $filter_owner, $filter_team, $filter_teamcat;
    //    if($filter_type=='0') {
    //        $filter = ($filter_team<=0) ? '' : "WHERE i.department=$filter_team ";
    //        if($filter_teamcat!='0') $filter .= (($filter!='') ? ' AND' : ' WHERE')." i.category='$filter_teamcat' ";
    //    } else {
    //        $filter = "WHERE i.owner=$filter_owner";
    //    }
    $statuscount = array();
    $q = "SELECT category, COUNT(id_promoboxes) AS total_datas";
    $q .= " FROM promoboxes GROUP BY category";
    $r = tep_db_query($q);
    foreach ($tabs as $skey => $sval) {
        $statuscount[$skey] = '0';
    }
    while ($row = tep_db_fetch_array($r)) {
        $statuscount[$row['category']] = $row['total_datas'];
    }
    $dcArray = array();
    foreach ($statuscount as $status => $dc) {
        $dcArray[] = $status . '|' . $dc;
    }
    return implode('|||', $dcArray);
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:25,代码来源:setting-promobox.php

示例13: query

 function query($order_id)
 {
     $order_query = tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
     $order = tep_db_fetch_array($order_query);
     $totals_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' order by sort_order");
     while ($totals = tep_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'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], 'shipping_tax' => $order['shipping_tax'], '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'], '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']);
     $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']);
     $countryid = tep_get_country_id($this->delivery["country"]);
     $zoneid = tep_get_zone_id($countryid, $this->delivery["state"]);
     $index = 0;
     $orders_products_query = tep_db_query("\n     SELECT \n\t op.orders_products_id, \n\t op.products_name, \n\t op.products_model, \n\t op.products_price,\n\t op.products_tax, \n\t op.products_quantity, \n\t op.final_price, \n\t p.products_tax_class_id,\n\t p.products_weight\n  FROM " . TABLE_ORDERS_PRODUCTS . " op\n  LEFT JOIN " . TABLE_PRODUCTS . " p\n    ON op.products_id = p.products_id\n WHERE orders_id = '" . (int) $order_id . "'");
     while ($orders_products = tep_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'], 'tax_description' => tep_get_tax_description($orders_products['products_tax_class_id'], $countryid, $zoneid), 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price'], 'weight' => $orders_products['products_weight'], 'orders_products_id' => $orders_products['orders_products_id']);
         $subindex = 0;
         $attributes_query = tep_db_query("select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $order_id . "' and orders_products_id = '" . (int) $orders_products['orders_products_id'] . "'");
         if (tep_db_num_rows($attributes_query)) {
             while ($attributes = tep_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++;
             }
         }
         $index++;
     }
 }
开发者ID:eosc,项目名称:EosC-2.3,代码行数:29,代码来源:order.php

示例14: processXMLFile

function processXMLFile($xml_file)
{
    global $timestamp, $logger;
    $xmlt = new xml_tools();
    $xml = $xmlt->loadFile($xml_file);
    $order_date = $timestamp;
    $segments_id = (int) $xml->LOCAL_INFO->SEGMENT_ID;
    $group_name = (string) $xml->LOCAL_INFO->GROUP_NAME;
    $refill_orders = $xml->REFILL_ORDERS->ORDER;
    $counter = 0;
    foreach ($refill_orders as $ro) {
        $products_id = (int) $ro->PRODUCTS_ID;
        $articles_id = (int) $ro->ARTICLES_ID;
        $products_ean = $ro->PRODUCTS_EAN;
        $quantity = (int) $ro->QUANTITY;
        $trans_type = (string) (strtoupper($ro->TRANS_TYPE) == 'NULL' ? '' : $ro->TRANS_TYPE);
        $trans_id = (int) $ro->TRANS_ID;
        //CREATE DEPOT ORDERS
        $q_check = "SELECT depot_orders_id FROM depot_orders " . " WHERE segments_id = {$segments_id}" . " AND trans_type = '' AND trans_id = {$trans_id}";
        $r_check = tep_db_query($q_check);
        //ONLY CREATE ORDER WHICH NOT IMPORTED
        if (tep_db_num_rows($r_check) == 0) {
            $class_do = new depot_orders();
            $class_do->newOrder($segments_id, $products_id, $articles_id, $products_ean, $quantity, $order_date, $trans_type, $trans_id, $group_name);
            $counter++;
        }
    }
    $logger->write("{$counter} orders imported");
    unlink($xml_file);
    $logger->write("xml deleted");
    return $counter;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:32,代码来源:depot-refill-global-xml-downloader.php

示例15: calculate_price

 function calculate_price($products_price, $products_tax, $quantity = 1, $rate = "", $pid = "")
 {
     global $currency;
     if (is_numeric($pid)) {
         $dbres = tep_db_query("select categories_id from products_to_categories where products_id='" . $pid . "'");
         $row = tep_db_fetch_array($dbres);
         $cat_id = (int) $row['categories_id'];
         if ($cat_id == 23) {
             return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity;
         }
     }
     if ($rate == "") {
         $rate = get_price_rate($_SESSION['customer_id']);
     }
     if (get_price_group_name($_SESSION['customer_id']) == "Interior Designer") {
         $dbres = tep_db_query("select dn_price from products where products_id='{$pid}'");
         $row = tep_db_fetch_array($dbres);
         if ((double) $row['dn_price'] > 0) {
             $products_price = $row['dn_price'];
             $rate = "100";
         }
     }
     return ceil(tep_add_tax($products_price * $rate / 100, $products_tax)) * $quantity;
     //      return tep_round(tep_add_tax(($products_price*$rate)/100, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity;
 }
开发者ID:rongandat,项目名称:scalaprj,代码行数:25,代码来源:currencies.php


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