partially implemented todo tracker
This commit is contained in:
+9
-8
@@ -2,22 +2,23 @@
|
||||
$current_page = $_SERVER['SCRIPT_NAME'];
|
||||
$nav = '
|
||||
<nav>
|
||||
<div class="row_no_margin">
|
||||
<div class="row_space_between no_margin">
|
||||
<div class="site_navigation">
|
||||
<ul>
|
||||
<li><a href="/index.php"' . ($current_page == '/index.php' ? ' class="underline"' : '') . '>Home</a></li>
|
||||
<li><a href="/articles.php?view=sort&sort=newest"' . ($current_page == '/articles.php' ? ' class="underline"' : '') . '>Articles</a></li>
|
||||
';
|
||||
|
||||
if (isset($_SESSION['role_id']) && $_SESSION['role_id'] <= 2) {
|
||||
$nav .= '
|
||||
if (isset($_SESSION['role_id']) && $_SESSION['role_id'] <= admin) {
|
||||
$nav .= '
|
||||
<li><a href="/admin.php?view=users"' . ($current_page == '/admin.php' ? ' class="underline"' : '') . '>Admin</a></li>
|
||||
';
|
||||
}
|
||||
|
||||
if (isset($_SESSION['user_id'])) {
|
||||
$nav .= '
|
||||
$nav .= '
|
||||
<li><a href="/user.php?view=display&user_id=' . $_SESSION['user_id'] . '"' . ($current_page == '/user.php' ? ' class="underline"' : '') . '>Account</a></li>
|
||||
<li><a href="/todo.php?view=display"' . ($current_page == '/todo.php' ? ' class="underline"' : '') . '>Todos</a></li>
|
||||
';
|
||||
}
|
||||
|
||||
@@ -30,9 +31,9 @@ $nav .= '
|
||||
|
||||
$theme_toggle = '';
|
||||
if ($_SESSION['theme'] == 'dark')
|
||||
$theme_toggle = 'light';
|
||||
$theme_toggle = 'light';
|
||||
else
|
||||
$theme_toggle = 'dark';
|
||||
$theme_toggle = 'dark';
|
||||
|
||||
$nav .= '
|
||||
<button id="theme_toggle" value="' . $theme_toggle . '" name="theme"><i class="nf ' . ($theme_toggle == 'dark' ? 'nf-oct-moon' : 'nf-oct-sun') . '"></i></button>
|
||||
@@ -40,11 +41,11 @@ $nav .= '
|
||||
';
|
||||
|
||||
if (isset($_SESSION['username'])) {
|
||||
$nav .= '
|
||||
$nav .= '
|
||||
<a href="user.php?view=logout">Log Out</a>
|
||||
';
|
||||
} else {
|
||||
$nav .= '
|
||||
$nav .= '
|
||||
<a href="user.php?view=login">Login</a>
|
||||
<a href="user.php?view=signup">Sign Up</a>
|
||||
';
|
||||
|
||||
Reference in New Issue
Block a user