.
This commit is contained in:
70
WebRoot/JSPhandle/admin_delete.jsp
Normal file
70
WebRoot/JSPhandle/admin_delete.jsp
Normal file
@@ -0,0 +1,70 @@
|
||||
<%@ 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("AdminName");
|
||||
|
||||
%>
|
||||
<%
|
||||
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("delete from adminstrator_record where AdminName=?");
|
||||
sql.setString(1, name);
|
||||
int rtn = sql.executeUpdate();
|
||||
if (rtn != 0) {
|
||||
flag = true;
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
%>
|
||||
<jsp:forward page="delete_success.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
%>
|
||||
<%=name%>
|
||||
|
||||
<%-- <%=sql.setString(1, name)%>
|
||||
<%=sql.setString(2, Email)%>
|
||||
<%=sql.setString(4, VIP)%>
|
||||
<%=sql.setString(3, Administrator)%>
|
||||
<%=sql.setString(5, name)%> --%>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
70
WebRoot/JSPhandle/adminjob_delete.jsp
Normal file
70
WebRoot/JSPhandle/adminjob_delete.jsp
Normal file
@@ -0,0 +1,70 @@
|
||||
<%@ 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("AdminJob");
|
||||
|
||||
%>
|
||||
<%
|
||||
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("delete from administrator_job where AdminJob=?");
|
||||
sql.setString(1, name);
|
||||
int rtn = sql.executeUpdate();
|
||||
if (rtn != 0) {
|
||||
flag = true;
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
%>
|
||||
<jsp:forward page="delete_success.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
%>
|
||||
<%=name%>
|
||||
|
||||
<%-- <%=sql.setString(1, name)%>
|
||||
<%=sql.setString(2, Email)%>
|
||||
<%=sql.setString(4, VIP)%>
|
||||
<%=sql.setString(3, Administrator)%>
|
||||
<%=sql.setString(5, name)%> --%>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
27
WebRoot/JSPhandle/delete_success.jsp
Normal file
27
WebRoot/JSPhandle/delete_success.jsp
Normal 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>
|
||||
70
WebRoot/JSPhandle/job_delete.jsp
Normal file
70
WebRoot/JSPhandle/job_delete.jsp
Normal file
@@ -0,0 +1,70 @@
|
||||
<%@ 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("AdminJob");
|
||||
|
||||
%>
|
||||
<%
|
||||
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("delete from administrator_job where AdminJob=?");
|
||||
sql.setString(1, name);
|
||||
int rtn = sql.executeUpdate();
|
||||
if (rtn != 0) {
|
||||
flag = true;
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
%>
|
||||
<jsp:forward page="delete_success.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
%>
|
||||
<%=name%>
|
||||
|
||||
<%-- <%=sql.setString(1, name)%>
|
||||
<%=sql.setString(2, Email)%>
|
||||
<%=sql.setString(4, VIP)%>
|
||||
<%=sql.setString(3, Administrator)%>
|
||||
<%=sql.setString(5, name)%> --%>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
67
WebRoot/JSPhandle/limits_check_delete.jsp
Normal file
67
WebRoot/JSPhandle/limits_check_delete.jsp
Normal 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=../delete_user.jsp");
|
||||
} else if (flag == false) {
|
||||
out.println("<script language=javascript>alert('你不是管理员,不能访问此版块')</script>");
|
||||
response.setHeader("refresh", "1;url=../mainframe.jsp");
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -48,6 +48,8 @@
|
||||
if (rs.next()) {
|
||||
flag = true;
|
||||
}
|
||||
rs.close();
|
||||
sql.close();
|
||||
%>
|
||||
<%
|
||||
try {
|
||||
|
||||
@@ -76,10 +76,11 @@ String str_date2 = currentTime.toString(); //将Date型日期时间转换成字
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
j<%
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<%
|
||||
stmt.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
登录成功. <br>
|
||||
<% response.setHeader("refresh","0;url=../mainframe.jsp");%>
|
||||
</body>
|
||||
|
||||
70
WebRoot/JSPhandle/user_delete.jsp
Normal file
70
WebRoot/JSPhandle/user_delete.jsp
Normal file
@@ -0,0 +1,70 @@
|
||||
<%@ 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("userName");
|
||||
|
||||
%>
|
||||
<%
|
||||
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("delete from user where userName=?");
|
||||
sql.setString(1, name);
|
||||
int rtn = sql.executeUpdate();
|
||||
if (rtn != 0) {
|
||||
flag = true;
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
%>
|
||||
<jsp:forward page="delete_success.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
%>
|
||||
<%=name%>
|
||||
|
||||
<%-- <%=sql.setString(1, name)%>
|
||||
<%=sql.setString(2, Email)%>
|
||||
<%=sql.setString(4, VIP)%>
|
||||
<%=sql.setString(3, Administrator)%>
|
||||
<%=sql.setString(5, name)%> --%>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user