Esempio n. 1
0
<?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>&nbsp;&nbsp;';
$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) {
Esempio n. 2
0
<?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'] . '\');
Esempio n. 3
0
<?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']) {
    if (!$_GET['CID']) {
        error('您要编辑哪个分类?');
    }
    $array = $NC->getCategory($_GET['CID']);
    $pid = $array['pid'];
    $pArray = $NC->getCategory($pid);
    $getarray = $NC->readCategoryCache();
    if (!is_array($getarray)) {
        $getarray = array();
    }
    $last = '├─';
    $option = '<option value=0>根目录</option>';
Esempio n. 4
0
<?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);
$getarray = $NC->readCategoryCache();
$NC->changeOrderID($getarray, $_GET['CID'], $_GET['type']);
unset($getarray);
$catearray = $NC->getCategory();
$getarray = $NC->getTree($catearray, 0, 0, 'category');
$NC->doCategoryCache($getarray);
header('location:?module=listCategory');
Esempio n. 5
0
<?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['CID']) {
    error('您要删除什么分类?');
}
$getarray = $NC->readCategoryCache();
$delCIDList = $NC->delCategory($getarray, $_GET['CID']);
$catearray = $NC->getCategory();
$getarray = $NC->getTree($catearray, 0, 0, 'category');
$NC->doCategoryCache($getarray);
showloading('?module=listCategory', '分类删除', '分类删除完毕,现在返回分类列表', 1);
$tpShowBody = false;