Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <%@ page import = "java.io.IOException"%>
- <%@ page import = "java.io.PrintWriter"%>
- <%@ page import = "java.util.ArrayList"%>
- <%@ page import = "java.util.Collection"%>
- <%@ page import = "java.util.Collections"%>
- <%@ page import = "javax.servlet.http.*"%>
- <%@ page import="java.io.*,java.util.*,java.sql.*"%>
- <%@ page import="javax.servlet.http.*,javax.servlet.*" %>
- <html>
- <head>
- <style>
- @font-face { font-family: Moon Flower; src: url('Moon Flower.ttf'); }
- @font-face { font-family: Moon Flower; font-weight: bold; src: url('Moon Flower Bold.ttf');}
- * {
- font-family: Verdana;
- font-size: 15px;
- }
- div{ width: 50%; height: 100%; float: left;text-align: center; font-size: 33px;font-weight: bold;}
- #img1 {
- margin-right: auto;
- margin-left: auto;
- display: block;
- max-width: 100%;
- width: auto;
- height: auto;
- text-align: center;
- }
- #link {
- font-family: Moon Flower;
- color: gray;
- text-decoration: none;
- font-size: 80px;
- }
- img {
- width: 200px;
- }
- .Main {
- width: 500px;
- display: block;
- margin: 0 auto;
- text-align: center;
- }
- #div1{
- width: 80%;
- text-align: right;
- font-size: 40px;
- font-weight: normal;
- }
- #div2{
- width: 20%;
- text-align: left;
- }
- ul{
- font-weight: normal;
- font-size: 30px;
- }
- label{
- display: inline-block;
- float: left;
- clear: left;
- width: 150px;
- }
- input {
- font-family: Moon Flower;
- color: black;
- font-size: 19px;
- font-weight: bold;
- display: inline-block;
- float:left;
- }
- input.radiobutton {
- display:inline-block;
- float:left;
- margin-left:1cm;
- }
- </style>
- <br></br>
- <img id="img1" src="banner.jpg" >
- <br></br>
- <div><a href="RemoveView?pid=f1" , id="link">Home</a></div>
- <!--<div><a href="MainPage" onclick="myJSFunc()", id="link">Home</a></div>-->
- <div><a href="RemoveView?pid=f1", id="link">About Us</a></div>
- <br></br>
- </head>
- <%
- response.setContentType("text/html;charset=UTF-8");
- // Load the MYSQL JDBC driver.
- Class.forName("com.mysql.jdbc.Driver");
- // Create a connection to the Database with a specific user and
- // password. Remember users have access to a specific tabel in the
- // database.
- // URL: jdbc:mysql://<host_name>/<database_name>
- // Connection con = DriverManager.getConnection( "jdbc:mysql://sylvester-mccoy-v3.ics.uci.edu:3306/inf124grp31",
- // "inf124grp31",
- // "bRU@Eph2");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/cs137", "danielhan", "12041992");
- // If the connection was successful, create a result set object
- Statement stmt = null;
- ResultSet rs = null;
- //SQL query command
- String SQL = "SELECT * FROM product";
- stmt = con.createStatement();
- rs = stmt.executeQuery(SQL);
- rs.next();
- %>
- <body>
- <table align="center">
- <tr>
- <td><img src=
- <%
- out.print(rs.getString("mainphoto"));
- %>
- " class="Main" alt=" <%
- out.print(rs.getString("P_Id"));
- %>"/></td>
- <td width="300px"style="font-size:16px;"><b>
- <%
- out.print(rs.getString("P_Id"));
- %>
- </b><br>
- <%
- out.print(rs.getString("description"));
- %>
- </td>
- </tr>
- </table>
- <table align="center">
- <tr>
- <td><img src=
- <%
- out.print(rs.getString("link1"));
- %>
- alt=" <%
- out.print(rs.getString("P_Id"));
- %>
- " /></td>
- <td><img src=
- <%
- out.print(rs.getString("link2"));
- %>
- alt=" <%
- out.print(rs.getString("P_Id"));
- %>" /></td>
- <td><img src=
- <%
- out.print(rs.getString("link3"));
- %>
- alt=" <%
- out.print(rs.getString("P_Id"));
- %>" /></td>
- </tr>
- </table>
- <br></br>
- <div id="div2"><br></br></div>
- <div id="div2" style="font-size:20px;font-weight:bold;width:80%;">
- Description:
- <ul>
- <li>From
- <%
- out.print(rs.getString("origin"));
- %>
- </li>
- <li>Amount of
- <%
- out.print(rs.getString("name"));
- %>
- per order:
- <%
- out.print(rs.getString("amount"));
- %>
- </li>
- <li>Product ID:
- <%
- out.print(rs.getString("P_Id"));
- %>
- </li>
- </ul>
- </div>
- <br></br>
- <div id="div1">
- <b style="font-size:40px;"> Price: </b> $
- <%
- out.print(rs.getString("price"));
- %>
- </div>
- <br></br>
- <br></br>
- <br></br>
- <br></br>
- <br></br>
- <br></br>
- <br>
- <div style="width:100%;text-align:center" id="buttonWrapper">
- <form action=index.html>
- <!--<form action=ShoppingCart>-->
- <button style="text-align:center;width:150px" name=name value=
- <%out.print(rs.getString("P_Id"));%>
- >Add to Cart</button>
- </form>
- </div>
- <br></br><br></br>
- </body>
- <p>
- Access Count: <% out.print(getServletContext().getAttribute(
- rs.getString("P_Id")));
- %>
- </p>
- <% con.close();%>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement