Пример #1
0
function showqx($menuarry, $prgqx_arr, $optqx_arr)
{
    global $loginskin;
    $show = "<table width=98% border=0 cellpadding=0 cellspacing=0>";
    for ($i = 0; $i < count($menuarry); $i++) {
        $temp_arr1 = $menuarry[$i];
        $temp_arr2 = explode("±", $temp_arr1);
        $code = $temp_arr2[0];
        //代号
        $fcode = $temp_arr2[1];
        //父代号
        $name = $temp_arr2[2];
        //名称
        $isnode = $temp_arr2[5];
        //是否为节点,1为是,0为不是,也就是代表最底
        $level = $temp_arr2[6];
        //级别
        $optqx = $temp_arr2[7];
        //新增、修改、删除权限
        $optqxcode = $temp_arr2[8];
        //新增、修改、删除权限代号
        $arr_optqx = explode("^", $optqx);
        $arr_optqxcode = explode("^", $optqxcode);
        $makeempty = makenbsp($level);
        //宿行
        if ($isnode == 1) {
            //如果是节点
            $checkbox = "";
            $show .= "<tr><td height=25 noWrap width='350' class='titlefont'>&nbsp;&nbsp;&nbsp;&nbsp;" . $makeempty . $name . ":</td></tr>";
            if ($level == 1) {
                $show .= "<tr><td align='left' colspan='2'><div style='margin:0px 0px 0px 12px;'><img src='" . $loginskin . "shortline.jpg' ></div></td></tr>";
            }
        } else {
            if ($prgqx_arr[$code] == 1) {
                //判断是否已经已有该权限
                $prg_check = "checked";
                //$prg_disabled ="disabled";
            } else {
                $prg_check = "";
                //$prg_disabled ="";
            }
            $checkbox = "<input id='code" . $code . "' type='checkbox' name='prgqx[]' value='{$code}' " . $prg_check . " >";
            $show .= "<tr><td height=25 noWrap width='350' >" . $makeempty . $checkbox . $name . "</td>";
            $show .= "<td height=25 >";
            $optqxbox = "";
            $optqx_count = count($arr_optqx);
            //新增、修改、删除权限数组
            for ($optqx_i = 0; $optqx_i < $optqx_count; $optqx_i++) {
                $optcode = $arr_optqxcode[$optqx_i];
                $optcode = intval($optcode);
                if ($optqx_arr[$code][$optcode] == 1) {
                    //判断是否已经已有该权限
                    $opt_check = "checked";
                } else {
                    $opt_check = "";
                }
                if (!empty($arr_optqx[$optqx_i])) {
                    $optqxbox .= "<input id='opt" . $arr_optqxcode[$optqx_i] . "' type='checkbox' name='optqx[{$code}][]' value=" . $arr_optqxcode[$optqx_i] . " onclick=checkcode(" . $code . ") " . $opt_check . " >";
                    $optqxbox .= "&nbsp;" . $arr_optqx[$optqx_i] . "&nbsp;&nbsp;";
                }
            }
            $show .= $optqxbox . "</td></tr>";
        }
    }
    $show .= "</table>";
    return $show;
}
Пример #2
0
function showqx($menuarry, $menu_arr, $shortcut_arr)
{
    global $loginskin;
    $show = "<table width=98% border=0 cellpadding=0 cellspacing=0>";
    $nodecount = 0;
    for ($i = 0; $i < count($menuarry); $i++) {
        $temp_arr1 = $menuarry[$i];
        $temp_arr2 = explode("±", $temp_arr1);
        $code = $temp_arr2[0];
        //代号
        $fcode = $temp_arr2[1];
        //父代号
        $name = $temp_arr2[2];
        //名称
        $isnode = $temp_arr2[5];
        //是否为节点,1为是,0为不是,也就是代表最底
        $level = $temp_arr2[6];
        //级别
        $makeempty = makenbsp($level);
        //宿行
        if ($menu_arr[$code] == 1) {
            //是否有该权限
            if ($isnode == 1) {
                //如果是节点
                $show .= "<tr><td height=25 noWrap width='98%' class='titlefont'>&nbsp;&nbsp;&nbsp;&nbsp;" . $makeempty . $name . "</td></tr>";
                if ($level == 1) {
                    $show .= "<tr><td align='left' colspan='2'>&nbsp;&nbsp;<img src='" . $loginskin . "shortline.jpg' ></td></tr>";
                }
                $nodecount = 0;
            } else {
                if ($shortcut_arr[$code] == 1) {
                    //判断该用户所属的组是否已经已有该权限
                    $prg_check = "checked";
                } else {
                    $prg_check = "";
                }
                $checkbox = "<input id='code" . $code . "' type='checkbox' name='prg_shortcut[]' value='{$code}' " . $prg_check . " >";
                if ($nodecount == 0) {
                    $show .= "<tr><td height=25 noWrap width='98%' >" . $makeempty . $checkbox . $name;
                    $nodecount++;
                } elseif ($nodecount < 5 and $nodecount > 0) {
                    $nodecount++;
                    $show .= "&nbsp;&nbsp;&nbsp;" . $checkbox . $name;
                } elseif ($nodecount == 5) {
                    $show .= "&nbsp;&nbsp;&nbsp;" . $checkbox . $name . "</td></tr>";
                    $nodecount = 0;
                }
            }
        }
    }
    $show .= "</table>";
    return $show;
}
Пример #3
0
function showqx($menuarry, $prgqx_arr, $optqx_arr, $telprgqx_arr, $teloptqx_arr)
{
    global $loginskin;
    global $userqxtype;
    $show = "<table width=98% border=0 cellpadding=0 cellspacing=0>";
    for ($i = 0; $i < count($menuarry); $i++) {
        $temp_arr1 = $menuarry[$i];
        $temp_arr2 = explode("±", $temp_arr1);
        $code = $temp_arr2[0];
        //代号
        $fcode = $temp_arr2[1];
        //父代号
        $name = $temp_arr2[2];
        //名称
        $isnode = $temp_arr2[5];
        //是否为节点,1为是,0为不是,也就是代表最底
        $level = $temp_arr2[6];
        //级别
        $optqx = $temp_arr2[7];
        //新增、修改、删除权限
        $optqxcode = $temp_arr2[8];
        //新增、修改、删除权限代号
        $optqxtype = $temp_arr2[9];
        //权限类型
        $arr_qxtype = explode("^", $optqxtype);
        if (trim($arr_qxtype[0]) == $userqxtype || trim($arr_qxtype[1]) == $userqxtype || trim($arr_qxtype[2]) == $userqxtype || trim($arr_qxtype[3]) == $userqxtype || trim($arr_qxtype[4]) == $userqxtype || trim($arr_qxtype[5]) == $userqxtype) {
            //把符合条件的菜单列出来
            $arr_optqx = explode("^", $optqx);
            $arr_optqxcode = explode("^", $optqxcode);
            $makeempty = makenbsp($level);
            //宿行
            if ($isnode == 1) {
                //如果是节点
                $checkbox = "";
                if ($level == 1) {
                    $k = 0;
                    $j = 0;
                } else {
                    $j = 0;
                    $k++;
                }
                if ($optqx == 1) {
                    $style = "style='display:none'";
                } else {
                    $style = "";
                }
                $show .= "<tr><td height=25 noWrap width='350' class='titlefont'>&nbsp;&nbsp;&nbsp;&nbsp;" . $makeempty . $name . "<INPUT id='code" . $fcode . $k . "' onclick=Checkdept(this) type=checkbox " . $style . " name=" . $code . " ></td></tr>";
                if ($level == 1) {
                    $show .= "<tr><td align='left' colspan='2'><div style='margin:0px 0px 0px 12px;'><img src='" . $loginskin . "shortline.jpg' ></div></td></tr>";
                }
            } else {
                $j++;
                if ($prgqx_arr[$code] == 1 or $telprgqx_arr[$code] == 1) {
                    //判断该用户所属的组是否已经已有该权限
                    $prg_check = "checked";
                    if ($prgqx_arr[$code] == 1) {
                        $prg_disabled = "disabled";
                    } else {
                        $prg_disabled = "";
                    }
                } else {
                    $prg_check = "";
                    $prg_disabled = "";
                }
                if ($fcode < 10) {
                    $fcode = $fcode . "0";
                }
                $checkbox = "<input id='code" . $fcode . $j . "' type='checkbox' name='prgqx[]' value='{$code}' " . $prg_check . "  " . $prg_disabled . " >";
                $show .= "<tr><td height=25 noWrap width='350' >" . $makeempty . $checkbox . $name . "</td>";
                $show .= "<td height=25 >";
                $optqxbox = "";
                $optqx_count = count($arr_optqx);
                //新增、修改、删除权限数组
                for ($optqx_i = 0; $optqx_i < $optqx_count; $optqx_i++) {
                    $optcode = $arr_optqxcode[$optqx_i];
                    $optcode = intval($optcode);
                    if ($optqx_arr[$code][$optcode] == 1 or $teloptqx_arr[$code][$optcode] == 1) {
                        //判断该用户所属的组是否已经已有该权限
                        $opt_check = "checked";
                        if ($optqx_arr[$code][$optcode] == 1) {
                            $opt_disabled = "disabled";
                        } else {
                            $opt_disabled = "";
                        }
                    } else {
                        $opt_check = "";
                        $opt_disabled = "";
                    }
                    if (!empty($arr_optqx[$optqx_i])) {
                        $arr_optqxcode[$optqx_i] = str_replace(array("\r", "\n"), array('', ''), $arr_optqxcode[$optqx_i]);
                        $optqxbox .= "<input id='opt" . $fcode . $j . $arr_optqxcode[$optqx_i] . "' type='checkbox' name='optqx[{$code}][]' value=" . $arr_optqxcode[$optqx_i] . " onclick=checkcode('" . $fcode . $j . "') " . $opt_check . " " . $opt_disabled . " >";
                        $optqxbox .= "&nbsp;" . $arr_optqx[$optqx_i] . "&nbsp;&nbsp;";
                    }
                }
                $show .= $optqxbox . "</td></tr>";
            }
        }
    }
    $show .= "</table>";
    return $show;
}