Ejemplo n.º 1
0
}
$where = ' 1 = 1 ';
switch ($a) {
    case 'list':
    default:
        //list
        //*******************************************查询类别信息******************************************************
        if (empty($classid)) {
        } else {
            $where = $where . ' and id = ' . $classid . ' ';
        }
        if (isset($filename) && !empty($filename)) {
            $where = $where . " and `filename` = '" . $filename . "' ";
        }
        $info = array();
        $info = $products_class->GetInfo(array('id', 'title', 'seotitle', 'seokeyword', 'seointro', 'filename', 'listnum', 'linkurl', 'intro', 'thumb'), $where);
        //*******************************************查询类别信息 end ******************************************************
        if (empty($info)) {
            $errorInfo = '变量错误';
            errorinfo($errorInfo, '');
        }
        //20120919
        if (isset($filename) && !empty($filename)) {
            $classid = $info['id'];
        }
        $topTitle = $info['title'];
        //20120808 //20120919
        if (empty($classid) && empty($filename)) {
            $topTitle = '列表';
        }
        //seo新增 20120706
Ejemplo n.º 2
0
         $templatefile = $moduleRoot . WEB_APP . 'templates/' . 'products_class_list.tpl.php';
     }
     break;
 case 'edit':
     //
     if (isset($submit)) {
         $info = array();
         $time = time();
         if (isset($id)) {
             $id = intval($id);
             if ($id <= 0) {
                 errorinfo('变量错误', '');
             }
             //20120719
             checkClassPower('products', $id);
             $infoold = $products_class->GetInfo('', ' id = ' . $id);
             //改变分类从属判断
             if ($parentid != $infoold['parentid']) {
                 $classNum = $products_class->GetClassCount($id);
                 if ($classNum > 0) {
                     errorinfo('对不起,该分类有子分类', '');
                 }
             }
         }
         //分析根分类
         if ($parentid == 0) {
             $rootid = 0;
         } else {
             $parent = $products_class->GetInfo('', ' id = ' . $parentid);
             if ($parent['parentid'] == 0) {
                 $rootid = $parentid;