1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- global $_GPC, $_W;
- // $action = 'ad';
- // $title = $this->actions_titles[$action];
- $GLOBALS['frames'] = $this->getMainMenu();
- $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
- if ($operation == 'display') {
- $list = pdo_getall('zhtc_help',array('uniacid'=>$_W['uniacid']),array() , '' , 'sort ASC');
-
- } elseif ($operation == 'post') {
- $list = pdo_get('zhtc_help',array('id'=>$_GPC['id']));
- if(checksubmit('submit')){
-
- $data['created_time']=date("Y-m-d H:i:s");
- $data['question']=$_GPC['question'];
- $data['answer']=html_entity_decode($_GPC['answer']);
- $data['sort']=$_GPC['sort'];
- $data['uniacid']=$_W['uniacid'];
- if($_GPC['id']==''){
- $res=pdo_insert('zhtc_help',$data);
- if($res){
- message('添加成功',$this->createWebUrl('help',array()),'success');
- }else{
- message('添加失败','','error');
- }
- }else{
- $res = pdo_update('zhtc_help', $data, array('id' => $_GPC['id']));
- if($res){
- message('编辑成功',$this->createWebUrl('help',array()),'success');
- }else{
- message('编辑失败','','error');
- }
- }
- }
- } elseif ($operation == 'delete') {
- $id=$_GPC['id'];
-
- $result = pdo_delete('zhtc_help', array('id'=>$id));
- if($result){
- message('删除成功',$this->createWebUrl('help',array()),'success');
- }else{
- message('删除失败','','error');
- }
- }
- include $this->template('web/help');
|