<!--{include file="<!--{$oapath}-->public/ins_page.tpl"}-->

<block name="content">
<div class="page-header">
	<h1>考勤规则</h1>
</div>
	<div class="panel blank-panel">
		<div class="panel-heading">
			<div class="panel-options">
				<ul class="nav nav-tabs">
					<li id="tb1">
						<a href="#tab-1" onclick="set_current_tab(1)" data-toggle="tab" aria-expanded="false">考勤设置</a>
						<!--<notempty name="system_license">
							<li id="tb2">
								<a href="#tab-2" onclick="set_current_tab(2)"data-toggle="tab" aria-expanded="false">微信设置</a>
							</li>
							<li id="tb3">
								<a href="#tab-3" onclick="set_current_tab(3)"data-toggle="tab" aria-expanded="false">微信菜单</a>
							</li>
						</notempty>
					<li id="tb4">
						<a href="#tab-4" onclick="set_current_tab(4)"data-toggle="tab" aria-expanded="false">其他</a>
					</li>
					<li id="tb5">
						<a href="#tab-5" onclick="set_current_tab(5)"data-toggle="tab" aria-expanded="false">推送设置</a>
					</li>-->
				</ul>
			</div>
		</div>

		<div class="panel-body">
			<div class="tab-content">
				<div class="tab-pane" id="tab-1">
					<form id="form_system" name="form_system" method="post">
						<input type="hidden" name="data_type" value="sign">
                                                <div class="form-group col-sm-12">
                                                        <label class="col-sm-2 control-label" for="signin_time">上班时间：</label>
                                                        <div class="col-sm-8">
                                                            <div class="input-daterange input-group">
                                                                <input  type="text" class="input-sm form-control text-center" name="signin_start_time" readonly="readonly" value="<!--{$sign_data.signin_start_time}-->"/>
                                                                </div>
                                                        </div>
                                                </div>
 
                                                <div class="form-group col-sm-12">
                                                        <label class="col-sm-2 control-label" for="signback_time">下班时间：</label>
                                                        <div class="col-sm-8">
                                                               <div class="input-daterange input-group">
                                                                        <input type="text" class="input-sm form-control text-center" name="signback_start_time" readonly="readonly" value="<!--{$sign_data.signback_start_time}-->"/>
                                                                </div>
                                                        </div>
                                                </div>
                                                <div class="form-group col-sm-12">
                                                        <label class="col-sm-2 control-label" for="address">考勤地址：</label>
                                                        <div class="col-sm-8">
                                                                <div class="input-group"  style="width: 260px;">
                                                                        <input type="text" id='address' class="input-sm form-control" name="address" value="<!--{$sign_data.address}-->"/>
                                                                </div>
                                                            <div class="input-group">
                <a style="text-decoration:none" class="layui-btn layui-btn-danger  layui-btn-small"  id="juti" style="width:32%;  float:right">选择具体地址</a>     
                                                             </div>
                                                        </div>
                                                </div>
                                                <div class="form-group col-sm-12">
                                                        <label class="col-sm-2 control-label" for="be_create_time">经纬度：</label>
                                                        <div class="col-sm-8">
                                                                <div class="input-group" style="width: 260px;">
                                                                        <input type="text" class="input-sm form-control" name="jing" readonly="readonly" value="<!--{$sign_data.jing}-->"/>
                                                                        <span class="input-group-addon">-</span>
                                                                        <input type="text" class="input-sm form-control" name="wei" readonly="readonly" value="<!--{$sign_data.wei}-->"/>
                                                                </div>
                                                        </div>
                                                </div>   
                                                 <div class="form-group col-sm-12">
                                                        <label class="col-sm-2 control-label" for="distance">周边范围(m)：</label>
                                                        <div class="col-sm-8">
                                                                <div class="input-group" style="width: 260px;">
                                                                        <input type="text" class="input-sm form-control" name="distance" value="<!--{$sign_data.distance}-->"/>
                                                                </div>
                                                        </div>
                                                </div>
						<div class="form-group col-xs-12">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-10">
								<a onclick="save_system()" class="btn btn-sm btn-primary">保存</a>
							</div>
						</div>
					</form>
				</div>

		</div>
</block>

					
				</div>
			</div>
		</div>
		<!--<iframe src="{:U('push/client')}" class="push" id="push"></iframe>-->
		<!-- Mainly scripts -->
		<script src="<!--{$oapath}-->Ins/js/jquery-2.1.1.js"></script>
		<script src="<!--{$oapath}-->Ins/js/bootstrap.min.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<!-- Custom and plugin javascript -->
		<script src="<!--{$oapath}-->Ins/js/inspinia.js"></script>
		<script src="<!--{$oapath}-->Ins/js/common.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/pace/pace.min.js"></script>
                
                        <script src="<!--{$oapath}-->Ins/js/plugins/date-time/moment-with-locales.js"></script>
	<script src="<!--{$oapath}-->Ins/js/plugins/date-time/bootstrap-datetimepicker.js"></script>
         <script type="text/javascript" src="<!--{$oapath}-->Ins/js/layer/layer.js"></script>
<block name="js">
	<script type="text/javascript">
		

		function save_system() {
			sendForm("form_system", "oa.php?c=Sign&a=save_sign");
		}
		

		function showdata_weixin(result) {
			$("#form_data_weixin #id").val(result.data['id']);
			$("#form_data_weixin #name").val(result.data['name']);
			$("#form_data_weixin #url").val(result.data['url']);
			$("#form_data_weixin #key").val(result.data['key']);
			$("#form_data_weixin #pid").val(result.data['pid']);
			$("#form_data_weixin #type").val(result.data['type']);

			$("#form_data_weixin #sort").val(result.data['sort']);

			$("#pid_name").val($("#weixin_menu_list option[value='" + $("#pid").val() + "']").text());
			$("#opmode").val("edit");
		}

		function showdata_common(result) {
			$("#form_data #code").val(result.data['code']);
			$("#form_data #name").val(result.data['name']);
			$("#form_data #val").val(result.data['val']);
			$("#form_data #sort").val(result.data['sort']);
			$("#form_data #is_del").val(result.data['is_del']);
			$("#form_data #remork").val(result.data['remork']);
			$("#form_data #pid").val(result.data['pid']);
			$("#form_data #id").val(result.data['id']);
			$("#form_data #pid_name").val($("#system_config_list option[value='" + result.data['pid'] + "']").text());
			$("#opmode").val("edit");
		}


		$("#weixin_option").change(function() {
			$('#form_search_weixin').submit();
		});

		function set_current_tab(num) {
			set_cookie('current_tab', num);
		}

		function get_current_tab() {
			if (get_cookie('current_tab') == undefined) {
				return 1;
			} else {
				return get_cookie('current_tab');
			}
		}

		//读取修改侧页
		$(document).ready(function() {

			//选择上次选择的TAB
			$current_tab = get_current_tab();
			$(".panel-heading li").removeClass("active");
			$(".tab-pane").removeClass("active");

			$("#tb" + $current_tab).addClass("active");
			$("#tab-" + $current_tab).addClass("active");

		
			
		});
                	$("#juti").click(function(){
			var zuo=$("[name=jing]").val();  
			var biao=$("[name=wei]").val();
			if(zuo!='' && biao!=''){  
			var zuobiao=zuo+","+biao;
			}else{
				var zuobiao='';
				
				}
                        var p='oa.php?c=Sign&a=choice_address&dizhi='+zuobiao;
                                      layer.open({
                        type: 2,
                        title : '选择具体坐标',
                        area: ['700px', '530px'],
                        fix: false, //不固定
                        maxmin: true,
                        content: p
                           });

	
	})
	</script>
          <script type="text/javascript">
	$(document).ready(function() {
		$('.input-date').datetimepicker({
				format : 'HH:mm',
			locale : 'zh-cn',
			ignoreReadonly : true,
			widgetPositioning : {
				horizontal : 'auto',
				vertical : 'bottom'
			},
		});
		
		$(".input-daterange input").datetimepicker({
				format : 'HH:mm',
			locale : 'zh-cn',
			showTodayButton : true,
			showClose : true,
			ignoreReadonly : true,
			widgetPositioning : {
				horizontal : 'auto',
				vertical : 'bottom'
			},
		});

		$("#start_date").on("dp.change", function(e) {
			if ($("#end_date").length > 0) {
				$('#end_date').data("DateTimePicker").minDate(e.date);
			}
		});
		
		$("#end_date").on("dp.change", function(e) {
			if ($("#start_date").length > 0) {
				$('#start_date').data("DateTimePicker").maxDate(e.date);
			}
		});

		$(".input-date-time").datetimepicker({
			format : 'YYYY-MM-DD HH:mm',
			locale : 'zh-cn',
			sideBySide : true,
			showTodayButton : true,
			showClose : true,
			ignoreReadonly : true,
			widgetPositioning : {
				horizontal : 'auto',
				vertical : 'bottom'
			},
		});		 
	}); 
</script>
</block>
	</body>
</html>
