📄 user_list.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="qyxx.connectDB" />
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="css/style.css" rel="stylesheet" type="text/css">
<title>查看用户</title>
<script language="javascript">
</script>
<%
String pr = (String)session.getAttribute("priority");
String departid = (String)session.getAttribute("departid");
ResultSet rs = null;
try
{
String sql = "";
if("1".equals(departid))
{
sql = "select * from QYXX_USER orderby depart_id ";
}
else
{
sql = "select * from QYXX_USER where depart_id = '"+departid+"'";
}
rs = db.executeQuery(sql);
if(rs.next())
{
if("1".equals(pr))
{
%>
<table>
<tr>
<td><a href="#" onclick="op(1)">删除用户</a></td>
</tr>
</table>
<%
}
if("2".equals(pr))
{
%>
<table>
<tr>
<td><a href="#" onclick="op(1)">删除用户</a></td>
<td><a href="#" onclick="op(2)">提升用户</a></td>
</tr>
</table>
<%
}
if("3".equals(pr))
{
%>
<table>
<tr>
<td><a href="#" onclick="op(1)">删除用户</a></td>
<td><a href="#" onclick="op(2)">提升用户</a></td>
<td><a href="#" onclick="op(3)">降低用户</a></td>
</tr>
</table>
<%
}
%>
<table>
</table>
<%
}
else
{
session.setAttribute("error","2");
response.sendRedirect("error.jsp");
}
}
catch(Exception e)
{
session.setAttribute("error","1");
response.sendRedirect("error.jsp");
}
finally
{
try
{
db.closeDB();
rs.close();
}
catch(Exception ee)
{
session.setAttribute("error","1");
response.sendRedirect("error.jsp");
}
}
%>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -