本文整理汇总了PHP中zen_db_prepare_input函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_db_prepare_input函数的具体用法?PHP zen_db_prepare_input怎么用?PHP zen_db_prepare_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_db_prepare_input函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: authentication
public function authentication()
{
if (!isset($_POST['admin_name']) || empty($_POST['admin_name']) || !isset($_POST['admin_pass']) || empty($_POST['admin_pass'])) {
$this->authenticed = false;
$this->addError('"name" and "password" invalid.');
} else {
$admin_name = zen_db_prepare_input($_POST['admin_name']);
$admin_pass = zen_db_prepare_input($_POST['admin_pass']);
$sql = "select admin_id, admin_name, admin_pass from " . TABLE_ADMIN . " where admin_name = '" . zen_db_input($admin_name) . "'";
$result = $this->db->Execute($sql);
if (isset($result->fields) && $admin_name == $result->fields['admin_name'] && zen_validate_password($admin_pass, $result->fields['admin_pass'])) {
$this->authenticed = true;
} else {
if (!isset($result->fields) || !($admin_name == $result->fields['admin_name'])) {
$this->authenticed = false;
$this->addError('"name" invalid.');
}
if (!isset($result->fields) || !zen_validate_password($admin_pass, $result->fields['admin_pass'])) {
$this->authenticed = false;
$this->addError('"password" invalid.');
}
}
}
return $this->authenticed;
}
开发者ID:wwxgitcat,项目名称:zencart_v1.0,代码行数:25,代码来源:super_api.php
示例2: zen_update_whos_online
/**
* @package ZenCart_Functions
*/
function zen_update_whos_online()
{
global $gBitDb;
if (!empty($_SESSION['customer_id'])) {
$wo_customer_id = $_SESSION['customer_id'];
$customer_query = "select `customers_firstname`, `customers_lastname`\n from " . TABLE_CUSTOMERS . "\n where `customers_id` = '" . (int) $_SESSION['customer_id'] . "'";
$customer = $gBitDb->Execute($customer_query);
$wo_full_name = $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname'];
} else {
$wo_customer_id = '';
$wo_full_name = 'Guest';
}
$wo_session_id = zen_session_id();
$wo_ip_address = $_SERVER['REMOTE_ADDR'];
$wo_last_page_url = $_SERVER['REQUEST_URI'];
$wo_user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']) : '-';
$current_time = time();
$xx_mins_ago = $current_time - 900;
// remove entries that have expired
$sql = "delete from " . TABLE_WHOS_ONLINE . "\n where `time_last_click` < '" . $xx_mins_ago . "'";
$gBitDb->Execute($sql);
$stored_customer_query = 'select count(*) as "count"
from ' . TABLE_WHOS_ONLINE . "\n where `session_id` = '" . zen_db_input($wo_session_id) . "'";
$stored_customer = $gBitDb->Execute($stored_customer_query);
if (empty($wo_customer_id)) {
$wo_customer_id = NULL;
}
if ($stored_customer->fields['count'] > 0) {
$sql = "update " . TABLE_WHOS_ONLINE . "\n set `customer_id` = ?, `full_name` = ?, `ip_address` = ?, `time_last_click` = ?, `last_page_url` = ?, `host_address` = ?, `user_agent` = ?\n where `session_id` = ?";
$gBitDb->query($sql, array($wo_customer_id, $wo_full_name, $wo_ip_address, $current_time, substr($wo_last_page_url, 0, 255), $_SESSION['customers_host_address'], substr($wo_user_agent, 0, 255), $wo_session_id));
} else {
$sql = "insert into " . TABLE_WHOS_ONLINE . "\n (`customer_id`, `full_name`, `session_id`, `ip_address`, `time_entry`,\n `time_last_click`, `last_page_url`, `host_address`, `user_agent`)\n values ( ?, ?, ?, ?, ?, ?, ?, ?, ? )";
$gBitDb->query($sql, array($wo_customer_id, $wo_full_name, $wo_session_id, $wo_ip_address, $current_time, $current_time, $wo_last_page_url, $_SESSION['customers_host_address'], $wo_user_agent));
}
}
开发者ID:bitweaver,项目名称:commerce,代码行数:38,代码来源:whos_online.php
示例3: storeManufacturer
function storeManufacturer(&$pParamHash)
{
$sql_data_array = array('manufacturers_name' => zen_db_prepare_input($pParamHash['manufacturers_name']));
$sql_data_array['manufacturers_image'] = !empty($pParamHash['manufacturers_image']) ? $pParamHash['manufacturers_image'] : NULL;
if (!empty($pParamHash['manufacturers_id']) && $this->manufacturerExists($pParamHash['manufacturers_id'])) {
$sql_data_array['last_modified'] = $gBitDb->NOW();
$manufacturers_id = zen_db_prepare_input($pParamHash['manufacturers_id']);
$gBitDb->associateInsert(TABLE_MANUFACTURERS, $sql_data_array, 'update', "manufacturers_id = '" . (int) $manufacturers_id . "'");
} else {
if (!empty($pParamHash['manufacturers_id'])) {
$sql_data_array['manufacturers_id'] = $pParamHash['manufacturers_id'];
}
$sql_data_array['date_added'] = $gBitDb->NOW();
$gBitDb->associateInsert(TABLE_MANUFACTURERS, $sql_data_array);
if (!empty($pParamHash['manufacturers_id'])) {
$sql_data_array['manufacturers_id'] = $pParamHash['manufacturers_id'];
}
}
$languages = zen_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
$manufacturers_url_array = $pParamHash['manufacturers_url'];
$language_id = $languages[$i]['id'];
$sql_data_array = array('manufacturers_url' => zen_db_prepare_input($manufacturers_url_array[$language_id]));
if ($action == 'insert') {
$insert_sql_data = array('manufacturers_id' => $manufacturers_id, 'languages_id' => $language_id);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
$gBitDb->associateInsert(TABLE_MANUFACTURERS_INFO, $sql_data_array);
} elseif ($action == 'save') {
$gBitDb->associateInsert(TABLE_MANUFACTURERS_INFO, $sql_data_array, 'update', "manufacturers_id = '" . (int) $manufacturers_id . "' and languages_id = '" . (int) $language_id . "'");
}
}
}
开发者ID:bitweaver,项目名称:commerce,代码行数:32,代码来源:Bitcart.php
示例4: notifierUpdate
function notifierUpdate($notifier)
{
global $db;
global $order;
switch ($notifier) {
case 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING':
if (zen_not_null($_POST['calendar_hope_delivery_day'])) {
$_SESSION['calendar_hope_delivery_day'] = zen_db_prepare_input($_POST['calendar_hope_delivery_day']);
}
if (zen_not_null($_POST['calendar_hope_delivery_time'])) {
$_SESSION['calendar_hope_delivery_time'] = zen_db_prepare_input($_POST['calendar_hope_delivery_time']);
}
break;
case 'NOTIFY_CHECKOUT_PROCESS_AFTER_PAYMENT_MODULES_BEFOREPROCESS':
//
// 希望配送日時をコメントへ付加する
$order->info['comments'] = MODULE_CALENDAR_HOPE_DELIVERY_DAY_HEADER . ":" . $_SESSION['calendar_hope_delivery_day'] . "\n" . MODULE_CALENDAR_HOPE_DELIVERY_TIME_HEADER . ":" . $_SESSION['calendar_hope_delivery_time'] . "\n" . $order->info['comments'];
break;
case 'NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL':
$_SESSION['calendar_hope_delivery_day'] = '';
$_SESSION['calendar_hope_delivery_time'] = '';
unset($_SESSION['calendar_hope_delivery_day']);
unset($_SESSION['calendar_hope_delivery_time']);
break;
}
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:26,代码来源:module.php
示例5: zen_update_whos_online
/**
* @package ZenCart_Functions
*/
function zen_update_whos_online()
{
global $db;
if ($_SESSION['customer_id']) {
$wo_customer_id = $_SESSION['customer_id'];
$customer_query = "select customers_firstname, customers_lastname\r\n from " . TABLE_CUSTOMERS . "\r\n where customers_id = '" . (int) $_SESSION['customer_id'] . "'";
$customer = $db->Execute($customer_query);
$wo_full_name = $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname'];
} else {
$wo_customer_id = '';
$wo_full_name = 'Guest';
}
$wo_session_id = zen_session_id();
$wo_ip_address = $_SERVER['REMOTE_ADDR'];
$wo_last_page_url = $_SERVER['REQUEST_URI'];
$wo_user_agent = zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']);
$current_time = time();
$xx_mins_ago = $current_time - 900;
// remove entries that have expired
$sql = "delete from " . TABLE_WHOS_ONLINE . "\r\n where time_last_click < '" . $xx_mins_ago . "'";
$db->Execute($sql);
$stored_customer_query = "select count(*) as count\r\n from " . TABLE_WHOS_ONLINE . "\r\n where session_id = '" . zen_db_input($wo_session_id) . "'";
$stored_customer = $db->Execute($stored_customer_query);
if ($stored_customer->fields['count'] > 0) {
$sql = "update " . TABLE_WHOS_ONLINE . "\r\n set customer_id = '" . (int) $wo_customer_id . "',\r\n full_name = '" . zen_db_input($wo_full_name) . "',\r\n ip_address = '" . zen_db_input($wo_ip_address) . "',\r\n time_last_click = '" . zen_db_input($current_time) . "',\r\n last_page_url = '" . zen_db_input($wo_last_page_url) . "',\r\n host_address = '" . zen_db_input($_SESSION['customers_host_address']) . "',\r\n user_agent = '" . zen_db_input($wo_user_agent) . "'\r\n where session_id = '" . zen_db_input($wo_session_id) . "'";
$db->Execute($sql);
} else {
$sql = "insert into " . TABLE_WHOS_ONLINE . "\r\n (customer_id, full_name, session_id, ip_address, time_entry,\r\n time_last_click, last_page_url, host_address, user_agent)\r\n values ('" . (int) $wo_customer_id . "', '" . zen_db_input($wo_full_name) . "', '" . zen_db_input($wo_session_id) . "', '" . zen_db_input($wo_ip_address) . "', '" . zen_db_input($current_time) . "', '" . zen_db_input($current_time) . "', '" . zen_db_input($wo_last_page_url) . "', '" . zen_db_input($_SESSION['customers_host_address']) . "', '" . zen_db_input($wo_user_agent) . "')";
$db->Execute($sql);
}
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:34,代码来源:whos_online.php
示例6: send
function send($newsletter_id)
{
global $db;
$audience_select = get_audience_sql_query($this->query_name, 'newsletters');
$audience = $db->Execute($audience_select['query_string']);
$records = $audience->RecordCount();
if ($records == 0) {
return 0;
}
$i = 0;
while (!$audience->EOF) {
$i++;
$html_msg['EMAIL_FIRST_NAME'] = $audience->fields['customers_firstname'];
$html_msg['EMAIL_LAST_NAME'] = $audience->fields['customers_lastname'];
$html_msg['EMAIL_GREET'] = EMAIL_GREET;
$html_msg['EMAIL_MESSAGE_HTML'] = $this->content_html;
zen_mail($audience->fields['customers_firstname'] . ' ' . $audience->fields['customers_lastname'], $audience->fields['customers_email_address'], $this->title, $this->content, STORE_NAME, EMAIL_FROM, $html_msg, 'newsletters');
echo zen_image(DIR_WS_ICONS . 'tick.gif', $audience->fields['customers_email_address']);
//force output to the screen to show status indicator each time a message is sent...
if (function_exists('ob_flush')) {
@ob_flush();
}
@flush();
$audience->MoveNext();
}
$newsletter_id = zen_db_prepare_input($newsletter_id);
$db->Execute("update " . TABLE_NEWSLETTERS . "\r\n set date_sent = now(), status = '1'\r\n where newsletters_id = '" . zen_db_input($newsletter_id) . "'");
return $records;
//return number of records processed whether successful or not
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:30,代码来源:newsletter.php
示例7: objectInfo
function objectInfo($object_array)
{
//this line should be added, but should be tested first:
// if (!is_array($object_array)) return;
reset($object_array);
while (list($key, $value) = each($object_array)) {
$this->{$key} = zen_db_prepare_input($value);
}
}
开发者ID:dalinhuang,项目名称:yijinhuanxiang,代码行数:9,代码来源:object_info.php
示例8: googlebase
function googlebase()
{
global $db;
$result = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key='GOOGLEBASE_BULK_OPTIONS'");
if (!$result->EOF) {
$this->_options = unserialize(zen_db_prepare_input($result->fields['configuration_value']));
} else {
$this->_options = array();
}
}
开发者ID:pnomolos,项目名称:Zen-Cart-Google-Base-Module,代码行数:10,代码来源:googlebase.php
示例9: updateObjectInfo
/**
* @param $object_array
*/
function updateObjectInfo($object_array)
{
if (!is_array($object_array)) {
return;
}
reset($object_array);
while (list($key, $value) = each($object_array)) {
$this->{$key} = zen_db_prepare_input($value);
}
}
开发者ID:lat9,项目名称:zc155_backward_compatibility,代码行数:13,代码来源:object_info.php
示例10: zen_visitors_update_visitors_data
function zen_visitors_update_visitors_data($customers_id, $customers_email_address)
{
global $db;
$customers_id = zen_db_prepare_input($customers_id);
$customers_email_address = zen_db_prepare_input($customers_email_address);
$check_email = $db->Execute("select customers_email_address\r\n from " . TABLE_CUSTOMERS . "\r\n where customers_email_address = '" . zen_db_input($customers_email_address) . "'\r\n and customers_id != '" . (int) $customers_id . "'");
if (!$check_email->RecordCount()) {
$sql_data_array = array('visitors_email_address' => $customers_email_address, 'visitors_info_date_account_last_modified' => 'now()');
zen_db_perform(TABLE_VISITORS, $sql_data_array, 'update', "visitors_id = '" . (int) $customers_id . "'");
}
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:11,代码来源:functions.php
示例11: update_status
function update_status($oID, $new_status, $notified = 0, $comments = '')
{
global $db;
if ($notified == -1) {
$cust_notified = -1;
} elseif ($notified == 1) {
$cust_notified = 1;
} else {
$cust_notified = 0;
}
$db->Execute("INSERT INTO " . TABLE_ORDERS_STATUS_HISTORY . "\n (orders_id, orders_status_id, date_added, customer_notified, comments)\n VALUES ('" . (int) $oID . "',\n '" . $new_status . "',\n now(),\n '" . $cust_notified . "',\n '" . zen_db_prepare_input($comments) . "')");
$db->Execute("UPDATE " . TABLE_ORDERS . " SET\n orders_status = '" . $new_status . "', last_modified = now()\n WHERE orders_id = '" . (int) $oID . "'");
}
开发者ID:retched,项目名称:zen_SuperOrders,代码行数:13,代码来源:super_orders_functions.php
示例12: zen_db_prepare_input
function zen_db_prepare_input($string)
{
if (is_string($string)) {
return trim(stripslashes($string));
} elseif (is_array($string)) {
reset($string);
while (list($key, $value) = each($string)) {
$string[$key] = zen_db_prepare_input($value);
}
return $string;
} else {
return $string;
}
}
开发者ID:dalinhuang,项目名称:kakayaga,代码行数:14,代码来源:database.php
示例13: recordFirstStep
public function recordFirstStep($orderId, $paramsSAR, $responseSAR)
{
global $db;
$datetime = new DateTime('NOW');
if ($this->_getStep($orderId) == self::FIRST_STEP) {
$requestKey = $responseSAR['RequestKey'];
$publicRequestKey = $responseSAR['PublicRequestKey'];
$query = "UPDATE todopago_transaccion SET first_step = '" . $datetime->format('Y-m-d H:i:s') . "', params_SAR = '" . zen_db_input(zen_db_prepare_input(json_encode($paramsSAR))) . "', response_SAR = '" . zen_db_input(zen_db_prepare_input(json_encode($responseSAR))) . "', request_key = '" . zen_db_input(zen_db_prepare_input($requestKey)) . "', public_request_key = '" . zen_db_input(zen_db_prepare_input($publicRequestKey)) . "' WHERE id_orden = " . $orderId;
$db->Execute($query);
return $query;
} else {
return 0;
}
}
开发者ID:TodoPago,项目名称:Plugin-ZenCart,代码行数:14,代码来源:TodopagoTransaccion.php
示例14: zen_update_whos_online
/**
* zen_update_whos_online
*/
function zen_update_whos_online()
{
global $db;
if (isset($_SESSION['customer_id']) && $_SESSION['customer_id']) {
$wo_customer_id = $_SESSION['customer_id'];
$customer_query = "select customers_firstname, customers_lastname\n from " . TABLE_CUSTOMERS . "\n where customers_id = '" . (int) $_SESSION['customer_id'] . "'";
$customer = $db->Execute($customer_query);
$wo_full_name = $customer->fields['customers_lastname'] . ', ' . $customer->fields['customers_firstname'];
} else {
$wo_customer_id = '';
$wo_full_name = '¥' . 'Guest';
}
$wo_session_id = zen_session_id();
$wo_ip_address = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'Unknown';
$wo_user_agent = substr(zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']), 0, 254);
$_SERVER['QUERY_STRING'] = isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '' ? $_SERVER['QUERY_STRING'] : zen_get_all_get_params();
if (isset($_SERVER['REQUEST_URI'])) {
$uri = $_SERVER['REQUEST_URI'];
} else {
if (isset($_SERVER['QUERY_STRING'])) {
$uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
} else {
$uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['argv'][0];
}
}
if (substr($uri, -1) == '?') {
$uri = substr($uri, 0, strlen($uri) - 1);
}
$wo_last_page_url = zen_not_null($uri) ? substr($uri, 0, 254) : 'Unknown';
$current_time = time();
$xx_mins_ago = $current_time - 900;
// remove entries that have expired
$sql = "delete from " . TABLE_WHOS_ONLINE . "\n where time_last_click < '" . $xx_mins_ago . "'";
$db->Execute($sql);
$stored_customer_query = "select count(*) as count\n from " . TABLE_WHOS_ONLINE . "\n where session_id = '" . zen_db_input($wo_session_id) . "' and ip_address='" . zen_db_input($wo_ip_address) . "'";
$stored_customer = $db->Execute($stored_customer_query);
if (empty($wo_session_id)) {
$wo_full_name = '¥' . 'Spider';
}
if ($stored_customer->fields['count'] > 0) {
$sql = "update " . TABLE_WHOS_ONLINE . "\n set customer_id = '" . (int) $wo_customer_id . "',\n full_name = '" . zen_db_input($wo_full_name) . "',\n ip_address = '" . zen_db_input($wo_ip_address) . "',\n time_last_click = '" . zen_db_input($current_time) . "',\n last_page_url = '" . zen_db_input($wo_last_page_url) . "',\n host_address = '" . zen_db_input($_SESSION['customers_host_address']) . "',\n user_agent = '" . zen_db_input($wo_user_agent) . "'\n where session_id = '" . zen_db_input($wo_session_id) . "' and ip_address='" . zen_db_input($wo_ip_address) . "'";
$db->Execute($sql);
} else {
$sql = "insert into " . TABLE_WHOS_ONLINE . "\n (customer_id, full_name, session_id, ip_address, time_entry,\n time_last_click, last_page_url, host_address, user_agent)\n values ('" . (int) $wo_customer_id . "', '" . zen_db_input($wo_full_name) . "', '" . zen_db_input($wo_session_id) . "', '" . zen_db_input($wo_ip_address) . "', '" . zen_db_input($current_time) . "', '" . zen_db_input($current_time) . "', '" . zen_db_input($wo_last_page_url) . "', '" . zen_db_input($_SESSION['customers_host_address']) . "', '" . zen_db_input($wo_user_agent) . "')";
$db->Execute($sql);
}
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:50,代码来源:whos_online.php
示例15: zen_get_not_setuped_layout_pages
function zen_get_not_setuped_layout_pages($template_dir)
{
global $db;
$setuped_pages_id = array();
$setuped_pages = $db->Execute("SELECT layout_page FROM " . TABLE_LAYOUT_BOXES . " WHERE layout_template = '" . zen_db_prepare_input($template_dir) . "' GROUP BY layout_page");
while (!$setuped_pages->EOF) {
$setuped_pages_id[] = $setuped_pages->fields['layout_page'];
$setuped_pages->MoveNext();
}
$not_setuped_pages = array();
$all_pages = zen_get_all_layout_pages();
foreach ($all_pages as $page) {
if (!in_array($page['id'], $setuped_pages_id)) {
$not_setuped_pages[] = $page;
}
}
return $not_setuped_pages;
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:18,代码来源:layout_controller.php
示例16: execute_sql_file
function execute_sql_file($upload_query)
{
global $messageStack;
$query_string = $upload_query;
if (@get_magic_quotes_runtime() > 0) {
$query_string = zen_db_prepare_input($upload_query);
}
$success = false;
if ($query_string != '') {
$query_results = $this->executeSql($query_string, DB_DATABASE, DB_PREFIX);
if ($query_results['queries'] > 0 && $query_results['queries'] != $query_results['ignored']) {
$messageStack->add($query_results['queries'] . ' statements processed.', 'success');
$success = true;
} else {
$messageStack->add('Failed: ' . $query_results['queries'], 'error');
}
if (zen_not_null($query_results['errors'])) {
foreach ($query_results['errors'] as $value) {
$messageStack->add('ERROR: ' . $value, 'error');
}
}
if ($query_results['ignored'] != 0) {
$messageStack->add('Note: ' . $query_results['ignored'] . ' statements ignored. See "upgrade_exceptions" table for additional details.', 'caution');
}
if (zen_not_null($query_results['output'])) {
foreach ($query_results['output'] as $value) {
if (zen_not_null($value)) {
$messageStack->add('ERROR: ' . $value, 'error');
}
}
}
} else {
$messageStack->add(ERROR_NOTHING_TO_DO, 'error');
}
return $success;
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:36,代码来源:sqlpatch_class.php
示例17: strtoupper
$duplicate_option .= ' <b>' . strtoupper(zen_get_language_name($languages[$i]['id'])) . '</b> : ' . $option_name;
}
}
if (!empty($duplicate_option)) {
$messageStack->add_session(ATTRIBUTE_POSSIBLE_OPTIONS_NAME_WARNING_DUPLICATE . ' ' . $option_id . ' - ' . $duplicate_option, 'caution');
}
zen_redirect(zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, $_SESSION['page_info'] . '&option_order_by=' . $option_order_by));
break;
case 'delete_option':
// demo active test
if (zen_admin_demo()) {
$_GET['action'] = '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, $_SESSION['page_info'] . '&option_order_by=' . $option_order_by));
}
$option_id = zen_db_prepare_input($_GET['option_id']);
$remove_option_values = $db->Execute("select products_options_id, products_options_values_id from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id='" . (int) $option_id . "'");
while (!$remove_option_values->EOF) {
$db->Execute("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id='" . $remove_option_values->fields['products_options_values_id'] . "' and products_options_values_id !=0");
$remove_option_values->MoveNext();
}
$db->Execute("delete from " . TABLE_PRODUCTS_OPTIONS . "\n where products_options_id = '" . (int) $option_id . "'");
$db->Execute("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int) $option_id . "'");
zen_redirect(zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, $_SESSION['page_info'] . '&option_order_by=' . $option_order_by));
break;
/////////////////////////////////////
// additional features
/////////////////////////////////////
// additional features
case 'update_options_values':
// get products to update with at least one option_value for selected options_name
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:31,代码来源:options_name_manager.php
示例18: send
function send($newsletter_id)
{
global $_POST, $db;
$audience = array();
if (isset($_POST['global']) && $_POST['global'] == 'true') {
$products = $db->Execute("select distinct pn.customers_id, c.customers_firstname,\r\n c.customers_lastname, c.customers_email_address\r\n from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn\r\n where c.customers_id = pn.customers_id");
while (!$products->EOF) {
$audience[$products->fields['customers_id']] = array('firstname' => $products->fields['customers_firstname'], 'lastname' => $products->fields['customers_lastname'], 'email_address' => $products->fields['customers_email_address']);
$products->MoveNext();
}
$customers = $db->Execute("select c.customers_id, c.customers_firstname, c.customers_lastname,\r\n c.customers_email_address\r\n from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci\r\n where c.customers_id = ci.customers_info_id\r\n and ci.global_product_notifications = '1'");
while (!$customers->EOF) {
$audience[$customers->fields['customers_id']] = array('firstname' => $customers->fields['customers_firstname'], 'lastname' => $customers->fields['customers_lastname'], 'email_address' => $customers['customers_email_address']);
$customers->MoveNext();
}
} else {
//not global==true; instead, process all selected products
$chosen = $_POST['chosen'];
$ids = implode(',', $chosen);
$products = $db->Execute("select distinct pn.customers_id, c.customers_firstname,\r\n c.customers_lastname, c.customers_email_address\r\n from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn\r\n where c.customers_id = pn.customers_id\r\n and pn.products_id in (" . $ids . ")");
while (!$products->EOF) {
$audience[$products->fields['customers_id']] = array('firstname' => $products->fields['customers_firstname'], 'lastname' => $products->fields['customers_lastname'], 'email_address' => $products->fields['customers_email_address']);
$products->MoveNext();
}
$customers = $db->Execute("select c.customers_id, c.customers_firstname, c.customers_lastname,\r\n c.customers_email_address\r\n from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci\r\n where c.customers_id = ci.customers_info_id\r\n and ci.global_product_notifications = '1'");
while (!$customers->EOF) {
$audience[$customers->fields['customers_id']] = array('firstname' => $customers->fields['customers_firstname'], 'lastname' => $customers->fields['customers_lastname'], 'email_address' => $customers->fields['customers_email_address']);
$customers->MoveNext();
}
}
//send emails
reset($audience);
$i = 0;
while (list($key, $value) = each($audience)) {
$i++;
$html_msg['EMAIL_FIRST_NAME'] = $value['firstname'];
$html_msg['EMAIL_LAST_NAME'] = $value['lastname'];
$html_msg['EMAIL_GREET'] = EMAIL_GREET;
$html_msg['EMAIL_MESSAGE_HTML'] = $this->content_html;
zen_mail($value['firstname'] . ' ' . $value['lastname'], $value['email_address'], $this->title, $this->content, STORE_NAME, EMAIL_FROM, $html_msg, 'product_notification', '');
echo zen_image(DIR_WS_ICONS . 'tick.gif', $value['email_address']);
//force output to the screen to show status indicator each time a message is sent...
if (function_exists('ob_flush')) {
@ob_flush();
}
@flush();
}
$newsletter_id = zen_db_prepare_input($newsletter_id);
$db->Execute("update " . TABLE_NEWSLETTERS . "\r\n set date_sent = now(), status = '1'\r\n where newsletters_id = '" . zen_db_input($newsletter_id) . "'");
return $i;
//return number of records processed whether successful or not
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:52,代码来源:product_notification.php
示例19: zen_db_prepare_input
$lastname = zen_db_prepare_input($_POST['lastname']);
// ->furikana
if (FURIKANA_NESESSARY) {
$firstname_kana = zen_db_prepare_input($_POST['firstname_kana']);
$lastname_kana = zen_db_prepare_input($_POST['lastname_kana']);
}
// <-furikana
if (ACCOUNT_DOB == 'true') {
$dob = empty($_POST['dob']) ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_db_prepare_input($_POST['dob']);
}
$email_address = zen_db_prepare_input($_POST['email_address']);
$telephone = zen_db_prepare_input($_POST['telephone']);
$fax = zen_db_prepare_input($_POST['fax']);
$email_format = zen_db_prepare_input($_POST['email_format']);
if (CUSTOMERS_REFERRAL_STATUS == '2' and $_POST['customers_referral'] != '') {
$customers_referral = zen_db_prepare_input($_POST['customers_referral']);
}
$error = false;
if (ACCOUNT_GENDER == 'true') {
if ($gender != 'm' && $gender != 'f') {
$error = true;
$messageStack->add('account_edit', ENTRY_GENDER_ERROR);
}
}
if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
$error = true;
$messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR);
}
if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
$error = true;
$messageStack->add('account_edit', ENTRY_LAST_NAME_ERROR);
开发者ID:ygeneration666,项目名称:ec,代码行数:31,代码来源:header_php.php
示例20: zen_mail_archive_write
function zen_mail_archive_write($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject, $email_html, $email_text, $module)
{
// this function stores sent emails into a table in the database as a log record of email activity. This table CAN get VERY big!
// To disable this function, set the "Email Archives" switch to 'false' in ADMIN!
global $db;
$to_name = zen_db_prepare_input($to_name);
$to_email_address = zen_db_prepare_input($to_email_address);
$from_email_name = zen_db_prepare_input($from_email_name);
$from_email_address = zen_db_prepare_input($from_email_address);
$email_subject = zen_db_prepare_input($email_subject);
$email_html = EMAIL_USE_HTML == 'true' ? zen_db_prepare_input($email_html) : zen_db_prepare_input('HTML disabled in admin');
$email_text = zen_db_prepare_input($email_text);
$module = zen_db_prepare_input($module);
$db->Execute("insert into " . TABLE_EMAIL_ARCHIVE . "\r\n (email_to_name, email_to_address, email_from_name, email_from_address, email_subject, email_html, email_text, date_sent, module)\r\n values ('" . zen_db_input($to_name) . "',\r\n '" . zen_db_input($to_email_address) . "',\r\n '" . zen_db_input($from_email_name) . "',\r\n '" . zen_db_input($from_email_address) . "',\r\n '" . zen_db_input($email_subject) . "',\r\n '" . zen_db_input($email_html) . "',\r\n '" . zen_db_input($email_text) . "',\r\n now() ,\r\n '" . zen_db_input($module) . "')");
return $db;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:16,代码来源:functions_email.php
注:本文中的zen_db_prepare_input函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论