<%@page contentType="text/html;charset=GBK" %>

<SCRIPT>
function submitForm(actionType) {
	document.cartForm.actionType.value = actionType;
	document.cartForm.submit();
}
</script>
<TABLE cellSpacing=0 cellPadding=0 width="830" align=center border=0>
  <TR align=left colspan="3"> 
    <TD>
    <SPAN > 
      <P>
      	<br>
        <IMG 
        src="<%=CONTEXT%>/img/gouwu-shangpin.gif" width="476" height="27"><br>
        <BR>
      </P>
      </SPAN>
    </TD>
  </TR>
	 <%
  	List searchResult = (List)request.getAttribute("searchresult");
  	double zongjia=0.00;
  	if(SESSION_USER != null && searchResult != null && searchResult.size() > 0) {
  %>
  <html:form action="/fg/order/cart">
	<html:hidden property="channelId" value="<%=currentChannel.getId()%>"/>
	<input type="hidden" name="actionType"/>
  <TR> 
    <TD> 
      <TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
        <TR bgColor=#016e3b> 
          <TD> 
          	<TABLE cellSpacing=1 cellPadding=1 width="100%" align=center border=0>
              <TR > 
                <TD  align=middle width="11%" bgColor=#FFC9C9 
                      height=23><FONT color=#ED2E2E>次序</FONT></TD>
                <TD  align=middle width="11%" bgColor=#FFC9C9 
                      height=23><FONT color=#ED2E2E>图片</FONT></TD>
                <TD  align=middle width="11%" bgColor=#FFC9C9 
                      height=23><FONT color=#ED2E2E>名称</FONT></TD>
                <TD  align=middle width="14%" bgColor=#FFC9C9 
                      height=23><FONT color=#ED2E2E>型号</FONT></TD>
                <TD  align=center width="16%" bgColor=FFC9C9 
                      height=23><FONT color=#ED2E2E>数量</FONT></TD>
                <TD  align=middle width="11%" bgColor=FFC9C9 
                      height=23><FONT color=#ED2E2E>零售价</FONT></TD>
                <TD  align=middle width="11%" bgColor=FFC9C9 
                      height=23><FONT color=#ED2E2E>小计</FONT></TD>
                <TD  align=middle width="4%" bgColor=FFC9C9 
                      height=23><FONT color=#ED2E2E>操作</FONT></TD>
              </TR>
                <INPUT type=hidden value=KT0110_360 name=product_id>
                <INPUT type=hidden value=1 name=svalue>
                <% int i=0;%>
              <logic:iterate id="result" name="searchresult" type="CartManager.CartManagerProduct" scope="request">
              <%
					  	if(result.getProduct() != null) {
					  	zongjia=zongjia+result.getNumber() * result.getProduct().getUnitPrice();
					  	i++;
					  %>
                <TR > 
                  <TD width="11%" bgColor=#ffffff  align="center" height=23><%=i%></TD>
                  <TD width="11%" bgColor=#ffffff  align="center" height=23><img src="<%=CONTEXT%>/<%=result.getProduct().getPopPicture()%>" width="50" hight="50"></TD>
                  <TD width="11%" bgColor=#ffffff  align="center" height=23><%=result.getProduct().getName()%></TD>
                  <TD width="14%" bgColor=#ffffff  align="center" height=23><%=result.getProduct().getProductNo()%></TD>
                  <TD align=center width="16%" bgColor=#ffffff height=23>
                  	<input type="text" value="<%=result.getNumber()%>" 
                  	name="cart_productNumber<%=result.getId()%>" size="5" onkeypress="intOnly();" />
                  	<!--
                  	-->
                  </TD>
                  <TD  align=right width="11%" bgColor=#ffffff height=23>
                      <%=result.getProduct().getUnitPrice()%>&nbsp;</TD>
                  <TD  borderColor=#ED2E2E align=right 
                      width="11%" bgColor=#ffffff height=23>
                      <%=result.getNumber() * result.getProduct().getUnitPrice()%></TD>
                  <TD  align=middle width="4%" bgColor=#ffffff  height=23>
                  <input type="button" name="Submit322" onclick="window.location='<%=CONTEXT%>/fg/order/cart.do?channelId=<%=currentChannel.getId()%>&actionType=removeproduct&productId=<%=result.getId()%>'" value="删除" >
                  </TD>
                </TR>
              <%
						  	}
						  %>
						  </logic:iterate>
                <TR  bgColor=#ffffff> 
                  <TD  colSpan=5 height=24>本次购物总价：</TD>
                  <TD  align=right height=24><%=zongjia%>&nbsp;</TD>
                  <TD  align=right height=24><%=zongjia%>&nbsp;</TD>
                  <TD  align=middle height=24></TD>
                </TR>
            </TABLE>
          </TD>
        </TR>
      </TABLE>
      <BR> 
<!--
      <TABLE width=51%>
          <TR> 
	          <TD width="31%" height=23 vAlign=top><A 
	                  href="#"></A><IMG onclick="javascript:window.location='<%=CONTEXT%>/index.jsp'" 
	                  src="<%=CONTEXT%>/img/cart01.gif" alt=继续购物 name=clear width="93" height="43" border=0>
	          </TD>
            <TD width="31%" height=23 vAlign=top><input type="button" onclick="javascript:submitForm('updateproduct')" name="Submit32" value="更改数量">
            </TD>
            <TD width="35%" height=23 vAlign=top><input type="button" onclick="javascript:location.href='<%=CONTEXT%>/fg/order/order.do?actionType=add&init=true'" name="Submit32" value="结算中心">
            </TD>
            <TD width="3%" vAlign=top>
            	<A href="#">
                  <img onclick="javascript:location='<%=CONTEXT%>/fg/order/order.do?actionType=add&init=true'"
                  src="<%=CONTEXT%>/img/cart04.gif" alt=收银台 border=0  width="87" height="43"></a>
            </TD>
          </TR>
      </TABLE>
-->
      <TABLE width=51%>
        <TR> 
          <TD width="31%" height=23 vAlign=top>
          	<A href="<%=CONTEXT%>/index.jsp">
          	<IMG onclick="javascript:window.location='<%=CONTEXT%>/index.jsp'" src="<%=CONTEXT%>/img/cart01.gif" alt=回到首页 name=clear width="93" height="43" border=0>
          	</A>
            </TD>
            <TD width="31%" height=23 vAlign=top>
            	<A  href="">
            		<IMG onclick="javascript:submitForm('updateproduct')"  src="<%=CONTEXT%>/img/cart03.gif" alt=修改数量 width="97" height="43" border=0>
            	</A>
            </TD>
            <TD width="35%" height=23 vAlign=top>
            	<A href="#"> 
            		<IMG src="<%=CONTEXT%>/img/cart02.gif" alt=清空购物车 width="107" height="43"  border=0>
              </A>
            </TD>
            <TD width="3%" vAlign=top><A href="#">
            	<img onclick="javascript:location.href='<%=CONTEXT%>/fg/order/order.do?actionType=add&channelId=<%=currentChannel.getId()%>&init=true'" 
            	src="<%=CONTEXT%>/img/cart04.gif" alt=收银台 border=0 width="87" height="43"></A>
            </TD>
          </TR>
      	</TABLE>
     </TD>
  </TR>
  </html:form> 
  <%
  }
  %>
</TABLE>