denycontroller.php

来自「a short sketch about linux syntex lines.」· PHP 代码 · 共 45 行

PHP
45
字号
<?php
/*
秀影EasyFramework框架
qq:24498936
msn:jdzcn_net@hotmail.com
website:http://www.vodcms.com
*/
class DenyController extends Easy_Controller_Action {
	public function init(){
		$this->_deny = new DenyModel();
	}
	public function IndexAction(){
		if ($this->_Request->getParams('keyword')){
			$this->_View->deny = $this->_deny->search($this->_Request->getParams('keyword'));
		}else{
			$this->_View->deny = $this->_deny->getAll();
		}
	}
	public function deleteAction(){
		$id = $this->_Request->getParam('id');
		$this->_deny->delete(array('id'=>$id));
		$this->_View->redirect('?mod=deny');
	}
	public function addAction(){
		if ($this->_Request->isPost()){
			$array = array();
			$array['title'] = $this->_Request->getPost('title');
			$array['sip'] = $this->_Request->getPost('sip');
			$array['eip'] = $this->_Request->getPost('eip');
			$array['etime'] =  strtotime($this->_Request->getPost('etime'));
			if ($this->_deny->Deny($array['title'], $array['sip'], $array['eip'], $array['etime'])===false){
				$this->_View->message = $this->_deny->error;
			}else{
				$this->_View->message = _('添加成功!');
			}
			exit($this->_View->render('message'));
		}
	}
	public function modifyAction(){
		if ($this->_Request->getParam('do') == 'locked'){
			$this->_deny->locked((int)$this->_Request->getParam('id'));
		}
		$this->_View->redirect('?mod=deny');
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?