<!--{include file="<!--{$oapath}-->public/ins_popup.tpl"}-->
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<select name="dept_list" id="dept_list" class="hidden">
		{:fill_option($dept_list)}
	</select>
	<div class="popup-header clearfix">
		<div class="pull-left">
			<h1>添加员工</h1>
		</div>
		<div class="pull-right">
			<a onclick="save();" class="btn btn-sm btn-primary">确定</a>
			<a onclick="myclose();" class="btn btn-sm btn-default">关闭</a>
		</div>
	</div>
	<div class="popup-body" style="height: 420px;overflow-y: auto;">
		<form id="form_data" name="form_data" method="post" class="form-horizontal">
			<input type="hidden" name="opmode" id="opmode" value="add">
			<table class="table table-bordered" >
				<tr>
					<th class="col-10">
					<nobr>
						员工编号*
					</nobr></th>
					<td class="col-20">
					<input class="form-control" type="text" id="emp_no" name="emp_no"  check="require" msg="请输入员工编号">
					</td>
					<th  class="col-5">姓名*</th>
					<td class="col-20">
					<input  class="form-control" type="text" id="name" name="name" class="input-sm" check="require" msg="请输入姓名">
					</td>

				</tr>
				<tr>
					<th  class="col-10">昵称*</th>
					<td class="col-10">
					<input  class="form-control" type="text" id="nickname" name="nickname" class="input-sm" check="require" msg="请输入昵称">
					</td>
				</tr>
				<tr>
					<th>性别</th>
					<td >
					<select name="sex" id="sex" class="form-control col-10">
						<option  value="male">男</option>
						<option value="female">女</option>
					</select></td>
					<th>生日</th>
					<td style="position: relative" >
					<input type="text" id="birthday" name="birthday" readonly="readonly" class="input-date form-control" readonly="readonly">
					</td>
				</tr>
				<tr>
					<th>部门*</th>
					<td class="col-20">
					<div class="input-group ">
						<input class="form-control" name="dept_name"  id="dept_name" type="text" msg="请选择部门" check="require" readonly="readonly" />
						<input name="dept_id" id="dept_id" type="hidden" msg="请选择部门" check="require" />
						<div class="input-group-btn">
							<a class="btn btn-sm btn-primary" onclick="select_dept();" > <i class="fa fa-search" ></i> </a>
						</div>
					</div></td>
					<th class="col-10">职位*</th>
					<td>
					<select name="position_id" id="position_id" class="form-control" msg="请选择职位" check="require">
						<option value="">选择职位</option>
						<!--{foreach $position_list as  $key=>$vo}-->
                                                              <option value="<!--{$vo.id}-->"><!--{$vo.name}--></option>
                                                        <!--{/foreach}-->
					</select></td>
				</tr>
				<tr>
					<th>
					<nobr>
						办公室电话
					</nobr></th>
					<td>
					<input type="text" id="office_tel" name="office_tel" class="form-control">
					</td>
					<th>
					<nobr>
						移动电话
					</nobr></th>
					<td>
					<input type="text" id="mobile_tel" name="mobile_tel" class="form-control">
					</td>
				</tr>
				<tr>
				<tr>
					<th>电子邮箱</th>
					<td colspan="3">
					<input type="text" id="email" name="email" class="form-control">
					</td>
				</tr>
				<tr>
					<th>
					<nobr>
						负责业务
					</nobr></th>
					<td colspan="3">
					<input type="text" id="duty" name="duty" class="form-control">
					</td>
				</tr>
				<tr>
					<th>状态</th>
					<td colspan="3">
					<select class="form-control col-10"  name="is_del" id="is_del">
						<option  value="0">启用</option>
						<option value="1">禁用</option>
					</select></td>
				</tr>
			</table>
		</form>
	</div>
	</div>
</block>

                                		</div>
		<!-- 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/toastr/toastr.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/gritter/jquery.gritter.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/bootbox/bootbox.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>
		<block name="js"></block>
		<script>
			$(document).ready(function() {
				$(".popup-container").width($("#dialog", parent.document).width());
				if (is_mobile()) {
					$(".popup-container").height(window.screen.height - 40);
					$(".popup-container").css('overflow', 'auto');
				}
			});
		</script>
<block name="js">
    <script type="text/javascript">
	$(document).ready(function() {
	
		 $('.input-date').datetimepicker({
			format : 'YYYY-MM-DD',
			locale : 'zh-cn',
			ignoreReadonly : true,
			widgetPositioning : {
				horizontal : 'auto',
				vertical : 'bottom'
			},
		});
		
		$(".input-daterange input").datetimepicker({
			format : "YYYY-MM-DD",
			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>
	<script type="text/javascript">
		function select_dept() {
			winopen("oa.php?c=Dept&a=winpop2", 560, 470);
		}

		function save() {
			if (check_form("form_data")) {
				var vars = $("#form_data").serialize();
				sendAjax("oa.php?c=User&a=save", vars, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							parent.location.reload(true);
							myclose();
						});
					} else {
						ui_error(data.info);
					}
				});
			}
		}
	</script>
</block>
	</body>
</html>