groupgoodsinfo.inc.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $info=pdo_get('zhtc_groupgoods',array('id'=>$_GPC['id']));
  5. if($info['img']){
  6. if(strpos($info['img'],',')){
  7. $img= explode(',',$info['img']);
  8. }else{
  9. $img=array(
  10. 0=>$info['img']
  11. );
  12. }
  13. }
  14. if($info['details_img']){
  15. if(strpos($info['img'],',')){
  16. $details_img= explode(',',$info['details_img']);
  17. } else{
  18. $details_img=array(
  19. 0=>$info['details_img']
  20. );
  21. }
  22. }
  23. $type=pdo_getall('zhtc_grouptype',array('uniacid'=>$_W['uniacid']),array(),'','num asc');
  24. if(!$type){
  25. message('请先添加分类',$this->createWebUrl('adddishestype',array()),'error');
  26. }
  27. if(checksubmit('submit')){
  28. if($_GPC['img']){
  29. $data['img']=implode(",",$_GPC['img']);
  30. }else{
  31. $data['img']='';
  32. }
  33. if($_GPC['details_img']){
  34. $data['details_img']=implode(",",$_GPC['details_img']);
  35. } else{
  36. $data['details_img']='';
  37. }
  38. $data['name']=$_GPC['name'];
  39. $data['type_id']=$_GPC['type_id'];
  40. $data['logo']=$_GPC['logo'];
  41. $data['inventory']=$_GPC['inventory'];
  42. $data['start_time']=strtotime($_GPC['start_time']);
  43. $data['end_time']=strtotime($_GPC['end_time']);
  44. $data['xf_time']=strtotime($_GPC['xf_time']);
  45. $data['pt_price']=$_GPC['pt_price'];
  46. $data['y_price']=$_GPC['y_price'];
  47. $data['dd_price']=$_GPC['dd_price'];
  48. $data['ycd_num']=$_GPC['ycd_num'];
  49. $data['ysc_num']=$_GPC['ysc_num'];
  50. $data['people']=$_GPC['people'];
  51. $data['is_shelves']=$_GPC['is_shelves'];
  52. $data['details']=html_entity_decode($_GPC['details']);
  53. $data['num']=$_GPC['num'];
  54. $data['introduction']=$_GPC['introduction'];
  55. $data['cityname']=$_GPC['cityname'];
  56. $data['uniacid']=$_W['uniacid'];
  57. if($_GPC['id']==''){
  58. $res=pdo_insert('zhtc_groupgoods',$data);
  59. if($res){
  60. message('添加成功',$this->createWebUrl('groupgoods',array()),'success');
  61. }else{
  62. message('添加失败','','error');
  63. }
  64. }else{
  65. $res = pdo_update('zhtc_groupgoods', $data, array('id' => $_GPC['id']));
  66. if($res){
  67. message('编辑成功',$this->createWebUrl('groupgoods',array()),'success');
  68. }else{
  69. message('编辑失败','','error');
  70. }
  71. }
  72. }
  73. include $this->template('web/groupgoodsInfo');