92 lines
3.9 KiB
PHP
92 lines
3.9 KiB
PHP
<?php
|
|
if (session_status() == PHP_SESSION_NONE) {
|
|
session_start();
|
|
}
|
|
|
|
// Check for session message for toast notifications
|
|
$message = null;
|
|
if (isset($_SESSION['message'])) {
|
|
$message = $_SESSION['message'];
|
|
$message_type = $_SESSION['message_type'] ?? 'success';
|
|
unset($_SESSION['message']);
|
|
unset($_SESSION['message_type']);
|
|
}
|
|
|
|
$current_user = $_SESSION['user_id'] ?? null;
|
|
$current_username = $_SESSION['username'] ?? null;
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<!-- SEO and Meta Tags -->
|
|
<title>MyTaskManager</title>
|
|
<meta name="description" content="A simple and beautiful task manager built with Flatlogic.">
|
|
<meta name="keywords" content="task manager, to-do list, productivity, project management, simple tasks, online to-do, Flatlogic Generator, php task manager">
|
|
<meta property="og:title" content="MyTaskManager">
|
|
<meta property="og:description" content="A simple and beautiful task manager built with Flatlogic.">
|
|
<meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
|
|
|
|
<!-- Stylesheets -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
</head>
|
|
<body>
|
|
|
|
<!-- Navbar -->
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="index.php">
|
|
<i class="bi bi-check2-square text-primary"></i>
|
|
MyTaskManager
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav ms-auto">
|
|
<?php if ($current_user): ?>
|
|
<li class="nav-item">
|
|
<span class="navbar-text me-3">
|
|
Welcome, <?php echo htmlspecialchars($current_username); ?>
|
|
</span>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="btn btn-outline-danger" href="logout.php">Logout</a>
|
|
</li>
|
|
<?php else: ?>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="login.php">Login</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="btn btn-primary" href="register.php">Register</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Main Content -->
|
|
<main class="container my-5">
|
|
|
|
<!-- Toast Notification -->
|
|
<?php if ($message): ?>
|
|
<div class="toast-container position-fixed bottom-0 end-0 p-3">
|
|
<div class="toast align-items-center text-white bg-<?php echo $message_type; ?> border-0 show" role="alert" aria-live="assertive" aria-atomic="true">
|
|
<div class="d-flex">
|
|
<div class="toast-body">
|
|
<?php echo htmlspecialchars($message); ?>
|
|
</div>
|
|
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|