📄 goodssearchresult.jsp
字号:
<%@ page language="java" import="java.util.*,com.test.ps.goods.*" pageEncoding="utf-8"%>
<%@page import="com.test.ps.util.TransStr;"%>
<html>
<head>
<LINK href="../img/adminStyle.css" type=text/css rel=stylesheet>
<title>商品搜索结果</title>
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
-->
</style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="790" align="left">
<tr>
<td height="80" colspan="3">
<jsp:include page="../adminTop.jsp" flush="true"/></td>
</tr>
<tr>
<td colspan="3" height="30" bgcolor="#e6f3ff"><span class="STYLE1"><a href="../adminRight.jsp">首页</a>><a href="goodsSearch.jsp">搜索</a>>搜索结果</span></td>
</tr>
<tr>
<td colspan="3" height="30"><hr size="5" color="#e6f3ff"></td>
</tr>
<tr>
<td colspan="3" height="30"><h1>搜索结果</h1></td>
</tr>
<tr><td>
<% String pageNum=(String)request.getParameter("page");
int categoryId=Integer.parseInt(request.getParameter("sonCate"));
String keyWord=TransStr.transStr(request.getParameter("keyWord"));
if(pageNum==null){pageNum="1";}
GoodsAction action=new GoodsAction();
PageData pagedata=action.getPageData(pageNum,categoryId,keyWord);
if(pagedata==null)
{out.print("<table align='center'><tr><td><div align='center'>抱歉,没有您搜索的商品!</div></td></tr></table>");}
else{
ArrayList<Goods> goodList=pagedata.getData();
int page1=pagedata.getCurPage();
Iterator<Goods> i=goodList.iterator();
while(i.hasNext()){
Goods good=(Goods)i.next();
%>
<table width="80%" height="200" border="0" cellpadding="0" cellspacing="0">
<tr> <td width="200" height="200" >
<table width="200"height="200" border="0" cellpadding="0" cellspacing="0" bgcolor="#e5e5e5">
<tr><td width="106" height="106" align="center" bgcolor="#ffffff">
<img src="/phoneshop/<%=good.getGoodsImage() %>">
</td></tr>
</table>
</td>
<td align="left">
<table width="590"height="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" height="65" >商品名称:<%=good.getGoodsName()%></td>
</tr>
<tr>
<td height="65" colspan="3">
<span style="color: #FF6633">价格:<%=good.getGoodsPrice() %> 元 </span></td>
</tr>
<tr>
<td height="70">
<div align="center"></div></td>
<td height="39">
<a href="goodsInf.jsp?goodsCode=<%=good.getGoodsCode() %>"> 查看详情</a></td>
</tr>
</table> </td> </tr><tr>
<td colspan="3" height="30"><hr size="5" color="#e6f3ff"></td>
</tr></table>
<%} %>
<table width="400" border="0" align="center">
<tr><td width="150">
第<%=pagedata.getCurPage() %>页
</td>
<td>
共<%=pagedata.getTotalPage() %>页 </td>
<%
if(page1>1) {
%>
<td>
<a href="searchResult1.jsp?page=1">首页</a> </td>
<td>
<a href="searchResult1.jsp?page=<%=page1-1 %>">上页</a> </td>
<%
}
if(page1<pagedata.getTotalPage()){
%>
<td>
<a href="searchResult1.jsp?page=<%=page1+1 %>">下页</a> </td>
<td>
<a href="searchResult1.jsp?page=<%=pagedata.getTotalPage() %>">尾页</a> </td>
<%} %>
</tr>
</table>
<%}%>
</td>
</tr>
<tr>
<td colspan="6" height="30"><hr size="5" color="#e6f3ff"></td>
</tr>
<tr>
<td colspan="6"><hr align="left" size="10" noshade color="#318EB7"></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -