本文整理汇总了PHP中admin_priv函数的典型用法代码示例。如果您正苦于以下问题:PHP admin_priv函数的具体用法?PHP admin_priv怎么用?PHP admin_priv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了admin_priv函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lessmoney
public function lessmoney()
{
if(false === admin_priv('quickrecharge')) {
$this->ajax_response('err', 'forbidden');
}
$uid = get('uid', 'int');
$money = get('money', 'float');
$remark = get('remark', 'txt');
$r = logic('me')->money()->less($money, $uid, array('name' => '管理员后台扣费', 'intro' => $remark));
$r ? $this->ajax_response('ok', '扣费成功!') : $this->ajax_response('err', '扣费失败!');
}
示例2: array
}
}
$smarty->assign('rebate', $rebate);
$smarty->assign('supplier', $supplier);
$smarty->assign('ur_here', '佣金详细信息');
$lang_rebate_list = $_GET['is_pay_ok'] ? $_LANG['03_rebate_pay'] : $_LANG['03_rebate_nopay'];
$href_rebate_list = "supplier_rebate.php?act=list&is_pay_ok={$is_pay_ok}";
$smarty->assign('action_link', array('href' => $href_rebate_list, 'text' => $lang_rebate_list));
$smarty->assign('form_action', 'update');
$pay_type_list = explode("\n", str_replace("\r\n", "\n", $_CFG['supplier_rebate_paytype']));
$smarty->assign('pay_type_list', $pay_type_list);
assign_query_info();
$smarty->display('supplier_rebate_info.htm');
} elseif ($_REQUEST['act'] == 'update') {
/* 检查权限 */
admin_priv('supplier_manage');
$_POST['pay_type_input'] = trim($_POST['pay_type_input']);
$_POST['pay_time'] = trim($_POST['pay_time']);
if (empty($_POST['pay_type_input'])) {
sys_msg('请编辑汇款方式!');
}
if (empty($_POST['pay_time'])) {
sys_msg('请选择转帐时间!');
}
$pay_time = local_strtotime(str_replace(".", "-", $_POST['pay_time']));
//if(time() > $pay_time){
//sys_msg('转帐时间必须大于当前时间!');
//}
/* 提交值 */
$rebate_id = intval($_POST['id']);
$rebate = array('pay_type' => trim($_POST['pay_type_input']), 'remark' => trim($_POST['remark']), 'pay_time' => $pay_time, 'is_pay_ok' => 1);
示例3: clear_cache_files
$db->query($sql);
clear_cache_files();
$links[] = array('href' => 'topic.php', 'text' => $_LANG['back_list']);
sys_msg($_LANG['succed'], 0, $links);
} elseif ($_REQUEST['act'] == 'get_goods_list') {
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$filters = $json->decode($_GET['JSON']);
$arr = get_goods_list($filters);
$opt = array();
foreach ($arr as $key => $val) {
$opt[] = array('value' => $val['goods_id'], 'text' => $val['goods_name']);
}
make_json_result($opt);
} elseif ($_REQUEST['act'] == 'delete') {
admin_priv('topic_manage');
$sql = 'DELETE FROM ' . $ecs->table('topic') . ' WHERE ';
if (!empty($_POST['checkboxs'])) {
$sql .= db_create_in($_POST['checkboxs'], 'topic_id');
} elseif (!empty($_GET['id'])) {
$_GET['id'] = intval($_GET['id']);
$sql .= "topic_id = '{$_GET['id']}'";
} else {
exit;
}
$db->query($sql);
clear_cache_files();
if (!empty($_REQUEST['is_ajax'])) {
$url = 'topic.php?act=query&' . str_replace('act=delete', '', $_SERVER['QUERY_STRING']);
ecs_header("Location: {$url}\n");
exit;
示例4: define
* $Id: area_manage.php 17217 2011-01-19 06:29:08Z liubo $
*/
define('IN_ECTOUCH', true);
require dirname(__FILE__) . '/includes/init.php';
$exc = new exchange($ecs->table('region'), $db, 'region_id', 'region_name');
/* act操作项的初始化 */
if (empty($_REQUEST['act'])) {
$_REQUEST['act'] = 'list';
} else {
$_REQUEST['act'] = trim($_REQUEST['act']);
}
/*------------------------------------------------------ */
//-- 列出某地区下的所有地区列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
admin_priv('area_manage');
/* 取得参数:上级地区id */
$region_id = empty($_REQUEST['pid']) ? 0 : intval($_REQUEST['pid']);
$smarty->assign('parent_id', $region_id);
/* 取得列表显示的地区的类型 */
if ($region_id == 0) {
$region_type = 0;
} else {
$region_type = $exc->get_name($region_id, 'region_type') + 1;
}
$smarty->assign('region_type', $region_type);
/* 获取地区列表 */
$region_arr = area_list($region_id);
$smarty->assign('region_arr', $region_arr);
/* 当前的地区名称 */
if ($region_id > 0) {
示例5: sort_flag
$smarty->assign('page_count', $tag_list['page_count']);
$sort_flag = sort_flag($tag_list['filter']);
$smarty->assign($sort_flag['tag'], $sort_flag['img']);
make_json_result($smarty->fetch('tag_manage.htm'), '', array('filter' => $tag_list['filter'], 'page_count' => $tag_list['page_count']));
} elseif ($_REQUEST['act'] == 'search_goods') {
check_authz_json('tag_manage');
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$filter = $json->decode($_GET['JSON']);
$arr = get_goods_list($filter);
if (empty($arr)) {
$arr[0] = array('goods_id' => 0, 'goods_name' => '');
}
make_json_result($arr);
} elseif ($_REQUEST['act'] == 'batch_drop') {
admin_priv('tag_manage');
if (isset($_POST['checkboxes'])) {
$count = 0;
foreach ($_POST['checkboxes'] as $key => $id) {
$sql = "DELETE FROM " . $ecs->table('tag') . " WHERE tag_id='{$id}'";
$db->query($sql);
$count++;
}
admin_log($count, 'remove', 'tag_manage');
clear_cache_files();
$link[] = array('text' => $_LANG['back_list'], 'href' => 'tag_manage.php?act=list');
sys_msg(sprintf($_LANG['drop_success'], $count), 0, $link);
} else {
$link[] = array('text' => $_LANG['back_list'], 'href' => 'tag_manage.php?act=list');
sys_msg($_LANG['no_select_tag'], 0, $link);
}
示例6: get_sales_order
} else {
echo $data;
}
exit;
}
$goods_order_data = get_sales_order();
$smarty->assign('goods_order_data', $goods_order_data['sales_order_data']);
$smarty->assign('filter', $goods_order_data['filter']);
$smarty->assign('record_count', $goods_order_data['record_count']);
$smarty->assign('page_count', $goods_order_data['page_count']);
$sort_flag = sort_flag($goods_order_data['filter']);
$smarty->assign($sort_flag['tag'], $sort_flag['img']);
make_json_result($smarty->fetch('sale_order.htm'), '', array('filter' => $goods_order_data['filter'], 'page_count' => $goods_order_data['page_count']));
} else {
/* 权限检查 */
admin_priv('sale_order_stats');
/* 时间参数 */
if (!isset($_REQUEST['start_date'])) {
$_REQUEST['start_date'] = local_strtotime('-1 months');
}
if (!isset($_REQUEST['end_date'])) {
$_REQUEST['end_date'] = local_strtotime('+1 day');
}
$goods_order_data = get_sales_order();
/* 赋值到模板 */
$smarty->assign('ur_here', $_LANG['sell_stats']);
$smarty->assign('goods_order_data', $goods_order_data['sales_order_data']);
$smarty->assign('filter', $goods_order_data['filter']);
$smarty->assign('record_count', $goods_order_data['record_count']);
$smarty->assign('page_count', $goods_order_data['page_count']);
$smarty->assign('filter', $goods_order_data['filter']);
示例7: JSON
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'get_goods_list') {
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$filters = $json->decode($_GET['JSON']);
$arr = get_goods_list($filters);
$opt = array();
foreach ($arr as $key => $val) {
$opt[] = array('value' => $val['goods_id'], 'text' => $val['goods_name'], 'data' => $val['shop_price']);
}
make_json_result($opt);
} elseif ($_REQUEST['act'] == 'batch') {
/* 批量删除 */
if (isset($_POST['type'])) {
if ($_POST['type'] == 'button_remove') {
admin_priv('article_manage');
if (!isset($_POST['checkboxes']) || !is_array($_POST['checkboxes'])) {
sys_msg($_LANG['no_select_article'], 1);
}
/* 删除原来的文件 */
$sql = "SELECT file_url FROM " . $ecs->table('article') . " WHERE article_id " . db_create_in(join(',', $_POST['checkboxes'])) . " AND file_url <> ''";
$res = $db->query($sql);
while ($row = $db->fetchRow($res)) {
$old_url = $row['file_url'];
if (strpos($old_url, 'http://') === false && strpos($old_url, 'https://') === false) {
@unlink(ROOT_PATH . $old_url);
}
}
foreach ($_POST['checkboxes'] as $key => $id) {
if ($exc->drop($id)) {
$name = $exc->get_name($id);
示例8: admin_log
/* 记录管理员操作 */
admin_log($_POST['link_name'], 'add', 'friendlink');
/* 清除缓存 */
clear_cache_files();
/* 提示信息 */
$link[0]['text'] = $_LANG['continue_add'];
$link[0]['href'] = 'friend_link.php?act=add';
$link[1]['text'] = $_LANG['back_list'];
$link[1]['href'] = 'friend_link.php?act=list';
sys_msg($_LANG['add'] . " " . stripcslashes($_POST['link_name']) . " " . $_LANG['attradd_succed'], 0, $link);
} else {
$link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
sys_msg($_LANG['link_name_exist'], 0, $link);
}
} elseif ($_REQUEST['act'] == 'edit') {
admin_priv('friendlink');
/* 取得友情链接数据 */
$sql = "SELECT link_id, link_name, link_url, link_logo, show_order " . "FROM " . $ecs->table('friend_link') . " WHERE link_id = '" . intval($_REQUEST['id']) . "'";
$link_arr = $db->getRow($sql);
/* 标记为图片链接还是文字链接 */
if (!empty($link_arr['link_logo'])) {
$type = 'img';
$link_logo = $link_arr['link_logo'];
} else {
$type = 'chara';
$link_logo = '';
}
$link_arr['link_name'] = sub_str($link_arr['link_name'], 250, false);
// 截取字符串为250个字符避免出现非法字符的情况
/* 模板赋值 */
$smarty->assign('ur_here', $_LANG['edit_link']);
示例9: str_replace
if ($type == 3) {
$ad_code = "ad_code = '{$_POST['ad_text']}', ";
}
$ad_code = str_replace('../' . DATA_DIR . '/afficheimg/', '', $ad_code);
/* 更新信息 */
$sql = "UPDATE " . $ecs->table('ad') . " SET " . "position_id = '{$_POST['position_id']}', " . "ad_name = '{$_POST['ad_name']}', " . "ad_link = '{$ad_link}', " . $ad_code . "start_time = '{$start_time}', " . "end_time = '{$end_time}', " . "link_man = '{$_POST['link_man']}', " . "link_email = '{$_POST['link_email']}', " . "link_phone = '{$_POST['link_phone']}', " . "enabled = '{$_POST['enabled']}' " . "WHERE ad_id = '{$id}'";
$db->query($sql);
/* 记录管理员操作 */
admin_log($_POST['ad_name'], 'edit', 'ads');
clear_cache_files();
// 清除模版缓存
/* 提示信息 */
$href[] = array('text' => $_LANG['back_ads_list'], 'href' => 'ads.php?act=list');
sys_msg($_LANG['edit'] . ' ' . $_POST['ad_name'] . ' ' . $_LANG['attradd_succed'], 0, $href);
} elseif ($_REQUEST['act'] == 'add_js') {
admin_priv('ad_manage');
/* 编码 */
$lang_list = array('UTF8' => $_LANG['charset']['utf8'], 'GB2312' => $_LANG['charset']['zh_cn'], 'BIG5' => $_LANG['charset']['zh_tw']);
$js_code = "<script type=" . '"' . "text/javascript" . '"';
$js_code .= ' src=' . '"' . $ecs->url() . 'affiche.php?act=js&type=' . $_REQUEST['type'] . '&ad_id=' . intval($_REQUEST['id']) . '"' . '></script>';
$site_url = $ecs->url() . 'affiche.php?act=js&type=' . $_REQUEST['type'] . '&ad_id=' . intval($_REQUEST['id']);
$smarty->assign('ur_here', $_LANG['add_js_code']);
$smarty->assign('action_link', array('href' => 'ads.php?act=list', 'text' => $_LANG['ad_list']));
$smarty->assign('url', $site_url);
$smarty->assign('js_code', $js_code);
$smarty->assign('lang_list', $lang_list);
assign_query_info();
$smarty->display('ads_js.htm');
} elseif ($_REQUEST['act'] == 'edit_ad_name') {
check_authz_json('ad_manage');
$id = intval($_POST['id']);
示例10: array
$attr = array();
$arr = array();
foreach ($goods_attr as $index => $array_val) {
foreach ($array_val as $value) {
$arr = explode(':', $value);
//以 : 号将属性拆开
$attr[$index][] = @array('name' => $arr[0], 'value' => $arr[1]);
}
}
$smarty->assign('goods_attr', $attr);
$smarty->assign('goods_list', $goods_list);
$str = $smarty->fetch('order_goods_info.htm');
$goods[] = array('order_id' => $order_id, 'str' => $str);
make_json_result($goods);
} elseif ($_REQUEST['act'] == 'invoice_op') {
admin_priv('invoice_manage');
if (isset($_REQUEST['export'])) {
$order_ids = explode(',', trim($_REQUEST['order_id']));
if (count($order_ids) > 0) {
$rows = get_invoice_rows($order_ids);
if (count($rows) > 0) {
$rows = format_invoice_rows($rows);
export_invoice_to_xml_excel($rows);
}
}
}
} elseif ($_REQUEST['act'] == 'export_all_invoice') {
$rows = get_invoice_rows();
if (count($rows) > 0) {
$rows = format_invoice_rows($rows);
export_invoice_to_xml_excel($rows);
示例11: array
$lnk[] = array('text' => $_LANG['back_list'], 'href' => 'reg_fields.php?act=list');
$lnk[] = array('text' => $_LANG['add_continue'], 'href' => 'reg_fields.php?act=add');
sys_msg($_LANG['add_field_success'], 0, $lnk);
} elseif ($_REQUEST['act'] == 'edit') {
admin_priv('reg_fields');
$form_action = 'update';
$sql = "SELECT id AS reg_field_id, reg_field_name, dis_order AS reg_field_order, display AS reg_field_display, is_need AS reg_field_need FROM " . $ecs->table('reg_fields') . " WHERE id='{$_REQUEST['id']}'";
$reg_field = $db->GetRow($sql);
$smarty->assign('reg_field', $reg_field);
$smarty->assign('ur_here', $_LANG['add_reg_field']);
$smarty->assign('action_link', array('text' => $_LANG['021_reg_fields'], 'href' => 'reg_fields.php?act=list'));
$smarty->assign('form_action', $form_action);
assign_query_info();
$smarty->display('reg_field_info.htm');
} elseif ($_REQUEST['act'] == 'update') {
admin_priv('reg_fields');
/* 检查是否存在重名的会员注册项 */
if ($_POST['reg_field_name'] != $_POST['old_field_name'] && !$exc->is_only('reg_field_name', trim($_POST['reg_field_name']))) {
sys_msg(sprintf($_LANG['field_name_exist'], trim($_POST['reg_field_name'])), 1);
}
$sql = "UPDATE " . $ecs->table('reg_fields') . " SET `reg_field_name` = '{$_POST['reg_field_name']}', `dis_order` = '{$_POST['reg_field_order']}', `display` = '{$_POST['reg_field_display']}', `is_need` = '{$_POST['reg_field_need']}' WHERE `id` = '{$_POST['id']}'";
$db->query($sql);
/* 管理员日志 */
admin_log(trim($_POST['reg_field_name']), 'edit', 'reg_fields');
clear_cache_files();
$lnk[] = array('text' => $_LANG['back_list'], 'href' => 'reg_fields.php?act=list');
sys_msg($_LANG['update_field_success'], 0, $lnk);
} elseif ($_REQUEST['act'] == 'remove') {
check_authz_json('reg_fields');
$field_id = intval($_GET['id']);
$field_name = $exc->get_name($field_id);
示例12: define
* * 版权所有 2008-2015 秦皇岛商之翼网络科技有限公司,并保留所有权利。
* 网站地址: http://www.68ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: 倪庆洋 $
* $Id: customer.php 17217 2015-07-07 06:29:08Z niqingyang $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
require_once ROOT_PATH . 'includes/lib_goods.php';
require_once ROOT_PATH . 'includes/lib_order.php';
require_once ROOT_PATH . 'includes/lib_chat.php';
/* 检查权限 */
admin_priv('customer');
// 检查php扩展项是否开启
if (!function_exists("curl_init")) {
sys_msg($_LANG['error_php_ext_curl_invalid']);
}
/* act操作项的初始化 */
$action = isset($_REQUEST['act']) ? trim($_REQUEST['act']) : 'list';
/* 路由 */
$function_name = 'action_' . $action;
if (!function_exists($function_name)) {
$function_name = "action_list";
}
call_user_func($function_name);
return;
/* 路由 */
/**
示例13: array
}
$smarty->assign('rebate', $rebate);
$smarty->assign('full_page', 1);
$smarty->assign('ur_here', '佣金相关订单信息');
$is_pay_ok = $rebate['is_pay_ok'];
$lang_rebate_list = $rebate['is_pay_ok'] ? $_LANG['03_rebate_pay'] : $_LANG['03_rebate_nopay'];
$href_rebate_list = "supplier_store_rebate.php?act=list&is_pay_ok={$is_pay_ok}";
$smarty->assign('action_link', array('href' => $href_rebate_list, 'text' => $lang_rebate_list));
//判断是不是仓库的主管
$is_store_admin = haveDoQueRen($rebate['store_id'], $_SESSION['admin_id']);
$smarty->assign('is_store_admin', $is_store_admin);
assign_query_info();
$smarty->display('store_rebate_info.htm');
} elseif ($_REQUEST['act'] == 'query') {
/* 检查权限 */
admin_priv('store_rebate');
$id = intval($_REQUEST['rid']);
$order_type = isset($_REQUEST['otype']) && intval($_REQUEST['otype']) > 0 ? intval($_REQUEST['otype']) : 0;
$rebate = rebateHave($id);
$nowtime = gmtime();
$rebate['rebate_paytime_start'] = local_date('Y.m.d', $rebate['rebate_paytime_start']);
$paytime_end = $rebate['rebate_paytime_end'];
$rebate['rebate_paytime_end'] = local_date('Y.m.d', $paytime_end);
$rebate['isdo'] = $paytime_end + $GLOBALS['_CFG']['okgoods_time'] * 3600 * 24 >= $nowtime ? 0 : 1;
$rebate['chadata'] = datecha($paytime_end + $GLOBALS['_CFG']['okgoods_time'] * 3600 * 24);
$rebate['caozuo'] = getRebateDo($rebate['status'], $rebate['rebate_id'], 'view');
if ($order_type == 0) {
$order_list = getOkOrder();
$display = 'rebate_store_order.htm';
} else {
$order_list = getBackHuanOrder();
示例14: define
* ============================================================================
* 版权所有 2005-2008 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: testyang $
* $Id: group_buy.php 15013 2008-10-23 09:31:42Z testyang $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
require_once ROOT_PATH . 'includes/lib_goods.php';
require_once ROOT_PATH . 'includes/lib_order.php';
/* 检查权限 */
admin_priv('group_by');
/* act操作项的初始化 */
if (empty($_REQUEST['act'])) {
$_REQUEST['act'] = 'list';
} else {
$_REQUEST['act'] = trim($_REQUEST['act']);
}
/*------------------------------------------------------ */
//-- 团购活动列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
/* 模板赋值 */
$smarty->assign('full_page', 1);
$smarty->assign('ur_here', $_LANG['group_buy_list']);
$smarty->assign('action_link', array('href' => 'group_buy.php?act=add', 'text' => $_LANG['add_group_buy']));
$list = group_buy_list();
示例15: assign_query_info
$smarty->assign('filter', $type_list['filter']);
$smarty->assign('record_count', $type_list['record_count']);
$smarty->assign('page_count', $type_list['page_count']);
assign_query_info();
$smarty->display('stock_out_type_list.htm');
} elseif ($_REQUEST['act'] == 'add') {
/* 权限判断 */
admin_priv('stock_out_type');
$smarty->assign('ur_here', "添加出库类型");
$smarty->assign('action_link', array('text' => "出库类型列表", 'href' => 'stock_out_type.php?act=list'));
$smarty->assign('form_action', 'insert');
assign_query_info();
$smarty->display('stock_out_type_info.htm');
} elseif ($_REQUEST['act'] == 'insert') {
/* 权限判断 */
admin_priv('stock_out_type');
$remarks = $_POST['remarks'];
$add_time = gmtime();
$user_id = $_SESSION[admin_id];
$admin_agency_id = admin_agency_id();
$ip_addr = real_ip();
$sql = "INSERT INTO " . $ecs->table('stock_out_type') . "(remarks, add_time, user_id, if_delete, ip_addr, admin_agency_id ) " . "VALUES ('{$remarks}', '{$add_time}', '{$user_id}', '0', '{$ip_addr}', '{$admin_agency_id}')";
$db->query($sql);
clear_cache_files();
// 清除相关的缓存文件
$link[0]['text'] = "操作成功";
$link[0]['href'] = 'stock_out_type.php?act=list';
sys_msg("出库类型添加操作成功", 0, $link);
} elseif ($_REQUEST['act'] == 'query') {
check_authz_json('stock_out_type');
$type_list = get_typelist();