commission.inc.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. global $_GPC, $_W;
  3. // $action = 'ad';
  4. // $title = $this->actions_titles[$action];
  5. $GLOBALS['frames'] = $this->getMainMenu();
  6. $item=pdo_get('zhtc_yjset',array('uniacid'=>$_W['uniacid']));
  7. if(checksubmit('submit')){
  8. if($_GPC['type']==1){
  9. $data['type']=$_GPC['type'];
  10. $data['typer']=$_GPC['typer'];
  11. $data['sjper']='';
  12. $data['hyper']='';
  13. $data['pcper']='';
  14. $data['tzper']='';
  15. }
  16. if($_GPC['type']==2){
  17. $data['type']=$_GPC['type'];
  18. $data['typer']='';
  19. $data['sjper']=$_GPC['sjper'];
  20. $data['hyper']=$_GPC['hyper'];
  21. $data['pcper']=$_GPC['pcper'];
  22. $data['tzper']=$_GPC['tzper'];
  23. }
  24. $data['uniacid']=$_W['uniacid'];
  25. if($_GPC['id']==''){
  26. $res=pdo_insert('zhtc_yjset',$data);
  27. if($res){
  28. message('添加成功',$this->createWebUrl('commission',array()),'success');
  29. }else{
  30. message('添加失败','','error');
  31. }
  32. }else{
  33. $res = pdo_update('zhtc_yjset', $data, array('id' => $_GPC['id']));
  34. if($res){
  35. message('编辑成功',$this->createWebUrl('commission',array()),'success');
  36. }else{
  37. message('编辑失败','','error');
  38. }
  39. }
  40. }
  41. include $this->template('web/commission');