本文整理汇总了PHP中check_purview函数的典型用法代码示例。如果您正苦于以下问题:PHP check_purview函数的具体用法?PHP check_purview怎么用?PHP check_purview使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_purview函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if (!$db->delete($remove_product)) {
$transaction = false;
}
if ($transaction) {
$links = array(array('link' => 'virtual_product.php', 'alt' => '虚拟产品列表'), array('link' => 'virtual_product.php?act=cycle', 'alt' => '回收站'), array('link' => 'virtual_product.php?act=add', 'alt' => '添加虚拟产品'));
$db->commit();
show_system_message('产品' . $product['product_sn'] . '已被彻底删除', $links);
exit;
} else {
$db->rollback();
show_system_message('系统繁忙,请稍后重试', array());
exit;
}
}
if ('inventory' == $act) {
if (!check_purview('pur_virtual_product_edit', $_SESSION['business_purview'])) {
show_system_message('权限不足', array());
exit;
}
$product_sn = trim(getGET('sn'));
if ('' == $product_sn) {
show_system_message('参数错误', array());
exit;
}
$product_sn = $db->escape($product_sn);
$get_product = 'select a.* from ' . $db->table('product') . ' as a';
$get_product .= ' where business_account = \'' . $_SESSION['business_account'] . '\'';
$get_product .= ' and is_virtual = 1';
//实体产品
$get_product .= ' and a.product_sn = \'' . $product_sn . '\' and status <> 2 limit 1';
$product = $db->fetchRow($get_product);
示例2: assign
$ad_list[$key]['pos_name'] = $adpos_json[$ad['ad_pos_id']]['name'];
}
}
assign('ad_list', $ad_list);
}
if ('edit' == $act) {
if (!check_purview('pur_ad_edit', $_SESSION['purview'])) {
show_system_message('权限不足');
exit;
}
$id = intval(getGET('id'));
$get_ad = 'select * from ' . $db->table('ad') . ' where `id`=' . $id . ' and business_account = \'\'';
assign('ad', $db->fetchRow($get_ad));
}
if ('delete' == $act) {
if (!check_purview('pur_ad_del', $_SESSION['purview'])) {
show_system_message('权限不足');
exit;
}
$id = intval(getGET('id'));
if ($id <= 0) {
show_system_message('请求失败');
exit;
}
$get_img = 'select `img` from ' . $db->table('ad') . ' where `id`=' . $id . ' and business_account = \'\'';
$img = $db->fetchOne($get_img);
if ($db->autoDelete('ad', '`id`=' . $id)) {
show_system_message('删除广告成功');
exit;
} else {
show_system_message('系统繁忙,请稍后再试');
示例3: intval
$page = intval($page);
$count = intval($count);
if (!in_array($count, $count_expected)) {
$count = 10;
}
$total_page = ceil($total / $count);
$page = $page > $total_page ? $total_page : $page;
$page = $page <= 0 ? 1 : $page;
$offset = ($page - 1) * $count;
create_pager($page, $total_page, $total);
assign('count', $count);
assign('account', $account);
assign('begin_time', $begin_time > 0 ? date('Y-m-d', $begin_time) : '');
assign('end_time', $end_time > 0 ? date('Y-m-d', $end_time) : '');
assign('recharge_sn', $recharge_sn);
assign('status', $status);
$get_recharge_list = 'select * from ' . $db->table('recharge') . $where . ' order by `recharge_sn` DESC limit ' . $offset . ',' . $count;
$recharge_list = $db->fetchAll($get_recharge_list);
if ($recharge_list) {
foreach ($recharge_list as $k => $r) {
if (check_purview('pur_recharge_edit', $_SESSION['purview']) && $r['status'] == 1) {
$recharge_list[$k]['operation'] = '<a href="recharge.php?act=edit&sn=' . $r['recharge_sn'] . '">处理</a>';
} else {
$recharge_list[$k]['operation'] = '';
}
}
}
assign('recharge_list', $recharge_list);
}
assign('act', $act);
$smarty->display($template . 'recharge.phtml');
示例4: show_system_message
show_system_message('当前导航条还有子栏目,请先删除子栏目', array());
exit;
} else {
$deleteNav = 'delete from `' . DB_PREFIX . 'nav` where `id`=' . $id . ' limit 1';
if ($db->delete($deleteNav)) {
show_system_message('删除成功', array());
exit;
} else {
show_system_message('删除导航条失败,请稍后再试', array());
exit;
}
}
}
//导航列表
if ('view' == $act) {
if (!check_purview('pur_nav_view', $_SESSION['purview'])) {
show_system_message('权限不足', array());
exit;
}
$getNavs = 'select * from `' . DB_PREFIX . 'nav`';
$getNavs .= ' order by `position` desc, `order_view` asc';
$navs = $db->fetchAll($getNavs);
//初始化入栈标志
if ($navs) {
foreach ($navs as $k => $v) {
$navs[$k]['in'] = false;
}
}
$stack = array();
$result = array();
if ($navs) {
示例5: back_base_init
* @version 1.0.0
*/
include 'library/init.inc.php';
back_base_init();
$template = 'virtual_order/';
assign('subTitle', '消费券管理');
$action = 'view';
$operation = '';
$act = check_action($action, getGET('act'));
$act = $act == '' ? 'view' : $act;
$opera = check_action($operation, getPOST('opera'));
$status_str = array(0 => '有效', 1 => '已使用', 2 => '已过期', 3 => '失效');
//===========================================================================
//===========================================================================
if ('view' == $act) {
if (!check_purview('pur_virtual_order_view', $_SESSION['purview'])) {
show_system_message('权限不足', array());
exit;
}
$status = intval(getGET('status'));
if ($status == 0) {
assign('status', 0);
assign('order_status', '');
$and_where = '';
} else {
switch ($status) {
case 1:
$and_where .= ' and a.status = 0';
break;
case 2:
$and_where .= ' and a.status = 1';
示例6: foreach
$get_exchange_list .= ' limit ' . $offset . ',' . $count;
$exchange_list = $db->fetchAll($get_exchange_list);
// echo $get_exchange_list;exit;
if ($exchange_list) {
foreach ($exchange_list as $key => $value) {
$exchange_list[$key]['add_time_str'] = date('Y-m-d H:i:s', $value['add_time']);
}
}
assign('exchange_list', $exchange_list);
assign('count', $count);
assign('st', $st);
assign('et', $et);
create_pager($page, $total_page, $total);
}
if ('detail' == $act) {
if (!check_purview('pur_account_view', $_SESSION['purview'])) {
show_system_message('权限不足', array());
exit;
}
$account = trim(getGET('account'));
if ('' == $account) {
show_system_message('参数错误', array());
exit;
}
assign('account', $account);
$account = $db->escape($account);
$where = '';
$type = intval(getGET('type'));
if ($type == 0) {
$table = 'member_exchange_log';
$exists_table = 'member';
示例7: show_system_message
$content = $db->fetchRow($get_content);
if ($content) {
show_system_message('当前帖子下有回复,不能删除', array());
exit;
}
$delete_section = 'delete from `' . DB_PREFIX . 'forum` where `id`=' . $id . ' limit 1';
if ($db->delete($delete_section)) {
show_system_message('删除帖子成功', array());
exit;
} else {
show_system_message('系统繁忙,请稍后再试', array());
exit;
}
}
if ('top' == $act) {
if (!check_purview('pur_forum_edit', $_SESSION['purview'])) {
show_system_message('权限不足', array());
exit;
}
$id = getGET('id');
$id = intval($id);
$delete_section = 'update `' . DB_PREFIX . 'forum` set `is_top`=abs(1-`is_top`) where `id`=' . $id . ' limit 1';
if ($db->update($delete_section)) {
show_system_message('修改帖子成功', array());
exit;
} else {
show_system_message('系统繁忙,请稍后再试', array());
exit;
}
}
$template .= $act . '.phtml';
示例8: show_system_message
}
break;
default:
}
}
if ('view' == $act) {
if (!check_purview('pur_sysconf_view', $_SESSION['purview'])) {
show_system_message('权限不足', array());
exit;
}
$getSysconf = 'select `key`,`name`,`type`,`value`, `remark`, `group` from `' . DB_PREFIX . 'sysconf` where `group`=\'config\' order by `group` asc';
$sysconf = $db->fetchAll($getSysconf);
assign('sysconf', $sysconf);
}
if ('edit' == $act) {
if (!check_purview('pur_sysconf_edit', $_SESSION['purview'])) {
show_system_message('权限不足', array());
exit;
}
$key = getGET('key');
if ('' == $key) {
show_system_message('参数错误', array());
} else {
$getSysconf = 'select `key`,`name`,`type`,`value` from `' . DB_PREFIX . 'sysconf`';
$getSysconf .= ' where `key`=\'' . $key . '\'';
assign('conf', $db->fetchRow($getSysconf));
}
}
assign('act', $act);
$template .= $act . '.phtml';
$smarty->display($template);
示例9: ceil
if (!in_array($count, $count_expected)) {
$count = 10;
}
$total_page = ceil($total / $count);
$page = $page > $total_page ? $total_page : $page;
$page = $page <= 0 ? 1 : $page;
$offset = ($page - 1) * $count;
create_pager($page, $total_page, $total);
assign('count', $count);
assign('account', $account);
$get_member = 'select * from ' . $db->table('member') . $where . ' order by `add_time` DESC limit ' . $offset . ',' . $count;
$member_list = $db->fetchAll($get_member);
if ($member_list) {
foreach ($member_list as $k => $member) {
$tmp = '';
if (check_purview('pur_member_edit', $_SESSION['purview'])) {
$member_list[$k]['operation'] = '<a href="member.php?act=edit&account=' . $member['account'] . '">编辑</a>';
$member_list[$k]['operation'] .= ' | <a href="javascript:reset_password(\'' . $member['account'] . '\');">重置密码</a>';
if ($member['status'] == 2) {
$member_list[$k]['operation'] .= ' | <a href="javascript:lock(\'' . $member['account'] . '\');">锁定用户</a>';
} else {
$member_list[$k]['operation'] .= ' | <a href="javascript:unlock(\'' . $member['account'] . '\');">解锁用户</a>';
}
if ($member['status'] == 4) {
$member_list[$k]['operation'] .= ' | <a href="javascript:release(\'' . $member['account'] . '\');">解冻用户</a>';
} else {
$member_list[$k]['operation'] .= ' | <a href="javascript:frozen(\'' . $member['account'] . '\');">冻结用户</a>';
}
if ($member['view_network'] == 0) {
$member_list[$k]['operation'] .= ' | <a href="javascript:open_network(\'' . $member['account'] . '\');">开启网络</a>';
} else {
示例10: time
}
$update_withdraw = 'update ' . $db->table($table) . ' set status = 1, solve_time = ' . time() . ' where withdraw_sn = \'' . $sn . '\' limit 1';
if ($db->update($update_withdraw)) {
$data = array('add_time' => time(), 'operator' => $_SESSION['account'], 'withdraw_sn' => $sn, 'status' => 1, 'remark' => '金额到帐');
$db->autoInsert($table . '_log', array($data));
//添加账户明细记录
add_memeber_exchange_log($withdraw['account'], 0, -1 * ($withdraw['amount'] + $withdraw['fee']), 0, 0, 0, $_SESSION['account'], '提现到帐');
show_system_message('操作成功', array());
exit;
} else {
show_system_message('系统繁忙,请稍后重试', array());
exit;
}
}
if ('log' == $act) {
if (!check_purview('pur_withdraw_log', $_SESSION['purview'])) {
show_system_message('权限不足', array());
exit;
}
$type = intval(getGET('type'));
if ($type == 0) {
$table = 'withdraw_log';
} else {
$table = 'business_withdraw_log';
}
assign('type', $type);
$st = trim(getGET('st'));
$et = trim(getGET('et'));
$start_time = strtotime($st);
$end_time = strtotime($et);
$and_where = '';
示例11: define
* 网站地址: http://www.beescms.com
* 您只能在不用于商业目的的前提下对程序代码进行修改和使用;
* 不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
*/
define('IN_CMS', 'true');
include 'init.php';
$action = isset($_REQUEST['action']) ? fl_html(fl_value($_REQUEST['action'])) : 'sys';
//系统设置页
if ($action == 'sys') {
if (file_exists(DATA_PATH . 'sys_info.php')) {
include DATA_PATH . 'sys_info.php';
}
include 'template/admin_sys.html';
} elseif ($action == 'add_sys') {
if (!check_purview('sys_info')) {
msg('<span style="color:red">操作失败,你的权限不足!</span>');
}
if (!isset($_POST['submit'])) {
msg('<span style="color:red">请从表单提交</span>');
}
unset($_POST['action'], $_POST['submit']);
foreach ($_POST as $k => $v) {
$info[$k] = $v;
}
$sql = "update " . DB_PRE . "cmsinfo set info_array='" . addslashes(var_export($info, 'true')) . "' where id=1 and info_tag='sys'";
$GLOBALS['mysql']->query($sql);
$file = DATA_PATH . 'sys_info.php';
$str = "<?php\n\$_sys=" . var_export($info, true) . ";\n?>";
creat_inc($file, $str);
msg('系统信息配置成功', '?' . $nav_query);
示例12: array
$update_order .= ' where business_account = \'' . $_SESSION['business_account'] . '\'';
$update_order .= ' and order_sn = \'' . $order_sn . '\' limit 1';
if ($db->update($update_order)) {
$log_data = array('order_sn' => $order_sn, 'operator' => $_SESSION['business_admin'], 'status' => 4, 'add_time' => time(), 'remark' => '确认已付款');
$db->autoInsert('order_log', array($log_data));
$links = array(array('alt' => '待发货订单列表', 'link' => 'order.php?status=4'));
show_system_message('确认客户已付款', $links);
exit;
} else {
show_system_message('系统繁忙,请稍后重试', array());
exit;
}
}
//预览
if ('preview' == $act) {
if (!check_purview('pur_order_view', $_SESSION['business_purview'])) {
echo '权限不足';
exit;
}
$status_str = array(1 => '待支付', 2 => '支付中', 3 => '支付完成', 4 => '待发货', 5 => '配货中', 6 => '已发货', 7 => '已收货', 8 => '申请退单', 9 => '退单中', 10 => '已退单', 11 => '无效订单', 12 => '已完成');
$order_sn = trim(getGET('sn'));
if ('' == $order_sn) {
show_system_message('参数错误', array());
exit;
}
$order_sn = $db->escape($order_sn);
$get_order = 'select a.*, p.province_name, city.city_name, d.district_name, g.group_name, e.name as express_name from ' . $db->table('order') . ' as a';
$get_order .= ' left join ' . $db->table('province') . ' as p on a.province = p.id';
$get_order .= ' left join ' . $db->table('city') . ' as city on a.city = city.id';
$get_order .= ' left join ' . $db->table('district') . ' as d on a.district = d.id';
$get_order .= ' left join ' . $db->table('group') . ' as g on a.group = g.id';
示例13: get_exceldown
function get_exceldown($keys)
{
if (!is_superadmin() && !check_purview($keys)) {
} else {
return '<a href="javascript:document:excel.submit();" seed="CR-download-top" id="J-download"><img class="v-al-middle" src="template/default/images/2EC5tZlqdV.gif" />下载查询结果</a>';
}
}
示例14: show_system_message
exit;
}
}
if ('withdraw' == $act) {
if (!check_purview('pur_finance_withdraw', $_SESSION['business_purview'])) {
show_system_message('权限不足', array());
exit;
}
$get_business = 'select `balance`, `trade` from ' . $db->table('business');
$get_business .= ' where business_account = \'' . $_SESSION['business_account'] . '\'';
$get_business .= ' limit 1';
$business = $db->fetchRow($get_business);
assign('business', $business);
}
if ('record' == $act) {
if (!check_purview('pur_finance_withdraw', $_SESSION['business_purview'])) {
show_system_message('权限不足', array());
exit;
}
$get_business = 'select * from ' . $db->table('business');
$get_business .= ' where business_account = \'' . $_SESSION['business_account'] . '\' limit 1';
$business = $db->fetchRow($get_business);
assign('business', $business);
$page = intval(getGET('page'));
$count = intval(getGET('count'));
$getTotal = 'select count(*) from ' . $db->table('business_withdraw');
$getTotal .= ' where account = \'' . $_SESSION['business_account'] . '\'';
$total = $db->fetchOne($getTotal);
$count = intval(getGET('count'));
$count = $count <= 0 ? 10 : $count;
$total_page = ceil($total / $count);
示例15: die
die($str);
} elseif ($action == 'check_table') {
if (check_str($value, '/[^0-9a-z_]+/') || empty($value)) {
die("<span class='err'>只能使用小写字母或数字</span>");
exit;
}
$sql = "show tables";
$tables = $GLOBALS['mysql']->show_tables();
$table = DB_PRE . $value;
if (in_array($table, $tables)) {
$num = 1;
}
$str = empty($num) ? "<span class='ld_ok'>{$value}可以使用</span>" : "<span class='err'>{$value}已经存在,请更换</span>";
die($str);
} elseif ($action == 'is_show') {
if (!check_purview('pannel_edit') || !check_purview('form_edit')) {
return false;
}
$id = intval($_REQUEST['id']);
$table = $_REQUEST['table'];
$field = $_REQUEST['field'];
$order = $_REQUEST['order'];
$value = empty($value) ? 1 : 0;
$sql = "update " . DB_PRE . "{$table} set {$field}=" . intval($value) . " where id={$id}";
$GLOBALS['mysql']->query($sql);
//更新缓存
if ($table == "channel") {
$sql = "select*from " . DB_PRE . "{$table} order by {$order} desc";
$rel = $GLOBALS['mysql']->fetch_asc($sql);
$cache_file = DATA_PATH . 'cache_channel/cache_channel_all.php';
$str = "<?php\n\$channel=" . var_export($rel, true) . ";\n?>";