<?php
/*
秀影EasyFramework框架
qq:24498936
msn:jdzcn_net@hotmail.com
website:http://www.vodcms.com
*/
class SystemlogController extends Easy_Controller_Action {
	public function init(){
		
	}
	public function indexAction(){
		$keyword = trim($this->_Request->getParams('keyword'));
		$type = intval($this->_Request->getParams('type'));
		$stime = $this->_Request->getParams('stime');
		$etime = $this->_Request->getParams('etime');
		if ($keyword){
			if ($type ==0){
				$this->_View->systemlog = systemlog::search("admin like '%".$keyword."%'");
			}else{
				$this->_View->systemlog = systemlog::search("message like '%".$keyword."%'");
			}
		}elseif ($stime && $etime){
			$this->_View->systemlog = systemlog::search('addtime<='.strtotime($stime).' OR addtime>='.strtotime($etime));
		}else{
			$this->_View->systemlog = systemlog::getAll();
		}
		$this->_View->printpage = systemlog::$printpage;
	}
	public function deleteAction(){
		$id = $this->_Request->getParam('id');
		systemlog::delete($id);
		$this->_View->message = _('删除成功!');
		exit($this->_View->render('message'));
	}
}