本文整理汇总了PHP中tep_db_fetch_array函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_db_fetch_array函数的具体用法?PHP tep_db_fetch_array怎么用?PHP tep_db_fetch_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_db_fetch_array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
function execute()
{
global $PHP_SELF, $oscTemplate, $languages_id, $currencies, $currency;
if ($PHP_SELF == 'product_info.php' && isset($_GET['products_id'])) {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_image from products p, products_description pd where p.products_id = '" . (int) $_GET['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'");
if (tep_db_num_rows($product_info_query) === 1) {
$product_info = tep_db_fetch_array($product_info_query);
$data = array('card' => MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TYPE, 'title' => $product_info['products_name']);
if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID)) {
$data['site'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID;
}
if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID)) {
$data['creator'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID;
}
$product_description = substr(trim(preg_replace('/\\s\\s+/', ' ', strip_tags($product_info['products_description']))), 0, 197);
if (strlen($product_description) == 197) {
$product_description .= ' ..';
}
$data['description'] = $product_description;
$products_image = $product_info['products_image'];
$pi_query = tep_db_query("select image from products_images where products_id = '" . (int) $product_info['products_id'] . "' order by sort_order limit 1");
if (tep_db_num_rows($pi_query) === 1) {
$pi = tep_db_fetch_array($pi_query);
$products_image = $pi['image'];
}
$data['image'] = tep_href_link('images/' . $products_image, '', 'NONSSL', false, false);
$result = '';
foreach ($data as $key => $value) {
$result .= '<meta name="twitter:' . tep_output_string_protected($key) . '" content="' . tep_output_string_protected($value) . '" />' . "\n";
}
$oscTemplate->addBlock($result, $this->group);
}
}
}
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:34,代码来源:ht_twitter_product_card.php
示例2: flat
function flat()
{
global $order;
$this->code = 'flat';
$this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE;
$this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS;
$this->enabled = MODULE_SHIPPING_FLAT_STATUS == 'True' ? true : false;
if ($this->enabled == true && (int) MODULE_SHIPPING_FLAT_ZONE > 0) {
$check_flag = false;
$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while ($check = tep_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
}
开发者ID:laiello,项目名称:hotel-os,代码行数:27,代码来源:flat.php
示例3: form_make
function form_make($engine, $id_field, $date_field, $i)
{
$html = '<div class="createhead">' . constant("CREATE_" . strtoupper($engine) . "_" . $i) . '</div>';
$engine != "customers" ? $dateclause = ", MIN(UNIX_TIMESTAMP({$date_field})) as date_min, MAX(UNIX_TIMESTAMP({$date_field})) as date_max" : ($dateclause = "");
$sql = "SELECT COUNT(*), MIN({$id_field}), MAX({$id_field})" . $dateclause . " FROM " . constant("TABLE_" . strtoupper($engine)) . $this->where;
$result = tep_db_query($sql);
if ($myrow = tep_db_fetch_array($result)) {
$date_min = date('M j, Y g:i a', $myrow["date_min"]);
$date_max = date('M j, Y g:i a', $myrow["date_max"]);
$html .= '<span class="createlabel">' . CREATE_TOTAL . ":</span> " . $myrow["COUNT(*)"] . "<br />";
if ($myrow["COUNT(*)"] >= 1) {
$html .= '<span class="createlabel">' . CREATE_NUM_S . ":</span> " . $myrow["MIN({$id_field})"];
$myrow["COUNT(*)"] > 1 ? $html .= " " . CREATE_TO . " " . $myrow["MAX({$id_field})"] . "<br />" : ($html .= "<br />");
if ($engine != "customers") {
$html .= '<span class="createlabel">' . CREATE_DATE_S . ":</span> " . $date_min;
$myrow["COUNT(*)"] > 1 ? $html .= " " . CREATE_TO . " " . $date_max . "<br />" : ($html .= "<br />");
}
$html .= '<form action=' . $_SERVER[PHP_SELF] . ' method="post" name="' . $engine . $i . '">';
$html .= '<input name="engine" type="hidden" value="' . $engine . '" />';
$html .= '<input name="whereclause" type="hidden" value="' . $this->where . '" />';
$html .= '<input name="qbimported" type="hidden" value="' . $i . '" />';
$html .= '<input name="stage" type="hidden" value="process" />';
$html .= '<input name="submit" type="submit" value="' . CREATE_BUTTON . '" />';
$html .= '</form>';
$html .= '<br /><br />';
} else {
$html .= '<br />';
}
}
$this->form = $html;
}
开发者ID:rrecurse,项目名称:IntenseCart,代码行数:31,代码来源:qbi_classes.php
示例4: execute
function execute()
{
global $sessiontoken, $login_customer_id, $messageStack, $oscTemplate;
$error = false;
if (isset($_GET['action']) && $_GET['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $sessiontoken) {
$email_address = tep_db_prepare_input($_POST['email_address']);
$password = tep_db_prepare_input($_POST['password']);
// Check if email exists
$customer_query = tep_db_query("select customers_id, customers_password from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1");
if (!tep_db_num_rows($customer_query)) {
$error = true;
} else {
$customer = tep_db_fetch_array($customer_query);
// Check that password is good
if (!tep_validate_password($password, $customer['customers_password'])) {
$error = true;
} else {
// set $login_customer_id globally and perform post login code in catalog/login.php
$login_customer_id = (int) $customer['customers_id'];
// migrate old hashed password to new phpass password
if (tep_password_type($customer['customers_password']) != 'phpass') {
tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password) . "' where customers_id = '" . (int) $login_customer_id . "'");
}
}
}
}
if ($error == true) {
$messageStack->add('login', MODULE_CONTENT_LOGIN_TEXT_LOGIN_ERROR);
}
ob_start();
include 'includes/modules/content/' . $this->group . '/templates/login_form.php';
$template = ob_get_clean();
$oscTemplate->addContent($template, $this->group);
}
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:34,代码来源:cm_login_form.php
示例5: output
public function output($step = 0)
{
global $temp_orders_id;
$html = '';
if ($temp_orders_id > 0) {
$to_query = tep_db_query('SELECT * FROM temp_orders WHERE orders_id = "' . $temp_orders_id . '"');
if (tep_db_num_rows($to_query) > 0) {
$to = tep_db_fetch_array($to_query);
$html .= '<div class="billing_address">';
$html .= '<h3 class="billing_address_title">' . Translate($this->config['title']) . '</h3>';
if (!empty($this->config['description'])) {
$html .= '<p class="billing_address_description">' . Translate($this->config['description']) . '</p>';
}
$html .= '<blockquote>';
$html .= '<address>';
//name
$html .= '<strong>' . $to['billing_name'] . '</strong><br />';
//street
$html .= $to['billing_street_address'] . '<br />';
//city + postcode + country
$html .= $to['billing_postcode'] . ' ' . $to['billing_city'] . ' ' . tep_get_country_name($to['billing_country']) . '<br />';
$html .= '</address>';
$html .= '</blockquote>';
$html .= '</div>';
//end billing_address
}
}
return $html;
}
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:29,代码来源:Billing_address_module.php
示例6: getData
function getData()
{
global $HTTP_GET_VARS, $request_type, $oscTemplate;
$data = '';
$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
// Display a list
$manufacturers_list = '<ul class="nav nav-list">';
while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
$manufacturers_name = strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name'];
if (isset($HTTP_GET_VARS['manufacturers_id']) && $HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id']) {
$manufacturers_name = '<strong>' . $manufacturers_name . '</strong>';
}
$manufacturers_list .= '<li><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a></li>';
}
$manufacturers_list .= '</ul>';
$content = $manufacturers_list;
} else {
// Display a drop-down
$manufacturers_array = array();
if (MAX_MANUFACTURERS_LIST < 2) {
$manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
}
while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
$manufacturers_name = strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name'];
$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers_name);
}
$content = tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', $request_type, false), 'get') . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : '', 'onchange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id() . '</form>';
}
$data = '<div class="panel panel-default">' . ' <div class="panel-heading">' . MODULE_BOXES_MANUFACTURERS_BOX_TITLE . '</div>' . ' <div class="panel-body">' . $content . '</div>' . '</div>';
}
return $data;
}
开发者ID:osc2nuke,项目名称:demobts,代码行数:34,代码来源:bm_manufacturers.php
示例7: retrieve
public function retrieve()
{
if (SEO_URLS_ENABLED != 'false') {
$query = str_replace(':cache_name', $this->cachename, $this->extract_query);
$result = usu::query($query);
$row = tep_db_fetch_array($result);
tep_db_free_result($result);
if (!empty($row)) {
$cache_seconds = usu::$cachedays * 24 * 60 * 60;
if (time() > strtotime($row['cache_date']) + $cache_seconds) {
$this->gc();
} else {
usu::$cachefile_size = number_format(strlen($row['cache_data']) / 1024, 2) . ' kb';
usu::$performance['time'] = microtime(true);
$this->md5check = md5($row['cache_data']);
$rawdata = gzinflate(base64_decode($row['cache_data']));
usu::$registry = unserialize($rawdata);
usu::$performance['time'] = round(microtime(true) - usu::$performance['time'], 4);
$this->retrieved = true;
return true;
}
}
}
usu::$registry = Usu_Registry::getInstance();
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:25,代码来源:Usu_Cache_Database.php
示例8: 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
示例9: 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
示例10: updateStatus
function updateStatus($upload_id, $status, $update_by = '')
{
$update_time = date('Y-m-d H:i:s');
tep_db_query("UPDATE jng_sp_upload SET upload_status='{$status}', status_update_time='{$update_time}', status_update_by='{$update_by}' WHERE jng_sp_upload_id={$upload_id}");
//Check if upload status update is "Success" (S)
if ($status == 'S') {
//Get all catalog id included in this upload for image upload and update the image_uploaded status to 1
$catalog_query = tep_db_query("SELECT jng_sp_catalog_id FROM jng_sp_upload_image WHERE jng_sp_upload_id={$upload_id}");
if (tep_db_num_rows($catalog_query) > 0) {
$jcid = array();
while ($row = tep_db_fetch_array($catalog_query)) {
$jcid[] = $row['jng_sp_catalog_id'];
}
$jcid_filter = implode(',', $jcid);
tep_db_query("UPDATE jng_sp_catalog SET image_uploaded='1' WHERE jng_sp_catalog_id IN ({$jcid_filter})");
}
//Get all catalog id included in this upload and upload last_active_status accordingly and price_uploaded to 1
$catalog_query = tep_db_query("SELECT jng_sp_catalog_id, active_status FROM jng_sp_upload_product_status WHERE jng_sp_upload_id={$upload_id}");
if (tep_db_num_rows($catalog_query) > 0) {
$active_status = array();
while ($row = tep_db_fetch_array($catalog_query)) {
if (!isset($active_status[$row['active_status']])) {
$active_status[$row['active_status']] = array();
}
$active_status[$row['active_status']][] = $row['jng_sp_catalog_id'];
}
foreach ($active_status as $status => $jcid) {
$jcid_filter = implode(',', $jcid);
tep_db_query("UPDATE jng_sp_catalog SET last_active_status='{$status}', price_uploaded='1' WHERE jng_sp_catalog_id IN ({$jcid_filter})");
}
}
} else {
tep_db_query("DELETE FROM jng_sp_otde_removed_ean WHERE jng_sp_upload_id={$upload_id}");
}
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:35,代码来源:jng_sp_upload.php
示例11: confirmation
function confirmation()
{
global $customer_id;
$customer_info_query = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
$customer_info = tep_db_fetch_array($customer_info_query);
return array('title' => sprintf(MODULE_PAYMENT_INTERKASSA_TEXT_DESCRIPTION_1, $customer_info['customers_email_address']));
}
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:7,代码来源:interkassa.php
示例12: process
public function process()
{
$this->get_value = $this->parsePath($_GET['articles_id']);
$this->original_get = (int) $_GET['articles_id'];
$this->cache_name = $this->setCacheString(__FILE__, 'article_info', $this->original_get);
if (false !== $this->retrieve($this->cache_name)) {
KissMT::init()->setCanonical($this->checkCanonical('articles_id'));
return;
}
$query_replacements = array(':articles_id' => (int) $this->get_value, ':languages_id' => (int) KissMT::init()->retrieve('languages_id'));
$query = str_replace(array_keys($query_replacements), array_values($query_replacements), $this->article_query);
$result = KissMT::init()->query($query);
$article_details = tep_db_fetch_array($result);
tep_db_free_result($result);
$name = trim($article_details['name']);
$description = trim($article_details['description']);
$breadcrumb = array_flip(KissMT::init()->retrieve('breadcrumb'));
if (array_key_exists($name, $breadcrumb)) {
unset($breadcrumb[$name]);
}
$breadcrumb = array_flip($breadcrumb);
$leading_values = $name . (!empty($breadcrumb) ? '[-separator-]' . implode('[-separator-]', $breadcrumb) : '');
KissMT::init()->setCanonical($this->checkCanonical('articles_id'));
$this->parse(KissMT::init()->entities($leading_values, $decode = true), KissMT::init()->entities($description, $decode = true));
}
开发者ID:tapwag,项目名称:oscommerce_deutsch,代码行数:25,代码来源:article_info.php
示例13: execute
function execute()
{
global $languages_id, $HTTP_GET_VARS, $currencies, $oscTemplate;
$random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' and r.reviews_status = 1";
if (isset($HTTP_GET_VARS['products_id'])) {
$random_select .= " and p.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "'";
}
$random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
$random_product = tep_random_select($random_select);
$reviews_box_contents = '';
if ($random_product) {
// display random review box
$rand_review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int) $random_product['reviews_id'] . "' and languages_id = '" . (int) $languages_id . "'");
$rand_review = tep_db_fetch_array($rand_review_query);
$rand_review_text = tep_break_string(tep_output_string_protected($rand_review['reviews_text']), 15, '-<br />');
$reviews_box_contents .= '<div class="ui-widget-content infoBoxContents"><div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . $rand_review_text . ' ..</a><br /><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif', sprintf(MODULE_BOXES_REVIEWS_BOX_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div></div>';
} elseif (isset($HTTP_GET_VARS['products_id'])) {
// display 'write a review' box
$reviews_box_contents .= '<table border="0" cellspacing="0" cellpadding="2" class="ui-widget-content infoBoxContents"><tr><td><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . MODULE_BOXES_REVIEWS_BOX_WRITE_REVIEW . '</a></td></tr></table>';
} else {
// display 'no reviews' box
$reviews_box_contents .= '<div class="ui-widget-content infoBoxContents">' . MODULE_BOXES_REVIEWS_BOX_NO_REVIEWS . '</div>';
}
$data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_REVIEWS) . '">' . MODULE_BOXES_REVIEWS_BOX_TITLE . '</a></div>' . ' ' . $reviews_box_contents . '</div>';
$oscTemplate->addBlock($data, $this->group);
}
开发者ID:Sibzsolutions,项目名称:Savostore,代码行数:26,代码来源:bm_reviews.php
示例14: product
/**
* @author Michael Hammelmann <[email protected]>
* @version 1
* @param $pID products_id
**/
function product($pID)
{
global $languages_id;
$product_info_query = tep_db_query("select p.products_distributor_id,p.products_id, pd.products_name, pd.products_description,pd.short_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,p.products_weight from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . $pID . "' and pd.products_id = p.products_id and pd.language_id = '" . (int) $languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
$this->price = $product_info['products_price'];
$this->tax = tep_get_tax_rate($product_info['products_tax_class_id']);
$tax_class_query = tep_db_query("select tax_class_title from " . TABLE_TAX_CLASS . " where tax_class_id=" . $product_info['products_tax_class_id']);
$tax_class = tep_db_fetch_array($tax_class_query);
$this->tax_title = $tax_class['tax_class_title'];
$this->weight = $product_info['products_weight'];
$this->short_description = $product_info['short_description'];
$this->name = $product_info['products_name'];
$this->image = $product_info['products_image'];
/**
* added for distributor specific data
**/
$distributor_path_query = tep_db_query("select * from " . TABLE_DISTRIBUTORS . " where distributor_id=" . $product_info['products_distributor_id']);
$distributor_path = tep_db_fetch_array($distributor_path_query);
$this->pdf_path = $distributor_path['pdf_prefix'];
$this->image_path = $distributor_path['image_prefix'];
if ($this->image_path == '') {
$this->image_path = DIR_WS_IMAGES;
}
if ($this->image == '') {
$this->image = 'empty.jpg';
$this->image_path = DIR_WS_IMAGES;
}
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:34,代码来源:product.php
示例15: update_status
function update_status()
{
global $order;
if ($this->enabled == true && (int) MODULE_PAYMENT_COD_ZONE > 0) {
$check_flag = false;
$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_COD_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while ($check = tep_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
// disable the module if the order only contains virtual products
if ($this->enabled == true) {
if ($order->content_type == 'virtual') {
$this->enabled = false;
}
}
}
开发者ID:respencer,项目名称:oscommerce2,代码行数:26,代码来源:cod.php
示例16: 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
示例17: execute
function execute()
{
global $HTTP_GET_VARS, $HTTP_POST_VARS, $oscTemplate, $customer_id, $order_id;
if (tep_session_is_registered('customer_id')) {
$global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int) $customer_id . "'");
$global = tep_db_fetch_array($global_query);
if ($global['global_product_notifications'] != '1') {
if (isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'update') {
if (isset($HTTP_POST_VARS['notify']) && is_array($HTTP_POST_VARS['notify']) && !empty($HTTP_POST_VARS['notify'])) {
$notify = array_unique($HTTP_POST_VARS['notify']);
foreach ($notify as $n) {
if (is_numeric($n) && $n > 0) {
$check_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $n . "' and customers_id = '" . (int) $customer_id . "' limit 1");
if (!tep_db_num_rows($check_query)) {
tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . (int) $n . "', '" . (int) $customer_id . "', now())");
}
}
}
}
}
$products_displayed = array();
$products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $order_id . "' order by products_name");
while ($products = tep_db_fetch_array($products_query)) {
if (!isset($products_displayed[$products['products_id']])) {
$products_displayed[$products['products_id']] = tep_draw_checkbox_field('notify[]', $products['products_id']) . ' ' . $products['products_name'];
}
}
$products_notifications = implode('<br />', $products_displayed);
ob_start();
include DIR_WS_MODULES . 'content/' . $this->group . '/templates/product_notifications.php';
$template = ob_get_clean();
$oscTemplate->addContent($template, $this->group);
}
}
}
开发者ID:Sibzsolutions,项目名称:Savostore,代码行数:35,代码来源:cm_cs_product_notifications.php
示例18: 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
示例19: 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' =&
|
请发表评论