<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> <% String username=(String)session.getAttribute("username"); ResultSet rs_sale=conn.executeQuery("select top 3 ID,GoodsName,price,nowprice,picture,introduce from tb_goods where sale=1 order by INTime desc"); int sale_ID=0; String s_goodsname=""; float s_price=0; float s_nowprice=0; String s_introduce=""; String s_picture=""; ResultSet rs_new=conn.executeQuery("select top 4 ID,GoodsName,nowprice,picture from tb_goods where newGoods=1 order by INTime desc"); int new_ID=0; String new_goodsname=""; float new_nowprice=0; String new_picture=""; %> MR网络购物中心
<%int s=0; while (rs_new.next()){ new_ID=rs_new.getInt(1); new_goodsname=rs_new.getString(2); new_nowprice=rs_new.getFloat(3); new_picture=rs_new.getString(4); if(s%2==0){ %> <%}else{%> <%} s++; }%>
⊙ <%=new_goodsname%>
产品价格:<%=new_nowprice%>
<%if (username!=null && username!=""){%>   <%}%>
⊙ <%=new_goodsname%>
产品价格:<%=new_nowprice%>
<%if (username!=null && username!=""){%>   <%}%>
<% while (rs_sale.next()){ sale_ID=rs_sale.getInt(1); s_goodsname=rs_sale.getString(2); s_price=rs_sale.getFloat(3); s_nowprice=rs_sale.getFloat(4); s_picture=rs_sale.getString(5); s_introduce=rs_sale.getString(6); if(s_introduce.length()>20){ s_introduce=s_introduce.substring(0,20)+"..."; } %> <%}%>
  名称:<%=s_goodsname%>
原价:<%=s_price%>(元)
  现价:<%=s_nowprice%>(元)
  <%=s_introduce%>
   <%if (username!=null && username!=""){%>   <%}%>
<%conn.close();%>