storeinfo2.inc.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $info = pdo_get('zhtc_store', array('id' => $_GPC['id']));
  5. $area = pdo_getall('zhtc_area', array('uniacid' => $_W['uniacid']));
  6. //行业
  7. $type = pdo_getall('zhtc_storetype', array('uniacid' => $_W['uniacid'], 'state' => 1), array(), '', 'num asc');
  8. //入住类型
  9. //$typein=pdo_getall('zhtc_in',array('uniacid'=>$_W['uniacid']));
  10. $system = pdo_get('zhtc_system', array('uniacid' => $_W['uniacid']));
  11. $time = 24 * 60 * 60 * 7; //一周
  12. $time2 = 24 * 182 * 60 * 60; //半年
  13. $time3 = 24 * 365 * 60 * 60; //一年
  14. if ($info['ad']) {
  15. if (strpos($info['ad'], ',')) {
  16. $ad = explode(',', $info['ad']);
  17. } else {
  18. $ad = array(
  19. 0 => $info['ad'],
  20. );
  21. }
  22. }
  23. if ($info['img']) {
  24. if (strpos($info['img'], ',')) {
  25. $img = explode(',', $info['img']);
  26. } else {
  27. $img = array(
  28. 0 => $info['img'],
  29. );
  30. }
  31. }
  32. /* $coordinates=explode(',',$info['coordinates']);
  33. $list['coordinates']=array(
  34. 'lat'=>$coordinates['0'],
  35. 'lng'=>$coordinates['1'],
  36. */
  37. if (checksubmit('submit')) {
  38. if ($_GPC['ad']) {
  39. $data['ad'] = implode(",", $_GPC['ad']);
  40. } else {
  41. $data['ad'] = '';
  42. }
  43. if ($_GPC['img']) {
  44. $data['img'] = implode(",", $_GPC['img']);
  45. } else {
  46. $data['img'] = '';
  47. }
  48. if (empty($_GPC['user_id'])) {
  49. message('没有绑定管理员,请绑定后提交', '', 'error');
  50. }
  51. //查询钱
  52. $storetype_id = pdo_get('zhtc_storetype', array('id' => $_GPC['storetype_id']));
  53. $typemoney = pdo_get('zhtc_in', array('id' => $_GPC['type']));
  54. $data['store_name'] = $_GPC['store_name'];
  55. $data['tel'] = $_GPC['tel'];
  56. $data['address'] = $_GPC['address'];
  57. $data['logo'] = $_GPC['logo'];
  58. $data['ewm_logo'] = $_GPC['ewm_logo'];
  59. $data['weixin_logo'] = $_GPC['weixin_logo'];
  60. $data['announcement'] = $_GPC['announcement'];
  61. $data['yy_time'] = $_GPC['yy_time'];
  62. $data['keyword'] = $_GPC['keyword'];
  63. $data['skzf'] = $_GPC['skzf'];
  64. $data['wifi'] = $_GPC['wifi'];
  65. $data['mftc'] = $_GPC['mftc'];
  66. $data['jzxy'] = $_GPC['jzxy'];
  67. $data['tgbj'] = $_GPC['tgbj'];
  68. $data['sfxx'] = $_GPC['sfxx'];
  69. //$data['area_id']=$_GPC['area_id'];
  70. $data['details'] = $_GPC['details'];
  71. $data['num'] = $_GPC['num'];
  72. $data['type'] = $_GPC['type'];
  73. //$data['coordinates']=$_GPC['op']['lat'].','.$_GPC['op']['lng'];
  74. $data['coordinates'] = $_GPC['coordinates'];
  75. $data['user_id'] = $_GPC['user_id'];
  76. $data['storetype_id'] = $_GPC['storetype_id'];
  77. $data['storetype2_id'] = $_GPC['storetype2_id'];
  78. $data['sfz_img'] = $_GPC['sfz_img'];
  79. $data['yyzz_img'] = $_GPC['yyzz_img'];
  80. $data['start_time'] = $_GPC['start_time'];
  81. $data['end_time'] = $_GPC['end_time'];
  82. $data['vr_link'] = $_GPC['vr_link'];
  83. $data['video'] = $_GPC['video'];
  84. $data['uniacid'] = $_W['uniacid'];
  85. $data['state'] = 2;
  86. $data['is_shop'] = $_GPC['is_shop'];
  87. $data['is_pt'] = $_GPC['is_pt'];
  88. $data['is_qg'] = $_GPC['is_qg'];
  89. $data['is_yhq'] = $_GPC['is_yhq'];
  90. $data['views'] = $_GPC['views'];
  91. $data['is_top'] = $_GPC['is_top'];
  92. $data['is_rm'] = $_GPC['is_rm'];
  93. $data['sh_time'] = time();
  94. $data['time_over'] = 2;
  95. if ($_GPC['type'] == 1) {
  96. $data['dq_time'] = time() + $time;
  97. }
  98. if ($_GPC['type'] == 2) {
  99. $data['dq_time'] = time() + $time2;
  100. }
  101. if ($_GPC['type'] == 3) {
  102. $data['dq_time'] = time() + $time3;
  103. }
  104. $data['money'] = $storetype_id['money'] + $typemoney['money'];
  105. if ($_GPC['id'] == '') {
  106. $data['cityname'] = $_GPC['cityname'];
  107. $res = pdo_insert('zhtc_store', $data);
  108. if ($res) {
  109. message('新增成功', $this->createWebUrl('store', array()), 'success');
  110. } else {
  111. message('新增失败', '', 'error');
  112. }
  113. } else {
  114. $res = pdo_update('zhtc_store', $data, array('id' => $_GPC['id']));
  115. if ($res) {
  116. message('编辑成功', $this->createWebUrl('store', array()), 'success');
  117. } else {
  118. message('编辑失败', '', 'error');
  119. }
  120. }
  121. }
  122. include $this->template('web/storeinfo2');