本文整理汇总了PHP中tep_db_query函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_db_query函数的具体用法?PHP tep_db_query怎么用?PHP tep_db_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_db_query函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: tep_update_htpasswd_file
function tep_update_htpasswd_file()
{
$shops = array();
$shops_query = tep_db_query("select shops_id, shops_htpasswd_file from " . TABLE_SHOPS . " where shops_htpasswd_file <> ''");
while ($shops_array = tep_db_fetch_array($shops_query)) {
$shops[$shops_array['shops_id']] = $shops_array['shops_htpasswd_file'];
}
$passwords = array();
$users_query = tep_db_query("select u.users_id, u.users_password, ug.users_groups_shops from " . TABLE_USERS . " u, " . TABLE_USERS_GROUPS . " ug where u.users_status = '1' and u.users_groups_id = ug.users_groups_id");
while ($users = tep_db_fetch_array($users_query)) {
$available_shops = array();
if (empty($users['users_groups_shops'])) {
$available_shops = array_keys($shops);
} else {
$available_shops = explode(',', $users['users_groups_shops']);
}
reset($shops);
while (list($shop_id, $shops_htpasswd_file) = each($shops)) {
if (in_array($shop_id, $available_shops)) {
$passwords[$shops_htpasswd_file] .= $users['users_id'] . ':' . $users['users_password'] . "\r\n";
}
}
}
reset($passwords);
while (list($shops_htpasswd_file, $passwords_string) = each($passwords)) {
if ($fp = fopen($shops_htpasswd_file, "w")) {
fwrite($fp, $passwords_string);
fclose($fp);
}
}
}
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:31,代码来源:users.php
示例17: build_cds_list_menu
function build_cds_list_menu($startid = 0, $ulstyle = '')
{
global $languages_id;
if ($ulstyle != '') {
$ulstyle = ' id="' . $ulstyle . '"';
}
$cds_menu = '';
//loop through category id to find all subcategories and pages
$cds_pages_query = tep_db_query("SELECT c.categories_id as 'ID', \r\n cd.categories_name as 'Name',\r\n c.categories_parent_id as 'ParentID',\r\n c.category_append_cdpath as 'Append',\r\n c.categories_url_override as 'URL',\r\n c.categories_url_override_target as 'Target',\r\n c.pages_group_access as 'Group', 'c' as 'type',\r\n c.categories_sort_order as 'Sort'\r\n FROM pages_categories c \r\n LEFT JOIN pages_categories_description cd \r\n ON c.categories_id = cd.categories_id \r\n WHERE c.categories_parent_id = '" . $startid . "' \r\n AND c.categories_status = '1'\r\n AND c.categories_in_menu = '1'\r\n AND cd.language_id = '" . (int) $languages_id . "'\r\n UNION\r\n SELECT p.pages_id as 'ID', \r\n pd.pages_menu_name as 'Name',\r\n p2c.categories_id as 'ParentID',\r\n p.pages_append_cdpath as 'Append',\r\n p.pages_url as 'URL',\r\n p.pages_url_target as 'Target',\r\n p.pages_group_access as 'Group', 'p' as 'type',\r\n p.pages_sort_order as 'Sort'\r\n FROM pages p, \r\n pages_description pd, \r\n pages_to_categories p2c \r\n WHERE p.pages_id = pd.pages_id \r\n AND pd.language_id ='" . (int) $languages_id . "'\r\n AND p.pages_id = p2c.pages_id \r\n AND p.pages_status = '1'\r\n AND pd.pages_menu_name <> ''\r\n AND p.pages_in_menu = '1'\r\n AND p2c.categories_id ='" . $startid . "'\r\n ORDER BY Sort ");
$rows_count = tep_db_num_rows($cds_pages_query);
if ($rows_count > 0) {
$cds_menu .= "\n" . ' <ul' . $ulstyle . '>' . "\n";
$ulstyle = '';
while ($cds_pages_data = tep_db_fetch_array($cds_pages_query)) {
$cds_menu .= ' <li>' . cds_build_menu_url($cds_pages_data['ID'], $cds_pages_data['Name'], $cds_pages_data['type'], $cds_pages_data['URL'], $cds_pages_data['Append'], $cds_pages_data['Target']);
if ($cds_pages_data['type'] == 'c' && $cds_pages_data['URL'] == '') {
//we found a subcategory, loop, loop, loop.......
$cds_menu .= build_cds_list_menu($cds_pages_data['ID']);
}
$cds_menu .= '</li>' . "\n";
}
$cds_menu .= ' </ul>' . "\n";
}
return $cds_menu;
}
开发者ID:resultsonlyweb,项目名称:loaded6-template,代码行数:25,代码来源:CDS_listmenu_applicationtop_bottom.php
示例18: loadProduct
function loadProduct($product_id, $products_price, $products_tax_class_id, $qtyBlocks = 1, $price_breaks_array = NULL, $min_order_qty = 1)
{
// Collect required data (show for retail only)
// in a preview read=only no data for the price break available
if (!tep_not_null($price_breaks_array)) {
$price_breaks_array = array();
$price_breaks_query = tep_db_query("select products_price, products_qty from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . (int) $product_id . "' and customers_group_id = '0' order by products_qty");
while ($price_break = tep_db_fetch_array($price_breaks_query)) {
$price_breaks_array[] = $price_break;
}
}
//Assign members
$this->thePrice = $products_price;
$this->taxClass = $products_tax_class_id;
$this->qtyBlocks = $qtyBlocks < 1 ? 1 : $qtyBlocks;
$this->price_breaks = $price_breaks_array;
$this->products_min_order_qty = $min_order_qty < 1 ? 1 : $min_order_qty;
//Custom
$this->hasQuantityPrice = false;
$this->hiPrice = $this->thePrice;
$this->lowPrice = $this->thePrice;
if (count($this->price_breaks) > 0) {
$this->hasQuantityPrice = true;
foreach ($this->price_breaks as $price_break) {
$this->hiPrice = max($this->hiPrice, $price_break['products_price']);
$this->lowPrice = min($this->lowPrice, $price_break['products_price']);
}
}
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:29,代码来源:PriceFormatterAdmin.php
示例19: _draw_stocked_attributes
function _draw_stocked_attributes()
{
global $languages_id;
$out = '';
$attributes = $this->_build_attributes_array(true, false);
if (sizeof($attributes) <= 1) {
return parent::_draw_stocked_attributes();
}
// Check stock
$s = sizeof($attributes[0]['ovals']);
for ($a = 0; $a < $s; $a++) {
$attribute_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int) $this->products_id . "' AND products_stock_attributes REGEXP '(^|,)" . (int) $attributes[0]['oid'] . "-" . (int) $attributes[0]['ovals'][$a]['id'] . "(,|\$)' AND products_stock_quantity > 0");
$out_of_stock = tep_db_num_rows($attribute_stock_query) == 0;
if ($out_of_stock) {
unset($attributes[0]['ovals'][$a]);
}
}
// Draw first option dropdown with all values
$out .= '<tr><td align="right" class=main><b>' . $attributes[0]['oname'] . ":</b></td><td class=main>" . tep_draw_pull_down_menu('id[' . $attributes[0]['oid'] . ']', array_merge(array(array('id' => 0, 'text' => 'First select ' . $attributes[0]['oname'])), $attributes[0]['ovals']), $attributes[0]['default'], "onchange=\"i" . $attributes[0]['oid'] . "(this.form);\"") . "</td></tr>\n";
// Draw second to next to last option dropdowns - no values, with onchange
for ($o = 1; $o < sizeof($attributes) - 1; $o++) {
$out .= '<tr><td align="right" class=main><b>' . $attributes[$o]['oname'] . ":</b></td><td class=main>" . tep_draw_pull_down_menu('id[' . $attributes[$o]['oid'] . ']', array(array('id' => 0, 'text' => 'Next select ' . $attributes[$o]['oname'])), '', "onchange=\"i" . $attributes[$o]['oid'] . "(this.form);\"") . "</td></tr>\n";
}
// Draw last option dropdown - no values, no onchange
$out .= '<tr><td align="right" class=main><b>' . $attributes[$o]['oname'] . ":</b></td><td class=main>" . tep_draw_pull_down_menu('id[' . $attributes[$o]['oid'] . ']', array(array('id' => 0, 'text' => 'Next select ' . $attributes[$o]['oname'])), '') . "</td></tr>\n";
$out .= $this->_draw_dropdown_sequence_js($attributes);
return $out;
}
开发者ID:eosc,项目名称:EosC-2.3,代码行数:28,代码来源:pad_sequenced_dropdowns.php
示例20: affiliate_insert
function affiliate_insert($sql_data_array, $affiliate_parent = 0)
{
// LOCK TABLES
tep_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
if ($affiliate_parent > 0) {
$affiliate_root_query = tep_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 = tep
|
请发表评论