Advertisement
Guest User

Untitled

a guest
May 31st, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. <!-- CREATE PRODUCT START -->
  2.  
  3. <div class="container">
  4. <div class="col-md-6">
  5.  
  6. <h3 class="headerSign">Opret den bil, du vil sælge!</h3>
  7. <div class="form-area">
  8.  
  9. <form action="index.jsp" method="post">
  10. <br/>
  11. Mærke: <br/>
  12. <div class="form-group">
  13. <input type="text" value="" name="brand" class="inputField"></input>
  14. </div> <br/>
  15.  
  16. <div class="form-group">
  17. Model: <br/>
  18. <input type="text" name="model" class="inputField"></input>
  19. </div> <br/>
  20. Type: <br/>
  21. <div class="form-group">
  22. <select name="type" class="inputField">
  23. <option value="c">Bil</option>
  24. <option value="t">Tilbehør</option>
  25. </select>
  26. </div>
  27. <br/>
  28. Årgang: <br/>
  29. <div class="form-group">
  30. <input type="text" name="year" class="inputField"></input>
  31. </div> <br/>
  32. Pris: <br/>
  33. <div class="form-group">
  34. <input type="text" name="price" class="inputField"></input>
  35. </div> <br/>
  36. Kapacitet (antal personer): <br/>
  37. <div class="form-group">
  38. <input type="text" name="capacity" class="inputField"></input>
  39. </div> <br/>
  40. Træk: <br/>
  41. <div class="form-group">
  42. <select name="drive" class="inputField">
  43. <option value="f">Forhjulstræk</option>
  44. <option value="r">Baghjulstræk</option>
  45. <option value="a">4-hjulstræk</option>
  46. </select>
  47. </div> <br/>
  48. Beskriv dit produkt: <br/>
  49. <div class="form-group">
  50. <input type="text" name="description" class="inputField"></input>
  51. </div>
  52. <input type="submit" value="create" name="create" class="btn btn-primary"></input>
  53. </form>
  54. </div>
  55. </div>
  56. </div>
  57.  
  58.  
  59. <%
  60.  
  61. JDBCConnectionFactory.initManualConnectionHandling("jdbc:mysql://student.hum.au.dk:3306/u201709137",
  62. "u201709137", "4W5Vn55y", "com.mysql.jdbc.Driver");
  63. String createButton = request.getParameter("create");
  64.  
  65. if (createButton != null) {
  66. String brand = request.getParameter("brand");
  67. String model = request.getParameter("model");
  68. String product_type = request.getParameter("type");
  69. Long product_year = Long.parseLong(request.getParameter("year"));
  70. Long capacity = Long.parseLong(request.getParameter("capacity"));
  71. String drive = request.getParameter("drive");
  72. Long price = Long.parseLong(request.getParameter("price"));
  73. String description = request.getParameter("description");
  74.  
  75.  
  76.  
  77. Product product = new Product(brand, model, product_type, product_year, capacity, drive, price, description);
  78. ProductDao.createProduct(product);
  79.  
  80. }
  81. %>
  82.  
  83. <!-- CREATE PRODUCT END -->
  84.  
  85.  
  86.  
  87.  
  88. <!-- CREATE ACCESSORIES START -->
  89. <!--
  90. <div class="container">
  91. <div class="col-md-6">
  92.  
  93. <h3 class="headerSign">Opret det tilbehør, du vil sælge!</h3>
  94. <div class="form-area">
  95.  
  96. <form action="index.jsp" method="post">
  97. <br/>
  98. Mærke: <br/>
  99. <div class="form-group">
  100. <input type="text" value="" name="brand" class="inputField"></input>
  101. </div> <br/>
  102.  
  103.  
  104. Pris: <br/>
  105. <div class="form-group">
  106. <input type="text" name="price" class="inputField"></input>
  107. </div> <br/>
  108.  
  109.  
  110. Beskriv dit produkt: <br/>
  111. <div class="form-group">
  112. <input type="text" name="description" class="inputField"></input>
  113. </div>
  114. <input type="submit" value="create" name="createTwo" class="btn btn-primary"></input>
  115. </form>
  116.  
  117. </div>
  118. </div>
  119. </div>
  120. -->
  121.  
  122. <% /*
  123. JDBCConnectionFactory.initManualConnectionHandling("jdbc:mysql://student.hum.au.dk:3306/u201709137",
  124. "u201709137", "4W5Vn55y", "com.mysql.jdbc.Driver");
  125. String createButtonTwo = request.getParameter("createTwo");
  126.  
  127. if (createButtonTwo != null) {
  128. String brand = request.getParameter("brand");
  129. Long price = Long.parseLong(request.getParameter("price"));
  130. String description = request.getParameter("description");
  131.  
  132.  
  133.  
  134. Product product = new Product(brand, price, description);
  135. ProductDao.createAccess(product);
  136.  
  137. } */
  138. %>
  139.  
  140. <!-- CREATE ACCESSORIES END -->
  141.  
  142. <jsp:include page="footer.jsp"></jsp:include>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement