예제 #1
0
         } else {
             if ($books_class->Add($info)) {
                 errorinfo('添加成功', '');
             } else {
                 errorinfo('添加失败', '');
             }
         }
     } else {
         $info = array();
         $time = time();
         if (isset($id)) {
             $id = intval($id);
             if ($id <= 0) {
                 errorinfo('变量错误', '');
             }
             $info = $books_class->GetInfo('', ' id = ' . $id);
             if (empty($info)) {
                 errorinfo('变量错误', '');
             }
         }
         if (is_file(WEB_TPL . 'books_class_edit.tpl.php')) {
             $templatefile = 'books_class_edit.tpl.php';
         } else {
             $tpl_in_module = 1;
             $templatefile = $moduleRoot . WEB_APP . 'templates/' . 'books_class_edit.tpl.php';
         }
     }
     break;
 case 'search':
     //
     break;
예제 #2
0
파일: books.php 프로젝트: zrwlc2008/abhx
    $id = intval($id);
}
if (isset($filename)) {
    $v->Validate($filename, '变量', 'safein', '1', '', 0, 100);
}
$where = ' 1 = 1 ';
switch ($a) {
    case 'list':
    default:
        //list
        if (empty($classid)) {
        } else {
            $where = $where . ' and id = ' . $classid . ' ';
        }
        $info = array();
        $info = $books_class->GetInfo(array('id', 'title'), $where);
        if (empty($info)) {
            $errorInfo = '变量错误';
            errorinfo($errorInfo, '');
        }
        $topTitle = $info['title'];
        //20120808
        if (empty($classid)) {
            $topTitle = '列表';
        }
        //列表
        if (empty($classid)) {
            $where = ' isplay = 1 ';
        } else {
            $where = " classid = '" . $classid . "' and isplay = 1 ";
        }