inaddyellowstore.inc.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu2();
  4. $info=pdo_get('zhtc_yellowstore',array('id'=>$_GPC['id']));
  5. //$area=pdo_getall('zhtc_area',array('uniacid'=>$_W['uniacid']));
  6. $type=pdo_getall('zhtc_yellowtype',array('uniacid'=>$_W['uniacid']));
  7. //入住类型
  8. $typein=pdo_getall('zhtc_yellowset',array('uniacid'=>$_W['uniacid']));
  9. if($info['imgs']){
  10. if(strpos($info['imgs'],',')){
  11. $imgs= explode(',',$info['imgs']);
  12. }else{
  13. $imgs=array(
  14. 0=>$info['imgs']
  15. );
  16. }
  17. }
  18. $coordinates=explode(',',$info['coordinates']);
  19. $list['coordinates']=array(
  20. 'lat'=>$coordinates['0'],
  21. 'lng'=>$coordinates['1'],
  22. );
  23. //var_dump( $list['coordinates']);die;
  24. if(checksubmit('submit')){
  25. if($_GPC['imgs']){
  26. $data['imgs']=implode(",",$_GPC['imgs']);
  27. }else{
  28. $data['imgs']='';
  29. }
  30. $data['company_name']=$_GPC['company_name'];
  31. $data['company_address']=$_GPC['company_address'];
  32. $data['link_tel']=$_GPC['link_tel'];
  33. $days=pdo_get('zhtc_yellowset',array('id'=>$_GPC['rz_type']));
  34. $data['dq_time']=time()+60*60*24*$days['days'];
  35. $data['logo']=$_GPC['logo'];
  36. $data['content']=$_GPC['content'];
  37. $data['coordinates']=$_GPC['op']['lat'].','.$_GPC['op']['lng'];
  38. $data['sort']=$_GPC['sort'];
  39. $data['views']=$_GPC['views'];
  40. $data['rz_type']=$_GPC['rz_type'];
  41. $data['time_over']=2;
  42. $data['state']=2;
  43. $data['uniacid']=$_W['uniacid'];
  44. $data['sh_time']=time();
  45. $data['type_id']=$_GPC['type_id'];
  46. $data['type2_id']=$_GPC['type2_id'];
  47. $data['cityname']=$_COOKIE["cityname"];
  48. $res = pdo_insert('zhtc_yellowstore', $data);
  49. if($res){
  50. message('编辑成功',$this->createWebUrl('inyellowstore',array()),'success');
  51. }else{
  52. message('编辑失败','','error');
  53. }
  54. }
  55. include $this->template('web/inaddyellowstore');