Skip to content

Commit

Permalink
user level check for admin menu
Browse files Browse the repository at this point in the history
  • Loading branch information
joelsalisbury committed Jan 18, 2024
1 parent 403ee39 commit 3f64cb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions public/layouts/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<?php if (isset($_SESSION['user_id'])) : ?>
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<?php if ($_SESSION['user_type'] == 'admin') : ?>
<li class="nav-item">
<a class="nav-link
<?php if ($_SERVER['REQUEST_URI'] == '/') : ?>
active
<?php endif; ?>
" aria-current="page" href="/">Management Dashboard</a>
</li>
<?php endif; ?>
<li class="nav-item">
<a class="

Expand Down
2 changes: 2 additions & 0 deletions seed.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
phone TEXT,
password TEXT NOT NULL,
user_type TEXT NOT NULL,
allow_sms INTEGER NOT NULL DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
)');

Expand Down Expand Up @@ -67,6 +68,7 @@
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
)');


/** insert states (new england) */
$db->exec('INSERT INTO states (state) VALUES ("Connecticut")');
$db->exec('INSERT INTO states (state) VALUES ("Maine")');
Expand Down

0 comments on commit 3f64cb8

Please sign in to comment.