privmanager.jsp
资源名称:examasp.rar [点击查看]
上传用户:hjt198082
上传日期:2015-04-16
资源大小:95k
文件大小:2k
源码类别:
MySQL数据库
开发平台:
Java
- <%@page contentType="text/html;charset=GBK"%>
- <%@page import="java.sql.*"%>
- <%@ include file="/public/checkvalidadmin.jsp"%>
- <jsp:useBean id="conn" scope="page" class="test.ConnOracle"/>
- <%!
- ResultSet rs = null;
- String username = "";
- String password = "";
- String priv_ok = "";
- int priv = 0;
- %>
- <html>
- <head>
- <title>权限管理</title>
- <link rel="stylesheet" href="../public/style.css">
- </head>
- <Body class="ss">
- <center>
- <%
- priv_ok = (String)session.getAttribute("adminpriv");
- if(priv_ok!=null && priv_ok.equals("8")) {
- rs = conn.executeQuery("select * from test_admin");
- if(!rs.next()) {
- out.println("数据库中还没有用户!<br>");
- out.println("单击这里<a href=javascript:history.back()>返回</a><br>");
- } else {
- %>
- <form action="privchange.jsp" method="post">
- <table bgColor="#acacff" border="1" borderColorDark="#ffffff" borderColorLight="#000000" cellSpacing="1" width="80%">
- <tr>
- <th width="25%">用户名</th>
- <th width="25%">密码</th>
- <th width="25%">面试权限</th>
- <th width="25%">管理权限</th>
- </tr>
- <%do {
- username = rs.getString("username");
- password = rs.getString("password");
- priv = rs.getInt("PRIVILEDGE");
- %>
- <tr align="center">
- <td><%=username%></td>
- <td><%=password%></td>
- <%
- if(priv == 1 || priv == 8) {
- %>
- <td>
- <Input name="check1<%=username%>" type="checkbox" value="ok" checked>
- </td>
- <%
- }else {
- %>
- <td>
- <Input name="check1<%=username%>"" type="checkbox" value="ok" >
- </td>
- <%
- }
- if(priv == 8) {
- %>
- <td>
- <Input name="check2<%=password%>" type="checkbox" value="ok" checked>
- </td>
- <%
- }else {
- %>
- <td>
- <Input name="check2<%=password%>" type="checkbox" value="ok" >
- </td>
- <%
- }
- %>
- </tr>
- <% } while(rs.next());%>
- <tr align="center">
- <td colspan="4">
- <Input type="submit" value="保存修改">
- <Input type="reset" value="恢复">
- </td>
- </tr>
- </table>
- <%
- }
- } else {
- out.println("对不起,您的权限不足!<br>");
- out.println("<a href=javascript:history.back()>单击这里返回</a><br>");
- }
- %>
- </form>
- </center>
- </Body>
- </html>