本文整理汇总了PHP中tep_db_input函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_db_input函数的具体用法?PHP tep_db_input怎么用?PHP tep_db_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_db_input函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: table
function table()
{
global $order;
$this->code = 'table';
$this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
$this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
$this->icon = '';
$this->tax_class = 0;
$this->enabled = MODULE_SHIPPING_TABLE_STATUS == 'True' ? true : false;
if ($order->content_type == 'virtual') {
$this->enabled = false;
}
$this->order_type = 'common';
// common - без периодики, periodical - периодика, mixed - смешанный
if ($this->enabled) {
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and city_id = '" . tep_db_input($order->delivery['postcode']) . "'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
if ($geozones_check['total'] < 1) {
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and city_id like '" . tep_db_input(substr($order->delivery['postcode'], 0, -1)) . "%'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
if ($geozones_check['total'] < 1) {
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and city_id like '" . tep_db_input(substr($order->delivery['postcode'], 0, -2)) . "%'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
}
}
if ($geozones_check['total'] < 1) {
$this->enabled = false;
}
}
}
示例2: 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) . "')");
}
}
示例3: query
function query($returns_id)
{
$returns_query = tep_db_query("SELECT * FROM " . TABLE_RETURNS . " WHERE returns_id = '" . tep_db_input($returns_id) . "'");
$returns = tep_db_fetch_array($returns_query);
$refund_payment_query = tep_db_query("SELECT * FROM " . TABLE_RETURN_PAYMENTS . " where returns_id = '" . tep_db_input($returns_id) . "'");
$refund_payment = tep_db_fetch_array($refund_payment_query);
$this->returnid = $returns['returns_id'];
$this->orderid = $returns['order_id'];
$this->info = array('currency' => $returns['currency'], 'currency_value' => $returns['currency_value'], 'payment_method' => $returns['payment_method'], 'rma_value' => $returns['rma_value'], 'order_id' => $returns['order_id'], 'cc_type' => $returns['cc_type'], 'cc_owner' => $returns['cc_owner'], 'cc_number' => $returns['cc_number'], 'cvvnumber' => $returns['cvvnumber'], 'cc_expires' => $returns['cc_expires'], 'comments' => $returns['comments'], 'date_purchased' => $returns['date_purchased'], 'orders_status' => $returns['returns_status'], 'date_finished' => $returns['date_finished'], 'customer_method' => $refund_payment['customer_method'], 'refund_method' => $refund_payment['refund_payment_name'], 'payment_reference' => $refund_payment['refund_payment_reference'], 'refund_amount' => 0, 'refund_date' => $refund_payment['refund_payment_date'], 'refund_gv_id' => $returns['refund_gv_id'], 'last_modified' => $returns['last_modified'], 'return_reason' => $returns['returns_reason']);
$this->customer = array('name' => $returns['customers_name'], 'company' => $returns['customers_company'], 'street_address' => $returns['customers_street_address'], 'suburb' => $returns['customers_suburb'], 'city' => $returns['customers_city'], 'postcode' => $returns['customers_postcode'], 'state' => $returns['customers_state'], 'country' => $returns['customers_country'], 'format_id' => $returns['customers_address_format_id'], 'telephone' => $returns['customers_telephone'], 'fax' => $returns['customers_fax'], 'email_address' => $returns['customers_email_address']);
$this->delivery = array('name' => $returns['delivery_name'], 'company' => $returns['delivery_company'], 'street_address' => $returns['delivery_street_address'], 'suburb' => $returns['delivery_suburb'], 'city' => $returns['delivery_city'], 'postcode' => $returns['delivery_postcode'], 'state' => $returns['delivery_state'], 'country' => $returns['delivery_country'], 'format_id' => $returns['delivery_address_format_id']);
$this->billing = array('name' => $returns['billing_name'], 'company' => $returns['billing_company'], 'street_address' => $returns['billing_street_address'], 'suburb' => $returns['billing_suburb'], 'city' => $returns['billing_city'], 'postcode' => $returns['billing_postcode'], 'state' => $returns['billing_state'], 'country' => $returns['billing_country'], 'format_id' => $returns['billing_address_format_id']);
$returns_products_query = tep_db_query("SELECT * FROM " . TABLE_RETURNS_PRODUCTS_DATA . " WHERE returns_id ='" . tep_db_input($returns_id) . "'");
while ($returned_products = tep_db_fetch_array($returns_products_query)) {
$this->products = array('qty' => $returned_products['products_quantity'], 'name' => $returned_products['products_name'], 'model' => $returned_products['products_model'], 'tax' => $returned_products['products_tax'], 'price' => $returned_products['products_price'], 'id' => $returned_products['products_id'], 'refund_shipping' => $returned_products['refund_shipping'], 'restock_quantity' => $returned_products['restock_quantity'], 'refund_amount' => $returned_products['refund_amount'], 'exchange_amount' => $returned_products['exchange_amount'], 'refund_shipping_amount' => $returned_products['refund_shipping_amount'], 'final_price' => $returned_products['products_price']);
$this->info['refund_amount'] += $returned_products['refund_amount'];
}
// # END while
$this->exchange = array();
$returns_products_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_PRODUCTS . " \r\n\t\t\t\t\t\t\t\t\t\t\t\t WHERE exchange_returns_id ='" . tep_db_input($returns_id) . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t");
while ($returned_products = tep_db_fetch_array($returns_products_query)) {
$this->exchange[] = array('orders_products_id' => $returned_products['orders_products_id'], 'qty' => $returned_products['products_quantity'], 'name' => $returned_products['products_name'], 'model' => $returned_products['products_model'], 'tax' => $returned_products['products_tax'], 'price' => $returned_products['products_price'], 'final_price' => $returned_products['products_price'], 'id' => $returned_products['products_id'], 'free_shipping' => $returned_products['free_shipping'], 'separate_shipping' => $returned_products['separate_shipping'], 'weight' => $returned_products['products_weight']);
$attributes_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " \r\n\t\t\t\t\t\t\t\t\t\t\t WHERE orders_id = '" . $this->orderid . "' \r\n\t\t\t\t\t\t\t\t\t\t\t AND orders_products_id = '" . (int) $returned_products['orders_products_id'] . "'\r\n\t\t\t\t\t\t\t\t\t\t\t");
if (tep_db_num_rows($attributes_query)) {
while ($attributes = tep_db_fetch_array($attributes_query)) {
$this->exchange[sizeof($this->exchange) - 1]['attributes'][] = array('option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
}
// # END while $attributes
}
// # END if tep_db_num_rows
}
// # END $returned_products
}
示例4: ot_tax_ma
function ot_tax_ma()
{
global $order, $customer_id;
$this->code = 'ot_tax_ma';
$this->title = MODULE_ORDER_TOTAL_TAX_MA_TITLE;
$this->description = MODULE_ORDER_TOTAL_TAX_MA_DESCRIPTION;
$this->enabled = MODULE_ORDER_TOTAL_TAX_MA_STATUS == 'true' ? true : false;
$this->sort_order = MODULE_ORDER_TOTAL_TAX_MA_SORT_ORDER;
$this->defined_handling = '';
$this->output = array();
if ($this->enabled) {
list($postcode) = explode('-', $order->delivery['postcode']);
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_ORDER_TOTAL_TAX_MA_ZONE . "' and city_id = '" . tep_db_input($postcode) . "'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
if ($geozones_check['total'] > 0) {
$company_info_query = tep_db_query("select companies_name, companies_tax_exempt_number from " . TABLE_COMPANIES . " where customers_id = '" . (int) $customer_id . "'");
$company_info = tep_db_fetch_array($company_info_query);
if (strpos(strtolower($company_info['companies_name']), 'library') !== false || $company_info['companies_tax_exempt_number'] > 0) {
$this->enabled = false;
} else {
$this->defined_handling = str_replace(',', '.', MODULE_ORDER_TOTAL_TAX_MA_HANDLING);
}
} else {
$this->enabled = false;
}
}
}
示例5: 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);
}
示例6: deliverAction
/**
* Call CONFIRMATION_DELIVER and updates order and item data
*/
public static function deliverAction()
{
$post = Globals::getPost();
$orderId = Globals::getPostEntry('order_number');
$order = new order($orderId);
$transactionId = Db::getRatepayOrderDataEntry($orderId, 'transaction_id');
$transactionShortId = Db::getRatepayOrderDataEntry($orderId, 'transaction_short_id');
$subType = Data::isFullDeliver(self::getDeliverPostData($post), $orderId) ? 'full-deliver' : 'partial-deliver';
$data = array('HeadInfo' => RequestMapper::getHeadInfoModel($order, $transactionId, $transactionShortId, $orderId, $subType), 'BasketInfo' => RequestMapper::getBasketInfoModel($order, $orderId, self::getDeliverPostData($post)));
$payment = Loader::getRatepayPayment($order->info['payment_method']);
$requestService = new RequestService($payment->sandbox, $data);
$result = $requestService->callConfirmationDeliver();
Db::xmlLog($order, $requestService->getRequest(), $orderId, $requestService->getResponse());
if (!array_key_exists('error', $result)) {
Session::setRpSessionEntry('message_css_class', 'messageStackSuccess');
Session::setRpSessionEntry('message', RATEPAY_ORDER_MESSAGE_DELIVER_SUCCESS);
Db::shipRpOrder(self::getDeliverPostData($post), $order);
Db::setRpHistoryEntrys($post, 'CONFIRMATION_DELIVER', $subType);
$flag = true;
foreach (Db::getRpItems($orderId) as $item) {
if ($item['ordered'] != $item['shipped']) {
$flag = false;
}
}
if ($flag) {
$sql = "UPDATE orders SET " . "orders_status = " . (int) 3 . " WHERE " . "orders_id = '" . tep_db_input($orderId) . "'";
tep_db_query($sql);
}
} else {
Session::setRpSessionEntry('message_css_class', 'messageStackError');
Session::setRpSessionEntry('message', RATEPAY_ORDER_MESSAGE_DELIVER_ERROR);
}
tep_redirect(tep_href_link("ratepay_order.php", 'oID=' . $orderId, 'SSL'));
}
示例7: quote
function quote($method = '')
{
global $order, $cart, $shipping_weight, $currencies, $currency;
$postcode_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES . " where city_id = '" . tep_db_input(tep_db_prepare_input($order->delivery['postcode'])) . "'");
$postcode_check = tep_db_fetch_array($postcode_check_query);
$shipping_cost = 0;
// if (empty($order->delivery['postcode'])) {
// $this->quotes['error'] = MODULE_SHIPPING_UKRPOSTBN_NO_ZIPCODE_FOUND;
// } elseif ($postcode_check['total'] < 1) {
// $this->quotes['error'] = MODULE_SHIPPING_UKRPOSTBN_NO_ZIPCODE_EXISTS;
// } else {
$total_sum = str_replace(',', '.', round($cart->total * $currencies->currencies[$currency]['value'], $currencies->currencies[$currency]['decimal_places']));
$persentage = str_replace(',', '.', MODULE_SHIPPING_UKRPOSTBN_COST);
$min_cost = str_replace(',', '.', MODULE_SHIPPING_UKRPOSTBN_MIN_COST);
$add_cost = str_replace(',', '.', MODULE_SHIPPING_UKRPOSTBN_ADDITIONAL_COST);
if ($persentage > 0) {
$shipping_cost = $total_sum * $persentage / 100;
}
if ($min_cost > 0 && $shipping_cost < $min_cost) {
$shipping_cost = $min_cost;
}
if ($add_cost > 0) {
$shipping_cost += $add_cost;
}
$shipping_method = sprintf(MODULE_SHIPPING_UKRPOSTBN_TEXT_WEIGHT, $shipping_weight);
// }
if ($shipping_cost > 0) {
$shipping_cost = $shipping_cost / $currencies->get_value($currency);
}
$this->quotes['id'] = $this->code;
$this->quotes['module'] = MODULE_SHIPPING_UKRPOSTBN_TEXT_TITLE;
$this->quotes['methods'] = array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost));
return $this->quotes;
}
示例8: subtable
function subtable()
{
global $order;
$this->code = 'subtable';
$this->title = MODULE_SHIPPING_SUBTABLE_TEXT_TITLE;
$this->description = MODULE_SHIPPING_SUBTABLE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_SUBTABLE_SORT_ORDER;
$this->icon = '';
$this->defined_handling = '';
$this->tax_class = 0;
$this->enabled = MODULE_SHIPPING_SUBTABLE_STATUS == 'True' ? true : false;
if ($order->content_type == 'virtual') {
$this->enabled = false;
}
if ($this->enabled) {
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_SUBTABLE_ZONE_1 . "' and city_id = '" . tep_db_input($order->delivery['postcode']) . "'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
if ($geozones_check['total'] > 0) {
$this->defined_handling = MODULE_SHIPPING_SUBTABLE_HANDLING_1;
} else {
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_SUBTABLE_ZONE_2 . "' and city_id = '" . tep_db_input($order->delivery['postcode']) . "'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
if ($geozones_check['total'] > 0) {
$this->defined_handling = MODULE_SHIPPING_SUBTABLE_HANDLING_2;
} else {
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_SUBTABLE_ZONE_3 . "' and city_id = '" . tep_db_input($order->delivery['postcode']) . "'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
if ($geozones_check['total'] > 0) {
$this->defined_handling = MODULE_SHIPPING_SUBTABLE_HANDLING_3;
} else {
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_SUBTABLE_ZONE_4 . "' and city_id = '" . tep_db_input($order->delivery['postcode']) . "'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
if ($geozones_check['total'] > 0) {
$this->defined_handling = MODULE_SHIPPING_SUBTABLE_HANDLING_4;
} else {
$geozones_check_query = tep_db_query("select count(*) as total from " . TABLE_CITIES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_SUBTABLE_ZONE_5 . "' and city_id = '" . tep_db_input($order->delivery['postcode']) . "'");
$geozones_check = tep_db_fetch_array($geozones_check_query);
if ($geozones_check['total'] > 0) {
$this->defined_handling = MODULE_SHIPPING_SUBTABLE_HANDLING_5;
}
}
}
}
}
if (empty($this->defined_handling)) {
$this->enabled = false;
}
}
if (is_object($order)) {
reset($order->products);
while (list(, $order_product) = each($order->products)) {
if ($order_product['periodicity'] > 0) {
$this->enabled = false;
break;
}
}
}
}
示例9: canPerform
function canPerform($user_id, $user_name)
{
$check_query = tep_db_query("select id from " . TABLE_ACTION_RECORDER . " where module = '" . tep_db_input($this->code) . "' and user_name = '" . tep_db_input($user_name) . "' and date_added >= date_sub(now(), interval " . (int) $this->minutes . " minute) and success = 1 order by date_added desc limit " . (int) $this->attempts);
if (tep_db_num_rows($check_query) == $this->attempts) {
return false;
} else {
return true;
}
}
示例10: _sess_destroy
function _sess_destroy($key)
{
$database = $_SESSION['database'];
//$database = new database();
//$database->connect();
$result = $database->query("delete from " . TABLE_SESSIONS . " where sessions_key = '" . tep_db_input($key) . "'");
//$database->close();
return $result;
}
示例11: tep_get_zone_id
function tep_get_zone_id($country_id, $zone_name)
{
$zone_id_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int) $country_id . "' and zone_name = '" . tep_db_input($zone_name) . "'");
if (tep_db_num_rows($zone_id_query) > 0) {
$zone_id_row = tep_db_fetch_array($zone_id_query);
return $zone_id_row['zone_id'];
}
return 0;
}
示例12: canPerform
function canPerform($user_id, $user_name)
{
$check_query = tep_db_query("select date_added from " . TABLE_ACTION_RECORDER . " where module = '" . tep_db_input($this->code) . "' and (" . (!empty($user_id) ? "user_id = '" . (int) $user_id . "' or " : "") . " identifier = '" . tep_db_input($this->identifier) . "') and date_added >= date_sub(now(), interval " . (int) $this->minutes . " minute) and success = 1 order by date_added desc limit 1");
if (tep_db_num_rows($check_query)) {
return false;
} else {
return true;
}
}
示例13: splitPageResults_rspv
function splitPageResults_rspv($query, $max_rows, $count_key = '*', $page_holder = 'page')
{
$this->sql_query = strtolower($query);
// force the quesry to all lower case
$this->page_name = $page_holder;
if (isset($_GET[$page_holder])) {
$page = $_GET[$page_holder];
} elseif (isset($_POST[$page_holder])) {
$page = $_POST[$page_holder];
} else {
$page = '';
}
if (empty($page) || !is_numeric($page)) {
$page = 1;
}
$this->current_page_number = $page;
if ($max_rows <= 0) {
$max_rows = '1';
}
$this->number_of_rows_per_page = $max_rows;
// SQL statements that have a "having" clause must be processed
// as the full SQL statment. Otherwise, a shorten version may be used.
if (strpos($this->sql_query, ' having') === false) {
$pos_to = strlen($this->sql_query);
$pos_from = strpos($this->sql_query, ' from', 0);
$pos_group_by = strpos($this->sql_query, ' group by', $pos_from);
if ($pos_group_by < $pos_to && $pos_group_by != false) {
$pos_to = $pos_group_by;
}
$pos_order_by = strpos($this->sql_query, ' order by', $pos_from);
if ($pos_order_by < $pos_to && $pos_order_by != false) {
$pos_to = $pos_order_by;
}
if (strpos($this->sql_query, 'distinct') || strpos($this->sql_query, 'group by')) {
$count_string = 'distinct ' . tep_db_input($count_key);
} else {
$count_string = tep_db_input($count_key);
}
$count_query = tep_db_query("select count(" . $count_string . ") as total " . substr($this->sql_query, $pos_from, $pos_to - $pos_from));
$count = tep_db_fetch_array($count_query);
$this->number_of_rows = $count['total'];
} else {
$count_query = tep_db_query($this->sql_query);
$this->number_of_rows = tep_db_num_rows($count_query);
}
$this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);
if ($this->current_page_number > $this->number_of_pages) {
$this->current_page_number = $this->number_of_pages;
}
$offset = $this->number_of_rows_per_page * ($this->current_page_number - 1);
//newer version of mysql can not handle neg number in limit, temp fix
if ($offset < '0') {
$offset = '1';
}
$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;
}
示例14: tep_get_author_info
function tep_get_author_info($author_id, $language_id = '', $field = 'authors_name')
{
global $languages_id;
if (empty($language_id)) {
$language_id = $languages_id;
}
$author_query = tep_db_query("select " . tep_db_input($field) . " as value from " . TABLE_AUTHORS . " where authors_id = '" . (int) $author_id . "' and language_id = '" . (int) $language_id . "'");
$author = tep_db_fetch_array($author_query);
return $author['value'];
}
示例15: check
function check()
{
global $customer_id;
$check_query = tep_db_query("select date_added from " . TABLE_ACTION_RECORDER . " where module = 'ar_contact_us' and (" . (tep_session_is_registered('customer_id') ? "customer_id = '" . (int) $customer_id . "' or " : "") . " identifier = '" . tep_db_input($this->_identifier) . "') and date_added >= date_sub(now(), interval " . (int) $this->_min_minutes . " minute) and success = 1 order by date_added desc limit 1");
if (tep_db_num_rows($check_query)) {
return false;
} else {
return true;
}
}