Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. <%@page import="java.io.*,java.util.*,java.sql.*" %>
  2. <%@page import="javax.servlet.http.*,javax.servlet.*" %>
  3. <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
  5. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  6. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  11. <title>JSP Page</title>
  12. </head>
  13. <body>
  14. <sql:setDataSource var="sqlDataSource"
  15. driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
  16. url="jdbc:sqlserver://DUONG8FCA:1433;databaseName=employee"
  17. user="sa"
  18. password="1"/>
  19. <sql:query dataSource="${sqlDataSource}" var="result">
  20. SELECT * FROM employee.dbo.OrderDetail
  21. </sql:query>
  22. <center>
  23. </br></br><h2 style="color: red">List Order</h2></br></br>
  24. <h4 style="color: greenyellow" >${message}</h4></br></br>
  25. <table border="1" width="70%">
  26. <tr>
  27. <th>Order ID</th>
  28. <th>Customer Name</th>
  29. <th>Customer Address</th>
  30. <th>Product Id</th>
  31. <th>Product Name</th>
  32. <th>Price</th>
  33. <th>Status</th>
  34. <th></th>
  35. </tr>
  36. <c:forEach var="row" items="${result.rows}">
  37. <tr>
  38. <form action="Order">
  39. <td><c:out value="${row.orderId}"/></td>
  40. <td><c:out value="${row.cusName}"/></td>
  41. <td><c:out value="${row.cusAddress}"/></td>
  42. <td><c:out value="${row.proId}"/></td>
  43. <td><c:out value="${row.proName}"/></td>
  44. <td><c:out value="${row.price}"/></td>
  45. <td><select name="status">
  46. <option><c:out value="${row.status}"/></option>
  47. <option>Done</option>
  48. </select></td>
  49. <td>
  50.  
  51. <input type="hidden" value="${row.orderId}" name="orderId" />
  52. <input type="hidden" value="${row.cusName}" name="cusName" />
  53. <input type="hidden" value="${row.cusAddress}" name="cusAddress" />
  54. <input type="hidden" value="${row.proId}" name="proId" />
  55. <input type="hidden" value="${row.proName}" name="proName" />
  56. <input type="hidden" value="${row.price}" name="price" />
  57.  
  58. <input type="submit" value="Update Status" name="action" />
  59.  
  60. </td>
  61. </form>
  62. </tr>
  63. </c:forEach>
  64. </table>
  65.  
  66. </br></br>
  67. <form action="LoginRegister">
  68. <button type="submit" value="Back" name="action" >Back</button></br></br></br>
  69. </form>
  70.  
  71. </center>
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement