diff --git a/db.php b/db.php new file mode 100644 index 0000000..18fb409 --- /dev/null +++ b/db.php @@ -0,0 +1,13 @@ +prepare('SELECT * FROM categories'); + $stmt->execute(); + $cats = $stmt->fetchAll(); + + return $cats; +} \ No newline at end of file diff --git a/layout.php b/layout.php index d03ccfc..ef0b60a 100644 --- a/layout.php +++ b/layout.php @@ -1,11 +1,12 @@ Logout'; + $logButton = 'href="../account/logout.php">Logout'; } else { - $logButton = 'href="account/login.php">Login'; + $logButton = 'href="../account/login.php">Login'; } + +require_once 'db.php'; ?> @@ -33,14 +34,7 @@ else {
Unsuccessful Login
'; diff --git a/public/account/logout.php b/public/account/logout.php index af49c50..6d4ec10 100644 --- a/public/account/logout.php +++ b/public/account/logout.php @@ -1,6 +1,6 @@ Logged Out'; +unset($_SESSION['admin']); +echo''; ?> \ No newline at end of file diff --git a/public/admin/adminCategories.php b/public/admin/adminCategories.php index e69de29..e0098eb 100644 --- a/public/admin/adminCategories.php +++ b/public/admin/adminCategories.php @@ -0,0 +1,28 @@ +window.location.href = "../index.php";'; + } +} +else { + //echo''; +} + +require_once '../../db.php'; +$pageContent = '