<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ciné Le Paris</title>
<link rel="stylesheet" href="assets/css/navbar.css">
</head>
<body>
<header class="cine-header">
<nav class="cine-nav">
<a href="index.php" class="cine-logo-link">
<img src="assets/images/logo.svg" alt="Ciné Le Paris Logo" class="cine-logo">
</a>
<!-- Hamburger Menu Button -->
<div class="cine-hamburger" id="hamburgerBtn">
<span></span>
<span></span>
<span></span>
</div>
<div class="cine-nav-links" id="mobileMenu">
<a href="index.php?page=home">Home</a>
<a href="index.php?page=showtimes">Showtimes</a>
<a href="index.php?page=movies">Movies</a>
<?php if (isset($_SESSION['user_id'])): ?>
<?php
$usernameInitial = "U";
if ($dbc && !mysqli_connect_errno()) {
$id = $_SESSION['user_id'];
$stmt = mysqli_prepare($dbc, "SELECT username FROM CINE_Person WHERE pk_Person = ?");
mysqli_stmt_bind_param($stmt, "i", $id);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
if ($result && mysqli_num_rows($result) > 0) {
$fetchedUsername = mysqli_fetch_assoc($result)['username'];
// take the first letter of the user
$usernameInitial = strtoupper(substr($fetchedUsername, 0, 1));
}
mysqli_stmt_close($stmt);
}
?>
<a href="index.php?page=dashboard">Dashboard</a>
<a href="index.php?page=logout">Logout</a>
<a href="index.php?page=profile" class="cine-profile-icon"><?php echo htmlspecialchars($usernameInitial); ?></a>
<?php else: ?>
<a href="index.php?page=login">Login</a>
<!-- <a href="index.php?page=register">Register</a> incase register is needed later-->
<?php endif; ?>
</div>
</nav>
</header>
<script src="assets/js/navbar.js"></script>
</body>
</html>