dlinstoreinfo2.inc.php 3.5 KB

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