Beispiel #1
0
    $Base->ErrorMsg('非超级管理员无法管理!');
    exit;
}
switch ($action) {
    case "new_ovoafile":
        echo "<form style=\"margin:0px;  \" action=\"upload.php?action=upload_ovoa&dizhi=" . $dizhi . "&rstform=" . $rstform . "&introduce=" . $introduce . "\" method=\"post\" enctype=\"multipart/form-data\" name=\"fileform\" id=\"fileform\">";
        echo "<input name=\"attachment\" type=\"file\" style=\"width:160px;\"/>\n";
        echo "<input type='submit' class=\"button\" value='上传'/>&nbsp;";
        break;
    case "upload_ovoa":
        $files = $_FILES['attachment'];
        if (empty($files['name'])) {
            $Base->WarnBack("请选择文件!");
            exit;
        }
        $File->Upload_ovoafile($files, $dizhi, $rstform);
        break;
    case "view":
        //$smarty->debugging = true;
        $Admin->CheckLogin();
        $sql = "SELECT * FROM `" . $db_prefix . "file` ORDER BY `file_id` DESC";
        $_SESSION['session_sql'] = $sql;
        $pageno = intval($_REQUEST['page']);
        if ($pageno == 0 || $pageno < 0) {
            $pageno = 1;
        }
        $recordcount = $Db->RowsAll($sql);
        $pagerecord = 10;
        //每页记录数
        $page_num = intval($recordcount / $pagerecord);
        if ($recordcount != 0 and $recordcount % $pagerecord > 0 or $recordcount == 0) {