Пример #1
0
<?php

//-----------------------------
//	Programmer	: SH.Jafarkhani
//	Date		: 1390-02
//-----------------------------
include 'header.inc.php';
require_once 'management/framework.class.php';
if (empty($_REQUEST["SystemID"])) {
    die;
}
$_SESSION['USER']["RecentSystems"][$_REQUEST["SystemID"]] = true;
$_SESSION["SystemID"] = $_REQUEST["SystemID"];
$menus = FRW_access::getAccessMenus($_REQUEST["SystemID"]);
$groupArr = array();
$menuStr = "";
for ($i = 0; $i < count($menus); $i++) {
    if (!isset($groupArr[$menus[$i]["GroupID"]])) {
        if ($i > 0) {
            $menuStr = substr($menuStr, 0, strlen($menuStr) - 1);
            $menuStr .= "]}]},";
        }
        $menuStr .= "{\n\t\t\txtype : 'panel',\n\t\t\tlayout: 'fit',\n\t\t\ttitle: '" . $menus[$i]["GroupDesc"] . "',\n\t\t\titems :[{\n\t\t\t\txtype : 'menu',\n\t\t\t\tfloating: false,\n\t\t\t\tbodyStyle : 'background-color:white !important;',\n\t\t\t\titems :[";
        $groupArr[$menus[$i]["GroupID"]] = true;
    }
    $icon = $menus[$i]['icon'];
    $icon = !$icon ? "/generalUI/ext4/resources/themes/icons/star.gif" : "/generalUI/ext4/resources/themes/icons/{$icon}";
    $link_path = "/" . $menus[$i]['SysPath'] . "/" . $menus[$i]['MenuPath'];
    $param = "{";
    $param .= "MenuID : " . $menus[$i]['MenuID'] . ",";
    //--------- extract params --------------
Пример #2
0
$systems = FRW_access::getAccessSystems();
$menuStr = "";
foreach ($systems as $sysRow) {
    $menuStr .= "{text: '" . $sysRow["SysName"] . "',arrowCls:'none',icon : 'icons/app.png'";
    if ($sysRow["SystemID"] == "2") {
        $dt = PdoDataAccess::runquery("\r\n\t\t\tselect * from ACC_UserState \r\n\t\t\t\tjoin BSC_branches using(BranchID)\r\n\t\t\t\tjoin ACC_cycles using(CycleID)\r\n\t\t\twhere PersonID=?", array($_SESSION["USER"]["PersonID"]));
        if (count($dt) > 0) {
            $_SESSION["accounting"]["BranchID"] = $dt[0]["BranchID"];
            $_SESSION["accounting"]["CycleID"] = $dt[0]["CycleID"];
            $_SESSION["accounting"]["CycleYear"] = $dt[0]["CycleYear"];
            $_SESSION["accounting"]["BranchName"] = $dt[0]["BranchName"];
            $_SESSION["accounting"]["DefaultBankTafsiliID"] = $dt[0]["DefaultBankTafsiliID"];
            $_SESSION["accounting"]["DefaultAccountTafsiliID"] = $dt[0]["DefaultAccountTafsiliID"];
        }
    }
    $menus = FRW_access::getAccessMenus($sysRow["SystemID"]);
    if (count($menus) > 0) {
        $menuStr .= ",menu : {xtype : 'menu',bodyStyle: 'background:white !important;',items:[";
    }
    //........................................................
    $groupArr = array();
    foreach ($menus as $row) {
        if (!isset($groupArr[$row["GroupID"]])) {
            if (count($groupArr) > 0) {
                $menuStr = substr($menuStr, 0, strlen($menuStr) - 1);
                $menuStr .= "]}},";
            }
            $icon = $row['GroupIcon'];
            $icon = !$icon ? "/generalUI/ext4/resources/themes/icons/star.gif" : "/generalUI/ext4/resources/themes/icons/{$icon}";
            $menuStr .= "{text : '" . $row["GroupDesc"] . "', icon: '" . $icon . "', menu :{bodyStyle: 'background:white !important;',items:[";
            $groupArr[$row["GroupID"]] = true;