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

📄 user_buy_page.jsp

📁 《J2EE专业项目实例开发》源代码
💻 JSP
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Buy Page</title>
</head>

<body bgcolor="#C0C0C0" topmargin="0" background="http:\\localhost:8000\music\Background.bmp" >

<table border="0" width="100%">
  <tr>
    <td width="100%">
      <table border="0" width="97%" height="19">
        <tr>
          <td width="18%" height="13" valign="middle" align="right">
      <font face="Arial" size="5" color="#800000"><b><i>eMusicWorld-----&gt; The World of Music</i></b></font>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>


<form method="get" action="http://localhost:8000/music/shopping_cart.jsp">

      
<table border="1" width="100%">
  <tr>
          <td width="11%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a href="Offers.jsp">Offers</a></b></font></td>
          <td width="20%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/shopping_cart.jsp">Shopping Cart</a></b></font></td>
          <td width="16%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/wishlist_page.jsp">Wishlist</a></b></font></td>
          <td width="8%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/feedback_page.jsp">Feedback</a></b></font></td>
          <td width="13%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/user_buy_page.htm">Buy</b></font></a></b></font></td>
          <td width="9%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/logout_page.jsp">Logout</a></b></font></td>
  </tr>
</table>
<table border="1" width="100%">
  <tr>
    <td width="18%">

<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/home_page.htm">Home</a></b></font></p>

<p><b><font face="Arial" size="2" color="#800000"><a HREF="http://localhost:8000/music/chart_toppers.jsp">Chart Toppers</a></font></b></p>
<p><b><font face="Arial" size="2" color="#800000"><a HREF="http://localhost:8000/SearchContext/SearchAlias">Search</a></font></b></p>
<p><b><font face="Arial" size="2" color="#800000"><a HREF="http://localhost:8000/music/vote_page.jsp">Vote</a></font></b></p>

<p><b><font face="Arial" size="2" color="#800000"><a HREF="http://localhost:8000/music/new_release_page.jsp">New Releases</a></font></b>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/Register/RegisterPage.htm">Register</a></b></font>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/help_page.htm">Help</a></b></font></p>
      <p>&nbsp;</td>
    <td width="82%" valign="top">
<%! String songtype;%>
<% songtype=request.getParameter("SearchBy");

%>
	<%@ page import="java.util.*" %>
	<%@ page import="java.sql.*" %>
	<%@ page import="java.text.*" %>
	<%@ page import="java.sql.Date" %>

	<%@ page language = "java" %> 
<p align="center"><font face="Arial" size="2" color="#800000"><b><u>Buy Page</u></b></font></p>
<p><font face="Arial" size="2" color="#800000">Dear <%=session.getAttribute("username")%>,<br>
The items are displayed. To move an item to the shopping cart, select the checkbox next to the item and then click the Move to Shopping Cart button.</font></p>
<table>
<tr>
<td width="5%"><font face="Arial" size="2" color="#800000"><b>Buy</b></font></td>
<td width="25%"><font face="Arial" size="2" color="#800000"><b>Item</b></font></td>
<td width="25%"><font face="Arial" size="2" color="#800000"><b>Price ($)</b></font></td>
</tr>

<%
	try{
	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	Connection connect;

	connect=DriverManager.getConnection("jdbc:odbc:RegisterDataSource","wasiqr","bhalbabatu");
	
	Statement state;
	
	state = connect.createStatement();
	
	String strQuery1 = "select * from Item_Master where Type='"+songtype+"'";
	
	ResultSet result = state.executeQuery(strQuery1);
	
	String username, itemcode, qty, wishdate;
	while(result.next())				
	{	
		out.println("<tr>");
		out.println("<td width=\"25%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">");
		out.println("<font face=\"Arial\" size=\"2\" color=\"#800000\">");
		itemcode=result.getString("Item_Code");
		out.println("<p><input type=\"checkbox\" name="+itemcode+" value=\"ON\">");
		out.println("</td>");
		out.println("<td width=\"25%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">");
		out.println(result.getString("Title"));
out.println("</td>");
out.println("<td width=\"25%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">");
		out.println(result.getString("Rate"));
out.println("</td>");
		
		out.println("</font>");
		out.println("</tr>");
	}
	connect.close();
	}
	catch(Exception e)
	{
		out.println("Exception: " + e + " occured.");
	}
%>

</table>
 
  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="submit" value="Move to Shopping Cart" name="Submit">&nbsp;&nbsp;<input type="reset" value="Reset" name="Reset"></p>
    </td>
  </tr>
</table>

<p>&nbsp; </p>

<p>&nbsp; </p>

</form>

</body>

</html>

⌨️ 快捷键说明

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