addyellowtype2.inc.php 963 B

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