addtype2.inc.php 992 B

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