Browse Source

上传文件至 'webapp/WEB-INF/jsp'

1701010542 6 years ago
parent
commit
591f092410

+ 87 - 0
webapp/WEB-INF/jsp/employees.jsp

@@ -0,0 +1,87 @@
+<%@ page import="java.util.*"  %>
+<%@ page language="java" contentType="text/html; charset=UTF-8"%> 
+<%@ page pageEncoding="UTF-8" %>
+
+    <%@ page isELIgnored="false" %>
+    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>员工部门管理</title>
+<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  
+	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
+	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
+</head>
+<body>
+<body>
+<div class="jumbotron text-center" style="margin-bottom:0">
+  <h1>员工部门管理系统</h1>
+</div>
+
+<nav class="navbar navbar-inverse">
+  <div class="container-fluid">
+    <div class="navbar-header">
+      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>                        
+      </button>
+      <a class="navbar-brand" href="#">主页管理</a>
+    </div>
+    <div class="collapse navbar-collapse" id="myNavbar">
+      <ul class="nav navbar-nav">
+        <li class="active"><a href="#"></a></li>
+        <li><a href="#"></a></li>
+        <li><a href="#"></a></li>
+      </ul>
+    </div>
+  </div>
+</nav>
+
+<center>
+<table border="10" class="table table-hover">
+<tr>
+	<td>员工id</td>
+	<td>员工名称</td>
+	<td>员工年龄</td>
+	<td>员工薪水</td>
+	<td>所属部门</td>
+	<td>操作</td>
+</tr>
+<!-- PageInfo有getList的方法 -->
+<c:forEach items="${employees.list }" var="employee">
+
+<tr>
+	<td>${employee.id }</td>
+	<td>${employee.name }</td>
+	<td>${employee.age}</td>
+	<td>${employee.salary}</td>
+	<td>${employee.department }</td>
+	  <td>
+        <a href="./toInsertForm">
+          <span class="glyphicon glyphicon-plus"></span>
+        </a>
+        <% out.println("&nbsp");%>
+        <a href="./toUpdateForm?id=${employee.id }">
+          <span class="glyphicon glyphicon-pencil" style="color:black"></span>
+        </a>
+        <% out.println("&nbsp");%>
+        <a href="./deleteEmployee?id=${employee.id }">
+          <span class="glyphicon glyphicon-remove" style="color:red"></span>
+        </a>
+	  </td>
+</tr>
+</c:forEach>
+</table>
+<!-- PageInfo有isFirstPage,getprePage,isLastPage,getNextPage方法 -->
+<c:if test="${!employees.isFirstPage}"><a href="selectEmployees?pageIndex=${employees.firstPage}">首页</a></c:if>
+<c:if test="${!employees.isFirstPage}"><a href="selectEmployees?pageIndex=${employees.prePage}">前一页</a></c:if>
+<c:if test="${!employees.isLastPage}"><a href="selectEmployees?pageIndex=${employees.nextPage}">后一页</a></c:if>
+<c:if test="${!employees.isFirstPage}"><a href="selectEmployees?pageIndex=${employees.lastPage}">尾页</a></c:if>
+</center>
+<div class="jumbotron text-center" style="margin-bottom:0">
+  <p style="color:#66CCFF">员工信息管理系统是事业单位科学、全面、高效进行人事管理的系统,参考大量中国人力资源管理理论,根植于国内管理的实际情况,实用而科学</p>
+</div>
+</body>
+</html>

+ 28 - 0
webapp/WEB-INF/jsp/insertForm.jsp

@@ -0,0 +1,28 @@
+<%@ page import="java.util.*" %>
+<%@ page language="java" contentType="text/html; charset=UTF-8"%> 
+<%@ page pageEncoding="UTF-8" %>
+
+    <%@ page isELIgnored="false" %>
+    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>加入新员工</title>
+<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  
+	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
+	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
+</head>
+<body>
+<form action="./insertEmployee">
+员工id:<input type="text" name="id"/>
+员工名称:<input type="text" name="name"/>
+员工年龄:<input type="text" name="age"/>
+员工薪水:<input type="text" name="salary"/>
+所属部门:<input type="text" name="department"/> 
+<input type="submit" value="确定"/>
+
+</form>
+</body>
+</html>

+ 72 - 0
webapp/WEB-INF/jsp/login.jsp

@@ -0,0 +1,72 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+<%@ page isELIgnored="false" %>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<meta name="description" content="">
+<meta name="author" content="">
+<title>登录员工部门管理系统</title>
+<!-- Bootstrap core css -->
+<link href="${pageContext.request.contextPath }/lib/css/bootstrap.min.css"
+rel="stylesheet">
+<!-- Custom style for this template -->
+<link href="${pageContext.request.contextPath }/lib/css/signin.css"
+rel="stylesheet">
+</head>
+<body>
+	<div class="container">
+		<form class="form-signin"
+		action="${pageContext.request.contextPath }/signOn" method="post"
+		onsubmit="return check()">
+			<h2 class="form-signin-heading">员工部门后台系统登录</h2>
+			<span style="color:red" id="message">${msg }</span>
+			<label for="no" class="sr-only">用户账号</label>
+			<input type="text" id="no" name="no" class="form-control" placeholder="
+			用户账号" required autofocus>
+			<label for="password" class="sr-only">用户密码</label>
+			<input type="password" id="password" name="password" class="form-control" placeholder="
+			用户密码" required>
+			<div class="checkbox">
+			<label>
+			<input type="checkbox" value="remember-me" id="remember-me">记住我
+			</label>
+			</div>
+			<button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
+			<!-- <button class="btn btn-lg btn-primary btn-block" type="submit">注册</button> -->
+		</form>
+		
+	</div><!-- /container -->
+	<script src="${pageContext.request.contextPath }/lib/js/jquery.min.js"></script>
+	<script src="${pageContext.request.contextPath }/lib/js/jquery.cookie.min.js"></script>
+	<!-- 加载就执行   用于记住我功能 -->
+	<script>
+		$(document).ready(function(){
+		if($.cookie('password')!=null){
+			$("#password".val($.cookie("password")));
+			}
+		if($.cookie('no')!=null){
+			$("#no".val($.cookie("no")));
+			}
+		});
+	</script>
+	<script>
+		function check(){
+			//记住我功能使用
+			//写入cookie
+			if($("#remember-me").prop("checked")==true){
+				var no=$("#no").val();
+				var password=$("#password").val();
+				$.cookie('no',no,{expiree:7});
+				$.cookie('password',password,{expiree:7});//存储一个带7天期限的cookie
+			}else{
+				$.cookie("no",null);
+				$.cookie("password",null);
+			}
+		}
+	</script>
+	</body>
+</html>

+ 25 - 0
webapp/WEB-INF/jsp/updateForm.jsp

@@ -0,0 +1,25 @@
+<%@ page import="java.util.*" %>
+<%@ page language="java" contentType="text/html; charset=UTF-8"%> 
+<%@ page pageEncoding="UTF-8" %>
+
+    <%@ page isELIgnored="false" %>
+    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>员工信息</title>
+</head>
+<body>
+<form action="./updateEmployee">
+<input type="hidden" name="id" value="${employee.id}" />
+员工名称:<input type="text" name="name" value="${employee.name }"/>
+员工年龄:<input type="text" name="age" value="${employee.age }"/>
+员工薪水:<input type="text" name="salary" value="${employee.salary }"/>
+所属部门:<input type="text" name="department" value="${employee.department }"/>
+<input type="submit" value="提交"/>
+</form>
+
+</body>
+</html>