addgrouptype.inc.php 935 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $info = pdo_get('zhtc_grouptype',array('uniacid' => $_W['uniacid'],'id'=>$_GPC['id']));
  5. if(checksubmit('submit')){
  6. if($info['img']!=$_GPC['img']){
  7. $data['img']=$_W['attachurl'].$_GPC['img'];
  8. }else{
  9. $data['img']=$_GPC['img'];
  10. }
  11. $data['num']=$_GPC['num'];
  12. $data['name']=$_GPC['name'];
  13. $data['uniacid']=$_W['uniacid'];
  14. if($_GPC['id']==''){
  15. $res=pdo_insert('zhtc_grouptype',$data);
  16. if($res){
  17. message('添加成功',$this->createWebUrl('grouptype',array()),'success');
  18. }else{
  19. message('添加失败','','error');
  20. }
  21. }else{
  22. $res = pdo_update('zhtc_grouptype', $data, array('id' => $_GPC['id']));
  23. if($res){
  24. message('编辑成功',$this->createWebUrl('grouptype',array()),'success');
  25. }else{
  26. message('编辑失败','','error');
  27. }
  28. }
  29. }
  30. include $this->template('web/addgrouptype');