瀏覽代碼

上传文件至 'webContent'

张汉钦 5 年之前
父節點
當前提交
4f08778bb1
共有 5 個文件被更改,包括 739 次插入0 次删除
  1. 242 0
      webContent/display.jsp
  2. 112 0
      webContent/login.jsp
  3. 176 0
      webContent/update.jsp
  4. 173 0
      webContent/update2.jsp
  5. 36 0
      webContent/welcome.jsp

+ 242 - 0
webContent/display.jsp

@@ -0,0 +1,242 @@
+<%@page import="java.sql.ResultSet"%>
+<%@page import="java.sql.PreparedStatement"%>
+<%@page import="java.sql.DriverManager"%>
+<%@page import="java.sql.Connection"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta name="viewport" content="width=device-width,initial-scale=1.0, 
+              minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
+        <title>员工信息</title>
+                <script>
+        function update(obj){
+        var ocount = document.getElementById('count');
+        var oname = document.getElementById('name');
+        var ogender = document.getElementById('gender');
+        var otelephone = document.getElementById('telephone');
+        var omailbox = document.getElementById('mailbox');
+        var oage = document.getElementById('age');
+        var odepartemnt = document.getElementById('department');
+        var oTr = obj.parentNode.parentNode;
+        var aTd = oTr.getElementsByTagName('td');
+        rowIndex = obj.parentNode.parentNode.rowIndex;  
+        ocount.value = aTd[1].innerHTML;
+        oname.value = aTd[2].innerHTML;
+        ogender.value = aTd[3].innerHTML;
+        otelephone.value = aTd[4].innerHTML;
+        omailbox.value = aTd[5].innerHTML;
+        oage.value = aTd[6].innerHTML;
+        odepartment.value = aTd[7].innerHTML;
+        console.log(aTd[4].innerHTML);
+        }
+        </script>
+        <style type="text/css">
+		*{
+			margin: 0;
+			padding: 0;
+		}
+		body{
+			padding: 10px 50px;
+		}
+		#wrap{
+				width: 800px;
+				margin: 10px auto;
+				font-family: 'trebuchet MS','Lucida sans',Arial;/*字体效果*/
+				font-size: 14px;
+				color: #444;
+			}
+		table{
+			*border-collapse:collapse;/*border-collapse用于表格属性,表示表格的两边框合并成一条*/
+			border-spacing: 0;/*border-spacing属性设置相邻单元格的边框的距离*/
+			width: 100%;
+		}
+		/*======bordered table======*/
+		/*-moz代表firefox浏览器私有属性,-ms代表ie浏览器私有属性,-webkit代表safari、chrome私有属性。这些是为了兼容老版本的写法,比较新版本的浏览器都支持直接写:border-radius。*/
+		.bordered{
+			border: solid #ccc 1px;
+			-moz-border-radius:6px;
+			-webkit-border-radius:6px;
+			border-radius: 6px; /*添加圆角边框:*/
+			-wekit-box-shadow:0 1px 1px #ccc;
+			-moz-box-shadow:0 1px 1px #ccc;
+			box-shadow: 0 1px 1px #ccc;  /*向方框添加阴影。*/
+		}
+		.bordered tr{
+			-o-transition:all 0.1s ease-in-out;/*过渡效果*/
+			-webkit-transition:all 0.1s ease-in-out;
+			-moz-transition:all 0.1s ease-in-out;
+			-ms-transition:all 0.1s ease-in-out;
+			transition:all 0.1s ease-in-out;
+		}
+		.bordered highlight,.bordered tr:hover{background: #fbf8e9;} /*hover:当鼠标经过时会颜色的变化*/
+		.bordered td,.bordered th{
+			border-left: 1px solid #ccc;
+			border-top: 1px solid #ccc;
+			padding: 10px;
+			text-align: left; /*左对齐元素中的文本*/
+		}
+		.bordered th{
+			border-color: #dce9f9;	/*-webkit safari、chrome私有属性 linear-gradient()函数用于创建一个线性渐变的 "图像"*/
+			background-image: -webkit-gradient(linear,left top,left bottom,from(#ebf3fc),to(#dce9f9));
+			background-image: -webkit-linear-gradient(top,#ebf3fc,#dce9f9);
+			background-image: -moz-linear-gradient(top,#ebf3fc,#dce9f9);
+			background-image: -ms-linear-gradient(top,#ebf3fc,#dce9f9);
+			background-image: -o-linear-gradient(top,#ebf3fc,#dce9f9);
+			background-image: linear-gradient(top,#ebf3fc,#dce9f9);
+			filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ebf3fc,endColorstr=#dce9f9);          /*ie提供的css渲染*/
+		    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ebf3fc,endColorstr=#dce9f9)";
+			-webkit-box-shadow:0 1px 0 raba(255,255,255,.8) inset;		/*ie提供的css渲染*/
+			-moz-box-shadow:0 1px 0 raba(255,255,255,.8) inset;
+			box-shadow:0 1px 0 raba(255,255,255,.8) inset;  /*内阴影*/
+			border-top: none;
+			text-shadow:0 1px 0 raba(255,255,255,.5);
+		}
+		.bordered td:first-child,.bordered th:first-child{
+			border-left: none;
+		}
+		.bordered th:first-child{
+			-moz-border-radius:6px 0 0 0;
+			-webkit-border-radius:6px 0 0 0;
+			border-radius:6px 0 0 0; 
+		}
+		.bordered th:last-child{
+			-moz-border-radius:0 6px 0 0;
+			-webkit-border-radius:0 6px 0 0;
+			border-radius:0 6px 0 0;
+				
+		}
+		.bordered tr:last-child td:first-child{
+			-moz-border-radius:0 0 0 6px;
+			-webkit-border-radius:0 0 0 6px;
+			border-radius:0 0 0 6px;
+		}
+		.bordered tr:last-child td:last-child{
+			-moz-border-radius:0 0 6px 0;
+			-webkit-border-radius:0 0 6px 0;
+			border-radius:0 0 6px 0;
+		}
+		.a{
+		color:blue;
+		}
+		.button{
+	background: url(images/button-bg.png) repeat-x top center;
+	border: 1px solid #999;
+	-moz-border-radius:4px;
+	-webkit-border-radius:4px;
+	border-radius:4px;
+	padding: 5px;
+	color: black;
+	font-weight: bold;
+	font-size: 13px;
+	width: 70px;
+}
+.button:hover{
+	background: white;
+	color: black;
+}
+	
+	
+	
+	</style>
+    </head>
+    <body>
+    <h1 align="center">员工信息列表</h1>
+    <div align="right" >
+            <input type="button" value="添加员工" class="button"
+                   onclick="javascrtpt:window.location.href = 'add.jsp'">
+        </div>
+        <br>
+         <div align="right">欢迎你,
+            <a href="login.jsp">退出</a>
+        </div>
+        
+        <br>
+        
+    	<form action="update.jsp" class="bordered">
+ <table align="center">
+  <tr>
+   <td>
+    姓名:<input type="text" name="name"/>
+   </td>
+   <td>
+    <input type="submit" value="查询" class="button" onclick="javascrtpt:window.location.href = 'update.jsp'"/>
+   </td>
+
+   </tr> 
+  </table>
+      </form>
+       
+        
+      <form action="update2.jsp" class="bordered">
+      <table align="center">
+           <tr>  
+      <td>
+    部门:
+    <select name="department">
+     <option value="人力部" >人力部</option>
+     <option value="生活部" >生活部</option>
+     <option value="活动部" >活动部</option>
+     <option value="财务部" >财务部</option>
+    </select>
+   </td>
+
+   <td>
+    <input type="submit" value="查询" class="button" onclick="javascrtpt:window.location.href = 'update2.jsp'" />
+   </td>
+</tr>
+  </table>
+        </form>
+          
+
+
+
+        <%
+            String driver = "com.mysql.cj.jdbc.Driver";
+            String url = "jdbc:mysql://localhost:3306/edu?characterEncoding=utf-8"
+                    + "&serverTimezone=UTC";
+            String usr = "root";
+            String password = "1234";
+
+            Class.forName(driver);
+            Connection conn = DriverManager.getConnection(url, usr, password);
+            String sqlString = "select * from manager1";
+            PreparedStatement pstmt = conn.prepareStatement(sqlString);
+            ResultSet rs = pstmt.executeQuery();
+        %>
+       
+        <table border=1 style="margin:auto" class="bordered">
+            <tr>
+                <th class="listTable" id="count">序号</th>
+                <th class="listTable" id="name">姓名</th>
+                <th class="listTable" id="gender">性别</th>
+                <th class="listTable" id="telephone">电话</th>
+                <th class="listTable" id="mailbox">邮箱</th>
+                <th id="profile" id="age">年龄</th>
+                <th id="operate" id="department">部门</th>
+                <th>操作</th>
+                
+            </tr>
+            
+
+            <%
+                while (rs.next()) {
+                    out.println("<tr>");
+                    out.println("<td >" + rs.getString("count") + "</td>");
+                    out.println("<td >" + rs.getString("name") + "</td>");
+                    out.println("<td>" + rs.getString("gender") + "</td>");
+                    out.println("<td>" + rs.getString("telephone") + "</td>");
+                    out.println("<td>" + rs.getString("mailbox") + "</td>");
+                    out.println("<td>" + rs.getInt("age") + "</td>");
+                    out.println("<td>" + rs.getString("department") + "</td>");
+                    out.println("<td><div><a href='../delete?count=" + rs.getString("count") + "'><button>删除</button></a></div><div><a href='change.jsp?count=" + rs.getString("count") + "'><button>修改</button></a></div></td>");
+                    out.println("</tr>");
+                }
+            %>
+        </table>
+        
+    </body>
+</html>
+
+

+ 112 - 0
webContent/login.jsp

@@ -0,0 +1,112 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta name="viewport" content="width=device-width,initial-scale=1.0">
+        <title>人员部门管理系统</title>
+    <script type="text/javascript">
+            function validate_form() {
+                var name = document.getElementById("username").value;
+                var password = document.getElementById("password").value;
+                if (name == "赖孽") {
+                    alert("欢迎你,赖总");
+                    return true;
+                }
+                if (password == null || password == "") {
+                    alert("密码不能为空");
+                    return false;
+                }
+                return true;
+            }
+    </script>
+    <style type="text/css">
+    	*{
+	margin: 0;
+	padding: 0;
+}
+body{
+	font-family: Georgia,serif;
+	background: url(file:///D:/java/新建文件夹/eclipse/ECLIPSE/student/WebContent/images/login-page-bg.jpg) center -50px no-repeat #c4c4c4;
+	color: #3a3a3a;
+}
+.clear{
+	clear: both;
+}
+form{
+	width: 406px;
+	margin: 120px auto 0;
+}
+legend{
+	display: none;
+}
+fieldset{
+	border: 0;
+}
+label{
+	width: 115px;
+	text-align: right;
+	float: left;
+	margin: 0 10px 0 0;
+	padding: 9px 0 0 0;
+	font-size: 16px;
+}
+input{
+	width: 220px;
+	display: block;
+	padding: 4px;
+	margin: 0 0 10px 0;
+	font-size: 18px;
+	color: #3a3a3a;
+	font-family: Georgia,serif;
+}
+input[type=checkbox]{
+	width: 20px;
+	margin: 0;
+	display: inline-block;
+	position: relative;
+	top: 3px;
+	left: -5px;
+	
+}
+.button{
+	background: url(file:///D:/java/新建文件夹/eclipse/ECLIPSE/student/WebContent/images/button-bg.png) repeat-x top center;
+	border: 1px solid #999;
+	-moz-border-radius:4px;
+	-webkit-border-radius:4px;
+	border-radius:4px;
+	padding: 5px;
+	color: black;
+	font-weight: bold;
+	font-size: 13px;
+	width: 70px;
+}
+.button:hover{
+	background: white;
+	color: black;
+}
+    	
+    </style>
+    </head>
+    <body>
+        <form id="login-form" action="display.jsp" onsubmit="return validate_form()" method="post">
+	<fieldset>
+		<legend>用户名</legend>
+		<label for="login">用户名</label>
+		<input type="text" id="username" name="username" placeholder="请输入用户名">
+		<div class="clear"></div>
+		<label for="password">密码</label>
+		<input type="password" id="password" name="password" placeholder="请输入密码">
+		<div class="clear"></div>
+		<label for="remember_me" style="padding: 0;">记住状态?</label>
+		<input type="checkbox" id="remember_me" name="remember_me">
+		<div class="clear"></div>
+		<br>
+		
+        <input type="submit" style="margin: -20px 0 0 287px;" class="button" name="commit" value="提 交"></ a>
+		
+		</fieldset>
+	</form>
+    </body>
+</html>

+ 176 - 0
webContent/update.jsp

@@ -0,0 +1,176 @@
+<%@page import="java.sql.ResultSet"%>
+<%@page import="java.sql.PreparedStatement"%>
+<%@page import="java.sql.Statement"%>
+<%@page import="java.sql.DriverManager"%>
+<%@page import="java.sql.Connection"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>Insert title here</title>
+<style type="text/css">
+*{
+	margin: 0;
+	padding: 0;
+}
+body{
+	padding: 10px 50px;
+}
+#wrap{
+		width: 800px;
+		margin: 10px auto;
+		font-family: 'trebuchet MS','Lucida sans',Arial;/*字体效果*/
+		font-size: 14px;
+		color: #444;
+	}
+table{
+	*border-collapse:collapse;/*border-collapse用于表格属性,表示表格的两边框合并成一条*/
+	border-spacing: 0;/*border-spacing属性设置相邻单元格的边框的距离*/
+	width: 100%;
+}
+/*======bordered table======*/
+/*-moz代表firefox浏览器私有属性,-ms代表ie浏览器私有属性,-webkit代表safari、chrome私有属性。这些是为了兼容老版本的写法,比较新版本的浏览器都支持直接写:border-radius。*/
+.bordered{
+	border: solid #ccc 1px;
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	border-radius: 6px; /*添加圆角边框:*/
+	-wekit-box-shadow:0 1px 1px #ccc;
+	-moz-box-shadow:0 1px 1px #ccc;
+	box-shadow: 0 1px 1px #ccc;  /*向方框添加阴影。*/
+}
+.bordered tr{
+	-o-transition:all 0.1s ease-in-out;/*过渡效果*/
+	-webkit-transition:all 0.1s ease-in-out;
+	-moz-transition:all 0.1s ease-in-out;
+	-ms-transition:all 0.1s ease-in-out;
+	transition:all 0.1s ease-in-out;
+}
+.bordered highlight,.bordered tr:hover{background: #fbf8e9;} /*hover:当鼠标经过时会颜色的变化*/
+.bordered td,.bordered th{
+	border-left: 1px solid #ccc;
+	border-top: 1px solid #ccc;
+	padding: 10px;
+	text-align: left; /*左对齐元素中的文本*/
+}
+.bordered th{
+	border-color: #dce9f9;	/*-webkit safari、chrome私有属性 linear-gradient()函数用于创建一个线性渐变的 "图像"*/
+	background-image: -webkit-gradient(linear,left top,left bottom,from(#ebf3fc),to(#dce9f9));
+	background-image: -webkit-linear-gradient(top,#ebf3fc,#dce9f9);
+	background-image: -moz-linear-gradient(top,#ebf3fc,#dce9f9);
+	background-image: -ms-linear-gradient(top,#ebf3fc,#dce9f9);
+	background-image: -o-linear-gradient(top,#ebf3fc,#dce9f9);
+	background-image: linear-gradient(top,#ebf3fc,#dce9f9);
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ebf3fc,endColorstr=#dce9f9);          /*ie提供的css渲染*/
+    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ebf3fc,endColorstr=#dce9f9)";
+	-webkit-box-shadow:0 1px 0 raba(255,255,255,.8) inset;		/*ie提供的css渲染*/
+	-moz-box-shadow:0 1px 0 raba(255,255,255,.8) inset;
+	box-shadow:0 1px 0 raba(255,255,255,.8) inset;  /*内阴影*/
+	border-top: none;
+	text-shadow:0 1px 0 raba(255,255,255,.5);
+}
+.bordered td:first-child,.bordered th:first-child{
+	border-left: none;
+}
+.bordered th:first-child{
+	-moz-border-radius:6px 0 0 0;
+	-webkit-border-radius:6px 0 0 0;
+	border-radius:6px 0 0 0; 
+}
+.bordered th:last-child{
+	-moz-border-radius:0 6px 0 0;
+	-webkit-border-radius:0 6px 0 0;
+	border-radius:0 6px 0 0;
+		
+}
+.bordered tr:last-child td:first-child{
+	-moz-border-radius:0 0 0 6px;
+	-webkit-border-radius:0 0 0 6px;
+	border-radius:0 0 0 6px;
+}
+.bordered tr:last-child td:last-child{
+	-moz-border-radius:0 0 6px 0;
+	-webkit-border-radius:0 0 6px 0;
+	border-radius:0 0 6px 0;
+}
+.a{
+color:blue;
+}
+.button{
+background: url(images/button-bg.png) repeat-x top center;
+border: 1px solid #999;
+-moz-border-radius:4px;
+-webkit-border-radius:4px;
+border-radius:4px;
+padding: 5px;
+color: black;
+font-weight: bold;
+font-size: 13px;
+width: 70px;
+}
+.button:hover{
+background: white;
+color: black;
+}
+
+
+
+</style>
+</head>
+<body>
+
+
+
+<table align="center" border="1" width="80%" class="bordered">
+ <tr>
+  <th>序号</th>
+  <th>姓名</th>
+  <th>性别</th>
+  <th>电话</th>
+  <th>邮箱</th>
+  <th>年龄</th>
+  <th>部门</th>
+  <th>操作</th>
+ </tr>
+
+ <%
+ String key=request.getParameter("name");
+ String driver="com.mysql.cj.jdbc.Driver";
+ String url="jdbc:mysql://localhost:3306/edu?characterEncoding=utf-8"
+         + "&serverTimezone=UTC";
+ String user="root";
+ String password="1234";
+ Class.forName(driver);
+ Connection conn=DriverManager.getConnection(url,user,password);
+  //插入数据
+  String sql="SELECT*FROM manager1 where name=?";
+  PreparedStatement pstmt=conn.prepareStatement(sql);
+  pstmt.setString(1, key);
+  ResultSet rs = pstmt.executeQuery();
+  int i=1;
+  while(rs.next()) {
+   %>
+   <% 
+                    out.println("<tr>");
+                    out.println("<td name=\"count\">" + rs.getString("count") + "</td>");
+                    out.println("<td id='name'>" + rs.getString("name") + "</td>");
+                    out.println("<td>" + rs.getString("gender") + "</td>");
+                    out.println("<td>" + rs.getString("telephone") + "</td>");
+                    out.println("<td>" + rs.getString("mailbox") + "</td>");
+                    out.println("<td>" + rs.getInt("age") + "</td>");
+                    out.println("<td>" + rs.getString("department") + "</td>");
+                   
+                    
+                    out.println("<td><div><a href='../delete?count=" + rs.getString("count") + "'><button>删除</button></a></div><div><a href='change.jsp?count=" + rs.getString("count") + "'><button>修改</button></a></div></td>");
+                    out.println("</tr>");
+                    %>
+   </table>
+  <%
+  }
+  pstmt.close();
+  conn.close();
+ %>
+</body>
+</html>

+ 173 - 0
webContent/update2.jsp

@@ -0,0 +1,173 @@
+<%@page import="java.sql.ResultSet"%>
+<%@page import="java.sql.PreparedStatement"%>
+<%@page import="java.sql.Statement"%>
+<%@page import="java.sql.DriverManager"%>
+<%@page import="java.sql.Connection"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>Insert title here</title>
+<style type="text/css">
+*{
+	margin: 0;
+	padding: 0;
+}
+body{
+	padding: 10px 50px;
+}
+#wrap{
+		width: 800px;
+		margin: 10px auto;
+		font-family: 'trebuchet MS','Lucida sans',Arial;/*字体效果*/
+		font-size: 14px;
+		color: #444;
+	}
+table{
+	*border-collapse:collapse;/*border-collapse用于表格属性,表示表格的两边框合并成一条*/
+	border-spacing: 0;/*border-spacing属性设置相邻单元格的边框的距离*/
+	width: 100%;
+}
+/*======bordered table======*/
+/*-moz代表firefox浏览器私有属性,-ms代表ie浏览器私有属性,-webkit代表safari、chrome私有属性。这些是为了兼容老版本的写法,比较新版本的浏览器都支持直接写:border-radius。*/
+.bordered{
+	border: solid #ccc 1px;
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	border-radius: 6px; /*添加圆角边框:*/
+	-wekit-box-shadow:0 1px 1px #ccc;
+	-moz-box-shadow:0 1px 1px #ccc;
+	box-shadow: 0 1px 1px #ccc;  /*向方框添加阴影。*/
+}
+.bordered tr{
+	-o-transition:all 0.1s ease-in-out;/*过渡效果*/
+	-webkit-transition:all 0.1s ease-in-out;
+	-moz-transition:all 0.1s ease-in-out;
+	-ms-transition:all 0.1s ease-in-out;
+	transition:all 0.1s ease-in-out;
+}
+.bordered highlight,.bordered tr:hover{background: #fbf8e9;} /*hover:当鼠标经过时会颜色的变化*/
+.bordered td,.bordered th{
+	border-left: 1px solid #ccc;
+	border-top: 1px solid #ccc;
+	padding: 10px;
+	text-align: left; /*左对齐元素中的文本*/
+}
+.bordered th{
+	border-color: #dce9f9;	/*-webkit safari、chrome私有属性 linear-gradient()函数用于创建一个线性渐变的 "图像"*/
+	background-image: -webkit-gradient(linear,left top,left bottom,from(#ebf3fc),to(#dce9f9));
+	background-image: -webkit-linear-gradient(top,#ebf3fc,#dce9f9);
+	background-image: -moz-linear-gradient(top,#ebf3fc,#dce9f9);
+	background-image: -ms-linear-gradient(top,#ebf3fc,#dce9f9);
+	background-image: -o-linear-gradient(top,#ebf3fc,#dce9f9);
+	background-image: linear-gradient(top,#ebf3fc,#dce9f9);
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ebf3fc,endColorstr=#dce9f9);          /*ie提供的css渲染*/
+    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ebf3fc,endColorstr=#dce9f9)";
+	-webkit-box-shadow:0 1px 0 raba(255,255,255,.8) inset;		/*ie提供的css渲染*/
+	-moz-box-shadow:0 1px 0 raba(255,255,255,.8) inset;
+	box-shadow:0 1px 0 raba(255,255,255,.8) inset;  /*内阴影*/
+	border-top: none;
+	text-shadow:0 1px 0 raba(255,255,255,.5);
+}
+.bordered td:first-child,.bordered th:first-child{
+	border-left: none;
+}
+.bordered th:first-child{
+	-moz-border-radius:6px 0 0 0;
+	-webkit-border-radius:6px 0 0 0;
+	border-radius:6px 0 0 0; 
+}
+.bordered th:last-child{
+	-moz-border-radius:0 6px 0 0;
+	-webkit-border-radius:0 6px 0 0;
+	border-radius:0 6px 0 0;
+		
+}
+.bordered tr:last-child td:first-child{
+	-moz-border-radius:0 0 0 6px;
+	-webkit-border-radius:0 0 0 6px;
+	border-radius:0 0 0 6px;
+}
+.bordered tr:last-child td:last-child{
+	-moz-border-radius:0 0 6px 0;
+	-webkit-border-radius:0 0 6px 0;
+	border-radius:0 0 6px 0;
+}
+.a{
+color:blue;
+}
+.button{
+background: url(images/button-bg.png) repeat-x top center;
+border: 1px solid #999;
+-moz-border-radius:4px;
+-webkit-border-radius:4px;
+border-radius:4px;
+padding: 5px;
+color: black;
+font-weight: bold;
+font-size: 13px;
+width: 70px;
+}
+.button:hover{
+background: white;
+color: black;
+}
+
+
+
+</style>
+</head>
+<body>
+
+
+
+<table align="center" border="1" width="80%" class="bordered">
+ <tr>
+  <th>序号</th>
+  <th>姓名</th>
+  <th>性别</th>
+  <th>电话</th>
+  <th>邮箱</th>
+  <th>年龄</th>
+  <th>部门</th>
+  <th>操作</th>
+ </tr>
+
+ <%
+ String department=request.getParameter("department");
+ String driver="com.mysql.cj.jdbc.Driver";
+ String url="jdbc:mysql://localhost:3306/edu?characterEncoding=utf-8"
+         + "&serverTimezone=UTC";
+ String user="root";
+ String password="1234";
+ Class.forName(driver);
+ Connection conn=DriverManager.getConnection(url,user,password);
+  //插入数据
+  String sql="SELECT*FROM manager1 where department=?";
+  PreparedStatement pstmt=conn.prepareStatement(sql);
+  pstmt.setString(1,department);
+  ResultSet rs = pstmt.executeQuery();
+  int i=1;
+  while (rs.next()) {
+      out.println("<tr>");
+      out.println("<td name=\"count\">" + rs.getString("count") + "</td>");
+      out.println("<td id='name'>" + rs.getString("name") + "</td>");
+      out.println("<td>" + rs.getString("gender") + "</td>");
+      out.println("<td>" + rs.getString("telephone") + "</td>");
+      out.println("<td>" + rs.getString("mailbox") + "</td>");
+      out.println("<td>" + rs.getInt("age") + "</td>");
+      out.println("<td>" + rs.getString("department") + "</td>");
+      out.println("<td><div><a href='../delete?count=" + rs.getString("count") + "'><button>删除</button></a></div><div><a href='change.jsp?count=" + rs.getString("count") + "'><button>修改</button></a></div></td>");
+      out.println("</tr>");
+  }
+                    %>
+   </table>
+  <%
+
+  pstmt.close();
+  conn.close();
+ %>
+</body>
+</html>

+ 36 - 0
webContent/welcome.jsp

@@ -0,0 +1,36 @@
+
+<%@page import="java.text.SimpleDateFormat"%>
+<%@page import="java.util.Date"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta name="viewport" content="width=device-width,initial-scale=1.0, 
+              minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
+        <title>欢迎0.0</title>
+    </head>
+    <body>
+        <h1 align="center">欢迎使用人员部门管理系统</h1>
+        <a href="login.jsp"><h2 align="center">点击进入</h2></a>
+        <div align="center" style="width:100%; position:fixed; bottom:0;">
+            <%
+                int num = 1;
+                if (application.getAttribute("Count") == null) {
+                    num = 1;
+                } else {
+                    num = ((Integer) application.getAttribute("Count")).intValue();
+                    num++;
+                }
+                application.setAttribute("Count", new Integer(num));
+            %>
+            <%="欢迎访问本站," + "您是第" + num + "个访问用户"%>
+        <br>
+            <%!Date time = new Date();%>
+            <%
+                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
+            %>
+            <% out.println(sdf1.format(time));%>
+        </div>
+    </body>
+</html>