Advertisement
Guest User

Untitled

a guest
May 16th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  2. <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
  3. <%--
  4. Document : kategoria
  5. Created on : 2016-05-15, 14:36:23
  6. Author : Izabela
  7. --%>
  8.  
  9. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  14. <link href="css/sklep.css" rel="stylesheet" type="text/css"/>
  15. <title>Sklep</title>
  16. </head>
  17. <body>
  18.  
  19. <%--<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
  20. url="jdbc:mysql://localhost:3306/mojsklep"
  21. user="root" password="lila33"/>
  22.  
  23. <sql:query var="categories" dataSource="${snapshot}">
  24. SELECT * FROM kategoria
  25. </sql:query>
  26.  
  27. <sql:query var="selectedCategory" dataSource="${snapshot}">
  28. SELECT nazwa FROM kategoria WHERE idKategoria = ?
  29. <sql:param value="${pageContext.request.queryString}"/>
  30. </sql:query>
  31.  
  32. <sql:query var="categoryProducts" dataSource="${snapshot}">
  33. SELECT * FROM produkt WHERE idKategoria = ?
  34. <sql:param value="${pageContext.request.queryString}"/>
  35. </sql:query>--%>
  36.  
  37. <div id="main">
  38.  
  39. <div id="categoryLeftColumn">
  40. <c:forEach var="kategoria" items="${categories}">
  41.  
  42. <c:choose>
  43. <c:when test="${kategoria.idKategoria == pageContext.request.queryString}">
  44. <div class="categoryButton" id="selectedCategory">
  45. <span class="categoryText">
  46. ${kategoria.nazwa}
  47. </span>
  48. </div>
  49. </c:when>
  50. <c:otherwise>
  51. <a href="kategoria?${kategoria.idKategoria}" class="categoryButton">
  52. <div class="categoryText">
  53. ${kategoria.nazwa}
  54. </div>
  55. </a>
  56. </c:otherwise>
  57. </c:choose>
  58.  
  59. </c:forEach>
  60. </div>
  61.  
  62. <div id="categoryRightColumn">
  63.  
  64.  
  65. <table id="productTable">
  66. <c:forEach var="produkt" items="${categoryProducts}" varStatus="iter">
  67.  
  68. <tr class="${((iter.index % 2) == 0) ? 'lightBlue' : 'white'}">
  69. <td>
  70. <img src="${initParam.productImagePath}${produkt.nazwa}.png"
  71. alt="${produkt.nazwa}">
  72. </td>
  73. <td>
  74. ${produkt.nazwa}
  75. <br>
  76. <span class="smallText">${produkt.opis}</span>
  77. </td>
  78. <td>
  79. &euro; ${produkt.cena} / unit
  80. </td>
  81. <td>
  82. <form action="dodajDoKoszyka" method="post">
  83. <input type="hidden"
  84. name="idProdukt"
  85. value="${produkt.idProdukt}">
  86. <input type="submit"
  87. value="Dodaj do koszyka">
  88. </form>
  89. </td>
  90. </tr>
  91.  
  92. </c:forEach>
  93. </table>
  94. </div>
  95.  
  96. </div>
  97. </body>
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement