Beispiel #1
0
        $_POST['thumbnail'] = $_POST['photo'][0]['photo'];
    } else {
        $_POST['thumbnail'] = $_POST['photo'];
    }
    $objWebInit->saveInfo($_POST, 0);
    if ($arrGWeb['file_static']) {
        //生成静态页面
        $intID = $objWebInit->getMaxID() - 1;
        $strDir = ceil($intID / $arrGCache['cache_filenum']);
        $objCache = new cache($arrGCache['cache_root'] . '-' . $strDir . '/' . $intID . $arrGWeb['file_suffix'], $arrGCache['cache_time']);
        $objCache->cache_start();
        $strContents = @file_get_contents('http://' . $_SERVER["HTTP_HOST"] . '/' . $arrGWeb['module_id'] . '/detail.php?id=' . $intID);
        if ($strContents) {
            echo $strContents;
        }
        $objCache->cache_end(false);
    }
    check::WindowLocation('index.php', 'page=' . $_GET['page']);
}
if (!is_array($arrMType) || empty($arrMType)) {
    $arrMType = $objWebInit->getTypeList();
    $arrMType = $objWebInit->formatTypeList(0, $arrMType);
}
$_SESSION['submitpasskey'] = md5(md5(time()));
//print_r($arrMType);
// 输出到模板
$arrMOutput["smarty_assign"]['arrType'] = $arrMType;
$arrMOutput["smarty_assign"]['FileCallPath'] = $arrGPic['FileCallPath'];
$arrMOutput["smarty_assign"]['FileListPicSize'] = $arrGPic['FileListPicSize'];
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['adminu_main_dir'] . 'submit.htm';
$objWebInit->output($arrMOutput);
Beispiel #2
0
$objWebInit->setDBG($arrGPdoDB);
//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);