<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
<title>Management platform</title>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/Public/Admin/images/favicon.ico" >
<LINK rel="Shortcut Icon" href="/Public/Admin/images/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/html5.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="/Public/h-ui_v2.3/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/skin/default/skin.css" rel="stylesheet" type="text/css" id="skin" />
<link href="/Public/h-ui_v2.3/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Public/static/jquery-2.0.3.min.js"></script>

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->

<link href="/Public/h-ui_v2.3/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />


<!-- 页面header钩子，一般用于加载插件CSS文件和代码 -->
<?php echo hook('pageHeader');?>

</head>
<body>

	<!-- 主体 -->
	

<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> Home <span class="c-gray en">&gt;</span> <?php echo ($meta_title); ?>
	<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="refresh" ><i class="Hui-iconfont">&#xe68f;</i></a>
	<a class="btn btn-secondary radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:history.go(-1);" title="back" ><i class="Hui-iconfont">&#xe66b;</i></a>
</nav>
<div class="pd-20">
	<form action="<?php echo U();?>" method="post" class="form form-horizontal" id="form-horizontal">
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>title：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="<?php echo ($info["title"]); ?>" placeholder="" autocomplete="off" id="title" name="title" datatype="*4-16" nullmsg="Can't be empty" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>serial_no：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="<?php echo ($info["serial_no"]); ?>" placeholder="" autocomplete="off" id="serial_no" name="serial_no" datatype="*4-26" nullmsg="Can't be empty" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>mac ID：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="<?php echo ($info["machine_id"]); ?>" placeholder="" autocomplete="off" id="machine_id" name="machine_id" datatype="*" nullmsg="Can't be empty" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">address：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="<?php echo ($info["address"]); ?>" placeholder="" autocomplete="off" id="address" name="address" datatype="*" ignore="ignore" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">mobile：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="<?php echo ($info["mobile"]); ?>" placeholder="" autocomplete="off" id="mobile" name="mobile" datatype="*" nullmsg="Can't be empty" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">password：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="<?php echo ($info["pwd"]); ?>" placeholder="" autocomplete="off" id="pwd" name="pwd" datatype="*" nullmsg="Can't be empty" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">select agent：</label>
			<div class="formControls col-5 skin-minimal">
				<span class="select-box">
		        <select class="select" size="1" name="agent_id" datatype="n" nullmsg="please select" ignore="ignore" >
		          <option value="0" selected>please select</option>
		          <?php if(is_array($agents)): $i = 0; $__LIST__ = $agents;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($data["id"]); ?>" <?php if(($data["id"]) == $info["agent_id"]): ?>selected<?php endif; ?> ><?php echo ($data["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
		        </select>
		        </span>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">select merchant：</label>
			<div class="formControls col-5 skin-minimal">
				<span class="select-box">
		        <select class="select" size="1" name="mid" datatype="n" nullmsg="please select" ignore="ignore" >
		          <option value="0" selected>please select</option>
		          <?php if(is_array($merchants)): $i = 0; $__LIST__ = $merchants;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($data["id"]); ?>" <?php if(($data["id"]) == $info["mid"]): ?>selected<?php endif; ?> ><?php echo ($data["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
		        </select>
		        </span>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">select factory：</label>
			<div class="formControls col-5 skin-minimal">
				<span class="select-box">
		        <select class="select" size="1" name="fac_id" datatype="n" nullmsg="please select" ignore="ignore" >
		          <option value="0" selected>please select</option>
		          <?php if(is_array($factorys)): $i = 0; $__LIST__ = $factorys;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($data["id"]); ?>" <?php if(($data["id"]) == $info["fac_id"]): ?>selected<?php endif; ?> ><?php echo ($data["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
		        </select>
		        </span>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl hidden">
			<label class="form-label col-3">地图坐标：</label>
			<div class="formControls col-5">
				<?php if(empty($info["lat"])): ?>还未设置
				<?php else: ?>
				<?php echo ($info["lat"]); ?>,<?php echo ($info["lng"]); endif; ?>
				<a href="javascript:showMap()" class="btn btn-link ml-5" >click to set </a>
			</div>
			<input type="hidden" id="lat" name="lat" value="<?php echo ($info["lat"]); ?>" />
			<input type="hidden" id="lng" name="lng" value="<?php echo ($info["lng"]); ?>" />
			<input type="hidden" id="poiaddress" name="poiaddress" value="<?php echo ($info["poiaddress"]); ?>" />
			<input type="hidden" id="poiname" name="poiname" value="<?php echo ($info["poiname"]); ?>" />
			<div class="col-4"> </div>
		</div>
		<div class="row cl hidden" id="qqmap">
			<label class="form-label col-3">地图坐标：</label>
			<div class="formControls col-5">
				<iframe id="mapPage" width="100%" height="400" frameborder=0
				    src="http://apis.map.qq.com/tools/locpicker?search=1&type=1&key=RVSBZ-PVGKU-N2UVP-24J53-SCOW6-WPFIA&referer=myapp">
				</iframe>
			</div>
			<div class="col-4"> </div>
		</div>

		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input type="hidden" name="id" value="<?php echo ($info["id"]); ?>" />
				<button class="btn btn-primary radius ajax-post" type="submit" target-form="form-horizontal"><i class="Hui-iconfont">&#xe632;</i>Submit</button>
				<button class="btn btn-default radius" onclick="javascript:history.back(-1);return false;">&nbsp;&nbsp;Back&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>

	<!-- /主体 -->
	
	<!-- 底部 -->
	<script type="text/javascript" src="/Public/h-ui_v2.3/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/Public/Common/js/common.js"></script>
<script type="text/javascript">

</script>


<script>
    window.addEventListener('message', function(event) {
        // 接收位置信息，用户选择确认位置点后选点组件会触发该事件，回传用户的位置信息
        var loc = event.data;
      	//防止其他应用也会向该页面post信息，需判断module是否为'locationPicker'
        if (loc && loc.module == 'locationPicker') {
        	console.log('location', loc);
        	$('#poiaddress').val(loc.poiaddress);
        	$('#poiname').val(loc.poiname);
        	$('#lat').val(loc.latlng.lat);
        	$('#lng').val(loc.latlng.lng);
        }
    }, false);

    function showMap(){
    	$('#qqmap').removeClass('hidden');
    }
</script>
 <!-- 用于加载js代码 -->
<!-- 页面footer钩子，一般用于加载插件JS文件和JS代码 -->
<?php echo hook('pageFooter', 'widget');?>
<div class="hidden"><!-- 用于加载统计代码等隐藏元素 -->
	
</div>

	<!-- /底部 -->

</body>
</html>