<!--{include file="<!--{$oapath}-->public/ins_page.tpl"}-->
   <link rel='stylesheet' type='text/css' href="<!--{$oapath}-->Ins/js/layui/css/layui.css">
<block name="content">
	<div class="page-header">
	<h1>基本资料</h1>
</div>
	<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-right">
				<a onclick="save()"  class="btn btn-sm btn-primary">保存</a>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-xs-12">
			<form id="form_data" name="form_data" method="post" class="form-horizontal">
				<input type="hidden" name="id" id="id"  value="<!--{$vo.id}-->">
				<input type="hidden" name="pic" id="pic" value="<!--{$vo.pic}-->">
				<input type="hidden" name="ajax" id="ajax" value="1">
				<input type="hidden" name="opmode" id="opmode" value="">
				<table class="table table-bordered" >
					<tr>
						<th class="col-10">
						<nobr>
							员工编号
						</nobr></th>
						<td colspan="2" class="col-30">
						<p class="form-control-static">
							<!--{$vo.emp_no}-->
						</p></td>
						<td rowspan="3" class="col-20">
  
                                                   <img class="img-thumbnail col-12" id="emp_pic"  src="<!--{$vo.pic}-->" onerror="javascript:this.src='<!--{$oapath}-->Ins/img/no_avatar.jpg'" >

                                                </td>
					</tr>
					<tr>
						<th>姓名</th>
						<td colspan="2">
						<p class="form-control-static">
							<!--{$vo.name}-->
						</p></td>
					</tr>
					<tr>
						<th>性别</th>
						<td colspan="2">
						<select name="sex" id="sex" class="form-control col-10">
							<option  value="male">男</option>
							<option value="female">女</option>
						</select></td>
					</tr>
					<tr>
						<th>生日</th>
						<td colspan="2">
						<input type="text" id="birthday" name="birthday" readonly="readonly" class="input-date form-control" value="<!--{$vo.birthday}-->">
						</td>
						<td colspan="2"><a class="btn btn-sm btn-primary" id="testList">上传头像</a>
							</td>
					</tr>
					<tr>
						<th>部门*</th>
						<td class="col-20">
						<p class="form-control-static">
							<!--{$vo.dept_name}-->
						</p></td>
						<th class="col-10">职位</th>
						<td>
						<p class="form-control-static">
							<!--{$vo.position_name}-->
					
						</p></td>
					</tr>
					<tr>
						<th>
						<nobr>
							办公室电话
						</nobr></th>
						<td>
						<input type="text" id="office_tel" name="office_tel" class="form-control" value="<!--{$vo.office_tel}-->">
						</td>
						<th>
						<nobr>
							移动电话
						</nobr></th>
						<td>
						<input type="text" id="mobile_tel" name="mobile_tel" class="form-control" value="<!--{$vo.mobile_tel}-->">
						</td>
					</tr>
					<tr>
					<tr>
						<th>电子邮箱</th>
						<td colspan="3">
						<p class="form-control-static">
							<!--{$vo.email}-->
						</p></td>
					</tr>
					<tr>
						<th>
						<nobr>
							负责业务
						</nobr></th>
						<td colspan="3">
						<input type="text" id="duty" name="duty" class="form-control" value="<!--{$vo.duty}-->">
						</td>
					</tr>
				</table>
			</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/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>
        <script type="text/javascript" src="<!--{$oapath}-->Ins/js/layui/layui.js"></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>
<block name="js">
	<script type="text/javascript">
		
		function save() {
			sendForm("form_data", "oa.php?c=User&a=save",fix_url("oa.php?c=User&a=info"));
		}
		$(document).ready(function() {
		set_return_url();
		set_val('sex','<!--{$vo.sex}-->');
		});
	</script>

</block>
        <script>
layui.use('upload', function(){
  var $ = layui.jquery
  ,upload = layui.upload;
  
  //普通图片上传
  var uploadInst = upload.render({
    elem: '#testList'
    ,url: 'oa.php?c=Popup&a=upload'
    ,before: function(obj){
      //预读本地文件示例，不支持ie8
      obj.preview(function(index, file, result){
        $('#demo1').attr('src', result); //图片链接（base64）
      });
    }
    ,done: function(res){
      //如果上传失败
      if(res.code > 0){
        return layer.msg('上传失败');
      }else{
          $("#emp_pic").attr("src",res.name);
          $("[name=pic]").val(res.name1);
      }
      //上传成功
    }
    ,error: function(){
      //演示失败状态，并实现重传
      var demoText = $('#demoText');
      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
      demoText.find('.demo-reload').on('click', function(){
        uploadInst.upload();
      });
    }
  });
  

  
  //绑定原始文件域
  upload.render({
    elem: '#test20'
    ,url: '/upload/'
    ,done: function(res){
      console.log(res)
    }
  });
  
});
</script>
</block>
	</body>
</html>
