<!DOCTYPE html>
<html>
	<?php echo $this->fetch('head.html'); ?>
	<body>
		<?php echo $this->fetch('olprint_shop/nav.html'); ?>
		<div class="main-body">
			<form method="post" action="/moduleadmin.php?m=olprint_shop&a=save">
				<input type="hidden" name="shopid" style="display:none;" value="<?php echo $this->_var['data']['shopid']; ?>">
				<table class="table-add">
					<tr>
						<td>商家名称：</td>
						<td><input type="text" name="shopname" id="shopname" value="<?php echo $this->_var['data']['shopname']; ?>"></td>
					</tr>
					 
					<tr>
						<td>标题：</td>
						<td><input type="text" name="title" id="title" value="<?php echo $this->_var['data']['title']; ?>"></td>
					</tr>
					<tr>
						<td>描述：</td>
						<td><input type="text" name="description" id="description" value="<?php echo $this->_var['data']['description']; ?>"></td>
					</tr>
					<?php if ($this->_var['data']): ?>
					<tr>
						<td>创建时间：</td>
						<td><?php echo $this->_var['data']['createtime']; ?></td>
					</tr>
					<?php endif; ?>
					<tr>
						<td>图片：</td>
						<td>
							<div class="js-upload-item">
								<input type="file" id="upa" class="js-upload-file" style="display: none;" />
								<div class="upimg-btn js-upload-btn">+</div>
								<input type="hidden" name="imgurl" class="js-imgurl" value="<?php echo $this->_var['data']['imgurl']; ?>" />
								<div class="js-imgbox">
									<?php if ($this->_var['data']['imgurl']): ?>
									<img src="<?php echo images_site($this->_var['data']['imgurl']); ?>.100x100.jpg">
									<?php endif; ?>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td>营业状态</td>
						<td>
							<input type="radio" <?php if ($this->_var['data']['yystatus'] == 0): ?>checked<?php endif; ?> name="yystatus" value="0" /> 待营业
							<input type="radio" <?php if ($this->_var['data']['yystatus'] == 1): ?>checked<?php endif; ?>  name="yystatus" value="1" /> 正常营业
							
							<input type="radio" <?php if ($this->_var['data']['yystatus'] == 2): ?>checked<?php endif; ?>  name="yystatus" value="2" /> 即将营业
						</td>
					</tr>
					<tr>
						<td>是否推荐：</td>
						<td><input type="text" name="isrecommend" id="isrecommend" value="<?php echo $this->_var['data']['isrecommend']; ?>"></td>
					</tr>
					<tr>
						<td>营业时间</td>
						<td>
							从<input class="w100" type="text" name="yystart" value="<?php echo $this->_var['data']['yystart']; ?>" />到
							<input class="w100"  type="text" name="yyend" value="<?php echo $this->_var['data']['yyend']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td>地图信息</td>
						<td>
							<div>
								<input type="hidden" name="lat" id="lat" value="<?php echo $this->_var['data']['lat']; ?>" />
								<input type="hidden" name="lng" id="lng" value="<?php echo $this->_var['data']['lng']; ?>" />
								<div id="gps">
									<?php echo $this->_var['data']['lng']; ?>,<?php echo $this->_var['data']['lat']; ?>
								</div>
							</div>
							<div id="allmap" style="width: 600px; height: 400px;"></div>
						</td>
					</tr>
					<tr>
						<td>联系人：</td>
						<td><input type="text" name="nickname" id="nickname" value="<?php echo $this->_var['data']['nickname']; ?>"></td>
					</tr>
					<tr>
						<td>联系电话：</td>
						<td><input type="text" name="telephone" id="telephone" value="<?php echo $this->_var['data']['telephone']; ?>"></td>
					</tr>
					<tr>
						<td>地址：</td>
						<td><input type="text" name="address" id="address" value="<?php echo $this->_var['data']['address']; ?>"></td>
					</tr>
					
					<tr>
						<td>访问数：</td>
						<td><input type="text" name="view_num" id="view_num" value="<?php echo $this->_var['data']['view_num']; ?>"></td>
					</tr>
					<tr>
						<td>评论数：</td>
						<td><input type="text" name="comment_num" id="comment_num" value="<?php echo $this->_var['data']['comment_num']; ?>"></td>
					</tr>
					<tr>
						<td>喜欢数：</td>
						<td><input type="text" name="love_num" id="love_num" value="<?php echo $this->_var['data']['love_num']; ?>"></td>
					</tr>
					<tr>
						<td>收藏数：</td>
						<td><input type="text" name="fav_num" id="fav_num" value="<?php echo $this->_var['data']['fav_num']; ?>"></td>
					</tr>
					 
					 
					<tr>
						<td>月售：</td>
						<td><input type="text" name="month_buy_num" id="month_buy_num" value="<?php echo $this->_var['data']['month_buy_num']; ?>"></td>
					</tr>
					 
					<tr>
						<td>资质文件：</td>
						<td><input type="text" name="zzdata" id="zzdata" value="<?php echo $this->_var['data']['zzdata']; ?>"></td>
					</tr>
					 
					<tr>
						<td>保证金：</td>
						<td><input type="text" name="earnest" id="earnest" value="<?php echo $this->_var['data']['earnest']; ?>"></td>
					</tr>
					<tr>
						<td>内容：</td>
						<td>
							<script type="text/plain" id="content" name="content"><?php echo $this->_var['data']['content']; ?></script>
						</td>
					</tr>
				</table>
				<div class="btn-row-submit js-submit">保存</div>
			</form>
		</div>
		<?php echo $this->fetch('footer.html'); ?>
		<script src="/static/admin/js/upload.js"></script>
		<?php loadEditor();;?>
		<script>
			var editor = UE.getEditor('content', options);
		</script>
			<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=<?php echo BDMAPKEY; ?>"></script>
			<script>
				var map = new BMap.Map("allmap");    // 创建Map实例
				map.enableScrollWheelZoom(true);
			// 初始化地图,设置中心点坐标和地图级别
		<?php if ($this->_var['data']['lat'] > 0): ?>
		var point=new BMap.Point(<?php echo $this->_var['data']['lng']; ?>, <?php echo $this->_var['data']['lat']; ?>)
		var marker = new BMap.Marker(point);  
		map.addOverlay(marker);
		map.centerAndZoom(point, 14);
		<?php else: ?>
		map.centerAndZoom(new BMap.Point(120.240986, 27.316632), 14);
		<?php endif; ?>
		map.addControl(new BMap.MapTypeControl({
			mapTypes:[
							BMAP_NORMAL_MAP,
							BMAP_HYBRID_MAP
					]}));
		map.enableScrollWheelZoom(true);
		map.setMapType(BMAP_HYBRID_MAP)
		function showInfo(e){
			var marker = new BMap.Marker(e.point);  
			map.clearOverlays();
			map.addOverlay(marker);
			//alert(e.point.lng + ", " + e.point.lat);
			$("#lat").val(e.point.lat);
			$("#lng").val(e.point.lng);
			$("#gps").html(e.point.lng + ", " + e.point.lat);
		}
		map.addEventListener("click", showInfo);
			</script>
	</body>
</html>
