changed shopping page

This commit is contained in:
CodeServer 2021-07-17 10:36:31 +01:00
parent a4de93feb5
commit 820e88e009
3 changed files with 70 additions and 41 deletions

View File

@ -1,16 +1,22 @@
<!DOCTYPE html> <!doctype html>
<html class="no-js" lang="zxx"> <html lang="en">
<?php
require_once '../php/connection.php';
<head> $conn = connectMysql();
session_start();
?>
<head>
<!-- Required meta tags -->
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<title>New Moon Dessert Bar</title> <link href="../bootstrap-5.0.1-dist/css/bootstrap-grid.min.css" rel="stylesheet">
<link href="../bootstrap-5.0.1-dist/css/bootstrap.min.css" rel="stylesheet">
<!--=== Main Style CSS ===--> <!--=== Main Style CSS ===-->
<link href="style.css" rel="stylesheet"> <link href="../style/style.css" rel="stylesheet">
<!-- Font Awesome styles CDN Link --> <!-- Font Awesome styles CDN Link -->
<link <link
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
@ -18,49 +24,67 @@
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
crossorigin="anonymous" crossorigin="anonymous"
/> />
</head> <title>New Moon Dessert Bar</title>
</head>
<body class="shopping_body"> <body class="shopping_body">
<div class="container-fluid">
<div id="wrapper"> <div class="sectionMenu" id="index-sectionMenu">
<div class="row">
<div class="col-sm-12">
<h1> Shopping </h1>
<p>| · Click on the picture to add to the cart · |</p>
</div>
</div>
<div class="row">
<?php <?php
$products = getProducts($_SERVER["QUERY_STRING"],$conn); $products = getAllProducts($conn);
foreach ($products as $product): foreach ($products as $product):
?> ?>
<div class="col-sm-12 col-lg-6 col-xl-3">
<section class="shopping_cart"> <div class="my-img-class">
<h1>Shopping Cart</h1> <img class="imgItem" src="../img/<?= $product['Product_Name']; ?>.jpg" alt="<?=$product['Product_Name']?>">
<form action="addingToCart.php" method="get"> <p><?= $product['Product_Name']; ?></p>
<p class="price">&dollar;<?= $product['Product_Price']; ?></p>
<img src="img/<?= $product['Product_Img'];?>" style="width: 300px; height: 100%; padding:10px; border: 1px solid black;"> </div>
<h2 style="font-size: 40px;text-transform: uppercase; "><?=$product['Product_Name']?></h2> </div>
<h2>Price: &dollar;<?=$product['Product_Price']?></h3> <?php endforeach; ?>
<nav aria-label="Page navigation">
<h3>Quantity: <input type="number" name="quantity" value="1" min="1" max="20" placeholder="Quantity" required> <ul class="pagination justify-content-center">
<li class="page-item">
<input type="submit" value="Add To Cart"></h3> <a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
<input type="hidden" name="product_id" value="<?=$product['Product_ID']?>"> </a>
<input type="hidden" name="product_name" value="<?=$product['Product_Name']?>"> </li>
<input type="hidden" name="product_price" value="<?=$product['Product_Price']?>"> <li class="page-item">
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a>
</form> </li>
</section> <li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<?php <li class="page-item"><a class="page-link" href="#">3</a></li>
endforeach; ?> <li class="page-item">
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Next</a>
</li>
<li class="page-item">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</li>
</ul>
</nav>
</div>
<?php
?>
</div>
<?php include 'footer.php' ?>
</div>
</div>
</body> </body>
</html> </html>

View File

@ -33,6 +33,9 @@
<div class="sectionShopping"> <div class="sectionShopping">
<div class="row"> <div class="row">
<div class="col-xl-12" id="shopping_headerImg">
<img class="rounded mx-auto d-block" style="height: 100px; background-color: rgba(255,0,0,0.1);" src="../img/headerImg.jpg">
</div>
<div class="col-sm-12"> <div class="col-sm-12">
<h1> Shopping </h1> <h1> Shopping </h1>
<p>| · Click on the picture to add to the cart · |</p> <p>| · Click on the picture to add to the cart · |</p>

View File

@ -17,5 +17,7 @@
color: OliveDrab color: OliveDrab
p p
text-align: center text-align: center
// #shopping_headerImg
// background-image: url("../img/headerImg.jpg")