<?php
/**
 *语音回复
**/
class VoiceresponseAction extends UserAction{
	public function index(){
		$where['uid']=session('uid');
		$where['token']=$_GET['token'];
		$res=M('Voiceresponse')->where($where)->select();
		$this->assign('info',$res);
		$this->display();
	}
	public function add(){
		$this->display();
	}
	public function edit(){
		$where['id']=$this->_get('id','intval');
		$where['uid']=session('uid');
		$res=D('Voiceresponse')->where($where)->find();
		$this->assign('info',$res);
		$this->display();
	}
	public function del(){
		$where['id']=$this->_get('id','intval');
		$where['uid']=session('uid');
		if(D(MODULE_NAME)->where($where)->delete()){
			M('Keyword')->where(array('pid'=>$where['id'],'token'=>session('token'),'module'=>'Voiceresponse'))->delete();
			$this->success('操作成功',U(MODULE_NAME.'/index'));
		}else{
			$this->error('操作失败',U(MODULE_NAME.'/index'));
		}
	}
	public function insert(){
		$this->all_insert();
	}
	public function upsave(){
		$this->all_save();
	}
}
?>