2022-11-02 15:39:55 +00:00
|
|
|
<?php
|
|
|
|
|
session_start();
|
|
|
|
|
if (isset($_SESSION['loggedin'])) {
|
|
|
|
|
$logButton = 'href="account/logout.php">Logout';
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$logButton = 'href="account/login.php">Login';
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
<form action="#">
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
<nav> <!--TODO: Populate this list from the categories defined by the admins-->
|
|
|
|
|
<ul>
|
2022-11-15 13:59:42 +00:00
|
|
|
<?php
|
|
|
|
|
$server = 'mysql';
|
|
|
|
|
$username = 'student';
|
|
|
|
|
$password = 'student';
|
|
|
|
|
$schema = 'ibuy';
|
|
|
|
|
$pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password);
|
|
|
|
|
$stmt = $pdo->prepare('SELECT * FROM categories');
|
|
|
|
|
$stmt->execute();
|
|
|
|
|
$cats = $stmt->fetchAll();
|
|
|
|
|
foreach ($cats as &$cat) {
|
|
|
|
|
echo '<li><a class="categoryLink" href="../index.php?pageHeading='. urlencode($cat['category_name']) .'">'. $cat['category_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-15 14:44:56 +00:00
|
|
|
© ibuy <?php echo date('Y')?>
|
2022-10-22 15:03:47 +00:00
|
|
|
</footer>
|
|
|
|
|
</main>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|