<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>人员简历信息管理</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		img{width: 50px;height: 50px;}
	</style>
	<script type="text/javascript">
        var validateForm;
		function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
			  $("#inputForm").submit();
			  return true;
		  }
	
		  return false;
		}
		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
                    loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		//上传简历
        $(function () {
            $("#attachment_btn").click(function () {
                $("#attachment_file").click();
            });
        })
        function attachment_insertTitle(tValue){
            $("#attachment_title_div").remove();
            var t1 = tValue.lastIndexOf("\\");
            if(t1 >= 0 && t1 < tValue.length){
                $("#attachment_title").text(tValue.substring(t1+1));
                $("#attachment_title").after("<div id='attachment_title_div' style='float: right'>&nbsp;&nbsp;<span id='attachment_delete' onclick='attachment_del()'style='color: red ; cursor: pointer;'>x</span></div>");
            }
        }
        function attachment_del() {
            $("#attachment_file").val("");
            $("#attachment_title").text("");
            $("#attachment_delete").remove();
            $("#attachment_title_div").remove();
        }
	</script>
</head>
<body class="hideScroll">
									<%--action="${ctx}/hr/jobResume/save"--%>
<form:form id="inputForm" modelAttribute="userInfo" method="post" enctype="multipart/form-data" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="userOffice.userId"/>
		<form:hidden path="userOffice.companyId"/>
		<form:hidden path="userOffice.id"/>
		<form:hidden path="userId"/>
		<form:hidden path="companyId"/>
		<sys:message content="${message}"/>
		<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   <tbody>
			   <tr>
				   <td class="width-15 active"><label class="pull-right">姓名：</label></td>
				   <td class="width-35">
						   ${userInfo.name}
				   </td>
				   <td class="width-15 active"><label class="pull-right">性别：</label></td>
				   <td class="width-35">
						   ${fns:getDictLabel(userInfo.gender,'sex' ,'' )}
				   </td>
			   </tr>
			   <tr>
				   <td class="width-15 active"><label class="pull-right">昵称：</label></td>
				   <td class="width-35">
						   ${userInfo.nickName}
				   </td>
				   <td class="width-15 active"><label class="pull-right">工号：</label></td>
				   <td class="width-35">
						   ${userInfo.jobNumber}
				   </td>
			   </tr>
			   <tr>
				   <td class="width-15 active"><label class="pull-right">联系电话：</label></td>
				   <td class="width-35">
						   ${userInfo.mobilePhone}
				   </td>
				   <td class="width-15 active"><label class="pull-right">电子邮件：</label></td>
				   <td class="width-35">
						   ${userInfo.email}
				   </td>
			   </tr>
			   <tr>
				   <td class="width-15 active"><label class="pull-right">个人简介：</label></td>
				   <td class="width-35" colspan="3">
						   ${userInfo.personalProfile}
				   </td>
			   </tr>
			   <tr>
				   <td class="width-15 active"><label class="pull-right">备注信息：</label></td>
				   <td class="width-35" colspan="3">
						   ${userInfo.remarks}
				   </td>
			   </tr>
		   		<tr>
					<td class="width-15 active"><label class="pull-right">上传简历：</label></td>
					<td class="width-35" colspan="3">
						<div>
							<div style="float:left; height: 100%; width: 100%; ">
								<div style="display: inline-block">
									<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)attachment_insertTitle(this.value);"/>
									<a id="attachment_btn" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 上传</a>
									<span id="attachment_title"></span>
								</div>
								<table id="listManuscriptFile"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
									<tr>
										<%--<td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
									</tr>
									<tr>
										<c:if test="${not empty userInfo.user.jobResume.id}">
											<%--<td>1</td>--%>
											<td>
												<%--<span title="${userInfo.user.jobResume.attachmentName}">${fns:abbr(userInfo.user.jobResume.attachmentName, 30)}</span>--%>
												<c:choose>
													<c:when test="${fn:containsIgnoreCase(userInfo.user.jobResume.attachmentName,'jpg')
															or fn:containsIgnoreCase(userInfo.user.jobResume.attachmentName,'png')
															or fn:containsIgnoreCase(userInfo.user.jobResume.attachmentName,'gif')
															or fn:containsIgnoreCase(userInfo.user.jobResume.attachmentName,'jpeg')}">
														<img src="${userInfo.user.jobResume.url}" onclick="openDialogView(' ','${ctx}/sys/picturepreview/picturePreview?url=${userInfo.user.jobResume.url}','860px','600px')" width="50" height="50" alt="${userInfo.user.jobResume.attachmentName}"/>
													</c:when>
													<c:otherwise>
														<c:choose>
															<c:when test="${fn:containsIgnoreCase(userInfo.user.jobResume.attachmentName,'pdf')}">
																<a href="javascript:void(0)" onclick="preview('预览','${userInfo.user.jobResume.url}','80%','80%','1')">
																	<span title="${userInfo.user.jobResume.attachmentName}">${fns:abbr(userInfo.user.jobResume.attachmentName, 30)}</span></a>
															</c:when>
															<c:otherwise>
																<a href="javascript:void(0)" onclick="preview('预览','${userInfo.user.jobResume.url}','80%','80%')">
																	<span title="${userInfo.user.jobResume.attachmentName}">${fns:abbr(userInfo.user.jobResume.attachmentName, 30)}</span>
																</a>
															</c:otherwise>
														</c:choose>
													</c:otherwise>
												</c:choose>
											</td>
											<td>${userInfo.user.jobResume.attachmentUser}</td>
											<td><fmt:formatDate value="${userInfo.user.jobResume.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
											<td>
												<%--<a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${userInfo.user.jobResume.url}" class="btn btn-success btn-xs">下载</a>--%>
													<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${userInfo.user.jobResume.url}');" class="btn btn-success btn-xs">下载</a>
											</td>
										</c:if>
									</tr>
								</table>
							</div>
						</div>
					</td>
				</tr>
		 	</tbody>
		</table>
	</form:form>
</body>
</html>