📄 class.jsp
字号:
<%@ page contentType="text/html;charset=gb2312" import="java.sql.*" %>
<jsp:useBean id="data" scope="page" class="shop.data.conn" />
<style type="text/css">
<!-- @import url("images/css.css"); -->
</style>
<script language="JavaScript">
function show(a)
{
window.open("wareshow.jsp?action="+a,"body","scrollbars=yes,width=434,height=500");
}
</script>
<%
String smallclass="";
String big=request.getParameter("big");
String small=request.getParameter("small");
if(small.equals("all"))
{ smallclass=""; }
else{ smallclass=" class_small='"+small+"' and "; }
int pagesize=8;
int allpage;
int allcount;
int intpage;
int i;
String strpage=request.getParameter("page");
if(strpage==null)
{
intpage=1;
}
else{
intpage=Integer.parseInt(strpage);
if(intpage<1) intpage=1;
}
String sql="select id,warename,explain,marketprice,managerprice,vipprice,small_pic from ware where "+smallclass+" class_big='"+big+"' and dustbin='"+"0"+"' order by id desc";
ResultSet rs=data.executeQuery(sql);
int all=0;
while(rs.next())
{ all++; }
allcount=all;
allcount=all;
allpage=(allcount+pagesize-1)/pagesize;
if(intpage>allpage) intpage=allpage;
if(allpage>0)
{
rs.absolute((intpage-1)*pagesize+1);
int id=rs.getInt("id");
String name=rs.getString("warename");
String explain=rs.getString("explain");
int marketprice=rs.getInt("marketprice");
int managerprice=rs.getInt("managerprice");
int vipprice=rs.getInt("vipprice");
String small_pic=rs.getString("small_pic");
%>
<table width="540" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td><table width="540" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="20%" rowspan="4" class="table-you" align="center"> <table onmouseover="this.style.backgroundColor='#FF4FAE'" onmouseout="this.style.backgroundColor=''" width=100 height=100 cellSpacing=1 cellPadding=2 bgColor=#e1e1e1 border=0>
<tr>
<td width=100 height=100 bgColor=#ffffff align=center><a target="_blank" href="upload/<%=small_pic%>"><img src="upload/<%=small_pic%>" alt="点击放大图片" width="100" height="100" border="0"></a></td>
</tr>
</table></td>
<td width="50%"><img src="images/ring.gif" width="9" height="9"><a href="javascript:show(<%=id%>)"><font color="#ff6600"><u><%=name%></u></font></a></td>
<td width="30%" rowspan="4" class="table-zuo"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align=center> 市场价:<s><%=marketprice%> 元</s><br>
会员价:<font color=#FF3300><%=managerprice%> 元</font><br>
VIP价:<font color="#FF3300"><%=vipprice%> 元</font></td>
</tr>
<tr>
<td align=center><a href="addware.jsp?add=<%=id%>"><img src="images/buy.gif" width="65" height="20" border=0></a></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><font color="#666666"><%=explain%></font></td>
</tr>
</table></td>
</tr>
</table>
<%
i=1;
id=0;
marketprice=0;
managerprice=0;
vipprice=0;
name="";
explain="";
small_pic="";
while(i<pagesize && rs.next())
{
id=rs.getInt("id");
name=rs.getString("warename");
explain=rs.getString("explain");
marketprice=rs.getInt("marketprice");
managerprice=rs.getInt("managerprice");
vipprice=rs.getInt("vipprice");
small_pic=rs.getString("small_pic");
%>
<table width="540" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td><table width="540" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="20%" rowspan="4" class="table-you" align="center"> <table onmouseover="this.style.backgroundColor='#FF4FAE'" onmouseout="this.style.backgroundColor=''" width=100 height=100 cellSpacing=1 cellPadding=2 bgColor=#e1e1e1 border=0>
<tr>
<td width=100 height=100 bgColor=#ffffff align=center><a target="_blank" href="upload/<%=small_pic%>"><img src="upload/<%=small_pic%>" alt="点击放大图片" width="100" height="100" border="0"></a></td>
</tr>
</table></td>
<td width="50%"><img src="images/ring.gif" width="9" height="9"><a href="javascript:show(<%=id%>)"><font color="#ff6600"><u><%=name%></u></font></a></td>
<td width="30%" rowspan="4" class="table-zuo"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align=center> 市场价:<s><%=marketprice%> 元</s><br>
会员价:<font color=#FF3300><%=managerprice%> 元</font><br>
VIP价:<font color="#FF3300"><%=vipprice%> 元</font></td>
</tr>
<tr>
<td align=center><a href="addware.jsp?add=<%=id%>"><img src="images/buy.gif" width="65" height="20" border=0></a></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><font color="#666666"><%=explain%></font></td>
</tr>
</table></td>
</tr>
</table>
<table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5"></td>
</tr>
</table>
<%
i++;
}}%>
<form action="" method="post">
<div align="center">当前<font color="#FF0000"><%=intpage%></font>/<font color="#FF0000"><%=allpage%></font>页,每页<font color="#FF0000"><%=pagesize%></font>条
<%if(intpage>1)
{
if(intpage==1)
{%>
<a href="class.jsp?page=<%=intpage-1%>&big=<%=big%>&small=<%=small%>">上一页 </a>
<%} else{%>
<a href="class.jsp?page=<%=1%>&big=<%=big%>&small=<%=small%>">最前页</a><a href="class.jsp?page=<%=intpage-1%>&big=<%=big%>&small=<%=small%>"> 上一页</a>
<%}}%>
<%
if(intpage<allpage)
{
if(intpage==allpage)
{%>
<a href="class.jsp?page=<%=intpage+1%>&big=<%=big%>&small=<%=small%>">下一页</a>
<%}else{%>
<a href="class.jsp?page=<%=intpage+1%>&big=<%=big%>&small=<%=small%>">下一页 </a><a href="class.jsp?page=<%=allpage%>&big=<%=big%>&small=<%=small%>">最后页</a>
<%}}%>
</div>
</form>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -