本文整理汇总了PHP中tep_db_perform函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_db_perform函数的具体用法?PHP tep_db_perform怎么用?PHP tep_db_perform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_db_perform函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
}
}
示例2: 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_db_fetch_array($affiliate_root_query)) {
tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_lft > " . $affiliate_root_array['affiliate_rgt'] . " AND affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
$sql_data_array['affiliate_root'] = $affiliate_root_array['affiliate_root'];
$sql_data_array['affiliate_lft'] = $affiliate_root_array['affiliate_rgt'];
$sql_data_array['affiliate_rgt'] = $affiliate_root_array['affiliate_rgt'] + 1;
tep_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = tep_db_insert_id();
}
// no parent -> new root
} else {
$sql_data_array['affiliate_lft'] = '1';
$sql_data_array['affiliate_rgt'] = '2';
tep_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = tep_db_insert_id();
tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' ");
}
// UNLOCK TABLES
tep_db_query("UNLOCK TABLES");
return $affiliate_id;
}
示例3: updateOrder
function updateOrder($orderId, $orderStatusId, $comment, $notify)
{
$order_status_history_data_array = array('orders_id' => $orderId, 'orders_status_id' => $orderStatusId, 'comments' => $comment, 'customer_notified' => '0', 'date_added' => 'now()');
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $order_status_history_data_array);
$order_data_array = array('orders_id' => $orderId, 'orders_status' => $orderStatusId);
tep_db_perform(TABLE_ORDERS, array('orders_status' => $orderStatusId), 'update', "orders_id = {$orderId}");
}
示例4: add
function add($products_id, $type, $links_id, $prepared = false)
{
if (is_array($links_id) && count($links_id) > 0) {
if (!$prepared) {
$products_id = tep_db_prepare_input($products_id);
$type = tep_db_prepare_input($type);
}
$plids = array();
foreach ($links_id as $lid) {
if (!$prepared) {
$lid = tep_db_prepare_input($lid);
}
if (intval($lid) != 0 && $products_id != $lid) {
//$check_exist = tep_db_query("SELECT products_linking_id FROM products_linking WHERE products_id=$products_id AND type='$type' AND links_id=$lid");
$check_exist = tep_db_query("SELECT products_linking_id FROM products_linking WHERE products_id={$products_id} AND links_id={$lid}");
if (tep_db_num_rows($check_exist) == 0) {
$sda = array();
$sda['products_id'] = $products_id;
$sda['type'] = $type;
$sda['links_id'] = $lid;
$sda['date_added'] = date('Y-m-d H:i:s');
tep_db_perform('products_linking', $sda);
$plids[] = tep_db_insert_id();
}
}
}
} else {
if ($links_id != '') {
$links = explode(',', $links_id);
$plids = $this->add($products_id, $type, $links, $prepared);
}
}
return $plids;
}
示例5: createNewCategoryTop
/**
* Create a new category top
* @param String $name Name of new category top
* @param Boolean $is_using_size True if category is using size instead of length
* @return Int ID of new category top or 0 if insert failed
*/
public static function createNewCategoryTop($name, $is_using_size)
{
$sda = array();
$sda[self::COLNAME_NAME] = $name;
$sda[self::COLNAME_SIZE] = $is_using_size ? '1' : '0';
tep_db_perform(self::TABLENAME, $sda);
return tep_db_insert_id();
}
示例6: addImportedOrder
function addImportedOrder($download_id, $orders_id)
{
$o_sda = array();
$o_sda['jng_sp_download_id'] = $download_id;
$o_sda['jng_sp_orders_id'] = $orders_id;
$o_sda['date_added'] = date('Y-m-d H:i:s');
tep_db_perform('jng_sp_download_orders', $o_sda);
}
示例7: update
function update($id, $sda, $updateby = null)
{
if (!is_null($updateby)) {
$sda['last_update_by'] = $updateby;
}
$sda['last_update_time'] = date('Y-m-d H:i:s');
$result = tep_db_perform('minierp_todos', $sda, 'update', "minierp_todos_id={$id}");
return $result;
}
示例8: setAsFree
function setAsFree($ean_no)
{
//BEFORE USING THIS FUNCTION
//PLEASE MAKE SURE PRODUCT IS NEVER ACTIVATED TO ANY SALES PARTNER
//DO NOT SET FREE THE EAN IF PRODUCT IS ALREADY ACTIVATED
$r = tep_db_perform('products', array('products_ean' => ''), 'update', "products_ean='{$ean_no}'");
$r = tep_db_perform('products_articles', array('products_ean' => ''), 'update', "products_ean='{$ean_no}'");
$result = tep_db_query("UPDATE products_ean SET status='0'" . " WHERE ean_no='{$ean_no}'");
return $result;
}
示例9: generateKeywords
function generateKeywords($product_id)
{
use_class('styles');
use_class('Product');
use_class('ProductAttribute');
$class_s = new styles();
$keywords = array();
$product = new Product($product_id);
$language_id = 2;
//Step 1 (Brand)
if ($product->brand_id == 24) {
$keywords = array(strtolower($product->brand_name), 'eli', 'silberschmuck', '925', 'junger', 'modischer', 'trendy', 'fashion');
} elseif ($product->brand_id == 3) {
$keywords = array(strtolower($product->brand_name), 'vergoldet', 'golden', 'gold', 'vermeil');
} elseif ($product->brand_id == 7) {
$keywords = array(strtolower($product->brand_name), 'perlenschmuck', 'brautschmuck', 'hochzeit');
}
//Step 2 (Symbol)
$symbol = $class_s->getProductStyle($product_id);
if ($symbol['Symbol'] > 0) {
$style = new ProductAttribute($symbol['Symbol']);
if ($symbol['Symbol'] != '') {
array_push($keywords, strtolower($style->displayAttributeName($product_id, ProductAttribute::GROUP_ID_SYMBOL, $language_id)));
}
}
//Step 3 (Basic)
array_push($keywords, 'günstiger', 'frau', 'freundin', 'geschenk', 'juwelier');
//Step 4 (Material)
$materials = array();
$q = "SELECT ptpm.products_materials_id AS id" . " , material_name AS name" . " FROM products_to_products_materials ptpm" . " INNER JOIN products_materials pm" . " ON pm.products_materials_id = ptpm.products_materials_id" . " WHERE ptpm.products_id = {$product_id}";
$r = tep_db_query($q);
while ($row = tep_db_fetch_array($r)) {
$materials[$row['id']] = $row['name'];
}
foreach ($materials as $key => $value) {
if ($key == 4 || $key == 2) {
list($material_name2, $material_name1, $material_name3) = split(",", $value);
array_push($keywords, strtolower($material_name2), 'glamourös', 'funkelnd', 'glitzernd', 'strass', 'festlich', 'elegant');
} else {
list($material_name2, $material_name1, $material_name3) = split(",", $value);
array_push($keywords, strtolower($material_name2));
}
}
//Step 5 (Color)
$color = $product->getColors($language_id);
array_push($keywords, strtolower($color));
//Step 6 (Rest of the products)
array_push($keywords, 'basic', 'klassik', 'klassisch', 'schlicht', 'elegant', 'zeitlos', 'sportlich', 'dezent', 'filigran', 'zart', 'schlicht');
$final_k = implode(',', $keywords);
//echo $pid." = ".$final_k;
$sda = array();
$sda['products_head_keywords_tag'] = $final_k;
tep_db_perform('products_description', $sda, 'update', "products_id={$product_id} AND language_id={$language_id}");
}
示例10: add
/**
* Add new data to Report COGS table. Existing data will be removed and
* replaced with new data.
* @global Array $bgst
* @param Int $jng_sp_id
* @param String $base_date
* @param String $ean
* @param Int $products_id
* @param Int $articles_id
* @param String $complexity
* @param Int $qty_sold
* @param Int $qty_return
* @param Float $price_total
* @param Float $matexp_total
* @param Float $cogs_total
* @param Float $vat
* @param Float $cash_discount_pct
* @param Float $price_total_before_return
*/
public static function add($jng_sp_id, $base_date, $ean, $products_id, $articles_id, $complexity, $qty_sold, $qty_return, $price_total, $matexp_total, $cogs_total, $vat, $cash_discount_pct, $price_total_before_return)
{
global $bgst;
if (!isset($bgst)) {
die('GLOBAL BEST GOOD SETTINGS ($bgst) NEEDEED FOR ReportCOGS::add');
}
self::remove($jng_sp_id, $base_date, $ean);
$qty = $qty_sold - $qty_return;
$qty_before_return = $qty_sold;
$price_average = $qty == 0 ? 0 : $price_total / $qty;
$price_average_before_return = $qty_sold == 0 ? 0 : $price_total_before_return / $qty_before_return;
$matexp_average = $qty == 0 ? 0 : $matexp_total / $qty;
$cogs_average = $qty == 0 ? 0 : $cogs_total / $qty;
$cogs = new ProductCOGS($matexp_average, $complexity);
$cash_discount_total = $cash_discount_pct * $price_total;
$cash_discount_total_before_return = $cash_discount_pct * $price_total_before_return;
$net_sales_total = $price_total / (1 + $vat) - $cash_discount_total;
$net_sales_total_before_return = $price_total_before_return / (1 + $vat) - $cash_discount_total_before_return;
$gross_profit_total = $net_sales_total - $qty * $cogs->value;
$gross_profit_total_pct = $net_sales_total == 0 ? 0 : $gross_profit_total / $net_sales_total;
$sda = array();
$sda['jng_sp_id'] = $jng_sp_id;
$sda['base_date'] = date('Y-m-d', strtotime($base_date));
$sda['products_ean'] = $ean;
$sda['products_id'] = $products_id;
$sda['articles_id'] = $articles_id;
$sda['quantity_sold'] = $qty_sold;
$sda['quantity_return'] = $qty_return;
$sda['quantity'] = $qty;
$sda['price_total'] = $price_total;
//equal gross sales
$sda['price_total_before_return'] = $price_total_before_return;
$sda['matexp_total'] = $matexp_total;
$sda['price'] = $price_average;
$sda['price_before_return'] = $price_average_before_return;
$sda['matexp'] = $matexp_average;
$sda['matexp_indirect'] = $cogs->indirect_material_expense;
$sda['cost_complexity'] = $cogs->cost_based_on_complexity;
$sda['cost_variable'] = $cogs->cost_variable;
$sda['cost_fixed'] = $cogs->cost_fixed;
$sda['cost_handling'] = $cogs->cost_handling;
$sda['cogs'] = $cogs->value;
$sda['cogs_average'] = $cogs_average;
$sda['cogs_total'] = $cogs_total;
$sda['vat'] = $vat;
$sda['cash_discount_percent'] = $cash_discount_pct;
$sda['cash_discount_total'] = $cash_discount_total;
$sda['cash_discount_total_before_return'] = $cash_discount_total_before_return;
$sda['net_sales_total'] = $net_sales_total;
$sda['net_sales_total_before_return'] = $net_sales_total_before_return;
$sda['gross_profit_total'] = $gross_profit_total;
$sda['gross_profit_total_percent'] = $gross_profit_total_pct;
tep_db_perform('report_cogs', $sda);
}
示例11: updateDescription
/**
* Update Measurements Description
* @param int $measurements_id
* @param int $languages_id
* @param array $measurements_data
*/
public function updateDescription($measurements_id, $languages_id, $measurements_data)
{
$q_check = "SELECT * FROM measurements_description" . " WHERE measurements_id = {$measurements_id} AND languages_id = {$languages_id}";
$check_query = tep_db_query($q_check);
if (tep_db_num_rows($check_query) == 0) {
$measurements_data['measurements_id'] = $measurements_id;
$measurements_data['languages_id'] = $languages_id;
tep_db_perform('measurements_description', $measurements_data);
} else {
$filter_update = "measurements_id = {$measurements_id} AND languages_id = {$languages_id}";
tep_db_perform('measurements_description', $measurements_data, 'update', $filter_update);
}
}
示例12: addNewDescription
function addNewDescription($design_id, $design_description, $updateby, $reminder)
{
$sdo = array();
$sdo['reminder'] = $reminder;
$result = tep_db_perform('projectplan_newdesign', $sdo, 'update', "project_id={$design_id}");
$sda = array();
$sda['project_id'] = $design_id;
$sda['project_description'] = $design_description;
$sda['last_update_by'] = $updateby;
$sda['last_update_time'] = date('Y-m-d H:i:s');
tep_db_perform('projectplan_description', $sda);
$newid = tep_db_insert_id();
return $newid;
}
示例13: removeLike
function removeLike($user_id)
{
$deleted = false;
$fk = array_search($user_id, $this->list);
if ($fk !== false) {
unset($this->list[$fk]);
$this->list_raw = implode(',', $this->list);
$sda = array();
$sda[$this->column_name] = $this->list_raw;
tep_db_perform($this->table_name, $sda, 'update', "{$this->column_id_name}={$this->column_id_value}");
$deleted = true;
}
return $deleted;
}
示例14: log
function log($module, $action, $result, $request, $response, $server, $is_ipn = false)
{
global $customer_id;
$do_log = false;
if (in_array(OSCOM_APP_PAYPAL_LOG_TRANSACTIONS, array('1', '0'))) {
$do_log = true;
if (OSCOM_APP_PAYPAL_LOG_TRANSACTIONS == '0' && $result === 1) {
$do_log = false;
}
}
if ($do_log !== true) {
return false;
}
$filter = array('ACCT', 'CVV2', 'ISSUENUMBER');
$request_string = '';
if (is_array($request)) {
foreach ($request as $key => $value) {
if (strpos($key, '_nh-dns') !== false || in_array($key, $filter)) {
$value = '**********';
}
$request_string .= $key . ': ' . $value . "\n";
}
} else {
$request_string = $request;
}
$response_string = '';
if (is_array($response)) {
foreach ($response as $key => $value) {
if (is_array($value)) {
if (function_exists('http_build_query')) {
$value = http_build_query($value);
}
} elseif (strpos($key, '_nh-dns') !== false || in_array($key, $filter)) {
$value = '**********';
}
$response_string .= $key . ': ' . $value . "\n";
}
} else {
$response_string = $response;
}
$data = array('customers_id' => tep_session_is_registered('customer_id') ? $customer_id : 0, 'module' => $module, 'action' => $action . ($is_ipn === true ? ' [IPN]' : ''), 'result' => $result, 'server' => $server == 'live' ? 1 : -1, 'request' => trim($request_string), 'response' => trim($response_string), 'ip_address' => sprintf('%u', ip2long($this->getIpAddress())), 'date_added' => 'now()');
tep_db_perform('oscom_app_paypal_log', $data);
}
示例15: tep_update_information_languages
function tep_update_information_languages($language_id = 0)
{
global $languages, $languages_id, $gID;
if ($language_id == 0) {
$language_id = $languages_id;
}
// Count all items
$information_query = tep_db_query("select count(*) as information_count from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "'");
$information = tep_db_fetch_array($information_query);
$information_count_all = $information['information_count'];
// Count items for main language
$information_query = tep_db_query("select count(*) as information_count from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "' and language_id = '" . (int) $language_id . "'");
$information = tep_db_fetch_array($information_query);
$information_count_single = $information['information_count'];
if ($information_count_all != $information_count_single * sizeof($languages)) {
// Create array of language id's in information table
$information_query = tep_db_query("select language_id from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "' group by language_id");
while ($information_language = tep_db_fetch_array($information_query)) {
$information_languages[] = $information_language['language_id'];
}
// Create array of language id's in languages
foreach ($languages as $language) {
$languages_ids[] = $language['id'];
}
// Remove entries with languages no longer being used
foreach ($information_languages as $_language_id) {
if (!in_array($_language_id, $languages_ids)) {
tep_db_query("delete from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "' and language_id = '" . (int) $_language_id . "'");
}
}
$information_query = tep_db_query("select * from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "' and language_id = '" . (int) $language_id . "'");
while ($information = tep_db_fetch_array($information_query)) {
foreach ($languages_ids as $_language_id) {
if (!in_array($_language_id, $information_languages)) {
$sql_data_array = array('language_id' => $_language_id, 'visible' => tep_db_prepare_input($information['visible']), 'show_in_infobox' => tep_db_prepare_input($information['show_in_infobox']), 'sort_order' => tep_db_prepare_input($information['sort_order']), 'information_id' => tep_db_prepare_input($information['information_id']), 'information_group_id' => tep_db_prepare_input($information['information_group_id']), 'information_title' => tep_db_prepare_input($information['information_title']), 'information_description' => tep_db_prepare_input($information['information_description']), 'information_url' => tep_db_prepare_input($information['information_url']), 'information_target' => tep_db_prepare_input($information['information_target']), 'info_cg_hide' => tep_db_prepare_input($information['info_cg_hide']));
tep_db_perform(TABLE_INFORMATION, $sql_data_array);
}
}
}
}
}