本文整理汇总了PHP中zen_admin_demo函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_admin_demo函数的具体用法?PHP zen_admin_demo怎么用?PHP zen_admin_demo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_admin_demo函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is|
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | license@zen-cart.com so we can mail you a copy immediately.|
// +----------------------------------------------------------------------+
//$Id: admin.php 1680 2005-08-02 16:24:06Z ajeh $
//
require 'includes/application_top.php';
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (zen_not_null($action)) {
switch ($action) {
// demo active test
case zen_admin_demo():
$action = '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_ADMIN));
break;
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
case 'insert':
case 'save':
case 'reset':
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
$error = false;
if ($action == 'insert' || $action == 'reset') {
$password_new = zen_db_prepare_input($_POST['password_new']);
$password_confirmation = zen_db_prepare_input($_POST['password_confirmation']);
if (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
示例2: array
$sql_data_array = array('group_name' => $group_name, 'group_percentage' => $group_percentage);
if ($action == 'insert') {
$insert_sql_data = array('date_added' => 'now()');
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
zen_db_perform(TABLE_GROUP_PRICING, $sql_data_array);
$group_id = $db->insert_ID();
} elseif ($action == 'save') {
$update_sql_data = array('last_modified' => 'now()');
$sql_data_array = array_merge($sql_data_array, $update_sql_data);
zen_db_perform(TABLE_GROUP_PRICING, $sql_data_array, 'update', "group_id = '" . (int) $group_id . "'");
}
}
zen_redirect(zen_href_link(FILENAME_GROUP_PRICING, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'gID=' . $group_id));
break;
case 'deleteconfirm':
if (zen_admin_demo()) {
$_GET['action'] = '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page']));
}
$delete_cust_confirmed = isset($_POST['delete_customers']) && $_POST['delete_customers'] == 'on' ? true : false;
$group_id = zen_db_prepare_input($_GET['gID']);
$customers_query = $db->Execute("select customers_id from " . TABLE_CUSTOMERS . " where customers_group_pricing = '" . (int) $group_id . "'");
if ($customers_query->RecordCount() > 0 && $delete_cust_confirmed == true) {
$db->Execute("delete from " . TABLE_GROUP_PRICING . " where group_id = '" . (int) $group_id . "'");
$db->Execute("update " . TABLE_CUSTOMERS . " set customers_group_pricing=0 where customers_group_pricing = '" . (int) $group_id . "'");
} elseif ($customers_query->RecordCount() > 0 && $delete_cust_confirmed == false) {
$messageStack->add_session(ERROR_GROUP_PRICING_CUSTOMERS_EXIST, 'error');
} elseif ($customers_query->RecordCount() == 0) {
$db->Execute("delete from " . TABLE_GROUP_PRICING . " where group_id = '" . (int) $group_id . "'");
}
示例3: die
/**
* visitors purchase modules init admin file
* see {@link http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
*
* @package initSystem
* @copyright Portions Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: init_admin.php $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
zen_visitors_purchase_clean_up_visitors_ordrs();
if (basename($PHP_SELF) == FILENAME_ORDERS . '.php') {
switch ($_GET['action']) {
case 'update_order':
// demo active test
if (!zen_admin_demo()) {
zen_visitors_purchase_update_visitors_order($_GET['oID']);
}
break;
case 'deleteconfirm':
// demo active test
if (!zen_admin_demo()) {
zen_visitors_purchase_delete_visitors_order($_GET['oID']);
}
break;
}
}