This commit is contained in:
FJY
2017-10-29 22:55:28 +08:00
parent bc345795db
commit 56ae828c97
186 changed files with 7949 additions and 360 deletions

View File

@@ -0,0 +1,69 @@
<%@ page language="java" import="java.sql.*"
contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>检验插入页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<br>
<%
boolean flag = false;
request.setCharacterEncoding("utf-8");
String adminNo = request.getParameter("adminno");
String name = request.getParameter("adminname");
String adminsex = request.getParameter("sex");
String adminjob = request.getParameter("job");
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, use, password);
PreparedStatement sql = conn
.prepareStatement("insert into adminstrator_record(AdminNo,AdminName,Adminsex,Adminjob)values(?,?,?,?)");
sql.setString(1, adminNo);
sql.setString(2, name);
sql.setString(3, adminsex);
sql.setString(4, adminjob);
int rtn = sql.executeUpdate();
if (rtn != 0) {
flag = true;
}
sql.close();
conn.close();
%>
<!-- 判断是否是插入成功 -->
<%
if (flag == true) {
%>
<jsp:forward page="insert_success.jsp" />
<%
} else if (flag == false) {
%>
<jsp:forward page="insert_success.jsp" />
<%
}
%>
</body>
</html>

View File

@@ -0,0 +1,65 @@
<%@ page language="java" import="java.sql.*"
contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>检验插入页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<br>
<%
boolean flag = false;
request.setCharacterEncoding("utf-8");
String name = request.getParameter("jobname");
String duty = request.getParameter("jobduty");
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, use, password);
PreparedStatement sql = conn
.prepareStatement("insert into administrator_job(AdminJob,AdminDuty)values(?,?)");
sql.setString(1, name);
sql.setString(2, duty);
int rtn = sql.executeUpdate();
if (rtn != 0) {
flag = true;
}
sql.close();
conn.close();
%>
<!-- 判断是否是插入成功 -->
<%
if (flag == true) {
%>
<jsp:forward page="insert_success.jsp" />
<%
} else if (flag == false) {
%>
<jsp:forward page="insert_success.jsp" />
<%
}
%>
</body>
</html>

View File

@@ -0,0 +1,49 @@
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>检验注册页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<br>
<%
request.setCharacterEncoding("utf-8");
String users=(String)session.getAttribute("actualuser");
String pass=request.getParameter("inputPassword");
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url="jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
Connection conn= DriverManager.getConnection(url,use,password);
PreparedStatement sql =conn.prepareStatement("update user set password=? where userName=?");
sql.setString(1,pass);
sql.setString(2,users);
int rtn=sql.executeUpdate();
sql.close();
conn.close();
%>
<%
out.println("<script language=javascript>alert('修改成功!');window.location.href='index.html'</script>");
%>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<%@ page language="java" import="java.sql.*"
contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'check.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String users = request.getParameter("inputUser");
String pass = request.getParameter("inputPassword");
String phone = request.getParameter("PhoneNumber");
boolean flag = false;
PreparedStatement sql = null;
ResultSet rs = null;
Connection conn = null;
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
conn = DriverManager.getConnection(url, use, password);
sql = conn.prepareStatement("select * from user where userName=? and Email=? and phoneNum=?");
sql.setString(1, users);
sql.setString(2, pass);
sql.setString(3, phone);
rs = sql.executeQuery();
if (rs.next()) {
flag = true;
}
%>
<!-- 判断是否是正确的登录用户 -->
<%
if (flag == true) {
session.setAttribute("actualuser", users);
%>
<jsp:forward page="login_show.jsp" />
<%
} else if (flag == false) {
out.println("<script language=javascript>alert('邮箱或手机输入有误,修改失败');window.location.href='index.html'</script>");
}
rs.close();
sql.close();
conn.close();
%>
</body>
</html>

View File

@@ -0,0 +1,29 @@
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>插入失败</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<% out.println("插入失败,5秒后自动跳转回主页面");%>
<% response.setHeader("refresh","5;url=../mainframe.jsp");%>
</body>
</html>

View File

@@ -0,0 +1,27 @@
<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>插入成功</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
插入成功. <br>
<% response.setHeader("refresh","1;url=mainframe.jsp");%>
</body>
</html>

View File

@@ -0,0 +1,68 @@
<%@ page language="java" import="java.sql.*"
contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'check.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
boolean flag = false;
PreparedStatement sql = null;
ResultSet rs = null;
Connection conn = null;
if (session.getAttribute("actualuser") == null) {
out.println(
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
return;
}
Object user0 = session.getAttribute("actualuser");
String users = (String) user0;
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
conn = DriverManager.getConnection(url, use, password);
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
sql.setString(1, users);
rs = sql.executeQuery();
if (rs.next()) {
flag = true;
}
rs.close();
sql.close();
conn.close();
%>
<!-- 判断是否是管理员 -->
<%
if (flag == true) {
%>
<jsp:forward page="../manage_user.jsp" />
<%
} else if (flag == false) {
out.println(
"<script language=javascript>alert('你不是管理员,不能访问此版块');window.location.href='../mainframe.jsp'</script>");
return;
}
%>
</body>
</html>

View File

@@ -0,0 +1,67 @@
<%@ page language="java" import="java.sql.*"
contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
boolean flag = false;
PreparedStatement sql = null;
ResultSet rs = null;
Connection conn = null;
if (session.getAttribute("actualuser") == null) {
out.println(
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
return;
}
Object user0 = session.getAttribute("actualuser");
String users = (String) user0;
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
conn = DriverManager.getConnection(url, use, password);
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
sql.setString(1, users);
rs = sql.executeQuery();
if (rs.next()) {
flag = true;
}
rs.close();
sql.close();
conn.close();
%>
<!-- 判断是否是管理员 -->
<%
if (flag == true) {
response.setHeader("refresh","0;url=../show_user.jsp");
} else if (flag == false) {
out.println("<script language=javascript>alert('你不是管理员,不能访问此版块')</script>");
response.setHeader("refresh","1;url=../mainframe.jsp");
}
%>
</body>
</html>

View File

@@ -0,0 +1,86 @@
<%@ page language="java" import="java.sql.*"
contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'check.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String users = request.getParameter("inputUser");
String pass = request.getParameter("inputPassword");
boolean flag = false;
PreparedStatement sql = null;
ResultSet rs = null;
Connection conn = null;
PreparedStatement vipsql = null;
ResultSet viprs = null;
session.setAttribute("actualuser", users);
session.setMaxInactiveInterval(1440);
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
conn = DriverManager.getConnection(url, use, password);
sql = conn.prepareStatement("select * from user where userName=? and password=?");
sql.setString(1, users);
sql.setString(2, pass);
rs = sql.executeQuery();
if (rs.next()) {
flag = true;
}
%>
<%
try {
vipsql = conn.prepareStatement(
"select userName,case when VIP = 1 then 'VIP用户' else '普通用户' end as VIP,case when Administrator = 1 then '管理员' else '' end as Administrator from show_user where userName=?");
vipsql.setString(1, users);
viprs = vipsql.executeQuery();
while (viprs.next()) {
String vipinfo = viprs.getString("VIP");
String adminfo = viprs.getString("Administrator");
session.setAttribute("VIPuser", vipinfo);
session.setAttribute("Adminuser", adminfo);
}
} catch (Exception ex) {
ex.printStackTrace();
}
%>
<!-- 判断是否是正确的登录用户 -->
<%
if (flag == true) {
%>
<jsp:forward page="login_show.jsp" />
<%
} else if (flag == false) {
%>
<jsp:forward page="login_fail.jsp" />
<%
}
viprs.close();
vipsql.close();
rs.close();
sql.close();
conn.close();
%>
</body>
</html>

View File

@@ -0,0 +1,29 @@
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>登录失败</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<% out.println("登录失败,5秒后自动跳转回登录页面");%>
<% response.setHeader("refresh","5;url=../index.html");%>
</body>
</html>

View File

@@ -0,0 +1,27 @@
<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>登录成功</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
登录成功. <br>
<% response.setHeader("refresh","0;url=../mainframe.jsp");%>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
session.removeAttribute("actualuser");
out.println("<script>window.location.href='../index.html'</script>");
%>

View File

@@ -0,0 +1,17 @@
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ page import="login.*" %>
<%
login in = new login();
String actualname = request.getParameter("inputUser");
boolean isLoginSucc = in.Login(actualname);
if(isLoginSucc)
{
session.setAttribute("inputUser", actualname);
session.setMaxInactiveInterval(1440);
}
else
{
out.println("<script>alert('登陆失败!');window.location.href='../index.html'</script>");
}
%>

View File

@@ -0,0 +1,51 @@
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>检验注册页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<br>
<%
request.setCharacterEncoding("utf-8");
String users=request.getParameter("inputUser");
String pass=request.getParameter("Password2");
String email=request.getParameter("Email");
String PhoneNumber=request.getParameter("PhoneNumber");
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url="jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
Connection conn= DriverManager.getConnection(url,use,password);
PreparedStatement sql =conn.prepareStatement("insert into user(userName,password,Email,phoneNum)values(?,?,?,?)");
sql.setString(1,users);
sql.setString(2,pass);
sql.setString(3,email);
sql.setString(4,PhoneNumber);
int rtn=sql.executeUpdate();
sql.close();
conn.close();
%>
<% response.setHeader("refresh","0;url=signin_show.jsp");%>
</body>
</html>

View File

@@ -0,0 +1,67 @@
<%@ page language="java" import="java.sql.*"
contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
boolean flag = false;
PreparedStatement sql = null;
ResultSet rs = null;
Connection conn = null;
if (session.getAttribute("actualuser") == null) {
out.println(
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
return;
}
Object user0 = session.getAttribute("actualuser");
String users = (String) user0;
%>
<%
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String use = "root";
String password = "";
Class.forName(driver);
conn = DriverManager.getConnection(url, use, password);
sql = conn.prepareStatement("select * from show_user where userName=? and VIP=1");
sql.setString(1, users);
rs = sql.executeQuery();
if (rs.next()) {
flag = true;
}
rs.close();
sql.close();
conn.close();
%>
<!-- 判断是否是管理员 -->
<%
if (flag == true) {
response.setHeader("refresh","0;url=../x2_resource.jsp");
} else if (flag == false) {
out.println("<script language=javascript>alert('你不是VIP不能访问此版块')</script>");
response.setHeader("refresh","1;url=../mainframe.jsp");
}
%>
</body>
</html>

View File

@@ -0,0 +1 @@
../JSPhandle/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>xz1_v0.1</display-name>
<display-name>xz1_v1.1</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>

117
WebRoot/add_admin.jsp Normal file
View File

@@ -0,0 +1,117 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.*"%>
<%@page import="java.sql.DriverManager"%>
<!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">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>学生管理</title>
<link rel="stylesheet" href="css/manage.css" type="text/css">
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="css/footer.css" type="text/css">
<script src="js/ie-emulation-modes-warning.js"></script>
</head>
<body>
<%@ include file="/module/top.jsp"%>
<div class="container">
<%
if (session.getAttribute("actualuser") == null) {
out.println("<script>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html';</script>");
return;
}
Object actualuser = session.getAttribute("actualuser");
%>
<div class="row">
<%@ include file="module/sidebar.jsp"%>
<div class="col-lg-1 col-md-1 hidden-xs"></div>
<h3 class="text-center">添加管理员</h3>
<div class="col-sm-12 col-lg-9 col-md-9">
<form class="form-horizontal" role="form" id="add_admin"
name="add_admin" action="JSPhandle/admin_insert.jsp" method="post">
<div class="form-group">
<label for="inputText1" class="col-sm-2 control-label">管理员号</label>
<div class="col-sm-10">
<input type="text" class="form-control" placeholder="管理员号"
name="adminno">
</div>
</div>
<div class="form-group">
<label for="inputText2" class="col-sm-2 control-label">管理员姓名</label>
<div class="col-sm-10">
<input type="text" class="form-control" placeholder="姓名"
name="adminname">
</div>
</div>
<div class="form-group">
<label for="inputText3" class="col-sm-2 control-label">管理员性别</label>
<div class="col-sm-10">
<input type="text" class="form-control" placeholder="性别"
name="sex">
</div>
</div>
<div class="form-group">
<label for="inputText1" class="col-sm-2 control-label">管理员角色</label>
<div class="col-sm-10">
<select name="job" class="form-control" name="job">
<%
String driverClass = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school";
String user = "root";
String password = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement sql = null;
try {
Class.forName(driverClass);
conn = DriverManager.getConnection(url, user, password);
Statement stmt = conn.createStatement();
sql = conn.prepareStatement("select * from administrator_job");
rs = sql.executeQuery();
while (rs.next()) {
%>
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
<%
}
} catch (Exception ex) {
ex.printStackTrace();
}
%>
<%
sql.close();
rs.close();
conn.close();
%>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success pull-right">添加</button>
</div>
</div>
</form>
</div>
</div>
<!-- Footer -->
<div class="footer">
<!-- Copyright -->
<div class="copyright">
<p>
&copy; 2016 学生信息管理系统. All Rights Reserved | Design by <a
href="http://blog.sina.com.cn/u/2007780675">F嘉阳</a>
</p>
</div>
<!-- //Copyright -->
</div>
<!-- //Footer -->
</div>
<script src="js/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
</body>
</html>

77
WebRoot/add_adminjob.jsp Normal file
View File

@@ -0,0 +1,77 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.*"%>
<%@page import="java.sql.DriverManager"%>
<!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">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>学生管理</title>
<link rel="stylesheet" href="css/manage.css" type="text/css">
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="css/footer.css" type="text/css">
<script src="js/ie-emulation-modes-warning.js"></script>
</head>
<body>
<%@ include file="/module/top.jsp" %>
<div class="container">
<%
if (session.getAttribute("actualuser") == null) {
out.println("<script>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html';</script>");
return;
}
Object actualuser = session.getAttribute("actualuser");
%>
<div class="row">
<%@ include file="module/sidebar.jsp" %>
<div class="col-lg-1 col-md-1 hidden-xs"></div>
<h3 class="text-center">添加岗位</h3>
<div class="col-sm-12 col-lg-9 col-md-9">
<form class="form-horizontal" role="form" id="add_adminjob"
name="add_adminjob" method="post"
action="JSPhandle/adminjob_insert.jsp">
<div class="form-group">
<label for="jobname" class="col-sm-2 control-label">岗位名称</label>
<div class="col-sm-10">
<input type="text" class="form-control" placeholder="岗位名称"
id="jobname" name="jobname">
</div>
</div>
<div class="form-group">
<label for="jobduty" class="col-sm-2 control-label">岗位职责</label>
<div class="col-sm-10">
<textarea for="jobduty" class="form-control col-sm-2" rows="3"
placeholder="岗位职责" id="jobduty" name="jobduty"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success pull-right">添加</button>
</div>
</div>
</form>
</div>
</div>
<!-- Footer -->
<div class="footer">
<!-- Copyright -->
<div class="copyright">
<p>
&copy; 2016 学生信息管理系统. All Rights Reserved | Design by <a
href="http://blog.sina.com.cn/u/2007780675">F嘉阳</a>
</p>
</div>
<!-- //Copyright -->
</div>
<!-- //Footer -->
</div>
<script src="js/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
</body>
</html>

117
WebRoot/change_user.jsp Normal file
View File

@@ -0,0 +1,117 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.*"%>
<%@page import="java.sql.DriverManager"%>
<!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">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>学生管理</title>
<link rel="stylesheet" href="css/manage.css" type="text/css">
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="css/footer.css" type="text/css">
<script src="js/ie-emulation-modes-warning.js"></script>
</head>
<body>
<%@ include file="/module/top.jsp"%>
<div class="container">
<%
if (session.getAttribute("actualuser") == null) {
out.println("<script>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html';</script>");
return;
}
Object actualuser = session.getAttribute("actualuser");
%>
<div class="row">
<%@ include file="module/sidebar.jsp"%>
<div class="col-lg-1 col-md-1 hidden-xs"></div>
<h3 class="text-center">修改用户</h3>
<div class="col-sm-12 col-lg-9 col-md-9">
<form class="form-horizontal" role="form" id="add_admin"
name="add_admin" action="JSPhandle/admin_insert.jsp" method="post">
<div class="form-group">
<label for="inputText1" class="col-sm-2 control-label">用户名</label>
<div class="col-sm-10">
<input type="text" class="form-control" placeholder="管理员号"
name="adminno">
</div>
</div>
<div class="form-group">
<label for="inputText2" class="col-sm-2 control-label">管理员姓名</label>
<div class="col-sm-10">
<input type="text" class="form-control" placeholder="姓名"
name="adminname">
</div>
</div>
<div class="form-group">
<label for="inputText3" class="col-sm-2 control-label">管理员性别</label>
<div class="col-sm-10">
<input type="text" class="form-control" placeholder="性别"
name="sex">
</div>
</div>
<div class="form-group">
<label for="inputText1" class="col-sm-2 control-label">管理员角色</label>
<div class="col-sm-10">
<select name="job" class="form-control" name="job">
<%
String driverClass = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/db_school";
String user = "root";
String password = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement sql = null;
try {
Class.forName(driverClass);
conn = DriverManager.getConnection(url, user, password);
Statement stmt = conn.createStatement();
sql = conn.prepareStatement("select * from administrator_job");
rs = sql.executeQuery();
while (rs.next()) {
%>
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
<%
}
} catch (Exception ex) {
ex.printStackTrace();
}
%>
<%
sql.close();
rs.close();
conn.close();
%>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success pull-right">添加</button>
</div>
</div>
</form>
</div>
</div>
<!-- Footer -->
<div class="footer">
<!-- Copyright -->
<div class="copyright">
<p>
&copy; 2016 学生信息管理系统. All Rights Reserved | Design by <a
href="http://blog.sina.com.cn/u/2007780675">F嘉阳</a>
</p>
</div>
<!-- //Copyright -->
</div>
<!-- //Footer -->
</div>
<script src="js/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Some files were not shown because too many files have changed in this diff Show More