Example #1
0
<?php

/*
 * Created on 2011-8-28
 *======================================
 *Author: Allen
 *Project:health360
 *File: index.php  
 *Date: 2011-8-28
 *======================================
 */
require '../include/init.php';
$method = $_GET['method'];
$login = new login();
$news = $login->checkLogined();
if (empty($method)) {
    $lang_method = $_LANG['ADD'];
    $method = 'select';
}
if ($method === 'select') {
    select();
    $lang_method = $_LANG['ADD'];
    $view_file = "category.tpl";
}
if ($method === 'update') {
    $method = 'update';
    update();
    $lang_method = $_LANG['UPDATE'];
    $view_file = "category.tpl";
}
if ($method === 'delete') {
Example #2
0
/*联系人列表*/
require ROOT_PATH . 'include/class/contact_class.php';
/*短信发送*/
require ROOT_PATH . 'include/class/message_class.php';
/*API*/
require ROOT_PATH . 'include/class/api_class.php';
/* 设置收费标准 */
require ROOT_PATH . 'include/class/setUpCharge_class.php';
if (!isset($_SESSION['token'])) {
    $token = mt_rand(0, 1000000);
    $_SESSION['token'] = $token;
}
$currentPage = explode("/", curPageURL());
if ($currentPage[count($currentPage) - 1] != "login.php" && $currentPage[count($currentPage) - 2] != "api") {
    $login = new login();
    $news = $login->checkLogined($currentPage[count($currentPage) - 2]);
    if (!$news == true) {
        header("location:login.php");
    } else {
        if ($currentPage[count($currentPage) - 2] == 'customer') {
            //显示账户余额
            $company = new Company();
            $company->company_id = $_SESSION['user']['customer']->company_id;
            $balance = $company->getBalanceByCompanyId();
            $smarty->assign("balance", $balance);
        }
    }
}
//根据用户角色显示导航
$smarty->assign("admin_menu", get_menu($admin_link));
$smarty->assign("customer_menu", get_menu($customer_link));