?>
&do=info&cn=<?php 
echo $className . ($_GET["ntype"] ? '&ntype=' . $_GET["ntype"] : '');
?>
">新增分類</a>
  </div>
  <table cellspacing="0" cellpadding="0" class="Admin_L">
    <tr>
      <th scope="col" class="T_title" width="50">ID</th>
      <th scope="col" class="T_title">分類名稱</th>
      <th scope="col" width="50" style="text-align: center;">排序</th>
      <th scope="col" class="N_title" width="85"><label>是否啟用</label></th>
      <th scope="col" width="70" style="text-align: center;">操作</th>
    </tr>
    <?php 
$list = resetArray(0, $list);
unset($pageCtrl);
foreach ($list as $val) {
    ?>
    <tr class="Ls2">
      <td class="N_title"><?php 
    echo $val["id"];
    ?>
</td>
      <td class="N_title"><?php 
    echo ($val["flag"] > 0 ? $val["indent"] . "├ " : "") . $val['name'];
    ?>
</td>
      <td><input postType="<?php 
    echo $_GET['cn'];
    ?>
function createmenu($array, $imgRootPath, $divIdPrefix = "", $parent_id = 0)
{
    $result = "";
    $rs = resetArray($parent_id, $array);
    $result = '<div class="tree_menu" id="' . $divIdPrefix . '_tree_menu" >';
    for ($i = 0; $i < count($rs); $i++) {
        $result .= "<div width='100%'>";
        for ($j = 0; $j < $rs[$i]["flag"]; $j++) {
            if ($rs[$i]["name"] && $j + 1 == $rs[$i]["flag"]) {
                if ($rs[$i + 1]["parent_id"] == $rs[$i]["parent_id"]) {
                    $result .= '<img src="' . $imgRootPath . 'style/tree/H.gif">';
                } else {
                    if ($rs[$i]["flag"] <= $rs[$i + 1]["flag"] + 1) {
                        $result .= '<img src="' . $imgRootPath . 'style/tree/H.gif">';
                    } else {
                        $result .= '<img src="' . $imgRootPath . 'style/tree/L.gif">';
                    }
                }
                //echo "<hr />";
            } else {
                $result .= '<img src="' . $imgRootPath . 'style/tree/I.gif">';
            }
        }
        $rsid = $rs[$i]["id"];
        $flag_img = "nfolder.gif";
        $onclick = "";
        $A_onclick = "";
        if (hasSub($rs[$i]["id"], $array)) {
            $flag_img = "ofolder.gif";
            //隱藏
            if ($rs[$i]["hide_sub"] == 1) {
                $flag_img = "folder.gif";
            }
            $onclick = ' onclick="OnClickOutline(\'' . $imgRootPath . '\',' . $rsid . ')" ';
            $A_onclick = "javascript:OnClickOutline('" . $imgRootPath . "'," . $rsid . ")";
        }
        $result .= '<img class="Outline" id="ID' . $rsid . '" style="CURSOR: pointer" ' . $onclick . ' alt="" src="' . $imgRootPath . 'style/tree/' . $flag_img . '" />&nbsp;';
        if ($rs[$i]["link"]) {
            $result .= '<a href="' . $rs[$i]["link"] . '">';
        } else {
            if ($A_onclick) {
                $result .= '<a href=' . $A_onclick;
            } else {
                $result .= '<a href="javascript:void(0);"';
            }
            //			$result.='<a href="javascript:void(0);"';
            //			if($onclick) $result.=$onclick;
            $result .= '>';
        }
        $result .= $rs[$i]["name"];
        $result .= '</a>';
        $result .= "</div>";
        //		if($rs[$i]["pid"]==0) $result.= "<br />";
        //</div>
        if ($rs[$i]["flag"] > $rs[$i + 1]["flag"]) {
            $div_n = $rs[$i]["flag"] - $rs[$i + 1]["flag"];
            for ($div_i = 0; $div_i < $div_n; $div_i++) {
                $result .= "</div>";
            }
        }
        //end </div>
        //<div>
        if (hasSub($rs[$i]["id"], $array)) {
            $result .= '<div id="ID' . $rsid . 'd"';
            if ($rs[$i]["hide_sub"] == 1) {
                $result .= ' style="display:none" ';
            }
            $result .= '>';
        }
        //end <div>
    }
    //$result.= '  <div id="infodisplay"><font color="#999999">點擊+展開節點</font></div>';
    $result .= '</div>';
    $result .= "<script>";
    $result .= "\t\$('#" . $divIdPrefix . "_tree_menu a').click(function (){";
    $result .= "\t\tif(\$(this).attr('href')!='javascript:void(0);') {";
    $result .= "\t\t\tSetCookie('" . $divIdPrefix . "_tree_menu',\$(this).attr('href'));";
    $result .= "\t\t\tSetCookie('" . $divIdPrefix . "_menu_name',\$(this).text());";
    $result .= "\t}});";
    $result .= "\ttree_menu_setNow(GetCookie('" . $divIdPrefix . "_tree_menu'),'" . $divIdPrefix . "_tree_menu');";
    $result .= "</script>";
    return $result;
}
?>
					</select>
					<input class="sub2" id="submitBtn" type="submit" value="修改">
				</span>
  </div>
<table style="margin-top:10px;"  cellspacing="0" cellpadding="0" class="tab" width="98%">
	<tr>
		<th align="left"><input type="checkbox" id="menu_selectAll" value="1" onclick="power_selectAll('menu_selectAll','menu_item_')" >選單</th>
		<th align="left"><input type="checkbox" id="list_selectAll" value="1" onclick="power_selectAll('list_selectAll','list_')">列表</th>
		<th align="left"><input type="checkbox" id="add_selectAll" value="1" onclick="power_selectAll('add_selectAll','add_')" >新增</th>
		<th align="left"><input type="checkbox" id="edit_selectAll" value="1" onclick="power_selectAll('edit_selectAll','edit_')" >修改</th>
		<th align="left"><input type="checkbox" id="delete_selectAll" value="1" onclick="power_selectAll('delete_selectAll','delete_')" >刪除</th>
	</tr>
	<?php 
$class = new section();
foreach (resetArray(0, $class->getList()) as $rs) {
    ?>
	<tr onMouseOver="this.bgColor='#00CCFF'" onMouseOut="this.bgColor='#FFFFFF'">
		<td><input type="checkbox" name="perm_id[]" pid="<?php 
    echo $rs['parent_id'];
    ?>
" id="menu_item_<?php 
    echo $rs["id"];
    ?>
_END" value="<?php 
    echo $rs["id"];
    ?>
" onclick="power_selectAll('menu_item_<?php 
    echo $rs["id"];
    ?>
_END','_item_<?php