finished final project
Deploy CSIS 2440 / deploy (push) Canceled after 0s

This commit is contained in:
2025-05-05 21:53:39 -06:00
parent 5cd4571a92
commit 3f844e4e06
32 changed files with 1087 additions and 219 deletions
+22
View File
@@ -8,6 +8,28 @@ if (!isset($_SESSION['id']))
foreach (glob('components/cart/*.php') as $file)
require_once $file;
require_once 'functions/catalog.php';
require_once 'components/head.php';
if (empty($_SESSION['cart'])) {
echo '
<div class="glass center md_width padding margin-top" style="height: auto;">
<h3>Your cart is empty!</h3>
<p>Check out our innovative and reliable products <a href="catalog.php">here</a>.</p>
</div>
';
} else {
if (isset($_POST['form_id'])) {
$total = calculate_total();
$items = [];
foreach ($_SESSION['cart'] as $id => $q) {
$items[fetch_product($id)['name']] = $q;
unset($_SESSION['cart'][$id]);
}
echo cart_confirmation($_POST['fname'], $_POST['lname'], $_POST['add'], $_POST['city'], $_POST['state'], $_POST['zip'], $total, $items);
} else
echo cart_layout();
}
require_once 'components/foot.php';