12345678910111213141516171819202122232425262728293031 |
- <?php
- global $_GPC, $_W;
- $GLOBALS['frames'] = $this->getMainMenu();
- $info = pdo_get('zhtc_top',array('uniacid' => $_W['uniacid'],'id'=>$_GPC['id']));
- if(checksubmit('submit')){
- $data['type']=$_GPC['type'];
- $data['money']=$_GPC['money'];
- $data['money2']=$_GPC['money2'];
- $data['num']=$_GPC['num'];
- $data['uniacid']=$_W['uniacid'];
- $rst=pdo_get('zhtc_top',array('type'=>$_GPC['type'],'uniacid'=>$_W['uniacid'],'id !='=>$_GPC['id']));
- if($rst){
- message('该期限已存在请重新添加','','error');
- }
- if($_GPC['id']==''){
- $res=pdo_insert('zhtc_top',$data);
- if($res){
- message('添加成功',$this->createWebUrl('top',array()),'success');
- }else{
- message('添加失败','','error');
- }
- }else{
- $res = pdo_update('zhtc_top', $data, array('id' => $_GPC['id']));
- if($res){
- message('编辑成功',$this->createWebUrl('top',array()),'success');
- }else{
- message('编辑失败','','error');
- }
- }
- }
- include $this->template('web/addtop');
|