/**
 * 商户管理后台初始化
 * @author 王仁欢
 */
function business_base_init()
{
    if (!isset($_SESSION['business_account'])) {
        $links = array(array('link' => 'index.php', 'alt' => '登陆'));
        show_system_message('请先登陆', $links);
        exit;
    }
    global $db;
    $get_business = 'select * from ' . $db->table('business');
    $get_business .= ' where business_account = \'' . $_SESSION['business_account'] . '\' and status = 2';
    $business = $db->fetchRow($get_business);
    if (empty($business)) {
        if (isset($_SESSION['business_account'])) {
            unset($_SESSION['business_shop_name']);
            unset($_SESSION['business_account']);
            unset($_SESSION['business_purview']);
        }
        $links = array(array('link' => 'index.php', 'alt' => '重新登陆'));
        show_system_message('商户不存在或不在运营中', $links);
        exit;
    }
    $current_shop = $_SESSION['business_shop_name'];
    assign('current_shop', $current_shop);
    assign('pageTitle', '网店' . $current_shop . '管理后台');
    create_business_menu();
    $active_nav = get_active_nav();
    $active_nav = explode('.', $active_nav);
    $active_nav = $active_nav[0];
    assign('active_nav', $active_nav);
    if ($active_nav == 'virtual_product') {
        $active_nav = 'product';
    }
    assign('menu_mark', 'menu_' . $active_nav);
    //未读消息数量
    $get_unread_message_count = 'select count(*) from ' . $db->table('message');
    $get_unread_message_count .= ' where business_account = \'' . $_SESSION['business_account'] . '\' and status = 0';
    $unread_message_count = $db->fetchOne($get_unread_message_count);
    assign('unread_message_count', $unread_message_count);
    if ($_SESSION['business_account'] == $_SESSION['business_admin']) {
        $primary_account = true;
    } else {
        $primary_account = false;
    }
    assign('primary_account', $primary_account);
}
/**
 * 后台文件初始化,检查是否已登陆,根据权限生成菜单,assign通用信息
 * @author 王仁欢
 * @date 2015-08-05
 * @return void
 */
function back_base_init()
{
    global $config;
    //是否已登陆
    if (!check_admin_login()) {
        show_system_message('请先登陆', array(array('link' => 'index.php', 'alt' => '登陆')));
        exit;
    }
    $activeNav = get_active_nav();
    $realMenus = create_menu();
    if ($activeNav != 'main.php') {
        $is_main = false;
    } else {
        $is_main = true;
    }
    global $menus;
    $menuMark = array();
    foreach ($menus as $key => $menu) {
        if ($activeNav == $menu['url']) {
            $menuMark['name'] = $realMenus[$menu['parent']]['key'];
            $menuMark['count'] = $realMenus[$menu['parent']]['count'];
            break;
        }
    }
    assign('menu_mark', $menuMark);
    assign('is_main', $is_main);
    assign('active_nav', $activeNav);
    assign('pageTitle', $config['site_name'] . '-管理后台');
    assign('currentAdmin', $_SESSION['name']);
}
Exemple #3
0
<?php

$nav_active = get_active_nav();
?>
		<nav id="hua-nav" class="navbar navbar-default <?php 
if (defined("NAV_FIX")) {
    echo " navbar-fixed-top";
}
?>
">
		  <div class="container-fluid">
		    <!-- Brand and toggle get grouped for better mobile display -->
		    <div class="navbar-header">
		      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#hua-navbar-collapse" aria-expanded="false">
		        <span class="sr-only">Toggle navigation</span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		      </button>
		      <a class="navbar-brand" href="/">
				<img alt="Brand" src="<?php 
echo get_template_directory_uri() . '/images/avatar_64.jpg';
?>
">
		 	  </a>
		    </div>
		
		    <!-- Collect the nav links, forms, and other content for toggling -->
		    <div class="collapse navbar-collapse" id="hua-navbar-collapse">
		      <ul class="nav navbar-nav">
		        <li<?php 
/**
 * 后台文件初始化,检查是否已登陆,根据权限生成菜单,assign通用信息
 * @author 王仁欢
 * @date 2015-08-05
 * @return void
 */
function back_base_init()
{
    //是否已登陆
    if (!check_admin_login()) {
        show_system_message('请先登陆', array(array('link' => 'index.php', 'alt' => '登陆')));
        exit;
    }
    $activeNav = get_active_nav();
    $realMenus = create_menu();
    if ($activeNav != 'main.php') {
        $is_main = false;
    } else {
        $is_main = true;
    }
    global $menus;
    $menuMark = array();
    foreach ($menus as $key => $menu) {
        if ($activeNav == $menu['url']) {
            $menuMark['name'] = $realMenus[$menu['parent']]['key'];
            $menuMark['count'] = $realMenus[$menu['parent']]['count'];
            break;
        }
    }
    assign('menuMark', $menuMark);
    assign('is_main', $is_main);
    assign('activeNav', $activeNav);
    assign('pageTitle', '三级分销系统-管理后台');
    assign('currentAdmin', $_SESSION['name']);
    //待处理商户数量
    global $db;
    $get_business_exam_count = 'select count(*) from ' . $db->table('business') . ' where status = 1';
    $business_exam_count = $db->fetchOne($get_business_exam_count);
    $get_business_auth_count = 'select count(*) from ' . $db->table('auth') . ' where status = 0';
    $business_auth_count = $db->fetchOne($get_business_auth_count);
    $business_deal_count = $business_auth_count + $business_exam_count;
    assign('business_deal_count', $business_deal_count);
    //待处理产品数量
    $get_product_exam_count = 'select count(*) from ' . $db->table('product') . ' where status = 2';
    $product_exam_count = $db->fetchOne($get_product_exam_count);
    assign('product_exam_count', $product_exam_count);
    //待处理提现
    $get_member_withdraw_deal_count = 'select count(*) from' . $db->table('withdraw') . ' where status = 0';
    $member_withdraw_deal_count = $db->fetchOne($get_member_withdraw_deal_count);
    $get_business_withdraw_deal_count = 'select count(*) from' . $db->table('business_withdraw') . ' where status = 0';
    $business_withdraw_deal_count = $db->fetchOne($get_business_withdraw_deal_count);
    $withdraw_deal_count = $member_withdraw_deal_count + $business_withdraw_deal_count;
    //待处理充值
    $get_recharge_deal_count = 'select count(*) from ' . $db->table('recharge') . ' where status = 2 and `type` = 1';
    $recharge_deal_count = $db->fetchOne($get_recharge_deal_count);
    $finance_count = $withdraw_deal_count + $recharge_deal_count;
    assign('member_withdraw_count', $member_withdraw_deal_count);
    assign('business_withdraw_count', $business_withdraw_deal_count);
    assign('withdraw_deal_count', $withdraw_deal_count);
    assign('recharge_deal_count', $recharge_deal_count);
    assign('finance_count', $finance_count);
}