Exemple #1
0
 * @package		ArthurXF
 * @subpackage	Newspapers_magazines
 */
require_once 'config/config.inc.php';
require_once "class/Newspapers_magazines.class.php";
$objWebInit = new Newspapers_magazines();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
$objWebInit->db();
if (!is_array($arrMType) || empty($arrMType)) {
    $arrMType = $objWebInit->getTypeList();
    $arrMType = $objWebInit->formatTypeList(0, $arrMType);
}
foreach ($arrMType as $k => $v) {
    $arrTopNewspapers_magazines[$k] = array();
    if (is_array($v)) {
        $arrTopNewspapers_magazines[$k]['type_title'] = $v['type_title'];
        $arrTopNewspapers_magazines[$k]['type_id'] = $v['type_id'];
    } else {
        $arrTopNewspapers_magazines[$k]['type_title'] = $v;
        $arrTopNewspapers_magazines[$k]['type_id'] = $k;
    }
    $arrTopNewspapers_magazines[$k]['datas'] = $objWebInit->getInfoList("where pass=1 and type_id=" . $arrTopNewspapers_magazines[$k]['type_id'], "  ORDER BY recommendflag DESC,clicktimes DESC,submit_date DESC", 0, 12, true, '', false);
}
// 输出到模板
$arrMOutput["smarty_assign"]['arrTopNewspapers_magazines'] = $arrTopNewspapers_magazines;
$arrMOutput["smarty_assign"]['arrMType'] = $arrMType;
Exemple #2
0
//smarty参数
$arrMOutput["template_file"] = "admin.html";
$objWebInit->arrGSmarty = $arrGSmarty;
$objWebInit->db();
//图形参数
$objWebInit->arrGPic = $arrGPic;
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        // 显示新增页面
        case 'add':
            $arrTypeList = $objWebInit->getTypeList(null, ' order by type_id desc');
            $arrTypeList = $objWebInit->formatTypeList(0, $arrTypeList);
            $arrMOutput["smarty_assign"]['arrData'] = $arrTypeList;
            $arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'add_category.htm';
            $objWebInit->output($arrMOutput);
            break;
            // 新增课程培训类型
        // 新增课程培训类型
        case 'insert':
            if (empty($_POST['type_title'])) {
                check::AlertExit("错误:提交数据为空!", -1);
            }
            if (!empty($_POST['type_link'])) {
                $_POST['type_link'] = str_replace("http://", "", strtolower($_POST['type_link']));
            }
            $objWebInit->makeInsertType($_POST);
            unset($_GET['action']);