?? goodssearch.jsp
字號:
<%@ page language="java" import="java.util.*,com.test.ps.category.*" pageEncoding="UTF-8"%>
<%
int cateId=0;
if(request.getParameter("categoryId")!=null)
cateId=Integer.parseInt(request.getParameter("categoryId"));
int parId=0;
if(request.getParameter("parentId")!=null)
parId=Integer.parseInt(request.getParameter("parentId"));
ArrayList<GoodsCategory> gcList=CategoryAction.getGoodsCategory();
Iterator<GoodsCategory> iPar=gcList.iterator();
ArrayList<GoodsCategory> gcSonList=CategoryAction.getSonGoodsCategory(parId);
Iterator<GoodsCategory> iSon=gcSonList.iterator();
%>
<html>
<head>
<title>搜索商品</title>
<LINK href="../img/adminStyle.css" type=text/css rel=stylesheet>
<script type="text/javascript">
//初始化類別下拉列表
function initCate()
{
document.all.parentCate.value="<%=parId%>";
document.all.sonCate.value="<%=cateId%>";
}
//二級下拉列表更新
function updateSonCate(o)
{
window.location.href="goodsSearch.jsp?parentId="+o.value;
}
//檢查并提交
function check()
{
if(document.all.parentCate.value=="0"||document.all.sonCate.value=="0"){
alert("商品類別不能為空");
}
else if(document.all.keyWord.value==""){
alert("請輸入關鍵字");
}
else{
document.goodsSearch.submit();
}
}
</script>
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
-->
</style>
</head>
<body onLoad="initCate()">
<form name="goodsSearch" method="post" action="goodsSearchResult.jsp">
<table width="80%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td height="80" colspan="6">
<jsp:include page="../adminTop.jsp" flush="true"/></td>
</tr>
<tr>
<td colspan="6" height="30" bgcolor="#e6f3ff"><span class="STYLE1"><a href="../adminRight.jsp">首頁</a>>搜索</span></td>
</tr>
<tr>
<td colspan="6" height="30"><hr size="5" color="#e6f3ff"></td>
</tr>
<tr>
<td height="30" colspan="6"><h1>請選擇相應的品牌及型號進行搜索</h1></td>
</tr>
<tr>
<td width="26" height="30"> </td>
<td width="53"><div align="center">搜索:</div></td>
<td width="108">
<div align="left">
<select name="parentCate" onchange=updateSonCate(this)>
<option value=0>選擇品牌</option>
<%
while(iPar.hasNext()){
GoodsCategory cate=(GoodsCategory)iPar.next();
%>
<option value="<%=cate.getCategoryId()%>"><%=cate.getCategoryName()%></option>
<% }%>
</select>
</div></td>
<td width="124">
<div align="left">
<select name="sonCate">
<option value=0>選擇型號</option>
<%
if(parId!=0){
while(iSon.hasNext()){
GoodsCategory cateS=(GoodsCategory)iSon.next();
%>
<option value="<%=cateS.getCategoryId()%>"><%=cateS.getCategoryName()%></option>
<% }
}%>
</select>
</div></td><td width="184"><div align="center">
<input name="keyWord" type="text" value="請輸入關鍵字" size=25 onFocus="this.value=''">
</div></td>
<td width="323">
<div align="left"><a href="javascript:check()"><img src="../img/searchdot.gif" alt="點擊搜索" border="0"></a> </div></td>
</tr>
<tr>
<td height="30" colspan="6" valign="middle"><hr size="5" color="#e6f3ff"></td>
</tr>
<tr>
<td colspan="6"><hr align="left" size="10" noshade color="#318EB7"></td>
</tr>
</table>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -