diff --git a/startbootstrap-agency-gh-pages/index.php b/startbootstrap-agency-gh-pages/index.php index a0e94d9c5f6ad8cb156b74bc18861065c94e45bc..e81613cf6dc96210d1213abe9acaf4ec4b46d259 100644 --- a/startbootstrap-agency-gh-pages/index.php +++ b/startbootstrap-agency-gh-pages/index.php @@ -42,8 +42,6 @@ switch ($j) { break; } include("../html/data_treatment/connect_database.php"); - -echo "Hello Mr./Ms. ".explode('@',$_SESSION["username"])[0].", you were last online on ".$Fday." - ".$day.".".$month.".".$year."."; ?> <html lang="en"> <head> @@ -76,16 +74,25 @@ echo "Hello Mr./Ms. ".explode('@',$_SESSION["username"])[0].", you were last onl </button> <div class="collapse navbar-collapse" id="navbarResponsive"> <a href="shoppingPage.php"><i class="fa-solid fa-cart-shopping"></i></a> - <style> - .fa-cart-shopping{ - color: white; - font-size: 25px - } - </style> + <div class="number-box">0</div> + <style> + .number-box { + width: 30px; + height: 30px; + background-color: #f0f0f0; + display: flex; + align-items: center; + justify-content: center; + font-size: 24px; + font-weight: bold; + margin-right: 240px; + } + </style> + <div id="onlineUsers" style="color:white">Loading ...</div> + <ul class="navbar-nav text-uppercase ms-auto py-4 py-lg-0"> <li> - <div id="onlineUsers" style="color:white">Loading ...</div> </li> <li> @@ -94,13 +101,24 @@ echo "Hello Mr./Ms. ".explode('@',$_SESSION["username"])[0].", you were last onl </form> </li> <li class="nav-item"><a class="nav-link" href="#services">Offers</a></li> - <li class="nav-item"><a class="nav-link" href="#portfolio">PCs & Laptops</a></li> + <li class="nav-item"><a class="nav-link" href="#portfolio">Laptops</a></li> <li class="nav-item"><a class="nav-link" href="#contact">Contact</a></li> <li class="nav-item"><a class="nav-link" href="../html/data_treatment/logout_treatment.php">Log Out</a></li> </ul> </div> </div> + <style> + #search { + width: 50%; + margin-right: 50px ; + } + .fa-cart-shopping{ + color: white; + font-size: 25px; + margin-right: 10px; + } + </style> </nav> <!-- Masthead--> <header class="masthead"> @@ -172,7 +190,7 @@ echo "Hello Mr./Ms. ".explode('@',$_SESSION["username"])[0].", you were last onl <section class="page-section bg-light" id="portfolio"> <div class="container"> <div class="text-center"> - <h2 class="section-heading text-uppercase">PC's & Laptops</h2> + <h2 class="section-heading text-uppercase">Laptops</h2> <h3 class="section-subheading text-muted">The best quality is here</h3> </div> <div class="row"> @@ -192,8 +210,11 @@ echo "Hello Mr./Ms. ".explode('@',$_SESSION["username"])[0].", you were last onl <div class="portfolio-caption-heading"><?php echo $articles[$i]["itemName"]?></div> <div class="portfolio-caption-subheading text-muted"><?php echo $articles[$i]["price"]." €"?></div> </div> + </div> + </div> + <?php };?> </div> </div> @@ -268,9 +289,6 @@ echo "Hello Mr./Ms. ".explode('@',$_SESSION["username"])[0].", you were last onl <div class="d-none" id="submitSuccessMessage"> <div class="text-center text-white mb-3"> <div class="fw-bolder">Form submission successful!</div> - To activate this form, sign up at - <br /> - <a href="https://startbootstrap.com/solution/contact-forms">https://startbootstrap.com/solution/contact-forms</a> </div> </div> <!-- Submit error message--> @@ -305,33 +323,83 @@ echo "Hello Mr./Ms. ".explode('@',$_SESSION["username"])[0].", you were last onl <?php for($i=0; $i<count($articles); $i++){ ?> - <div class="portfolio-modal modal fade" <?php echo 'id="portfolioModal'.$i.'"' ?> tabindex="-1" role="dialog" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="close-modal" data-bs-dismiss="modal"><img src="assets/img/close-icon.svg" alt="Close modal" /></div> - <div class="container"> - <div class="row justify-content-center"> - <div class="col-lg-8"> - <div class="modal-body" <?php echo 'id="modal'.$articles[$i]["itemName"].'"';?>> - <!-- Project details--> - <h2 class="text-uppercase"><?php echo $articles[$i]["itemName"]?></h2> - <img class="img-fluid d-block mx-auto" src=<?php echo "'../image/laptops/".$articles[$i]["imagename"]."'"; ?> alt="..." /> - <p><?php echo $articles[$i]["description"]; ?></p> - <p><?php echo "Price: ".$articles[$i]["price"]." € <br>Quantity available: ".$articles[$i]["quantity"];?></p> - <div class="quantity"> - <button class="remove-button" onclick="removeProduct(this)">X</button> - <button onclick="decrementQuantity(this)">-</button> - <input type="text" value="1" <?php echo 'id="quantity'.$i.'"'; ?>> - <button onclick="incrementQuantity(this)">+</button> - </div> - <button class="btn btn-primary btn-xl text-uppercase" type="button" - data-item-id="<?php echo $i; ?>" - data-item-name="<?php echo $articles[$i]["itemName"]; ?>" - data-item-price="<?php echo $articles[$i]["price"]; ?>" - onclick="addToCart(this)"> - Add to shopping cart - </button> + <div class="portfolio-modal modal fade" <?php echo 'id="portfolioModal'.$i.'"' ?> tabindex="-1" role="dialog" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="close-modal" data-bs-dismiss="modal"><img src="assets/img/close-icon.svg" alt="Close modal" /></div> + <div class="container"> + <div class="row justify-content-center"> + <div class="col-lg-8"> + <div class="modal-body" <?php echo 'id="modal'.$articles[$i]["itemName"].'"';?>> + <!-- Project details--> + <h2 class="text-uppercase"><?php echo $articles[$i]["itemName"]?></h2> + <!-- <p class="item-intro text-muted">Lorem ipsum dolor sit amet consectetur.</p> --> + <img class="img-fluid d-block mx-auto" src=<?php echo "'../image/laptops/".$articles[$i]["imagename"]."'"; ?> alt="..." /> + <p><?php echo $articles[$i]["description"]; ?></p> + <p><?php echo "Price: ".$articles[$i]["price"]." € <br>Quantity available: ".$articles[$i]["quantity"];?></p> + <div class="quantity"> + <button onclick="decrementQuantity(this)">-</button> + <input type="text" value="1" <?php echo 'id="quantity"'.$i; ?>> + <button onclick="incrementQuantity(this)">+</button> </div> + <button class="btn btn-primary btn-xl text-uppercase" type="button" <?php echo 'id = "buttonShoppingCart'.$i.'"';?>> + Add to shopping cart + </button> + + <script> + function incrementQuantity(button) { + var input = button.parentNode.querySelector('input'); + var value = parseInt(input.value, 10); + input.value = value + 1; + } + + function decrementQuantity(button) { + var input = button.parentNode.querySelector('input'); + var value = parseInt(input.value, 10); + if (value > 0) { + input.value = value - 1; + } + } + function removeProduct(button) { + var product = button.parentNode.parentNode; + product.parentNode.removeChild(product); + } + </script> + <style> + .button-container { + text-align: center; + } + .product { + border: 1px solid #ddd; + margin: 1em; + padding: 1em; + text-align: center; + } + .page-section h3.section-subheading, .page-section .section-subheading.h3 { + margin-bottom: 0; + } + .remove-button { + background-color: #ff6961; /* Light red color */ + color: #fff; + border: none; + padding: 0.5em; + cursor: pointer; + } + .quantity button { + background-color: #333; + color: #fff; + border: none; + padding: 0.5em; + cursor: pointer; + } + + .quantity input { + width: 2em; + text-align: center; + margin: 0 0.5em; + } + + </style> </div> </div> </div>