コード例 #1
0
ファイル: modnews.php プロジェクト: Minionstim/DayNews
<?php

header("content-type:text/html;charset=utf-8");
include_once '../dbio/NewsArticles.php';
include_once '../dbio/NewsTypes.php';
include_once 'nologin.php';
$articleId = $_GET['articleId'];
$deleteNews = NewsArticles::deleteNews($articleId);
if ($deleteNews != '') {
    $typeId = $_GET['typeId'];
    $delNums = NewsTypes::delNums($typeId);
}
//print_r(delNums);
//获得表单提交的数据
$searchType = $_POST["searchType"];
$keyword = $_POST["keyword"];
$currentPage = $_POST["currentPage"];
//当前页的页码
$currentPage = $currentPage == NULL ? 1 : $currentPage;
//搜索新闻
if ($keyword != NULL) {
    $result = NewsArticles::getNewsInfo($currentPage, $keyword, $searchType);
    $totalPage = $result[0];
    $newsInfo = $result[1];
} else {
    $result = NewsArticles::getNewsInfo($currentPage);
    //所有新闻
    $totalPage = $result[0];
    $newsInfo = $result[1];
}
?>