本文整理汇总了PHP中smn_db_input函数的典型用法代码示例。如果您正苦于以下问题:PHP smn_db_input函数的具体用法?PHP smn_db_input怎么用?PHP smn_db_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smn_db_input函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smn_update_whos_online
function smn_update_whos_online()
{
global $customer_id;
if (smn_session_is_registered('customer_id')) {
$wo_customer_id = $customer_id;
$customer_query = smn_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
$customer = smn_db_fetch_array($customer_query);
$wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
} else {
$wwo_full_name = 'Guest';
}
$wo_session_id = smn_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
smn_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
$stored_customer_query = smn_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . smn_db_input($wo_session_id) . "'");
$stored_customer = smn_db_fetch_array($stored_customer_query);
if ($stored_customer['count'] > 0) {
smn_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int) $wo_customer_id . "', full_name = '" . smn_db_input($wo_full_name) . "', ip_address = '" . smn_db_input($wo_ip_address) . "', time_last_click = '" . smn_db_input($current_time) . "', last_page_url = '" . smn_db_input($wo_last_page_url) . "' where session_id = '" . smn_db_input($wo_session_id) . "'");
} else {
smn_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 . "', '" . smn_db_input($wo_full_name) . "', '" . smn_db_input($wo_session_id) . "', '" . smn_db_input($wo_ip_address) . "', '" . smn_db_input($current_time) . "', '" . smn_db_input($current_time) . "', '" . smn_db_input($wo_last_page_url) . "')");
}
}
示例2: smn_get_languages_directory
function smn_get_languages_directory($code)
{
global $languages_id;
$language_query = smn_db_query("select languages_id, directory from " . TABLE_LANGUAGES . " where code = '" . smn_db_input($code) . "'");
if (smn_db_num_rows($language_query)) {
$language = smn_db_fetch_array($language_query);
$languages_id = $language['languages_id'];
return $language['directory'];
} else {
return false;
}
}
示例3: send
function send($newsletter_id)
{
$mail_query = smn_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
$mimemessage = new email(array('X-Mailer: oscMall bulk mailer'));
$mimemessage->add_html($this->content);
$mimemessage->build_message();
while ($mail = smn_db_fetch_array($mail_query)) {
$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
}
$newsletter_id = smn_db_prepare_input($newsletter_id);
smn_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . smn_db_input($newsletter_id) . "'");
}
示例4: splitPageResults
function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page')
{
global $_GET, $_POST;
$this->sql_query = $query;
$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;
$this->number_of_rows_per_page = $max_rows;
$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_having = strpos($this->sql_query, ' having', $pos_from);
if ($pos_having < $pos_to && $pos_having != false) {
$pos_to = $pos_having;
}
$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 ' . smn_db_input($count_key);
} else {
$count_string = smn_db_input($count_key);
}
$count_query = smn_db_query("select count(" . $count_string . ") as total " . substr($this->sql_query, $pos_from, $pos_to - $pos_from));
$count = smn_db_fetch_array($count_query);
$this->number_of_rows = $count['total'];
$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 = max($this->number_of_rows_per_page * ($this->current_page_number - 1), 0);
// systemsmanager begin - Dec 1, 2005 security patch
// $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;
$this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;
// systemsmanager end
}
示例5: smn_db_query
$banner_query = smn_db_query("select banners_url from " . TABLE_BANNERS . " where banners_id = '" . (int) $_GET['goto'] . "'");
if (smn_db_num_rows($banner_query)) {
$banner = smn_db_fetch_array($banner_query);
smn_update_banner_click_count($_GET['goto']);
smn_redirect($banner['banners_url']);
}
break;
case 'url':
// systemsmanager begin - Dec 1, 2005 security patch
/*
if (isset($_GET['goto']) && smn_not_null($_GET['goto'])) {
smn_redirect('http://' . $_GET['goto']);
}
*/
if (isset($_GET['goto']) && smn_not_null($_GET['goto'])) {
$check_query = smn_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_url = '" . smn_db_input($_GET['goto']) . "' limit 1");
if (smn_db_num_rows($check_query)) {
smn_redirect('http://' . $_GET['goto']);
}
}
// systemsmanager end
break;
case 'manufacturer':
if (isset($_GET['manufacturers_id']) && smn_not_null($_GET['manufacturers_id'])) {
$manufacturer_query = smn_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int) $_GET['manufacturers_id'] . "' and languages_id = '" . (int) $languages_id . "'");
if (smn_db_num_rows($manufacturer_query)) {
// url exists in selected language
$manufacturer = smn_db_fetch_array($manufacturer_query);
if (smn_not_null($manufacturer['manufacturers_url'])) {
smn_db_query("update " . TABLE_MANUFACTURERS_INFO . " set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = '" . (int) $_GET['manufacturers_id'] . "' and languages_id = '" . (int) $languages_id . "'");
smn_redirect($manufacturer['manufacturers_url']);
示例6: smn_session_recreate
if (!smn_validate_password($password, $check_customer['customers_password'])) {
$error = true;
} else {
if (SESSION_RECREATE == 'True') {
smn_session_recreate();
}
$check_country_query = smn_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $check_customer['customers_id'] . "' and address_book_id = '" . (int) $check_customer['customers_default_address_id'] . "'");
$check_country = smn_db_fetch_array($check_country_query);
$check_customer_store_query = smn_db_query("select store_id from " . TABLE_ADMIN . " where customer_id = '" . smn_db_input($check_customer['customers_id']) . "'");
if (smn_db_num_rows($check_customer_store_query)) {
$check_customer_store = smn_db_fetch_array($check_customer_store_query);
$customer_store_id = $check_customer_store['store_id'];
smn_session_register('customer_store_id');
}
/*Code to register session for affiliate by Cimi*/
$check_sales_agent_query = smn_db_query("select a.affiliate_id from " . TABLE_CUSTOMERS . " c, " . TABLE_AFFILIATE . " a where c.customers_id = '" . smn_db_input($check_customer['customers_id']) . "' and a.affiliate_customer_id = c.customers_id");
if (smn_db_num_rows($check_sales_agent_query)) {
$check_sales_agent = smn_db_fetch_array($check_sales_agent_query);
$affiliate_id = $check_sales_agent['affiliate_id'];
smn_session_register('affiliate_id');
$affiliate_email = $check_customer['customers_email_address'];
$affiliate_name = $check_customer['customer_first_name'];
smn_session_register('affiliate_email');
smn_session_register('affiliate_name');
}
/*End of code*/
$customer_id = $check_customer['customers_id'];
$customer_default_address_id = $check_customer['customers_default_address_id'];
$customer_first_name = $check_customer['customers_firstname'];
$customer_country_id = $check_country['entry_country_id'];
$customer_zone_id = $check_country['entry_zone_id'];
示例7: switch
if (smn_not_null($action)) {
switch ($action) {
case 'insert':
$tax_zone_id = smn_db_prepare_input($_POST['tax_zone_id']);
$tax_class_id = smn_db_prepare_input($_POST['tax_class_id']);
$tax_rate = smn_db_prepare_input($_POST['tax_rate']);
$tax_description = smn_db_prepare_input($_POST['tax_description']);
$tax_priority = smn_db_prepare_input($_POST['tax_priority']);
smn_db_query("insert into " . TABLE_TAX_RATES . " (store_id, tax_zone_id, tax_class_id, tax_rate, tax_description, tax_priority, date_added) values ('" . (int) $store_id . "', '" . (int) $tax_zone_id . "', '" . (int) $tax_class_id . "', '" . smn_db_input($tax_rate) . "', '" . smn_db_input($tax_description) . "', '" . smn_db_input($tax_priority) . "', now())");
smn_redirect(smn_href_link(FILENAME_TAX_RATES));
break;
case 'save':
$tax_rates_id = smn_db_prepare_input($_GET['tID']);
$tax_zone_id = smn_db_prepare_input($_POST['tax_zone_id']);
$tax_class_id = smn_db_prepare_input($_POST['tax_class_id']);
$tax_rate = smn_db_prepare_input($_POST['tax_rate']);
$tax_description = smn_db_prepare_input($_POST['tax_description']);
$tax_priority = smn_db_prepare_input($_POST['tax_priority']);
smn_db_query("update " . TABLE_TAX_RATES . " set tax_rates_id = '" . (int) $tax_rates_id . "', tax_zone_id = '" . (int) $tax_zone_id . "', tax_class_id = '" . (int) $tax_class_id . "', tax_rate = '" . smn_db_input($tax_rate) . "', tax_description = '" . smn_db_input($tax_description) . "', tax_priority = '" . smn_db_input($tax_priority) . "', last_modified = now() where tax_rates_id = '" . (int) $tax_rates_id . "' and store_id = '" . $store_id . "'");
smn_redirect(smn_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $tax_rates_id));
break;
case 'deleteconfirm':
$tax_rates_id = smn_db_prepare_input($_GET['tID']);
smn_db_query("delete from " . TABLE_TAX_RATES . " where tax_rates_id = '" . (int) $tax_rates_id . "' and store_id = '" . $store_id . "'");
smn_redirect(smn_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page']));
break;
}
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';
示例8: isset
require 'includes/application_top.php';
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (smn_not_null($action)) {
switch ($action) {
case 'insert':
$countries_name = smn_db_prepare_input($_POST['countries_name']);
$countries_iso_code_2 = smn_db_prepare_input($_POST['countries_iso_code_2']);
$countries_iso_code_3 = smn_db_prepare_input($_POST['countries_iso_code_3']);
$address_format_id = smn_db_prepare_input($_POST['address_format_id']);
smn_db_query("insert into " . TABLE_COUNTRIES . " (countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) values ('" . smn_db_input($countries_name) . "', '" . smn_db_input($countries_iso_code_2) . "', '" . smn_db_input($countries_iso_code_3) . "', '" . (int) $address_format_id . "')");
smn_redirect(smn_href_link(FILENAME_COUNTRIES));
break;
case 'save':
$countries_id = smn_db_prepare_input($_GET['cID']);
$countries_name = smn_db_prepare_input($_POST['countries_name']);
$countries_iso_code_2 = smn_db_prepare_input($_POST['countries_iso_code_2']);
$countries_iso_code_3 = smn_db_prepare_input($_POST['countries_iso_code_3']);
$address_format_id = smn_db_prepare_input($_POST['address_format_id']);
smn_db_query("update " . TABLE_COUNTRIES . " set countries_name = '" . smn_db_input($countries_name) . "', countries_iso_code_2 = '" . smn_db_input($countries_iso_code_2) . "', countries_iso_code_3 = '" . smn_db_input($countries_iso_code_3) . "', address_format_id = '" . (int) $address_format_id . "' where countries_id = '" . (int) $countries_id . "'");
smn_redirect(smn_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $countries_id));
break;
case 'deleteconfirm':
$countries_id = smn_db_prepare_input($_GET['cID']);
smn_db_query("delete from " . TABLE_COUNTRIES . " where countries_id = '" . (int) $countries_id . "'");
smn_redirect(smn_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page']));
break;
}
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';
示例9: smn_redirect
This source file is subject to version 2.0 of the GPL license,
that is bundled with this package in the file LICENSE. If you
did not receive a copy of the oscMall System license and are unable
to obtain it through the world-wide-web, please send a note to
license@systemsmanager.net so we can mail you a copy immediately.
*/
require 'includes/application_top.php';
if (isset($_GET['ID'])) {
$GLOBALS['store_id'] = '';
smn_redirect(smn_href_link(FILENAME_LOGIN, '', 'NONSSL'));
}
if (isset($_GET['action']) && $_GET['action'] == 'process') {
$email_address = smn_db_prepare_input($_POST['email_address']);
$password = smn_db_prepare_input($_POST['password']);
// Check if email exists
$check_admin_query = smn_db_query("select store_id, admin_id as login_id, admin_groups_id as login_groups_id, admin_firstname as login_firstname, admin_email_address as login_email_address, admin_password as login_password, admin_modified as login_modified, admin_logdate as login_logdate, admin_lognum as login_lognum from " . TABLE_ADMIN . " where admin_email_address = '" . smn_db_input($email_address) . "'");
if (!smn_db_num_rows($check_admin_query)) {
$login = 'fail';
} else {
$check_admin = smn_db_fetch_array($check_admin_query);
// Check that password is good
if (!smn_validate_password($password, $check_admin['login_password'])) {
$login = 'fail';
} else {
if (smn_session_is_registered('password_forgotten')) {
smn_session_unregister('password_forgotten');
}
$login_id = $check_admin['login_id'];
$store_id = $check_admin['store_id'];
$login_groups_id = $check_admin['login_groups_id'];
$login_firstname = $check_admin['login_firstname'];
示例10: array
if (ACCOUNT_DOB == 'true') $sql_data_array['affiliate_dob'] = smn_date_raw($affiliate_dob);
if (ACCOUNT_GENDER == 'true') $sql_data_array['affiliate_gender'] = $affiliate_gender;
if (ACCOUNT_COMPANY == 'true') {
$sql_data_array['affiliate_company'] = $affiliate_company;
$sql_data_array['affiliate_company_taxid'] = $affiliate_company_taxid;
}
if (ACCOUNT_SUBURB == 'true') $sql_data_array['affiliate_suburb'] = $affiliate_suburb;
if (ACCOUNT_STATE == 'true') {
$sql_data_array['affiliate_state'] = $affiliate_state;
$sql_data_array['affiliate_zone_id'] = $affiliate_zone_id;
}
$sql_data_array['affiliate_date_account_last_modified'] = 'now()';*/
$sql_data_array = array('affiliate_payment_check' => $affiliate_payment_check, 'affiliate_payment_paypal' => $affiliate_payment_paypal, 'affiliate_payment_bank_name' => $affiliate_payment_bank_name, 'affiliate_payment_bank_branch_number' => $affiliate_payment_bank_branch_number, 'affiliate_payment_bank_swift_code' => $affiliate_payment_bank_swift_code, 'affiliate_payment_bank_account_name' => $affiliate_payment_bank_account_name, 'affiliate_payment_bank_account_number' => $affiliate_payment_bank_account_number, 'affiliate_homepage' => $affiliate_homepage, 'affiliate_commission_percent' => $affiliate_commission_percent, 'affiliate_agb' => '1');
if (ACCOUNT_COMPANY == 'true') {
$sql_data_array['affiliate_company_taxid'] = $affiliate_company_taxid;
}
smn_db_perform(TABLE_AFFILIATE, $sql_data_array, 'update', "affiliate_id = '" . smn_db_input($affiliate_id) . "'");
smn_redirect(smn_href_link(FILENAME_AFFILIATE, smn_get_all_get_params(array('acID', 'action')) . 'acID=' . $affiliate_id));
break;
case 'deleteconfirm':
$affiliate_id = smn_db_prepare_input($_GET['acID']);
affiliate_delete(smn_db_input($affiliate_id));
smn_redirect(smn_href_link(FILENAME_AFFILIATE, smn_get_all_get_params(array('acID', 'action'))));
break;
}
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';
示例11: smn_db_input
</td>
<td class="dataTableHeadingContent" align="center"><?php
echo COUPON_STATUS;
?>
</td>
<td class="dataTableHeadingContent" align="right"><?php
echo TABLE_HEADING_ACTION;
?>
</td>
</tr>
<?php
if ($_GET['page'] > 1) {
$rows = $_GET['page'] * 20 - 20;
}
if ($status != '*') {
$cc_query_raw = "select * from " . TABLE_COUPONS . " where coupon_active='" . smn_db_input($status) . "' and coupon_type != 'G'";
} else {
$cc_query_raw = "select * from " . TABLE_COUPONS . " where coupon_type != 'G'";
}
$cc_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
$cc_query = smn_db_query($cc_query_raw);
while ($cc_list = smn_db_fetch_array($cc_query)) {
$rows++;
if (strlen($rows) < 2) {
$rows = '0' . $rows;
}
if ((!$_GET['cid'] || @$_GET['cid'] == $cc_list['coupon_id']) && !$cInfo) {
$cInfo = new objectInfo($cc_list);
}
if (is_object($cInfo) && $cc_list['coupon_id'] == $cInfo->coupon_id) {
echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . smn_href_link('coupon_admin.php', smn_get_all_get_params(array('cid', 'action')) . 'cid=' . $cInfo->coupon_id . '&action=edit') . '\'">' . "\n";
示例12: smn_db_prepare_input
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php
echo HEADING_TITLE;
?>
</td>
</tr>
</table></td>
</tr>
<?php
if ($_GET['action'] == 'new') {
$form_action = 'insert';
if ($_GET['abID']) {
$abID = smn_db_prepare_input($_GET['abID']);
$form_action = 'update';
$affiliate_banner_query = smn_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . smn_db_input($abID) . "'");
$affiliate_banner = smn_db_fetch_array($affiliate_banner_query);
$abInfo = new objectInfo($affiliate_banner);
} elseif ($_POST) {
$abInfo = new objectInfo($_POST);
} else {
$abInfo = new objectInfo(array());
}
$groups_array = array();
$groups_query = smn_db_query("select distinct affiliate_banners_group from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_group");
while ($groups = smn_db_fetch_array($groups_query)) {
$groups_array[] = array('id' => $groups['affiliate_banners_group'], 'text' => $groups['affiliate_banners_group']);
}
?>
<tr>
<td><?php
示例13: smn_db_query
}
if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
$error = true;
$messageStack->add('addressbook', ENTRY_CITY_ERROR);
}
if (!is_numeric($country)) {
$error = true;
$messageStack->add('addressbook', ENTRY_COUNTRY_ERROR);
}
if (ACCOUNT_STATE == 'true') {
$zone_id = 0;
$check_query = smn_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int) $country . "'");
$check = smn_db_fetch_array($check_query);
$entry_state_has_zones = $check['total'] > 0;
if ($entry_state_has_zones == true) {
$zone_query = smn_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int) $country . "' and (upper(zone_name) = upper('" . smn_db_input($state) . "') or upper(zone_code) = upper('" . smn_db_input($state) . "'))");
if (smn_db_num_rows($zone_query) == 1) {
$zone = smn_db_fetch_array($zone_query);
$zone_id = $zone['zone_id'];
} else {
$error = true;
$messageStack->add('addressbook', ENTRY_STATE_ERROR_SELECT);
}
} else {
if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
$error = true;
$messageStack->add('addressbook', ENTRY_STATE_ERROR);
}
}
}
if ($error == false) {
示例14: strlen
$entry_telephone_error = false;
}
$passlen = strlen($a_password);
if ($passlen < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$entry_password_error = true;
} else {
$entry_password_error = false;
}
if ($a_password != $a_confirmation) {
$error = true;
$entry_password_error = true;
}
/* Changed the query to check the uniqueness of customer email By Cimi on June 13,2007*/
/*$check_email = smn_db_query("select affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . smn_db_input($a_email_address) . "'");*/
$check_email = smn_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . smn_db_input($a_email_address) . "'");
if (smn_db_num_rows($check_email)) {
$error = true;
$entry_email_address_exists = true;
} else {
$entry_email_address_exists = false;
}
// Check Suburb
$entry_suburb_error = false;
// Check Fax
$entry_fax_error = false;
if (!affiliate_check_url($a_homepage)) {
$error = true;
$entry_homepage_error = true;
} else {
$entry_homepage_error = false;
示例15: isset
license@systemsmanager.net so we can mail you a copy immediately.
*/
require 'includes/application_top.php';
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (smn_not_null($action)) {
switch ($action) {
case 'insert':
$zone_country_id = smn_db_prepare_input($_POST['zone_country_id']);
$zone_code = smn_db_prepare_input($_POST['zone_code']);
$zone_name = smn_db_prepare_input($_POST['zone_name']);
smn_db_query("insert into " . TABLE_ZONES . " (zone_country_id, zone_code, zone_name) values ('" . (int) $zone_country_id . "', '" . smn_db_input($zone_code) . "', '" . smn_db_input($zone_name) . "')");
smn_redirect(smn_href_link(FILENAME_ZONES));
break;
case 'save':
$zone_id = smn_db_prepare_input($_GET['cID']);
$zone_country_id = smn_db_prepare_input($_POST['zone_country_id']);
$zone_code = smn_db_prepare_input($_POST['zone_code']);
$zone_name = smn_db_prepare_input($_POST['zone_name']);
smn_db_query("update " . TABLE_ZONES . " set zone_country_id = '" . (int) $zone_country_id . "', zone_code = '" . smn_db_input($zone_code) . "', zone_name = '" . smn_db_input($zone_name) . "' where zone_id = '" . (int) $zone_id . "'");
smn_redirect(smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $zone_id));
break;
case 'deleteconfirm':
$zone_id = smn_db_prepare_input($_GET['cID']);
smn_db_query("delete from " . TABLE_ZONES . " where zone_id = '" . (int) $zone_id . "'");
smn_redirect(smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page']));
break;
}
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';