<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%@ taglib prefix="s" uri="/struts-tags" %>  

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">   
    <title>产品列表</title>  
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="./css/style.css" rel="stylesheet" type="text/css">
	 <script language="JavaScript"> function doSearch(){ if(document.all.searchValue.value=="") { alert("请输入查询关键字!"); }else{ window.location.href="productsAction!list?queryName="+document.all.searchName.value+"&&queryValue="+document.all.searchValue.value; } } </script>  
	
  <link href="./css/163css.css" rel="stylesheet" type="text/css">	
<script type="./text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
	$('.seatext').focus(function(){
		var keyval=$('.seatext').val();
		if(keyval=='请输入关键字'){
			$('.seatext').val('');
		}
	})
	$('.keyul li').hover(function(){$(this).addClass('on');},function(){$(this).removeClass('on');})
	$('.seatext').focusout(function(){
		var keyval=$('.seatext').val();
		if(keyval==''){
			$('.seatext').val('请输入关键字');
		}
	})
	$('.mkey').click(function(){
		$('.keyul').show();
		$('.keyul li').click(function(){
			var keyval=$(this).text();
			$('.mkey').text(keyval);
			$('.keyul').hide();
		})		
	})
	$('.seabtn').click(function(){
		var mval=$('.mkey').text();
		var keyval=$('.seatext').val();
		alert(mval+keyval)	
	})
	$(document).mouseup(function() {
		$('.keyul').hide();
	});
})
</script> </head>
  
  <body>
<link href="./templets/skins/style/yulan.css" rel="stylesheet">
<div class="box_163css">
	<div class="key">
		<span class="mkey">搜索</span>
		<ul class="keyul">
			<li>产品</li>
			<li>新闻</li>
			<li><a href="#">更多>></a></li>
		</ul>
	</div>
	<input type="text" class="seatext" value="请输入关键字" />
	<input type="submit" class="seabtn" value="搜索" onClick="doSearch();">
</div><br>

  <table cellspacing="10" cellpadding="0" border="0"><tr><td>
 <P align="left"><b>产品列表</b></P>
  <table width="100%" cellspacing="0" border="0" align="center">
  <tr>
      <%int m=0;%>
           <s:iterator value="pageBean.list2"> 
            <%m=m+1;%>  
  <td>
    <s:property value="bigcategory"/>>><s:property value="smallcategory"/>    
            <br>  
             <s:set name="pic" value="pic" />
            <s:if test="#pic==''">           
 <img src="./images/nopic_small.jpg" width="150" height="150" border="0"/>
        </s:if>
         <s:else>           
<a href="<s:property value="pic"/>"><img src="<s:property value="pic"/>" width="150" height="150" border="0"/></a></s:else><br>       
            <a href="showProduct!get?id=<s:property value="id"/>"> <s:property value="productname"/></a><br>    
          <font size="5"> &yen; </font><font color="red" size="4"><b><s:property value="price"/></b></font>元  <br>
            <a href="addCart!add?id=<s:property value="id"/>"><img src="./images/addcart.gif" border="0">放入购物车</a>                       
</td>
         <%if ((m%5)==0){
%>
              </tr>
              <%}%>
   </s:iterator>       
      </table> <p  align="right">
               共<s:property value="pageBean.totalRows"/> 条记录
        共<s:property value="pageBean.totalPages"/> 页
        当前第<s:property value="pageBean.currentPage"/>页
        
        <s:if test="%{pageBean.currentPage == 1}">
            第一页 上一页        </s:if>
        <s:else>
            <a href="productsAction2!list?page=1">第一页</a>
            <a href="productsAction2!list?page=<s:property value="%{pageBean.currentPage-1}"/>">上一页</a>        </s:else>
        <s:if test="%{pageBean.currentPage != pageBean.totalPages}">
            <a href="productsAction2!list?page=<s:property value="%{pageBean.currentPage+1}"/>">下一页</a>
            <a href="productsAction2!list?page=<s:property value="pageBean.totalPages"/>">最后一页</a>        </s:if>
        <s:else>
        下一页 最后一页        </s:else>  </p>
     </td></tr></table> 
  </body>
</html>
