⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dingdan.jsp

📁 用JSP写的一个在线购物网站的代码
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" import="java.sql.*" %>
<jsp:useBean id="data" scope="page" class="shop.data.conn" />
<%
String id=request.getParameter("action");
%>
<style type="text/css">
<!-- @import url(images/main.css); -->
</style>
<body leftmargin="0" topmargin="0">
<table width="400" cellpadding="0" cellspacing="0" border="0">
<tr>
  <td>
	<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr>
          <td>
		  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="defaulttext">
              <tr valign="bottom"> 
                <td width="40" height="15" bgcolor="#63bce6"><div align="center"><font color="#FF0000">序号</font></div></td>
                <td width="164" bgcolor="#63bce6"><div align="center"><font color="#FF0000">商品名</font></div></td>
                <td width="40" bgcolor="#63bce6"><div align="center"><font color="#FF0000">数量</font></div></td>
                <td width="70" bgcolor="#63bce6"><div align="center"><font color="#FF0000">单价</font></div></td>
                <td width="70" bgcolor="#63bce6"><div align="center"><font color="#FF0000">总计</font></div></td>
              </tr>
              <%              
              String sql="select * from buyware where buyid='"+id+"'";
              ResultSet rs=data.executeQuery(sql);
              int i=0;
              String warename="";
              int wareid=0;
              int number=0;
              int price=0;
			  int allprice=0;
             while(rs.next())
             {
              i++;
             warename=rs.getString("warename");
             wareid=rs.getInt("wareid");
             number=rs.getInt("number");
             price=rs.getInt("price");
             %>
             <tr> 
             <td width="40"><div align="center"><%=i%></div></td>
			 <td width="164"><div align="center"><a target="_blank" href="wareshow.jsp?action=<%=wareid%>"><%=warename%></a></div></td>
			 <td width="40"><div align="center"><%=number%></div></td>
			 <td width="70"><div align="center"><%=price%>元</div></td>
			 <td width="70"><div align="center"><%=number*price%>元</div></td>
             </tr>
			 <tr>
			 <td width="90%" height="1" bgcolor="#CCCCCC" colspan="5"></td>
			 </tr>
             <%
			 allprice+=price;
			 }%>
			 <tr bgcolor="#63bce6">
			 <td height="15" colspan="5"><div align="center"><font color="#FF0000">商品共计:<%=allprice%>元</font></div></td>
			 </tr>
            </table>
		  </td>
        </tr>
      </table>
	  <tr>
	  <td height="30"></td>
	  </tr>
	  <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="defaulttext">
	  <tr>
	  <td height="20" bgcolor="#63bce6"><div align="center"><font color="#FF0000">定单说明</font></div></td>
	  </tr>
	  <%
	  sql="select * from dingdan where dingdanid='"+id+"'";
	  rs=data.executeQuery(sql);
	  if(rs.next())
	  {
	   String explain=rs.getString("explain");
	   if(explain.equals(""))
	   { explain="无说明"; }
	   String relapse=rs.getString("relapse");
	   if(relapse==null)
	   { relapse="无回复"; }	   
	   String preordainShop=rs.getString("preordainShop");
	   if(preordainShop.equals("0"))
	   { preordainShop="购买"; }
	   else{ preordainShop="预定"; }
	   String feedback=rs.getString("feedback");
	   if(feedback==null)
	   { feedback="无投诉"; }
	   %>
	   <tr bgcolor="#FFFFFF">
	   <td width="100%"><div align="center"><%=explain%></div></td>
	   </tr>	 
	  </table>
	  <table width="96%" align="center" cellpadding="0" cellspacing="1" border="0" bgcolor="#CCCCCC" class="defaulttext">
	  <tr>
	  <td height="20" bgcolor="#63bce6"><div align="center"><font color="#FF0000">定单回复</font></div></td>
	  </tr>
	  <tr bgcolor="#FFFFFF">
	  <td width="100%"><div align="center"><%=relapse%></div></td>
	  </tr>
	  </table>
	  <table width="96%" align="center" cellpadding="0" cellspacing="1" border="0" bgcolor="#CCCCCC" class="defaulttext">
	  <tr>
	  <td height="20" bgcolor="#63bce6"><div align="center"><font color="#FF0000">定单投诉</font></div></td>
	  </tr>
	  <tr bgcolor="#FFFFFF">
	  <td width="100%"><div align="center"><%=feedback%></div></td>
	  </tr>
	  </table>
      <table width="96%">
	  <tr>
	  <td height="30"></td>
	  </tr>
	  </table>
	  <%}%>
	  </td>
   </tr>
</table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -