<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>导入Excel新增或更新数据</title>
<link href="<c:url value='/styles/lib/bootstrap.min.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/lib/font-awesome.min.css'/>" rel="stylesheet" type="text/css" />
<link href='<c:url value='/styles/lib/ionicons.min.css' />' rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/lib/datatables/dataTables.bootstrap.css' />" rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/AdminLTE.css'/>" rel="stylesheet" type="text/css" />
<script src="${ctx }/scripts/lib/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="<c:url value='/scripts/loading/jquery.blockUI.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/loading/loading.js'/>"></script>
<script type="text/javascript">
	function fileChange(){
		var fileName=$("#excelFile").val();
		var extension=fileName.substring(fileName.lastIndexOf(".")+1,fileName.length);
		if(extension=="xlsx"){
			showBlock();
			$("#fileUploadForm").submit();
		}
		else{
			alert("请上传xlsx格式的文件");
		}
	}
</script>
</head>
<body style="background-color: #f9f9f9;">
	<input type="hidden" value="${ctx}" id="contextPath">
	<div class="col-md-6" style="width:100%;" align="center">
		<!-- general form elements disabled -->
		<div class="box box-warning">
			<div class="box-header" style="width:90%;">
				<h3 class="box-title">导入Excel新增或更新数据 </h3>
				
				
			</div>
			<div class="box-body">
					<div class="form-group">
						<label><span style="color: red">*</span>您将通过上传的Excel文件，批量追加或更新表格数据</label>
					</div>
					<div class="form-group">
						<form id="fileUploadForm" name="form" action="${ctx }/member/importUserModel" 
									method="POST" enctype="multipart/form-data">
							<input type="hidden" name="funcid" value="${funcid }">
							<!-- 选择文件 并上传-->
							<div class="upload">
								<label for="ufUpload"> <em>选择文件</em> 
								<input type="file" id="excelFile" name="excelFile" onchange="fileChange()" />
								</label>
							</div>
						</form>
					</div>
					<div class="form-group">
						<a class="btn btn-back" href="<c:url value='/member/list?funcid=${funcid}' />">返回</a>
					</div>
			</div>
		</div>
	</div>
</body>
</html>
