foreach ($menu['index']['' . $list_menu['MENU_ID'] . ''] as $menu_list) {
     $menu_2 = $menu['index'][$menu_list];
     ++$i;
     $pic_array = explode('/', $menu['index_name']['FUNC_CODE'][$menu_list]);
     $pic = $menu['index_name']['IMAGE'][$menu_list] . ".gif";
     if (is_array($menu_2)) {
         if (sizeof($menu['index']['' . $list_menu['MENU_ID'] . '']) == $i) {
             $tree_plus = 'tree_plusl.gif';
             $tree_pic3 = 'tree_transp.gif';
         } else {
             $tree_plus = 'tree_plus.gif';
             $tree_pic3 = 'tree_line.gif';
         }
         $sysfunctionid = $menu['index_name']['FUNC_ID'][$menu_list];
         parent_table_2($menu['index_name'][$FUNC_NAME_MENU][$menu_list], $menu['index_name']['MEMO'][$menu_list], $pic, $menu_list, $tree_plus, $tree_pic2);
         part_table_begin($menu_list);
         foreach ($menu_2 as $list) {
             ++$ii;
             if (sizeof($menu_2) == $ii) {
                 $tree_pic = "tree_blankl.gif";
                 $ii = 0;
             } else {
                 $tree_pic = "tree_blank.gif";
             }
             $pic_array = explode('/', $menu['index_name']['FUNC_CODE'][$list]);
             $pic = $menu['index_name']['IMAGE'][$list] . ".gif";
             menu_table_3($menu['index_name'][$FUNC_NAME_MENU][$list], $menu['index_name']['FUNC_LINK'][$list], $menu['index_name']['MEMO'][$list], $pic, $tree_pic, $tree_pic2, $tree_pic3);
         }
         //end foreach
         part_table_end();
     } else {
Beispiel #2
0
function newai_tree()
{
    global $db, $common_html, $tablename_one, $tablename_two, $link, $tablename_three;
    global $html_etc_one, $html_etc_two, $columns_one, $columns_two;
    global $tablename;
    require_once 'lib/function_menu.php';
    system_menu_css();
    global $db;
    $tablename_one_array = explode(":", $tablename_one);
    $tablename_two_array = explode(":", $tablename_two);
    $tablename_three_array = explode(":", $tablename_three);
    $columns_one = returntablecolumn($tablename_one_array[0]);
    $columns_two = returntablecolumn($tablename_two_array[0]);
    $columns_three = returntablecolumn($tablename_three_array[0]);
    $sql = "select " . $columns_one[$tablename_one_array[1]] . "," . $columns_one[$tablename_one_array[2]] . " from " . $tablename_one_array[0] . "";
    $rs_dept = $db->Execute($sql);
    $rs_dept_array = $rs_dept->GetArray();
    for ($i = 0; $i < sizeof($rs_dept_array); $i++) {
        $newarray_dept[(string) $rs_dept_array[$i][(string) $columns_one[$tablename_one_array[1]]]] = $rs_dept_array[$i][(string) $columns_one[$tablename_one_array[2]]];
        $newarray_dept_list['DEPT_NO'][$i] = $rs_dept_array[$i][(string) $columns_one[$tablename_one_array[1]]];
        $newarray_dept_list['DEPT_NAME'][$i] = $rs_dept_array[$i][(string) $columns_one[$tablename_one_array[2]]];
    }
    $sql_major = "select " . $columns_two[$tablename_two_array[1]] . "," . $columns_two[$tablename_two_array[2]] . "," . $columns_two[$tablename_two_array[3]] . " from " . $tablename_two_array[0] . "";
    $rs_major = $db->Execute($sql_major);
    $rs_major_array = $rs_major->GetArray();
    for ($i = 0; $i < sizeof($rs_major_array); $i++) {
        $newarray_major[(string) $rs_major_array[$i][(string) $columns_two[$tablename_two_array[3]]]][(string) $rs_major_array[$i][(string) $columns_two[$tablename_two_array[1]]]] = $rs_major_array[$i][(string) $columns_two[$tablename_two_array[2]]];
        $newarray_major_list[(string) $rs_major_array[$i][(string) $columns_two[$tablename_two_array[1]]]] = $rs_major_array[$i][(string) $columns_two[$tablename_two_array[2]]];
        $newarray_major_list[(string) $rs_major_array[$i][(string) $columns_two[$tablename_two_array[3]]]][$i] = $rs_major_array[$i][(string) $columns_two[$tablename_two_array[1]]];
    }
    $sql_class = "select " . $columns_three[$tablename_three_array[1]] . "," . $columns_three[$tablename_three_array[2]] . "," . $columns_three[$tablename_three_array[3]] . " from " . $tablename_three_array[0] . "";
    $rs_class = $db->Execute($sql_class);
    $rs_class_array = $rs_class->GetArray();
    for ($i = 0; $i < sizeof($rs_class_array); $i++) {
        $newarray_class[(string) $rs_class_array[$i][(string) $columns_three[$tablename_three_array[3]]]][(string) $rs_class_array[$i][(string) $columns_three[$tablename_three_array[1]]]] = $rs_class_array[$i][(string) $columns_three[$tablename_three_array[2]]];
        $newarray_class_list[(string) $rs_class_array[$i][(string) $columns_three[$tablename_three_array[1]]]] = $rs_class_array[$i][(string) $columns_three[$tablename_three_array[2]]];
        $newarray_class_list[(string) $rs_class_array[$i][(string) $columns_three[$tablename_three_array[3]]]][$i] = $rs_class_array[$i][(string) $columns_three[$tablename_three_array[1]]];
    }
    foreach ($newarray_dept_list['DEPT_NO'] as $DEPT_NO_LIST) {
        parent_table_1($newarray_dept[(string) $DEPT_NO_LIST], "system.gif", "MENU_" . $DEPT_NO_LIST, $image = 'tree_plus.gif', $addfile = 'A_Ban_newai.php?action=tree_student');
        part_table_begin($id = "MENU_" . $DEPT_NO_LIST);
        if (!is_array($newarray_major_list[(string) $DEPT_NO_LIST])) {
            $newarray_major_list[(string) $DEPT_NO_LIST] = array();
        }
        foreach ($newarray_major_list[(string) $DEPT_NO_LIST] as $MAJOR_LIST) {
            parent_table_2($newarray_major_list[$MAJOR_LIST], $pic = 'system.gif', "MENU_" . $MAJOR_LIST, 'tree_plus.gif', 'tree_line.gif', $addfile = 'A_Ban_newai.php?action=tree_student');
            part_table_begin("MENU_" . $MAJOR_LIST);
            if (!is_array($newarray_class_list[(string) $MAJOR_LIST])) {
                $newarray_class_list[(string) $MAJOR_LIST] = array();
            }
            foreach ($newarray_class_list[(string) $MAJOR_LIST] as $CLASS_LIST) {
                menu_table_3($newarray_class_list[$CLASS_LIST], $linkurl = "A_Stu_newai.php?action=init_default&所属班号={$CLASS_LIST}", $pic = 'system.gif', $tree_pic = "tree_blank.gif", $tree_pic2 = "tree_line.gif", $tree_pic3 = 'tree_line.gif', $addfile = 'A_Ban_newai.php?action=tree_student');
            }
            part_table_end();
        }
        //end rs_major_array
        part_table_end();
    }
    //end rs_dept_array
    system_menu_js($location = 'parent.main_body');
}