addjfgoods.inc.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $info = pdo_get('zhtc_jfgoods',array('uniacid' => $_W['uniacid'],'id'=>$_GPC['id']));
  5. $type = pdo_getall('zhtc_jftype',array('uniacid' => $_W['uniacid']));
  6. if(checksubmit('submit')){
  7. $data['name']=$_GPC['name'];
  8. $data['img']=$_GPC['img'];
  9. $data['money']=$_GPC['money'];
  10. $data['type_id']=$_GPC['type_id'];
  11. $data['goods_details']=html_entity_decode($_GPC['goods_details']);
  12. $data['process_details']=html_entity_decode($_GPC['process_details']);
  13. $data['attention_details']=html_entity_decode($_GPC['attention_details']);
  14. $data['number']=$_GPC['number'];
  15. $data['is_open']=$_GPC['is_open'];
  16. $data['type']=$_GPC['type'];
  17. $data['num']=$_GPC['num'];
  18. $data['hb_moeny']=$_GPC['hb_moeny'];
  19. $data['is_open']=1;
  20. $data['uniacid']=$_W['uniacid'];
  21. if($_GPC['id']==''){
  22. $res=pdo_insert('zhtc_jfgoods',$data);
  23. if($res){
  24. message('添加成功',$this->createWebUrl('jfgoods',array()),'success');
  25. }else{
  26. message('添加失败','','error');
  27. }
  28. }else{
  29. $res = pdo_update('zhtc_jfgoods', $data, array('id' => $_GPC['id']));
  30. if($res){
  31. message('编辑成功',$this->createWebUrl('jfgoods',array()),'success');
  32. }else{
  33. message('编辑失败','','error');
  34. }
  35. }
  36. }
  37. include $this->template('web/addjfgoods');