Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start(); ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <style type="text/css">
- body {
- font-family: Verdana, Geneva, sans-serif;
- background-color: darkred;
- }
- header {
- background-color: goldenrod;
- border: solid;
- height: 100px;
- width: 80%;
- margin-left: 10%;
- margin-bottom: 5%;
- }
- h1 {
- font-family: monospace;
- font-size: 250%;
- margin-right: 8%;
- }
- footer {
- background-color: goldenrod;
- height: 100px;
- max-width: 1024px;
- margin-left: auto;
- margin-right: auto;
- margin-top: 3%;
- }
- label {
- font-family: monospace;
- margin-left: 5%;
- font-size: 125%;
- }
- .header {
- max-width: 1024px;
- margin-left: auto;
- margin-right: auto;
- height: 100px;
- text-align: center;
- }
- .main {
- max-width: 1024px;
- margin-left: auto;
- margin-right: auto;
- margin-top: 2%;
- background-color: goldenrod;
- overflow: hidden;
- border: solid;
- }
- .left {
- float: left;
- margin-left: 5%;
- }
- .right {
- float: right;
- margin-right: 5%;
- }
- .varubild {
- height: 60%;
- }
- .box {
- float: left;
- height: 30%;
- width: 30%;
- background-color: deepskyblue;
- margin: 2% 0 2% 2%;
- border: solid;
- height: 300px;
- overflow: hidden;
- }
- .knapp {
- margin-top: 5%;
- }
- .inner {
- padding: 1em;
- }
- #buyB {
- display: none;
- }
- img {
- width: 100%;
- }
- body {
- line-height: 1;
- }
- </style>
- </head>
- <body>
- <header>
- <div class="header">
- <div class="inner">
- <h1>Glass Boom</h1>
- </div>
- </div>
- </header>
- <div class="main">
- <?php
- include("connect.php");
- include("cart.php");
- include("login.php");
- include("orderdetails.php");
- if($_SESSION['kund']==true){
- echo '<style type="text/css">
- #buyB {
- display: block;
- float:right;
- }
- </style>';
- }
- $sql = "SELECT prodid, name, amount, price, img FROM varor";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- ?>
- <div class="box">
- <img class="varubild" src="<?php echo $row['img'];?>" />
- <form method="post"> <label>
- </label><br /><label>
- <?php echo $row["name"]; ?></label><br /> <label>Pris:
- <?php echo $row["price"]; ?></label><br /> <label>Varor kvar:
- <?php echo $row["amount"]; ?></label><br /> <label>Antal</label>
- <input type="hidden" name="prodid" value="<?php echo $row['prodid']; ?>">
- <input type="hidden" name="vara" value="<?php echo $row['name']; ?>">
- <input type="hidden" name="pris" value="<?php echo $row['price']; ?>">
- <select name="amount">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- </select> <input type="submit" value="add">
- </form>
- </div>
- <?php
- }
- }
- ?>
- </div>
- <div class="main">
- <form method="post" class="left"><br />
- username<br /><input type="text" name="username"><br />
- password<br /><input type="text" name="password"><br />
- <input type="submit" name="login">
- </form>
- <form method="post" class="right"><br />
- username<br /><input type="text" name="username"><br />
- password<br /><input type="text" name="password"><br />
- fnamn <br /><input type="text" name="fnamn"><br />
- enamn <br /><input type="text" name="enamn"><br />
- adress <br /><input type="text" name="adress"><br />
- postnummer <br /><input type="text" name="postn"><br />
- stad <br /><input type="text" name="stad"><br />
- <input type="submit" name="create">
- </form>
- </div>
- <footer>
- <form method="post">
- <input class="knapp" type="submit" value="Logout" name="empty">
- <input id="buyB" class="knapp" type="submit" name="checkout" value="köp">
- <input type="hidden" name="töm">
- </form>
- </footer>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement