标签:io os sp java on cti 代码 bs ad
<?php
// 本类由系统自动生成,仅供测试用途
class IndexAction extends Action {
public function index(){
$this->display("essay");
}
function add_essay()
{
date_default_timezone_set(‘Asia/Shanghai‘);
$M=M("essay");
$data=$_POST;
$data[‘publishtime‘]=date(‘y-m-d H:i:s‘,time());
//print_r($data);exit;
$q=$M->add($data);
echo "<script language=‘javascript‘>alert(‘success‘);location.href=‘".__URL__."/essay_list‘;</script>";
}
function essay_list()
{
$M=M("essay");
$data=$M->select();
//print_r($data);exit;
$this->assign("data",$data);
$this->display("essaylist");
}
function essay_update()
{
$M=M("essay");
$ID=$_GET[‘id‘];
$data=$M->where("eid=".$ID."")->select();
//print_r($data);exit;
$this->assign("data",$data);
$this->display("userupdate");
}
function do_update()
{
date_default_timezone_set(‘Asia/Shanghai‘);
$M=M("essay");
$id=$_POST[‘id‘];
$data=$_POST;
$data[‘in_date‘]=date(‘y-m-d H:i:s‘,time());
$M->where("id=".$id."")->save($data);
echo "<script language=‘javascript‘>alert(‘success‘);location.href=‘".__URL__."/essay_list‘;</script>";
}
function essay_delete()
{
$M=M("essay");
$ID=$_GET[‘id‘];
$data=$M->where("eid=".$ID."")->delete();
$this->display("essayupdate");
echo "<script language=‘javascript‘>alert(‘success‘);location.href=‘".__URL__."/essay_list‘;</script>";
}
}
标签:io os sp java on cti 代码 bs ad
原文地址:http://www.cnblogs.com/xiaoying1019/p/4106692.html