📄 admin_order.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_order.jsp">订单列表</a></p>
<p class="style3"><a href="statistic.jsp">销售统计</a></p>
<p class="style3"><a href="admin_log.jsp">退出登陆</a></p>
<p> </p>
<p> </p></td>
<td width="87%" align="right" bgcolor="#FAF8F1">
<form name="form1" method="post" action="sq_order.jsp" onsubmit="return form1_onsubmit()" LANGUAGE="javascript">
<table width="724" border="0" align="center">
<tr>
<td width="153"><span class="style12">关键字</span>
<input name="rrr" type="text" size="10"></td>
<td width="119"><select name="what">
<option value="p" >-分类查询-</option>
<option value="paytype" >付款方式</option>
<option value="orderdate" >订购时间</option>
<option value="userid">会员编号</option>
<option value="status" >订单状态</option>
<option value="paid">支付状态</option>
</select></td>
<td width="313"><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){
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 orderinfo";
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 orderinfo order by orderdate";
rs = sql.executeQuery(swe);
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_order.jsp?showPage=1" class="style14">首页</a>
<%}%>
<%if(showPage<2){%>
<span class="style14">上一页</span>
<%}%><%if(showPage>1){%>
<a href="admin_order.jsp?showPage=<%=showPage-1%>" class="style14">上一页</a>
<%
}%><%if(showPage-PageCount>=0){%>
<span class="style14">下一页</span>
<%}%><%if(showPage<PageCount){%>
<a href="admin_order.jsp?showPage=<%=showPage+1%>" class="style14">下一页</a>
<%
}
%> <%if(showPage-PageCount>=0){%>
<span class="style14">尾页</span>
<%}%><%else{%><a href="admin_order.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"><div align="center"><span class="style12 ">订单ID</span></div></th>
<th width="16%" class="style12 " scope="col">会员ID</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="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(1);
String uid=rs.getString(2);
String date=rs.getString("orderdate");
String status=rs.getString("status");
String paytype=rs.getString("paytype");
String paid=rs.getString("paid");
%>
<tr bordercolor="#FF00FF">
<td align="center"><div align="left"><%=id%></div></td>
<td align="center" class="style11"><%=uid%></td>
<td align="center" class="style11"><%=status%></td>
<td align="center" class="style11"><%=paid%></td>
<td align="center" class="style11"><%=paytype%></td>
<td align="center" class="style12"><%=date%></td>
<td align="center" class="style12"><a href="ud_order.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 + -