/** * [编辑文章] * By:0x584A * Date:2015年9月21日 12:54:46 */ public function editartice() { // 接收ID $aid = intval($_REQUEST['editid']); // 实例化 $article = new ArticeModel(); $types = new SortArticleModel(); $type = $types->getAllType(); $list = $article->getById($aid); include_once VIEW_DIR . '/edit_artice.html'; }
/** * 删除文章 * By:0x584A * Date:2015年9月21日 12:56:39 */ public function delartice() { // 接收删除ID $aid = intval($_REQUEST['delid']); //判断删除的文章是否存在 $article = new ArticeModel(); $title = $article->getById($aid); if ($title) { $article->deleteByID($aid); $logs = new LogsModel(); $logs->insertOne($_SESSION['adminuser']['u_name'] . "删除文章【" . $title['a_title'] . "】成功"); $this->success('index.php?c=index&a=listartice', '删除成功..'); } else { $logs = new LogsModel(); $logs->insertOne($_SESSION['adminuser']['u_name'] . "删除文章【" . $title['a_title'] . "】<font style='color:red'>失败</font>"); $this->error("index.php?c=index&a=listartice", '删除失败,请联系管理员..'); } }