<?php include_once 'includes/class/basic/NEATCategory.class.php'; include_once 'includes/class/basic/NEATCache.class.php'; $db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE); $NBS = new NEATBulidSql(TB_CATE); $NC = new NEAT_CATEGORY(); $NCA = new NEAT_CACHE(); $NCA->setCachePath('tmp/'); $NCA->setCacheFile('categoryCache'); $NC->setTable(TB_CATE); $catData['id'] = 'id'; $catData['pid'] = 'pid'; $catData['orderid'] = 'orderid'; $NC->setField($catData); $NC->setNDB($db); $NC->setNBS($NBS); $NC->setNCA($NCA); $getarray = $NC->readCategoryCache(); if (!is_array($getarray)) { $getarray = array(); } foreach ($getarray as $k => $v) { !$i[$v['pid']] ? $i[$v['pid']] = 1 : $i[$v['pid']]++; $categoryPostion[$v['pid']][$v['id']] = $i[$v['pid']]; } $last = '<img src=images/tree_ico/join.gif> '; $i = 0; foreach ($getarray as $key => $val) { $num = count($categoryPostion[$val['pid']]); if ($categoryPostion[$val['pid']][$val['id']] == 1 and $categoryPostion[$val['pid']][$val['id']] != $num) {
<?php include_once 'includes/class/basic/NEATCategory.class.php'; include_once 'includes/class/basic/NEATCache.class.php'; $NC = new NEAT_CATEGORY(); $NBS = new NEATBulidSql(TB_CATE); $NCA = new NEAT_CACHE(); $NDB = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE); $NCA->setCachePath('tmp/'); $NCA->setCacheFile('categoryCache'); $NC->setTable(TB_CATE); $catData['id'] = 'id'; $catData['pid'] = 'pid'; $catData['orderid'] = 'orderid'; $NC->setField($catData); $NC->setNDB($NDB); $NC->setNBS($NBS); $NC->setNCA($NCA); if (!$_GET['action']) { $getarray = $NC->readCategoryCache(); if (!is_array($getarray)) { $getarray = array(); } $last = '├─'; $option = '<option value=0>根目录</option>'; foreach ($getarray as $key => $val) { $itemTemp = str_repeat('│', $val['deep']); $_GET['CID'] == $val['id'] ? $selected = ' selected' : ($selected = ''); $option .= '<option' . $selected . ' value="' . $val['id'] . '">' . $itemTemp . $last . $val['title'] . '</option> '; $tree .= 'var item' . $val['id'] . ' =new treeItem("' . $val['title'] . '", \'?module=addCategory&CID=' . $val['id'] . '\');