📄 sq_flo.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;
}
.style10 {font-size: 14px; color: #660033; }
.style11 {font-size: 14px}
.style12 {
font-size: 14;
color: #660000;
}
.style14 {font-size: 12px; color: #003300; }
.style16 {font-size: 14px; color: #660000; }
-->
</style>
</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" colspan="2" class="sstitle style1"> </td>
</tr>
<tr>
<td width="43%" align="left" bgcolor="#FAF8F1"><p class="style3">鲜花管理</p>
<p class="style3"><a href="main.jsp">花坊首页 </a></p>
<p class="style3"><a href="admin_flo.jsp">花坊鲜花列表</a></p>
<p class="style3"><a href="add_flo.jsp">添加鲜花信息</a></p>
<p> </p></td>
<td width="43%" align="right" bgcolor="#FAF8F1">
<p align="center">
<%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;
}%>
<%
String rrr=request.getParameter("rrr");
rrr=getString(rrr);
if(rrr==null)
{rrr=" ";}
String what=request.getParameter("what");
what=getString(what);
if(what==null)
{what=""; }
//String order1=request.getParameter("order1");
// order1=getString(order1);
// if(order1==null)
// {order1=""; }
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();
rs=sql.executeQuery("SELECT count(*) FROM bouquet where "+what+" like"+"'"+"%"+rrr+"%"+"'");
rs.next();
RowCount =rs.getInt(1);
rs.close();
PageCount = (RowCount+PageSize-1) / PageSize;
if(Page>PageCount) Page = PageCount;
rs=sql.executeQuery("SELECT * FROM bouquet where "+what+" like"+"'"+"%"+rrr+"%"+"'");
//rs = sql.executeQuery("SELECT * FROM bouquet where classify= "+"'"+rrr+"'");
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 >
</p>
<table width="725" border="0" align="center" cellspacing="1" >
<td width="27%" class="style14"><span class="style10">您查询的鲜花列表:(</span>共<%=PageCount%>页<span class="style10">):</span></td>
<td width="73%"> <div align="right"><%if(showPage<2){%>
<span class="style14">首页</span>
<%}%><%else{%><a href="sq_flo.jsp?showPage=1" class="style14">首页</a>
<%}%>
<%if(showPage<2){%>
<span class="style14">上一页</span>
<%}%><%if(showPage>1){%>
<a href="sq_flo.jsp?showPage=<%=showPage-1%>" class="style14">上一页</a>
<%
}%><%if(showPage-PageCount>=0){%>
<span class="style14">下一页</span>
<%}%><%if(showPage<PageCount){%>
<a href="sq_flo.jsp?showPage=<%=showPage+1%>" class="style14">下一页</a>
<%
}
%> <%if(showPage-PageCount>=0){%>
<span class="style14">尾页</span>
<%}%><%else{%><a href="sq_flo.jsp?showPage=<%=PageCount%>" class="style14">尾页</a></div></td>
<%}%>
</tr>
</table>
<table width=725 border="1" align=center cellpadding="0" cellspacing="1" bordercolor="#D4D0C8">
<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">库存量</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("bouquetid");
String name=rs.getString("bouquetname");
String classify=rs.getString("classify");
float price=rs.getFloat("price");
int storage=rs.getInt("storage");
%>
<tr bordercolor="#FF00FF">
<td align="center"> <%=id%></td>
<td align="center" class="style11"><%=name%></td>
<td align="center" class="style11"><%=classify%></td>
<td align="center" class="style11"><%=price%></td>
<td align="center" class="style11"><%=storage%></td>
<td align="center" class="style12"><a href="ud_flo.jsp?id=<%=id%>" >查看/更新</a></td>
<td align="center" class="style12"><a href="del_flo.jsp?id=<%=id%>" >删除</a></td>
</tr>
<% i++; }
%>
</table>
<p> </p>
<p>
<% con.close();}
catch(SQLException e) { }
%>
</p>
</td>
</tr>
</table>
<br>
<div align="center"></div>
</form>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -