<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="author" content="HANCHAO"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<?php $csscommon="/Public/bootstrap/css/bootstrap.min.css" ?>
<?php $csscommon.="|/Public/HanChaoUI/css/hanchaoui.css" ?>
<?php $CSSARR[]=THEME_PATH."/common/css/main.css" ?>
<?php $CSSARR[]="/Public/HanChaoUI/css/weebox.css" ?>
<link rel="stylesheet" href="<?php echo min_css($CSSARR,$csscommon);?>" media="all"/>
<?php $jscommon="/Public/script/jquery.min.js" ?>
<?php $jscommon.="|/Public/bootstrap/js/bootstrap.min.js" ?>
<?php $JSARR['min2']=THEME_PATH."/common/js/common.js" ?>
<?php $JSARR['min3']="/Public/HanChaoUI/js/weebox.js" ?>
<script language="javascript">var URL = '/admin.php?s=/shop/';var THEME_COLOR = '';var ROOT_PATH = '/';var APP   =   '/admin.php?s=/';var CONTROLLER_NAME   =   '<?php echo (CONTROLLER_NAME); ?>';var THEME_PATH   =   '<?php echo (TPL_PATH); ?>/';</script>
<script type="text/javascript" src="<?php echo min_js($JSARR,$jscommon);?>"></script><!--[if IE]>
<link href="/Public/bootstrap/css/bootstrap.ie.css" rel="stylesheet" type="text/css"/>
 <script src="/Public/bootstrap/js/html5shiv.js"></script>
<![endif]-->
<script language="javascript">
$(function($){
    $(window.parent.document).find('#loading').hide();
    var topid='<?php echo ($_GET['topid']); ?>';
    var leftid='<?php echo ($_GET['leftid']); ?>';
    changemenu(topid,leftid);
});
function changemenu(topid,leftid){
    if(!topid && !leftid)return false;
    if(topid)parent._OPENleft(topid);
    if(leftid){
        $(window.parent.document).find('#_OPENright'+leftid).parent().prev().click();
        $(window.parent.document).find('#_OPENright'+leftid+' a').click();
    }
}
</script>
<title><?php echo (L("website_manage")); ?>Powered by hanchao</title>
</head>
<body><?php if(!empty($big_menu)): ?><div class="pad-lr-10 col-sm-12">
    <div class="btn-handle mt15">
   <?php if(is_array($big_menu)): foreach($big_menu as $k=>$vo): ?><a class="btn <?php if(!empty($menu_hover)): if(in_array(($k), is_array($menu_hover)?$menu_hover:explode(',',$menu_hover))): ?>btn-primary<?php else: ?>btn-default<?php endif; ?>                
   <?php else: ?>btn-primary<?php endif; ?>" href="<?php echo (isset($vo)?$vo:''); ?>"><?php echo (isset($k)?$k:''); ?></a>&nbsp;&nbsp;<?php endforeach; endif; ?>
    </div>
</div><?php endif; ?>
<!--批量上传相册-->
<style>
    #info{font-size: 12px;}
</style>
<script type="text/javascript" src="/Public/script/MyDate/WdatePicker.js"></script><script type="text/javascript" src="/Public/script/kindeditor/kindeditor.js"></script><link rel="stylesheet" type="text/css" href="/Application/Runtime/statics/e0d943bb29a0cccaff68400c2dd58d24.css" /><script type="text/javascript" src="/Application/Runtime/statics/0ded5334a79f299b72a28e22920a2ef8.js"></script><script type="text/javascript">$(function(){$("a[rel^='prettyPhoto']").prettyPhoto();$("#myform").Validform({tiptype:3});})</script><script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak="></script>
<script charset="utf-8" src="//map.qq.com/api/js?v=2.exp&key=NBPBZ-YSKK5-RIDI5-QHBJC-BFG75-K5BOF"></script>
<div class="pad-lr-10 col-sm-12">
    <form action="<?php echo U('first_add');?>" method="post" name="myform" id="myform">
    <div class="mt15">
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="<?php echo U('Shops/edit',array('id'=>$id));?>">
			<?php if(empty($id)): echo L('ADD');?>仓库<?php else: echo L('EDIT');?>仓库<?php endif; ?>
			</a></li>
        </ul>
        <div class="cont_hanchao pd15 tab-content" id="myTabContent">
			<div class="prompt_div bg-info" id="explanation">
				<p class="text-primary" id="checkZoom" ><i class="glyphicon glyphicon-bell mr5"></i>温馨提示<span id="explanationZoom" title="收起提示"></span></p>
				<ul>
					<li><i>·</i>仓库编辑功能可对仓库的基本信息进行修改操作。</li>
				</ul>
			</div>
            <div class="present tab-pane mt15 fade active in" id="group_common">
                <table class="table_hanchao_z">
                    <tr>
                        <th>仓库<?php echo L('NAME');?>：</th>
                        <td><input type="text" name="name" id="name" value="<?php echo (isset($name)?$name:''); ?>" class="form-control f_l" datatype="*"><div class="Validform_checktip"></div></td>
                    </tr>
                    <tr>
                        <th>联系人：</th>
                        <td><input type="text" name="contacts" id="contacts" value="<?php echo (isset($contacts)?$contacts:''); ?>" class="form-control f_l" datatype="s1-10"><div class="Validform_checktip"></div></td>
                    </tr>
                    <tr>
                        <th>手机号：</th>
                        <td>
							<input type="text" name="phone" id="phone" value="<?php echo (isset($phone)?$phone:''); ?>" class="form-control f_l" datatype="m">
							<div class="Validform_checktip"></div>
						</td>
                    </tr>
					<tr>
                        <th><?php echo L('BUSINESS_HOURS');?>：</th>
                        <td>
							<?php if(empty($id)): $business_week_end = '周六'; endif; ?>
							<select id="business_week_start" class="form-control f_l" name="business_week_start" ><?php $business_week_start_arr=strtoarray("typeid_temp_32"); if(!empty($business_week_start_arr)){ $selectdvalue=0;foreach($business_week_start_arr as $key=>$val) { if(empty($business_week_start) && !is_numeric($business_week_start))$business_week_start=array();$business_week_startarr=remove_empty_array($business_week_start);if(in_array($key,$business_week_startarr)) { ?><option selected="selected" value="<?php echo $key ?>"><?php echo $val;$selectdvalue=1; ?></option><?php }else { ?><option value="<?php echo $key ?>"><?php echo $val ?></option><?php } } } ?></select>
							<em class="f_l" style="border-top:1px solid #ccc; border-bottom:1px solid #ccc;padding:0 8px;">-</em>
							<select id="business_week_end" class="form-control f_l" name="business_week_end" ><?php $business_week_end_arr=strtoarray("typeid_temp_32"); if(!empty($business_week_end_arr)){ $selectdvalue=0;foreach($business_week_end_arr as $key=>$val) { if(empty($business_week_end) && !is_numeric($business_week_end))$business_week_end=array();$business_week_endarr=remove_empty_array($business_week_end);if(in_array($key,$business_week_endarr)) { ?><option selected="selected" value="<?php echo $key ?>"><?php echo $val;$selectdvalue=1; ?></option><?php }else { ?><option value="<?php echo $key ?>"><?php echo $val ?></option><?php } } } ?></select>
							<div style="position:relative;display:table;">
								<input type="text" name="business_hours_start" id="business_hours_start" value="<?php echo (isset($business_hours_start)?$business_hours_start:''); ?>" class="form-control w100 f_l">
								<em class="f_l" style="border-top:1px solid #ccc; border-bottom:1px solid #ccc;padding:0 8px;">-</em>
								<input type="text" name="business_hours_end" id="business_hours_end" value="<?php echo (isset($business_hours_end)?$business_hours_end:''); ?>" class="form-control w100">
								<input type="hidden" id="new_id" value="">
								<div class="Validform_checktip"><span class="glyphicon glyphicon-exclamation-sign"></span>24小时制，如8：00-22：00,不填默认0：00-23：00</div>
								<div class="dropdown-menu1">
									<style>
	.dropdown-menu1{position: absolute;background: #fff;top: 44px;z-index: 99;left:0px;display:none;}
    .left_123{left:123px !important;}
	.datetime-hours{color:#676a6c;width:250px;font-size:12px;box-shadow: 0 0 3px rgba(86, 96, 117, 0.7);}
	.datetime-hours ul{display:table;padding:5px;}
    .datetime-hours:after {
        content: '';
        display: inline-block;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid #fff;
        border-top: 0;
        position: absolute;
        left: 7px;
        top: -6px;
    }
    .datetime-hours:before {
        content: '';
        display: inline-block;
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-bottom: 7px solid rgba(0, 0, 0, 0.15);
        border-top: 0;
        border-bottom-color:rgba(86, 96, 117, 0.5);
        position: absolute;
        top: -7px;
        left: 6px;
    }
	.datetime-hours ul li {
		display: block;
		width: 18%;
		height: 26px;
		line-height: 26px;
		text-align:center;
		float: left;
		margin: 1%;
		cursor: pointer;
		-webkit-border-radius: 4px;
		-moz-border-radius: 4px;
		border-radius: 4px;
	}
	.datetime-hours ul li.active{
		background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
		background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
		background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
		background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
		background-image: -o-linear-gradient(top, #0088cc, #0044cc);
		background-image: linear-gradient(to bottom, #0088cc, #0044cc);
		color:#fff;
    }
	
    .mr0{margin-right:0 !important;}
    .attribute  em.fuhao{
        border-top: 1px solid #E6E9EE;
        border-bottom: 1px solid #E6E9EE;
        height: 28px;
        display: inline-block;
        width: 15px;
        text-align: center;
        padding: 0;
        margin: 0;
        line-height: 28px;
    }
</style>

<!--时间 begin-->
    <div class="datetime-hours">
        <ul>
        	<li class="active">0:00</li>
            <li>0:30</li>
            <li>1:00</li>
            <li>1:30</li>
            <li>2:00</li>
            <li>2:30</li>
            <li>3:00</li>
            <li>3:30</li>
            <li>4:00</li>
            <li>4:30</li>
            <li>5:00</li>
            <li>5:30</li>
            <li>6:00</li>
            <li>6:30</li>
            <li>7:00</li>
            <li>7:30</li>
			<li>8:00</li>
            <li>8:30</li>
            <li>9:00</li>
            <li>9:30</li>
            <li>10:00</li>
            <li>10:30</li>
            <li>11:00</li>
            <li>11:30</li>
            <li>12:00</li>
            <li>12:30</li>
            <li>13:00</li>
            <li>13:30</li>
            <li>14:00</li>
            <li>14:30</li>
            <li>15:00</li>
            <li>15:30</li>
            <li>16:00</li>
            <li>16:30</li>
            <li>17:00</li>
            <li>17:30</li>
			<li>18:00</li>
            <li>18:30</li>
            <li>19:00</li>
            <li>19:30</li>
            <li>20:00</li>
            <li>20:30</li>
            <li>21:00</li>
            <li>21:30</li>
            <li>22:00</li>
            <li>22:30</li>
            <li>23:00</li>
            <li>23:30</li>
        </ul>           
    </div>
<!--时间 end-->

								</div>
							</div>
						</td>
                        
                    </tr>
                    <tr>
                        <th>仓库<?php echo L('SHOP_ADDRESS');?>：</th>
                        <td> <span id="linkagelinkage_val"><select class="linkage_linkage form-control f_l cls_province" name="province" id="province" data-first-title="请选择省" datatype="*"></select><select class="linkage_linkage form-control f_l cls_city_id" name="city_id" id="city_id" data-first-title="请选择市"></select><select class="linkage_linkage form-control f_l cls_district" name="district" id="district" data-first-title="请选择区县"></select><script type="text/javascript" src="/Public/data/areadata.json"></script></span><script type="text/javascript">$(function(){ $.cxSelect.defaults.url = '/Public/data/areadata.json';$('#linkagelinkage_val').cxSelect({selects: ['cls_province','cls_city_id','cls_district'],dataValues: [<?php echo (isset($province)?$province:''); ?>,<?php echo (isset($city_id)?$city_id:''); ?>,<?php echo (isset($district)?$district:''); ?>],valueInput: '',emptyStyle: 'none'});});</script></td>
                    </tr>
                    <tr>
                        <th><?php echo L('ADDRESS');?>：</th>
                        <td><input type="text" name="address" id="address" value="<?php echo (isset($address)?$address:''); ?>" class="form-control f_l" style="width:450px;" datatype="*" nullmsg="请点击右侧的按钮选择地址">
						<div class="f_l">&nbsp;&nbsp;<input type="hidden" name="xpoint" id="xpoint" class="form-control f_l" value="<?php echo (isset($xpoint)?$xpoint:''); ?>" /><input type="hidden" name="ypoint" id="ypoint" class="form-control f_l" value="<?php echo (isset($ypoint)?$ypoint:''); ?>"  /><button type="button" class="btn btn-default btn-lg f_l" onclick="openmapselect()" style="padding:0;border:0;"><span class="btn btn-primary">设置经纬度</span></button><p class="text-muted showlocation_xpointypoint"><?php echo showlocation($xpoint,$ypoint);?></p></div><script>function openmapselect(){var cityname=$("#city_id").find("option:selected").text();if(!cityname || cityname=="请选择市"){alert("请先选择所在城市");return;}$.openUrl(ROOT_PATH+'index.php?s=/Home/Public/map/x_name/xpoint/y_name/ypoint/address_id/address/x/<?php echo (isset($xpoint)?$xpoint:''); ?>/y/<?php echo (isset($ypoint)?$ypoint:''); ?>/city_name/'+cityname,'选择坐标','_map',960);}</script></td>
                    </tr>
                    <!-- <?php if(!empty($id)): ?>-->
                 <!--    <tr>
                        <th>仓库LOGO：</th>
                        <td><script>KindEditor.ready(function(K) {var editor = K.editor({fileManagerJson: "/index.php?s=/home/file/filemanager.html",uploadJson: "/index.php?s=/home/file/upload.html"});K("#thumb_button").click(function() {editor.loadPlugin("image", function() {editor.plugin.imageDialog({imageUrl : K("#thumb_id").val(),clickFn : function(url, title, width, height, border, align) {K("#thumb_id").val(url);K("#showupimage_thumb_id").html("<a href=\""+url+"\" target=\"_bank\" rel=\"prettyPhotothumb_id\"><img src=\""+url+"\"/></a>");$("a[rel^='prettyPhoto']").prettyPhoto();editor.hideDialog();}});});});});</script><div><div class="upload_img_hanchao"><ul class="clearfix"><li id="showupimage_thumb_id"><?php if(!empty($thumb)){?><a href="<?php echo $thumb;?>" target="_bank" rel="prettyPhotothumb_id"><img src="<?php echo $thumb;?>" /></a><?php }else{?><img src="/Public/images/add_img_icon.png" /><?php }?></li></ul><input type="hidden" id="thumb_id" name="thumb" class="w200" value="<?php echo (isset($thumb)?$thumb:''); ?>" /><button type="button" id="thumb_button" class="btn btn-primary">选择图片</button><p class="text-muted"><span class="glyphicon glyphicon-exclamation-sign"></span>请上传小于<?php echo (C("UPLOAD_MAXSIZE")); ?>M的图片,图片尺寸 1:1</p></div></div></td>
                    </tr>
                    <tr>
                        <th>仓库店标：</th>
                        <td><script>KindEditor.ready(function(K) {var editor = K.editor({fileManagerJson: "/index.php?s=/home/file/filemanager.html",uploadJson: "/index.php?s=/home/file/upload.html"});K("#picture_button").click(function() {editor.loadPlugin("image", function() {editor.plugin.imageDialog({imageUrl : K("#picture_id").val(),clickFn : function(url, title, width, height, border, align) {K("#picture_id").val(url);K("#showupimage_picture_id").html("<a href=\""+url+"\" target=\"_bank\" rel=\"prettyPhotopicture_id\"><img src=\""+url+"\"/></a>");$("a[rel^='prettyPhoto']").prettyPhoto();editor.hideDialog();}});});});});</script><div><div class="upload_img_hanchao"><ul class="clearfix"><li id="showupimage_picture_id"><?php if(!empty($picture)){?><a href="<?php echo $picture;?>" target="_bank" rel="prettyPhotopicture_id"><img src="<?php echo $picture;?>" /></a><?php }else{?><img src="/Public/images/add_img_icon.png" /><?php }?></li></ul><input type="hidden" id="picture_id" name="picture" class="w200" value="<?php echo (isset($picture)?$picture:''); ?>" /><button type="button" id="picture_button" class="btn btn-primary">选择图片</button><p class="text-muted"><span class="glyphicon glyphicon-exclamation-sign"></span>请上传小于<?php echo (C("UPLOAD_MAXSIZE")); ?>M的图片,图片尺寸 1:1</p></div></div></td>
                    </tr><?php endif; ?>
					<input type="hidden" name="shop_type" value="1" />
                    <tr>
                        <th>是否开启微信小程序：</th>
                        <td>
                            <?php $selectdvalue=0; $is_weixin_arr=strtoarray("1|是,0|否"); $i=1;$total=count($is_weixin_arr);foreach($is_weixin_arr as $key=>$val) { ?><label class="radio-inline"><input type="radio" name="is_weixin" value="<?php echo $key;?>" id="is_weixin_<?php echo $i;?>"<?php if(empty($is_weixin) && !is_numeric($is_weixin))$is_weixin=array();if((!empty($is_weixin) || is_numeric($is_weixin)) && $is_weixin==$key){echo " checked='checked'";$selectdvalue=1;}?>><?php echo $val.' ';?></label><?php ++$i;} if($selectdvalue==0)echo "<script>$(\"input[name='is_weixin'][value='0']\").attr(\"checked\",true);</script>";?></td>
                    </tr> -->
					<tr id="is_weixin" class="hide">
                        <th>地图定位：</th>
                        <td>
                            <div style="display:table;margin: 0 0 10px 0;">
    						 	
    						 	<span class="f_l">城市：<input id="region" type="textbox" class="form-control w180 f_n" value="北京" style="display:inline-block;"></span>
    							<span class="ml10 f_l">仓库名称或地址：<input id="keyword" type="textbox" class="form-control w180 f_n" value="" style="display:inline-block;"></span>
    							<input id="pageIndex" type="hidden" value="0">
    							<input id="pageCapacity" type="hidden" value="5" >
    							<input type="button" value="搜索" onClick="searchKeyword()" class="btn btn-primary ml10">
    						</div>
						    <div style="width:603px;height:300px" id="container"></div>
                            <div class="Validform_checktip" style="margin-left: 610px;margin-top: -30px;"><span class="glyphicon glyphicon-exclamation-sign"></span>必填项,请选择合适的地图位置点。</div>
                            
                      </td>

                    </tr>
					<!-- <tr>
                      <th>经营资质证件号 :</th>
                      <td>
                        <?php if(empty($credential)): ?><input type="text" name="credential" id="credential" value="<?php echo (isset($credential)?$credential:''); ?>" class="form-control f_l" datatype="s9-20">
                        <?php else: ?>
                            <input type="text" name="credential" id="credential" value="<?php echo (isset($credential)?$credential:''); ?>" class="form-control f_l" readonly='readonly'><?php endif; ?>
                        <div class="Validform_checktip"><span class="glyphicon glyphicon-exclamation-sign"></span>请填写经营资质证件号。请填写15位营业执照注册号或9位组织机构代码（如12345678-9）或18位或20位统一社会信用代码<span style="color:red;">(若要开启微信小程序，此项必填)</span></div>
                      </td>
                    </tr>
                    <?php if(check_use_auth('Call',2)): ?><tr>
                        <th>阿里云呼叫中心电话：</th>
                        <td><input type="text" name="shops_call" id="shops_call" value="<?php echo (isset($shops_call)?$shops_call:''); ?>" class="form-control f_l"></td>
                    </tr><?php endif; ?> -->
               <?php if(!empty($shop_list)): ?><tr>
                        <th>所属仓库：</th>
                        <td>
                            <select id="pid" class="form-control f_l" name="pid" ><option value="" >无所属仓库</option><?php if(!empty($shop_list)){ $selectdvalue=0;foreach($shop_list as $key=>$val) { if(empty($pid) && !is_numeric($pid))$pid=array();$pidarr=remove_empty_array($pid);if(in_array($key,$pidarr)) { ?><option selected="selected" value="<?php echo $key ?>"><?php echo $val;$selectdvalue=1; ?></option><?php }else { ?><option value="<?php echo $key ?>"><?php echo $val ?></option><?php } } } ?></select>
                        </td>
                    </tr><?php endif; ?>
                    <!-- <tr>
                        <th>仓库类型：</th>
                        <td>
                            <select id="shop_type" class="form-control f_l" name="shop_type" ><?php if(!empty($shop_options)){ $selectdvalue=0;foreach($shop_options as $key=>$val) { if(empty($shop_type) && !is_numeric($shop_type))$shop_type=array();$shop_typearr=remove_empty_array($shop_type);if(in_array($key,$shop_typearr)) { ?><option selected="selected" value="<?php echo $key ?>"><?php echo $val;$selectdvalue=1; ?></option><?php }else { ?><option value="<?php echo $key ?>"><?php echo $val ?></option><?php } } } ?></select>
                        </td>
                    </tr> -->
                    <tr>
                        <th><?php echo (L("SORT")); ?>：</th>
                        <td><input type="text" name="sort" id="sort" value="<?php echo ((isset($sort) && ($sort !== ""))?($sort):10); ?>" class="form-control f_l"></td>
                    </tr>
					<!-- <tr>
                        <th>是否网上销售：</th>
                        <td><?php $selectdvalue=0; $is_business_arr=strtoarray("1|是,0|否"); $i=1;$total=count($is_business_arr);foreach($is_business_arr as $key=>$val) { ?><label class="radio-inline"><input type="radio" name="is_business" value="<?php echo $key;?>" id="is_business_<?php echo $i;?>"<?php if(empty($is_business) && !is_numeric($is_business))$is_business=array();if((!empty($is_business) || is_numeric($is_business)) && $is_business==$key){echo " checked='checked'";$selectdvalue=1;}?>><?php echo $val.' ';?></label><?php ++$i;} if($selectdvalue==0)echo "<script>$(\"input[name='is_business'][value='1']\").attr(\"checked\",true);</script>";?></td>
                    </tr> -->
                    <tr>
                        <th><?php echo (L("STATUS")); ?>：</th>
                        <td><?php $selectdvalue=0; $status_arr=strtoarray("1|LAN_ENABLE,0|LAN_DISABLE"); $i=1;$total=count($status_arr);foreach($status_arr as $key=>$val) { ?><label class="radio-inline"><input type="radio" name="status" value="<?php echo $key;?>" id="status_<?php echo $i;?>"<?php if(empty($status) && !is_numeric($status))$status=array();if((!empty($status) || is_numeric($status)) && $status==$key){echo " checked='checked'";$selectdvalue=1;}?>><?php echo $val.' ';?></label><?php ++$i;} if($selectdvalue==0)echo "<script>$(\"input[name='status'][value='1']\").attr(\"checked\",true);</script>";?></td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="btn_group_btm">
            <input type="hidden" name="id" id='id' value="<?php echo (isset($id)?$id:''); ?>" />
			<input type="hidden" name="is_first" id='is_first' value="0" />
			<input type="hidden" id="map_poi_id" name="map_poi_id" value="<?php echo (isset($map_poi_id)?$map_poi_id:''); ?>">
			<input type="hidden" id="poi_id" name="poi_id" value="<?php echo (isset($poi_id)?$poi_id:''); ?>">
            <input type="hidden" name="updatetime" value="<?php echo (NOW_TIME); ?>" />
            <input type="submit" name="dosubmit" id="dosubmit" class="dialog btn btn-primary" value="<?php echo (L("SUBMIT")); ?>">
            <input class="btn btn-warning" type="button" onClick="javascript:history.back(-1);" value="<?php echo (L("GOBACK")); ?>" >
        </div>
    </div>
    </form>
    <script>
        var searchService, markers = [];
        var init = function() {
            var center = new qq.maps.LatLng(39.916527, 116.397128);
            var map = new qq.maps.Map(document.getElementById('container'), {
                center: center,
                zoom: 13
            });

            //设置Poi检索服务，用于本地检索、周边检索
            searchService = new qq.maps.SearchService({
                //检索成功的回调函数
                complete: function(results) {
                    //设置回调函数参数
                    var pois = results.detail.pois;
                    var infoWin = new qq.maps.InfoWindow({
                        map: map
                    });
                    var latlngBounds = new qq.maps.LatLngBounds();
                    for (var i = 0, l = pois.length; i < l; i++) {
                        var poi = pois[i];
                        //扩展边界范围，用来包含搜索到的Poi点
                        latlngBounds.extend(poi.latLng);

                        (function(n) {
                            var marker = new qq.maps.Marker({
                                map: map
                            });
                            marker.setPosition(pois[n].latLng);

                            marker.setTitle(i + 1);
                            markers.push(marker);
                            qq.maps.event.addListener(marker, 'click', function() {								
                                infoWin.open();
                                infoWin.setContent('<div style="width:280px;height:50px;">选中名称：' + pois[n].name + '<br>选中地址：' + pois[n].address + '</div>');
                                $("#map_poi_id").val(pois[n].id);
								infoWin.setPosition(pois[n].latLng);
                            });
                        })(i);
                    }
                    //调整地图视野
                    map.fitBounds(latlngBounds);
                },
                //若服务请求失败，则运行以下函数
                error: function() {
                    alert("你搜索的仓库不存在，请重新输入!");
                }
            });

        }
$(function(){
    init();
})
         //清除地图上的marker
            function clearOverlays(overlays) {
                var overlay;
                while (overlay = overlays.pop()) {
                    overlay.setMap(null);
                }
            }
            //设置搜索的范围和关键字等属性
            function searchKeyword() {
                var keyword = document.getElementById("keyword").value;
                var region = document.getElementById("region").value;
                var pageIndex = parseInt(document.getElementById("pageIndex").value);
                var pageCapacity = parseInt(document.getElementById("pageCapacity").value);
                clearOverlays(markers);
                //根据输入的城市设置搜索范围
                searchService.setLocation(region);
                //设置搜索页码
                searchService.setPageIndex(pageIndex);
                //设置每页的结果数
                searchService.setPageCapacity(pageCapacity);
                //根据输入的关键字在搜索范围内检索
                searchService.search(keyword);
                //根据输入的关键字在圆形范围内检索
                //var region = new qq.maps.LatLng(39.916527,116.397128);
                //searchService.searchNearBy(keyword, region , 2000);
                //根据输入的关键字在矩形范围内检索
                //region = new qq.maps.LatLngBounds(new qq.maps.LatLng(39.936273,116.440043),new qq.maps.LatLng(39.896775,116.354212));
                //searchService.searchInBounds(keyword, region);

            }
    </script>
</div>
<script>
    $(document).ready(function() {
        $("#business_hours_start").click(function(event){
            event.stopPropagation();
            $('.dropdown-menu1').show();
            $('#new_id').val('1');
            $('.dropdown-menu1').removeClass('left_123');
        });
        $("#business_hours_end").click(function(event){
            event.stopPropagation();
            $('.dropdown-menu1').show();
            $('#new_id').val('2');
            $('.dropdown-menu1').addClass('left_123');
        });
        $('input:radio[name="is_weixin"]').change(function(){
            var cityname=$('#city_id').find("option:selected").text()
            if(cityname)$('#region').val(cityname);
            var is_weixin=$('input:radio[name="is_weixin"]:checked').val();
            if(is_weixin>0){
                $("#is_weixin").removeClass('hide');
            }else{
                $("#is_weixin").addClass('hide');
            }
        });
        $('.datetime-hours ul li').click(function(){
            $(this).addClass("active").siblings().removeClass("active");
            var time = $(this).html();
            var new_id = $('#new_id').val();
            if(new_id == 1){
                $('#business_hours_start').val(time);
            }
            if(new_id == 2){
                $('#business_hours_end').val(time);
            }
            $('.dropdown-menu1').hide();
        });
        $(document).click(function(){
            $(".dropdown-menu1").hide();
        });
        $(".dropdown-menu1").click(function(event){
            event.stopPropagation();
        });
    });
    function suo_user(){
        var query= new Object();
        query.like=$('#like').val();
        $.ajax({
            type: "GET",
            url: APP+"Shops/searchuser.html",
            data: query,
            success: function(data){
                $("#user_list").html(data);
            }
        });
    }
	<!-- $('#login_name').blur(function(){ -->
		<!-- var query= new Object(); -->
		<!-- query.login_name= $('#login_name').val(); -->
        <!-- query.shop_id = $('#id').val(); -->
		<!-- if(query.login_name != ''){ -->
			<!-- $.ajax({ -->
				<!-- type: "POST", -->
				<!-- url: APP+"Shops/checklogin_name.html", -->
				<!-- data: query, -->
				<!-- success: function(data){ -->
					<!-- if(data.status == 0){ -->
						<!-- $.showErr(data.data,2); -->
						<!-- $('#login_name').val(''); -->
					<!-- } -->
				<!-- } -->
			<!-- }); -->
		<!-- } -->
	<!-- }); -->
	$('#phone').blur(function(){
		var query= new Object();
		query.phone= $('#phone').val();
        query.shop_id = $('#id').val();
		if(query.phone != ''){
			$.ajax({
				type: "POST",
				url: APP+"Shops/check_phone.html",
				data: query,
				success: function(data){
					if(data.status == 0){
						$.showErr(data.data,2);
						$('#phone').val('');
					}
				}
			});
		}
	});
</script>
<script>
    KindEditor.ready(function(K) {var editor = K.editor({uploadJson : "<?php echo U('Home/File/upload');?>",imageUploadLimit:9});
        K("#gallery_button").click(function() {
            editor.loadPlugin("multiimage", function() {
                editor.plugin.multiImageDialog({
                    clickFn : function(urlList) {
                        var div = K("#gallery_View");
                        d = new Date(); t = d.getTime();
                        K.each(urlList, function(i, data) {
                            div.append("<li><a href='" + data.url + "' rel=\"prettyPhoto[]\"><img src='" + data.url + "'></a><input type='hidden' name='pic_list["+t+"n"+i+"]' value='"+data.url+"'><div class=\"clearfix\"><div class=\"pr f_l\"><button type=\"button\" class=\"btn btn-danger btn-xs\" onclick=\"removethis(removethis(this,3))\">删除图片</button></div></div></li>");
                        });$("a[rel^='prettyPhoto']").prettyPhoto();
                        editor.hideDialog();
                    }
                });
            });
        });
    });
</script>

</body>
</html>