Advertisement
Guest User

store

a guest
May 26th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. <?php session_start(); ?>
  2.  
  3. <!DOCTYPE html>
  4.  
  5. <html>
  6.  
  7. <head>
  8. <meta charset="UTF-8">
  9. <style type="text/css">
  10. body {
  11. font-family: Verdana, Geneva, sans-serif;
  12. background-color: darkred;
  13. }
  14.  
  15. header {
  16. background-color: goldenrod;
  17. border: solid;
  18. height: 100px;
  19. width: 80%;
  20. margin-left: 10%;
  21. margin-bottom: 5%;
  22.  
  23.  
  24. }
  25.  
  26. h1 {
  27. font-family: monospace;
  28. font-size: 250%;
  29. margin-right: 8%;
  30. }
  31.  
  32. footer {
  33. background-color: goldenrod;
  34. height: 100px;
  35. max-width: 1024px;
  36. margin-left: auto;
  37. margin-right: auto;
  38. margin-top: 3%;
  39. }
  40.  
  41. label {
  42. font-family: monospace;
  43. margin-left: 5%;
  44. font-size: 125%;
  45. }
  46.  
  47. .header {
  48. max-width: 1024px;
  49. margin-left: auto;
  50. margin-right: auto;
  51.  
  52.  
  53. height: 100px;
  54. text-align: center;
  55.  
  56.  
  57. }
  58.  
  59. .main {
  60. max-width: 1024px;
  61. margin-left: auto;
  62. margin-right: auto;
  63. margin-top: 2%;
  64. background-color: goldenrod;
  65. overflow: hidden;
  66. border: solid;
  67.  
  68.  
  69.  
  70. }
  71.  
  72. .left {
  73. float: left;
  74. margin-left: 5%;
  75. }
  76.  
  77. .right {
  78. float: right;
  79. margin-right: 5%;
  80. }
  81.  
  82. .varubild {
  83. height: 60%;
  84. }
  85.  
  86. .box {
  87. float: left;
  88. height: 30%;
  89. width: 30%;
  90. background-color: deepskyblue;
  91. margin: 2% 0 2% 2%;
  92. border: solid;
  93. height: 300px;
  94. overflow: hidden;
  95.  
  96.  
  97. }
  98.  
  99. .knapp {
  100. margin-top: 5%;
  101. }
  102.  
  103. .inner {
  104.  
  105. padding: 1em;
  106. }
  107.  
  108. #buyB {
  109. display: none;
  110. }
  111.  
  112. img {
  113. width: 100%;
  114. }
  115.  
  116.  
  117. body {
  118. line-height: 1;
  119. }
  120.  
  121. </style>
  122. </head>
  123.  
  124.  
  125. <body>
  126. <header>
  127. <div class="header">
  128. <div class="inner">
  129. <h1>Glass Boom</h1>
  130. </div>
  131. </div>
  132. </header>
  133. <div class="main">
  134. <?php
  135. include("connect.php");
  136. include("cart.php");
  137. include("login.php");
  138. include("orderdetails.php");
  139. if($_SESSION['kund']==true){
  140. echo '<style type="text/css">
  141. #buyB {
  142. display: block;
  143. float:right;
  144. }
  145. </style>';
  146.  
  147. }
  148.  
  149. $sql = "SELECT prodid, name, amount, price, img FROM varor";
  150. $result = $conn->query($sql);
  151.  
  152.  
  153.  
  154.  
  155. if ($result->num_rows > 0) {
  156. while($row = $result->fetch_assoc()) {
  157. ?>
  158. <div class="box">
  159.  
  160. <img class="varubild" src="<?php echo $row['img'];?>" />
  161. <form method="post"> <label>
  162. </label><br /><label>
  163.  
  164. <?php echo $row["name"]; ?></label><br /> <label>Pris:
  165. <?php echo $row["price"]; ?></label><br /> <label>Varor kvar:
  166. <?php echo $row["amount"]; ?></label><br /> <label>Antal</label>
  167. <input type="hidden" name="prodid" value="<?php echo $row['prodid']; ?>">
  168. <input type="hidden" name="vara" value="<?php echo $row['name']; ?>">
  169. <input type="hidden" name="pris" value="<?php echo $row['price']; ?>">
  170.  
  171. <select name="amount">
  172. <option value="1">1</option>
  173. <option value="2">2</option>
  174. <option value="3">3</option>
  175. <option value="4">4</option>
  176. </select> <input type="submit" value="add">
  177. </form>
  178.  
  179. </div>
  180. <?php
  181. }
  182. }
  183. ?>
  184.  
  185.  
  186. </div>
  187.  
  188. <div class="main">
  189. <form method="post" class="left"><br />
  190. username<br /><input type="text" name="username"><br />
  191. password<br /><input type="text" name="password"><br />
  192.  
  193. <input type="submit" name="login">
  194. </form>
  195.  
  196. <form method="post" class="right"><br />
  197. username<br /><input type="text" name="username"><br />
  198. password<br /><input type="text" name="password"><br />
  199. fnamn <br /><input type="text" name="fnamn"><br />
  200. enamn <br /><input type="text" name="enamn"><br />
  201. adress <br /><input type="text" name="adress"><br />
  202. postnummer <br /><input type="text" name="postn"><br />
  203. stad <br /><input type="text" name="stad"><br />
  204.  
  205. <input type="submit" name="create">
  206. </form>
  207.  
  208. </div>
  209. <footer>
  210. <form method="post">
  211. <input class="knapp" type="submit" value="Logout" name="empty">
  212. <input id="buyB" class="knapp" type="submit" name="checkout" value="köp">
  213. <input type="hidden" name="töm">
  214. </form>
  215. </footer>
  216.  
  217.  
  218. </body>
  219.  
  220. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement