CSY2028-assignment-1/layout.php

58 lines
1.4 KiB
PHP
Raw Normal View History

2022-11-02 15:39:55 +00:00
<?php
if (isset($_SESSION['loggedin'])) {
2022-11-16 13:27:51 +00:00
$logButton = 'href="../account/logout.php">Logout';
2022-11-02 15:39:55 +00:00
}
else {
2022-11-16 13:27:51 +00:00
$logButton = 'href="../account/login.php">Login';
2022-11-02 15:39:55 +00:00
}
2022-11-16 13:27:51 +00:00
2022-11-19 15:38:26 +00:00
require_once 'functions.php';
2022-11-02 15:39:55 +00:00
?>
2022-10-22 15:03:47 +00:00
<!DOCTYPE html>
<html>
<head>
<title>
<?php
echo $pageTitle
?>
</title>
2022-11-02 15:39:55 +00:00
<link rel="stylesheet" href="../assets/ibuy.css" />
2022-10-22 15:03:47 +00:00
</head>
<body>
<header>
2022-11-02 15:39:55 +00:00
<h1><a href="../index.php"><span class="i">i</span><span class="b">b</span><span class="u">u</span><span class="y">y</span></a></h1>
2022-10-22 15:03:47 +00:00
2022-11-20 21:12:58 +00:00
<form action="../search.php" method='GET'>
2022-10-22 15:03:47 +00:00
<input type="text" name="search" placeholder="Search for anything" />
<input type="submit" name="submit" value="Search" />
</form>
2022-11-02 15:39:55 +00:00
2022-10-22 15:03:47 +00:00
</header>
2022-11-16 18:46:15 +00:00
<nav>
2022-10-22 15:03:47 +00:00
<ul>
<?php
2022-11-16 13:27:51 +00:00
$cats = fetchCats();
foreach ($cats as &$cat) {
2022-11-16 19:17:35 +00:00
echo '<li><a class="categoryLink" href="../index.php?pageHeading='. urlencode($cat['name']) .'">'. $cat['name'] .'</a></li>';
}
?>
2022-11-02 15:39:55 +00:00
<li><a class="categoryLink" <?php echo $logButton?></a></li>
2022-10-22 15:03:47 +00:00
</ul>
</nav>
<img src="../assets/banners/1.jpg" alt="Banner" />
<main>
<?php
echo $pageContent;
?>
<footer>
2022-11-20 21:12:58 +00:00
<a style="text-decoration: none;" href="../admin/adminCategories.php">admin categories</a><br>
<a style="text-decoration: none;" href="../admin/manageAdmins.php">admin users</a><br>
2022-11-15 14:44:56 +00:00
&copy; ibuy <?php echo date('Y')?>
2022-10-22 15:03:47 +00:00
</footer>
</main>
</body>
</html>