📄 admin_user.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<title>淳.清凉花坊</title>
<meta name="keywords" content="淳.清凉花坊">
<meta name="description" content="淳.清凉花坊">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.style1 {font-size: 12px}
.style2 {
color: #660000;
font-family: "幼圆";
}
.style3 {
font-size: 14px;
font-family: "幼圆";
color: #660000;
}
.style8 {font-size: 12px; color: #006633; }
.style10 {font-size: 14px; color: #660033; }
.style11 {font-size: 14px}
.style12 {
font-size: 14;
color: #660000;
}
.style14 {font-size: 12px; color: #003300; }
.style15 {font-size: 12px; color: #660000; }
-->
</style>
<script LANGUAGE="javascript">
function form1_onsubmit() {
if (document.form1.rrr.value=="")
{
alert("请输入你想要查询的内容")
document.form1.rrr.focus()
return false
}}
</script>
</head>
<%! //处理字符串的常用方法
public String getString(String s) {
if(s == null) s = "";
try{
byte a[] = s.getBytes("ISO-8859-1");
s = new String(a);
}
catch(Exception e) {}
return s;
}
%>
<% //获取session值,以及防止非法访问本页面
String userid= (String)session.getAttribute("userid");
userid=getString(userid);
%>
<body bgcolor="#FFFFFF" >
<table width="858" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top">
<table id="Table_06" width="100%" height="274" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="11"></td>
<td height="300" colspan="3" align="center" valign="top">
<table width="98%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="819"><img src="images/_r3_c4.gif" width="85" height="86" align="absmiddle"> <span class="style1">您的位置:>> 花坊管理系统</span></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
<tr align="left" bgcolor="#ECE9D8">
<td height="30"><span class="style2"> 淳.清凉花坊感谢您今天的辛勤工作......</span></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bordercolor="#003333" bgcolor="#EEE6D2" class="tableall_shop">
<tr align="center" bgcolor="#EEE6D2">
<td height="25" class="sstitle style1"> </td>
</tr>
<tr bgcolor="#FAF8F1">
<td width="13%" height="360" align="left" bgcolor="#FAF8F1"><p class="style3">鲜花管理</p>
<p class="style3"><a href="main.jsp">花坊首页 </a></p>
<p class="style3"><a href="admin_user.jsp">管理员名单</a></p>
<p class="style3"><a href="add_user.jsp">添加新管理员</a></p>
<p class="style3"><a href="admin_log.jsp">退出登陆</a></p></td>
<td width="87%" align="right" bgcolor="#FAF8F1">
<form name="form1" method="post" action="userquery.jsp" onsubmit="return form1_onsubmit()" LANGUAGE="javascript">
<table border="0" align="left">
<tr>
<td align="left"><span class="style10">关键字</span> <input name="rrr" type="text" size="10"></td>
<td><select name="what">
<option value="p" >-未选择-</option>
<option value="userid" >会员ID</option>
<option value="username" >会员姓名</option>
<option value="vip_class">会员级别</option>
<option value="admin">管理权限</option>
</select></td>
<td><input type="submit" name="Submit" value="搜索"></td>
</tr>
</table>
</form>
<%int PageSize=10; //????????
int RowCount; //????
int PageCount; //???
int Page; //?????
int showPage;
int i,j,k;
String strPage = request.getParameter("showPage");
if (strPage==null){
//???QueryString???page?????,?????????
Page = 1;
} else{
//?????????
Page = Integer.parseInt(strPage);
if(Page<1) Page = 1;
}%>
<%
Connection con=null;
Statement sql=null;
ResultSet rs=null;
try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); }
catch(ClassNotFoundException event) { }
try {
con=DriverManager.getConnection("jdbc:odbc:sun","sa","");
sql=con.createStatement();
String condition="select count(*) from uuser where vip_class=-1";
rs =sql.executeQuery(condition);
rs.next();
RowCount =rs.getInt(1);
rs.close();
PageCount = (RowCount+PageSize-1) / PageSize; //?????
if(Page>PageCount) Page = PageCount; //????????
String swe = "select * from uuser where vip_class=-1";
rs = sql.executeQuery(swe); //??SQL????????
i = (Page-1) * PageSize; //???????????????????
for(j=0;j<i;j++) rs.next(); %>
<%
String integer=request.getParameter("showPage");
if(integer==null)
{
integer="1";
}
try{showPage=Integer.parseInt(integer);
}
catch(NumberFormatException e1)
{
showPage=1;
}
if(showPage<=1)
{
showPage=1;
}
if(showPage>=PageCount)
{
showPage=PageCount;
}
%>
<br>
<br>
<center >
<table width="723" border="0" align="center" cellspacing="1" >
<tr></tr>
<td width="30%" ><span class="style10">花坊现有管理员列表(</span><span class="style14">共<%=PageCount%>页</span><span class="style10">):</span></td>
<td width="70%"> <div align="right"><%if(showPage<2){%>
<span class="style14">首页</span>
<%}%><%else{%><a href="admin_user.jsp?showPage=1" class="style14">首页</a>
<%}%>
<%if(showPage<2){%>
<span class="style14">上一页</span>
<%}%><%if(showPage>1){%>
<a href="admin_user.jsp?showPage=<%=showPage-1%>" class="style14">上一页</a>
<%
}%><%if(showPage-PageCount>=0){%>
<span class="style14">下一页</span>
<%}%><%if(showPage<PageCount){%>
<a href="admin_user.jsp?showPage=<%=showPage+1%>" class="style14">下一页</a>
<%
}
%>
<%if(showPage-PageCount>=0){%>
<span class="style14">尾页</span>
<%}%><%else{%><a href="admin_user.jsp?showPage=<%=PageCount%>" class="style14">尾页</a></div></td>
<%}%>
</tr>
</table>
<table width=725 border="1" align=center cellpadding="0" cellspacing="1" bordercolor="#C8E3FB">
<tr bordercolor="#FF00FF" class="style12">
<th width="16%" scope="col"><span class="style12 ">会员ID</span></th>
<th width="16%" class="style12 " scope="col">会员姓名</th>
<th width="16%" class="style12" scope="col">性别</th>
<th width="16%" class="style12 " scope="col">电话</th>
<th width="16%" class="style12" scope="col"><span class="style12 ">管理权限</span></th>
<th width="10%" class="style12" scope="col">查看/更新</th>
<th width="10%" class="style12" scope="col">删除</th>
</tr>
<%
i = 0;
while(i<PageSize && rs.next()){
String id=rs.getString("userid");
String name=rs.getString("username");
String sex=rs.getString("sex");
String phone=rs.getString("phone");
int admin=rs.getInt("admin");
%>
<tr bordercolor="#FF00FF">
<td align="center"> <%=id%></td>
<td align="center" class="style11"><%=name%></td>
<td align="center" class="style11"><%=sex%></td>
<td align="center" class="style11"><%=phone%></td>
<td align="center" class="style11"><%=admin%></td>
<td align="center" class="style12"><a href="ud_user.jsp?id=<%=id%>" >查看/更新</a></td>
<td align="center" class="style12"><a href="del_user.jsp?id=<%=id%>" >删除</a></td>
</tr>
<% i++; }
%>
</table>
<p> </p>
<p>
<% con.close();}
catch(SQLException e) { }
%>
</p>
</td>
</tr>
</table>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -