Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@page import="java.io.*,java.util.*,java.sql.*" %>
- <%@page import="javax.servlet.http.*,javax.servlet.*" %>
- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- </head>
- <body>
- <sql:setDataSource var="sqlDataSource"
- driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
- url="jdbc:sqlserver://DUONG8FCA:1433;databaseName=employee"
- user="sa"
- password="1"/>
- <sql:query dataSource="${sqlDataSource}" var="result">
- SELECT * FROM employee.dbo.OrderDetail
- </sql:query>
- <center>
- </br></br><h2 style="color: red">List Order</h2></br></br>
- <h4 style="color: greenyellow" >${message}</h4></br></br>
- <table border="1" width="70%">
- <tr>
- <th>Order ID</th>
- <th>Customer Name</th>
- <th>Customer Address</th>
- <th>Product Id</th>
- <th>Product Name</th>
- <th>Price</th>
- <th>Status</th>
- <th></th>
- </tr>
- <c:forEach var="row" items="${result.rows}">
- <tr>
- <form action="Order">
- <td><c:out value="${row.orderId}"/></td>
- <td><c:out value="${row.cusName}"/></td>
- <td><c:out value="${row.cusAddress}"/></td>
- <td><c:out value="${row.proId}"/></td>
- <td><c:out value="${row.proName}"/></td>
- <td><c:out value="${row.price}"/></td>
- <td><select name="status">
- <option><c:out value="${row.status}"/></option>
- <option>Done</option>
- </select></td>
- <td>
- <input type="hidden" value="${row.orderId}" name="orderId" />
- <input type="hidden" value="${row.cusName}" name="cusName" />
- <input type="hidden" value="${row.cusAddress}" name="cusAddress" />
- <input type="hidden" value="${row.proId}" name="proId" />
- <input type="hidden" value="${row.proName}" name="proName" />
- <input type="hidden" value="${row.price}" name="price" />
- <input type="submit" value="Update Status" name="action" />
- </td>
- </form>
- </tr>
- </c:forEach>
- </table>
- </br></br>
- <form action="LoginRegister">
- <button type="submit" value="Back" name="action" >Back</button></br></br></br>
- </form>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement