429 lines
15 KiB
PHP
429 lines
15 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
<title>@yield('title', 'Student Portal - Automobile Academic')</title>
|
|
|
|
<!-- Font Awesome Icons & Bootstrap 5 -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<style>
|
|
/* Global Root Variables based on Master Layout */
|
|
:root {
|
|
--theme-navy: #2D355B; /* Primary Dark Navy */
|
|
--theme-footer-navy: #1F2541; /* Dark Navy for active/hover states */
|
|
--theme-red: #822424; /* Primary Accent Red */
|
|
--theme-red-hover: #df2c3e; /* Red Hover state */
|
|
--theme-yellow: #FFEA85; /* Accent Yellow/Gold */
|
|
--theme-bg: #F6F6F6; /* Light Background */
|
|
--sidebar-width: 260px;
|
|
--text-dark: #333333;
|
|
}
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
font-family: 'Segoe UI', sans-serif;
|
|
}
|
|
|
|
body {
|
|
background-color: var(--theme-bg);
|
|
color: var(--text-dark);
|
|
display: flex;
|
|
min-height: 100vh;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
/* ---------- Sidebar Style ---------- */
|
|
.sidebar {
|
|
width: var(--sidebar-width);
|
|
height: 100vh;
|
|
background: var(--theme-navy);
|
|
color: #fff;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
padding: 24px 0;
|
|
transition: all 0.3s ease;
|
|
z-index: 1030;
|
|
display: flex;
|
|
flex-direction: column;
|
|
box-shadow: 2px 0 10px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.sidebar .brand {
|
|
padding: 0 24px 20px;
|
|
font-weight: 700;
|
|
font-size: 1.25rem;
|
|
color: #ffffff;
|
|
border-bottom: 1px solid rgba(255,255,255,.15);
|
|
margin-bottom: 12px;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.sidebar .nav {
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-grow: 1;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.sidebar .nav-link {
|
|
color: rgba(255, 255, 255, 0.85);
|
|
padding: 14px 24px;
|
|
font-size: 0.95rem;
|
|
font-weight: 600;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
transition: all 0.2s ease;
|
|
border-left: 4px solid transparent;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.sidebar .nav-link i {
|
|
width: 20px;
|
|
text-align: center;
|
|
}
|
|
|
|
/* Hover & Active states matched to Main Theme */
|
|
.sidebar .nav-link:hover {
|
|
background: rgba(255, 255, 255, 0.08);
|
|
color: var(--theme-yellow) !important;
|
|
padding-left: 28px;
|
|
}
|
|
|
|
.sidebar .nav-link.active {
|
|
background: var(--theme-footer-navy);
|
|
color: var(--theme-yellow) !important;
|
|
border-left: 4px solid #F73F52;
|
|
font-weight: 700;
|
|
}
|
|
|
|
/* User Profile Section inside Sidebar */
|
|
.sidebar-user-profile {
|
|
padding: 15px 24px;
|
|
border-top: 1px solid rgba(255,255,255,.15);
|
|
margin-top: auto;
|
|
background: var(--theme-footer-navy);
|
|
}
|
|
|
|
.sidebar-user-profile .user-dropdown-toggle {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
color: #fff;
|
|
text-decoration: none;
|
|
font-size: 0.95rem;
|
|
transition: color 0.2s ease;
|
|
}
|
|
|
|
.sidebar-user-profile .user-dropdown-toggle:hover {
|
|
color: var(--theme-yellow);
|
|
}
|
|
|
|
/* Custom Theme Buttons */
|
|
.btn-theme-register {
|
|
background-color: var(--theme-red);
|
|
color: white;
|
|
border: 1px solid #ffffff;
|
|
transition: background-color 0.2s ease;
|
|
}
|
|
|
|
.btn-theme-register:hover {
|
|
background-color: var(--theme-red-hover);
|
|
color: white;
|
|
}
|
|
|
|
/* ---------- Main Content Layout ---------- */
|
|
.main {
|
|
margin-left: var(--sidebar-width);
|
|
width: calc(100% - var(--sidebar-width));
|
|
min-height: 100vh;
|
|
padding: 40px;
|
|
background: var(--theme-bg);
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
/* Mobile Header Toggle Bar */
|
|
.mobile-header {
|
|
display: none;
|
|
background: var(--theme-navy);
|
|
color: #ffffff;
|
|
padding: 12px 20px;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
z-index: 1020;
|
|
}
|
|
|
|
.sidebar-toggle {
|
|
background: none;
|
|
border: none;
|
|
font-size: 1.4rem;
|
|
cursor: pointer;
|
|
color: #ffffff;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.sidebar-toggle:hover {
|
|
color: var(--theme-yellow);
|
|
}
|
|
|
|
.mobile-brand {
|
|
font-weight: 700;
|
|
font-size: 1.1rem;
|
|
color: #ffffff;
|
|
}
|
|
|
|
/* Overlay Background when sidebar open on Mobile */
|
|
.sidebar-overlay {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0,0,0,0.5);
|
|
z-index: 1025;
|
|
opacity: 0;
|
|
transition: opacity 0.3s ease;
|
|
}
|
|
|
|
.sidebar-overlay.show {
|
|
display: block;
|
|
opacity: 1;
|
|
}
|
|
|
|
/* Responsive Breakpoints */
|
|
@media (max-width: 991px) {
|
|
.sidebar {
|
|
left: calc(-1 * var(--sidebar-width));
|
|
}
|
|
|
|
.sidebar.show {
|
|
left: 0;
|
|
}
|
|
|
|
.main {
|
|
margin-left: 0;
|
|
padding: 85px 20px 20px 20px;
|
|
width: 100%;
|
|
}
|
|
|
|
.mobile-header {
|
|
display: flex;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- Mobile Top Navigation Bar -->
|
|
<header class="mobile-header">
|
|
<button class="sidebar-toggle" id="toggleBtn" aria-label="Toggle Sidebar">
|
|
<i class="fa-solid fa-bars"></i>
|
|
</button>
|
|
<div class="mobile-brand">
|
|
<i class="fa-solid fa-car-side me-1"></i> AutoEdu Portal
|
|
</div>
|
|
|
|
<!-- Mobile View User Profile Dropdown -->
|
|
<div class="mobile-user-profile">
|
|
@if(Auth::check())
|
|
<div class="dropdown">
|
|
<a class="text-white text-decoration-none dropdown-toggle d-flex align-items-center gap-2" href="#" role="button" id="userMenuMobile" data-bs-toggle="dropdown" aria-expanded="false">
|
|
<i class="fa-solid fa-circle-user" style="font-size: 26px; color: var(--theme-yellow);"></i>
|
|
<span class="fw-semibold small">{{ Auth::user()->first_name }}</span>
|
|
</a>
|
|
<ul class="dropdown-menu dropdown-menu-end shadow" aria-labelledby="userMenuMobile">
|
|
<li>
|
|
<a class="dropdown-item" href="/StudentProfile">
|
|
<i class="fa-solid fa-user me-2"></i> Profile
|
|
</a>
|
|
</li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li>
|
|
<button type="button" onclick="submitLogout()" class="dropdown-item text-danger w-100 text-start border-0 bg-transparent">
|
|
<i class="fa-solid fa-right-from-bracket me-2"></i> Logout
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
@else
|
|
<a href="/signin" class="btn btn-sm btn-outline-light"><i class="fa-solid fa-right-to-bracket me-1"></i> Sign In</a>
|
|
@endif
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Overlay dim background element -->
|
|
<div class="sidebar-overlay" id="sidebarOverlay"></div>
|
|
|
|
<!-- Sidebar Navigation -->
|
|
<aside class="sidebar" id="sidebar">
|
|
<div class="brand">
|
|
<i class="fa-solid fa-car-side me-2"></i> AutoEdu
|
|
</div>
|
|
|
|
<!-- Navigation Links -->
|
|
<nav class="nav">
|
|
<a href="/Dashboard" class="nav-link {{ request()->is('Dashboard*') ? 'active' : '' }}">
|
|
<i class="fa-solid fa-gauge"></i> Dashboard
|
|
</a>
|
|
<a href="/mycourse" class="nav-link {{ request()->is('mycourse*') ? 'active' : '' }}">
|
|
<i class="fa-solid fa-book"></i> My Courses
|
|
</a>
|
|
<a href="/timetable" class="nav-link {{ request()->is('timetable*') ? 'active' : '' }}">
|
|
<i class="fa-solid fa-calendar-days"></i> Class Timetable
|
|
</a>
|
|
<a href="/results" class="nav-link {{ request()->is('results*') ? 'active' : '' }}">
|
|
<i class="fa-solid fa-square-poll-vertical"></i> Exam Results
|
|
</a>
|
|
<a href="/Studentguidelines" class="nav-link {{ request()->is('Studentguidelines*') ? 'active' : '' }}">
|
|
<i class="fa-solid fa-book-open"></i> Student Guidelines
|
|
</a>
|
|
<a href="/Feedback&Complain" class="nav-link {{ request()->is('Feedback&Complain*') ? 'active' : '' }}">
|
|
<i class="fa-solid fa-comments"></i> Feedback & Complain
|
|
</a>
|
|
<!-- <a href="/StudentProfile" class="nav-link {{ request()->is('StudentProfile*') ? 'active' : '' }}">
|
|
<i class="fa-solid fa-user"></i> Student Profile
|
|
</a> -->
|
|
<a href="{{ route('StudentProfile') }}" class="nav-link {{ request()->routeIs('StudentProfile') ? 'active' : '' }}">
|
|
<i class="fa-solid fa-user"></i> Student Profile
|
|
</a>
|
|
</nav>
|
|
|
|
<!-- Sidebar User Profile (Desktop View Footer) -->
|
|
<div class="sidebar-user-profile">
|
|
@if(Auth::check())
|
|
@php
|
|
$displayName = Auth::user()->first_name . ' ' . Auth::user()->last_name;
|
|
@endphp
|
|
<div class="dropdown dropup">
|
|
<a class="user-dropdown-toggle dropdown-toggle" href="#" role="button" id="userMenuDesktop" data-bs-toggle="dropdown" aria-expanded="false">
|
|
<i class="fa-solid fa-circle-user" style="font-size: 24px; color: var(--theme-yellow);"></i>
|
|
<span class="text-truncate" style="max-width: 150px;">{{ $displayName }}</span>
|
|
</a>
|
|
|
|
<ul class="dropdown-menu dropdown-menu-start shadow w-100" aria-labelledby="userMenuDesktop">
|
|
<li>
|
|
<a class="dropdown-item" href="/StudentProfile">
|
|
<i class="fa-solid fa-user me-2"></i> Profile
|
|
</a>
|
|
</li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li>
|
|
<button type="button" onclick="submitLogout()" class="dropdown-item text-danger border-0 bg-transparent w-100 text-start">
|
|
<i class="fa-solid fa-right-from-bracket me-2"></i> Logout
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
@else
|
|
<div class="d-flex gap-2">
|
|
<a href="/signin" class="btn btn-outline-light btn-sm w-50">Sign In</a>
|
|
<a href="/signup" class="btn btn-theme-register btn-sm w-50">Register</a>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Main Content Area -->
|
|
<main class="main">
|
|
@yield('content')
|
|
</main>
|
|
|
|
<!-- Scripts -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
|
|
|
|
<script>
|
|
|
|
function submitLogout() {
|
|
const tokenEl = document.querySelector('meta[name="csrf-token"]');
|
|
|
|
fetch('/studentlogout', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'Accept': 'application/json',
|
|
'X-CSRF-TOKEN': tokenEl ? tokenEl.getAttribute('content') : ''
|
|
}
|
|
})
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
if (data.success) {
|
|
|
|
window.location.href = '/signin';
|
|
} else {
|
|
alert('Logout failed. Please try again.');
|
|
}
|
|
})
|
|
.catch(err => {
|
|
console.error('Error:', err);
|
|
alert('Server side error occurred during logout.');
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<!-- <script>
|
|
// Sidebar Toggle Logic
|
|
const toggleBtn = document.getElementById('toggleBtn');
|
|
const sidebar = document.getElementById('sidebar');
|
|
const overlay = document.getElementById('sidebarOverlay');
|
|
|
|
toggleBtn.addEventListener('click', () => {
|
|
sidebar.classList.toggle('show');
|
|
overlay.classList.toggle('show');
|
|
});
|
|
|
|
overlay.addEventListener('click', () => {
|
|
sidebar.classList.remove('show');
|
|
overlay.classList.remove('show');
|
|
});
|
|
|
|
// Dynamic Logout Logic
|
|
function submitLogout() {
|
|
const tokenEl = document.querySelector('meta[name="csrf-token"]');
|
|
|
|
fetch('/studentlogout', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'Accept': 'application/json',
|
|
'X-CSRF-TOKEN': tokenEl ? tokenEl.getAttribute('content') : ''
|
|
}
|
|
})
|
|
.then(res => {
|
|
if (!res.ok) {
|
|
return res.text().then(text => { throw new Error(text) });
|
|
}
|
|
return res.json();
|
|
})
|
|
.then(data => {
|
|
if (data.success) {
|
|
alert('Logged out successfully!');
|
|
window.location.href = '/students';
|
|
} else {
|
|
alert('Logout failed. Please try again.');
|
|
}
|
|
})
|
|
.catch(err => {
|
|
console.error('Error:', err);
|
|
alert('Server side error occurred during logout.');
|
|
});
|
|
}
|
|
</script> -->
|
|
</body>
|
|
</html> |