This commit is contained in:
ui0ppk 2023-02-05 13:48:54 +02:00
commit eeb819eedf
3 changed files with 42 additions and 16 deletions

View File

@ -11,6 +11,32 @@ require_once 'core/classes/user.php';
if (isset($_SESSION['user'])) {
$user = new User($con, $_SESSION['user']);
}
$possiblePages = [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11
];
if(isset($_GET["p"])) {
$page = (int) $_GET["p"];
if(!in_array($page,$possiblePages)) {
header('location: /catalog');
exit;
}
} else {
$page = 0;
}
$getitstarted = new PartyStarter;
$getitstarted->header();
?> </head>
@ -33,31 +59,31 @@ $getitstarted->header();
<br>
<h4>Category</h4>
</li>
<a href="/catalog" class="list-group-item active" aria-current="true">All categories</a>
<a href="?p=1" class="list-group-item">Hats</a>
<a href="?p=2" class="list-group-item">Shirts</a>
<a href="?p=3" class="list-group-item">Pants</a>
<a href="?p=4" class="list-group-item">Gears</a>
<a href="?p=5" class="list-group-item">Packages</a>
<button class="list-group-item text-start" type="button" data-bs-toggle="dropdown" aria-expanded="false">Body parts</button>
<a href="/catalog" class="list-group-item<?php if($page == 0) { ?> active<?php } ?>" aria-current="true">All categories</a>
<a href="?p=1" class="list-group-item<?php if($page == 1) { ?> active<?php } ?>">Hats</a>
<a href="?p=2" class="list-group-item<?php if($page == 2) { ?> active<?php } ?>">Shirts</a>
<a href="?p=3" class="list-group-item<?php if($page == 3) { ?> active<?php } ?>">Pants</a>
<a href="?p=4" class="list-group-item<?php if($page == 4) { ?> active<?php } ?>">Gears</a>
<a href="?p=5" class="list-group-item<?php if($page == 5) { ?> active<?php } ?>">Packages</a>
<button class="list-group-item text-start<?php if($page == 6 || $page == 7 || $page == 8 || $page == 9 || $page == 10 || $page == 11) { ?> active<?php } ?>" type="button" data-bs-toggle="dropdown" aria-expanded="false">Body parts</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="?bp=1">Heads</a>
<a class="dropdown-item<?php if($page == 6) { ?> active<?php } ?>" href="?p=6">Heads</a>
</li>
<li>
<a class="dropdown-item" href="?bp=2">Torso</a>
<a class="dropdown-item<?php if($page == 7) { ?> active<?php } ?>" href="?p=7">Torso</a>
</li>
<li>
<a class="dropdown-item" href="?bp=3">Left arm</a>
<a class="dropdown-item<?php if($page == 8) { ?> active<?php } ?>" href="?p=8">Left arm</a>
</li>
<li>
<a class="dropdown-item" href="?bp=4">Right arm</a>
<a class="dropdown-item<?php if($page == 9) { ?> active<?php } ?>" href="?p=9">Right arm</a>
</li>
<li>
<a class="dropdown-item" href="?bp=5">Left leg</a>
<a class="dropdown-item<?php if($page == 10) { ?> active<?php } ?>" href="?p=10">Left leg</a>
</li>
<li>
<a class="dropdown-item" href="?bp=6">Right leg</a>
<a class="dropdown-item<?php if($page == 11) { ?> active<?php } ?>" href="?p=11">Right leg</a>
</li>
</ul>
<li class="list-group-item">

View File

@ -1,6 +1,6 @@
.headerLogo{
background-image: url(/assets/icons/Grublox.png);
background-size: 131px 30px;
width: 131px;
height: 30px;
max-width: 131px;
max-height: 30px;
}

View File

@ -14,7 +14,7 @@ $conType = $_POST['err'];
} else {
$conType = $_GET['err'];
}
if(isset($conType)) {
if(!isset($conType)) {
header("Location: /");
}
if($conType == 404) {