?? userchakanshoujixuanze.jsp~35~
字號:
<%@page contentType="text/html; charset=GBK" import="java.util.*" %>
<jsp:useBean id="shouji" scope="page" class="JavaBean.ShouJiBean">
</jsp:useBean>
<%@page import="java.util.*" %>
<%@page import="ejb.ShouJiInfoVo" %>
<%
if (session.getAttribute("userCode") == null)
response.sendRedirect("qingdenglu.jsp");
%>
<html>
<head>
<title>userChaKan</title>
<script language="javascript" type="text/javascript">
function test(){
a=document.form1.select.selectedIndex
if(a==1){if(document.form1.shuru.value.length==0||isNaN(document.form1.shuru.value)){alert("價格不能為空,并只能為數字哦");document.form1.shuru.focus();return false;}}
if(a==2){if(document.form1.shuru.value.length==0){alert("查找條件不能為空");document.form1.shuru.focus();return false;}}
if(a==3){if(document.form1.shuru.value.length==0){alert("查找條件不能為空");document.form1.shuru.focus();return false;}}
}
</script>
</head>
<body bgcolor="#ffffff" background="photo/userRight.jpg">
<form name="form1" method="post" action="userChaKanShouJixuanze.jsp" onsubmit="return test()">
<table width="660" height="29" border="0">
<tr>
<td width="120">
<div align="right">請選擇查找方式</div>
</td>
<td width="243">
<div align="center">
<select name="select">
<option selected>全部商品</option>
<option>按價格/元(..以下)</option>
<option>按品牌(不用輸入型號)</option>
<option>按手機序列號</option>
</select>
</div>
</td>
<td width="131">
<div align="left">
<input type="text" name="shuru" size="15">
</div>
</td>
<td width="148">
<input type="submit" name="Submit" value="查找">
</td>
</tr>
</table>
</form>
<hr>
<br/>
<%String zhonglei=new String(request.getParameter("select").getBytes("8859_1"));%>
<%if(zhonglei.equals("全部商品")){%>
<%Iterator it =shouji.selectAll().iterator(); %>
<table width="957" height="38">
<tr><td width="61"><div align="center">序列號</div></td>
<td width="177"><div align="center">圖片</div></td>
<td width="60"><div align="center">品牌名</div></td>
<td width="69"><div align="center">型號</div></td>
<td width="50"><div align="center">顏色</div></td>
<td width="56"><div align="center">大小</div></td>
<td width="55"><div align="center">重量</div></td>
<td width="78"><div align="center">詳細介紹</div></td>
<td width="86"><div align="center">價格/1</div></td>
<td width="98"><div align="center">購買數量</div></td>
<td width="119"><div align="center">購物車</div></td>
</table>
<%!String a;%>
<%while(it.hasNext()){ ShouJiInfoVo vo=(ShouJiInfoVo)it.next();%>
<form name="form2" method="post" action="gouWuBaoCun1.jsp">
<table width="935" height="29" border="1">
<tr>
<td width="56">
<div align="center">
<input type="text" name="number" size="8" readOnly value="<%=vo.getNumber()%>" />
</div></td><td width="172"><div align="center">
<input name="imageField" type="image" src="<%=vo.getPhoto()%>" border="0">
</div></td>
<td width="62">
<div align="center">
<input type="text" name="name" size="8" readOnly value="<%=a=new String(vo.getName().getBytes("8859_1"))%>"/>
</div></td>
<td width="70">
<div align="center">
<input type="text" name="model" readOnly size="8" value="<%=vo.getModel()%>" />
</div></td><td width="48"><div align="center"><%=a=new String(vo.getYanSe().getBytes("8859_1"))%></div></td>
<td width="55"><div align="center"><%=vo.getDaXiao()%></div></td>
<td width="55"><div align="center"><%=vo.getZhongLiang()%></div></td>
<td width="75"><div align="center"><a href="<%=vo.getXiangXiJieShao()%>" target="_blank">查看</a></div></td>
<td width="83">
<div align="center">
<input type="text" name="price" size="8" readOnly value="<%=vo.getPrice()%>" />
</div></td>
<td width="92"> <div align="center">
<select name="count1">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
</div></td>
<td width="97">
<div align="center">
<input type="submit" name="tijiao" value="放入購物車"/>
</div></td></tr>
</table>
</form>
<p> </p>
<%}%>
<%}else if(zhonglei.equals("按價格/元(..以下)")){%>
<%float price=Float.parseFloat(request.getParameter("shuru"));
Iterator it=shouji.selectForPrice(price).iterator();%>
<table width="957" height="38">
<tr><td width="61"><div align="center">序列號</div></td>
<td width="177"><div align="center">圖片</div></td>
<td width="60"><div align="center">品牌名</div></td>
<td width="69"><div align="center">型號</div></td>
<td width="50"><div align="center">顏色</div></td>
<td width="56"><div align="center">大小</div></td>
<td width="55"><div align="center">重量</div></td>
<td width="78"><div align="center">詳細介紹</div></td>
<td width="86"><div align="center">價格/1</div></td>
<td width="98"><div align="center">購買數量</div></td>
<td width="119"><div align="center">購物車</div></td>
</table>
<%!String a1;%>
<%while(it.hasNext()){ ShouJiInfoVo vo=(ShouJiInfoVo)it.next();%>
<form name="form2" method="post" action="gouWuBaoCun1.jsp">
<table width="935" height="29" border="1">
<tr>
<td width="56">
<div align="center">
<input type="text" name="number" size="8" readOnly value="<%=vo.getNumber()%>" />
</div></td><td width="172"><div align="center">
<input name="imageField" type="image" src="<%=vo.getPhoto()%>" border="0">
</div></td>
<td width="62">
<div align="center">
<input type="text" name="name" size="8" readOnly value="<%=a=new String(vo.getName().getBytes("8859_1"))%>"/>
</div></td>
<td width="70">
<div align="center">
<input type="text" name="model" readOnly size="8" value="<%=vo.getModel()%>" />
</div></td><td width="48"><div align="center"><%=a=new String(vo.getYanSe().getBytes("8859_1"))%></div></td>
<td width="55"><div align="center"><%=vo.getDaXiao()%></div></td>
<td width="55"><div align="center"><%=vo.getZhongLiang()%></div></td>
<td width="75"><div align="center"><a href="<%=vo.getXiangXiJieShao()%>" target="_blank">查看</a></div></td>
<td width="83">
<div align="center">
<input type="text" name="price" size="8" readOnly value="<%=vo.getPrice()%>" />
</div></td>
<td width="92"> <div align="center">
<select name="count1">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
</div></td>
<td width="97">
<div align="center">
<input type="submit" name="tijiao" value="放入購物車"/>
</div></td></tr>
</table>
</form>
<p> </p>
<%}%>
<%}else if(zhonglei.equals("按品牌(不用輸入型號)")){%>
<%String name=request.getParameter("shuru");
Iterator it=shouji.selectForName(name).iterator();%>
<table width="957" height="38">
<tr><td width="61"><div align="center">序列號</div></td>
<td width="177"><div align="center">圖片</div></td>
<td width="60"><div align="center">品牌名</div></td>
<td width="69"><div align="center">型號</div></td>
<td width="50"><div align="center">顏色</div></td>
<td width="56"><div align="center">大小</div></td>
<td width="55"><div align="center">重量</div></td>
<td width="78"><div align="center">詳細介紹</div></td>
<td width="86"><div align="center">價格/1</div></td>
<td width="98"><div align="center">購買數量</div></td>
<td width="119"><div align="center">購物車</div></td>
</table>
<%!String a2;%>
<%while(it.hasNext()){ ShouJiInfoVo vo=(ShouJiInfoVo)it.next();%>
<form name="form2" method="post" action="gouWuBaoCun1.jsp">
<table width="935" height="29" border="1">
<tr>
<td width="56">
<div align="center">
<input type="text" name="number" size="8" readOnly value="<%=vo.getNumber()%>" />
</div></td><td width="172"><div align="center">
<input name="imageField" type="image" src="<%=vo.getPhoto()%>" border="0">
</div></td>
<td width="62">
<div align="center">
<input type="text" name="name" size="8" readOnly value="<%=a=new String(vo.getName().getBytes("8859_1"))%>"/>
</div></td>
<td width="70">
<div align="center">
<input type="text" name="model" readOnly size="8" value="<%=vo.getModel()%>" />
</div></td><td width="48"><div align="center"><%=a=new String(vo.getYanSe().getBytes("8859_1"))%></div></td>
<td width="55"><div align="center"><%=vo.getDaXiao()%></div></td>
<td width="55"><div align="center"><%=vo.getZhongLiang()%></div></td>
<td width="75"><div align="center"><a href="<%=vo.getXiangXiJieShao()%>" target="_blank">查看</a></div></td>
<td width="83">
<div align="center">
<input type="text" name="price" size="8" readOnly value="<%=vo.getPrice()%>" />
</div></td>
<td width="92"> <div align="center">
<select name="count1">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
</div></td>
<td width="97">
<div align="center">
<input type="submit" name="tijiao" value="放入購物車"/>
</div></td></tr>
</table>
</form>
<p> </p>
<%}%>
<%}%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -