335 lines
10 KiB
PHP
335 lines
10 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', 'Automobile Academic')</title>
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
|
|
|
|
<style>
|
|
body {
|
|
font-family: 'Segoe UI', sans-serif;
|
|
background: #f5f7fb;
|
|
padding-top: 80px;
|
|
}
|
|
|
|
.navbar {
|
|
background: #5E244E;
|
|
z-index: 1000;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
}
|
|
|
|
.navbar-brand {
|
|
color: white;
|
|
font-weight: bold;
|
|
font-size: 24px;
|
|
}
|
|
|
|
.navbar-brand:hover {
|
|
color: #ffc107;
|
|
}
|
|
|
|
.nav-link {
|
|
color: white !important;
|
|
margin-left: 20px;
|
|
}
|
|
|
|
.nav-link:hover {
|
|
color: #ffc107 !important;
|
|
}
|
|
|
|
.site-footer {
|
|
background: #2F1027;
|
|
color: #f1e9ee;
|
|
padding: 60px 0 30px;
|
|
}
|
|
|
|
.site-footer h4 {
|
|
color: #fff;
|
|
font-weight: 700;
|
|
margin-bottom: 18px;
|
|
}
|
|
|
|
.site-footer p {
|
|
color: #d8c7d3;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.user-dropdown-toggle {
|
|
cursor: pointer;
|
|
color: white;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
user-select: none;
|
|
text-decoration: none !important;
|
|
}
|
|
|
|
.user-dropdown-toggle:hover {
|
|
color: #ffc107;
|
|
}
|
|
|
|
.user-profile-name {
|
|
font-weight: 600;
|
|
font-size: 14px;
|
|
max-width: 120px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.footer-links li {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.footer-links a {
|
|
color: #d8c7d3;
|
|
text-decoration: none;
|
|
transition: .2s;
|
|
}
|
|
|
|
.footer-links a:hover {
|
|
color: #FFC107;
|
|
padding-left: 4px;
|
|
}
|
|
|
|
.footer-contact li {
|
|
margin-bottom: 14px;
|
|
color: #d8c7d3;
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 10px;
|
|
}
|
|
|
|
.footer-contact i {
|
|
color: #FFC107;
|
|
margin-top: 3px;
|
|
}
|
|
|
|
.footer-contact a {
|
|
color: #d8c7d3;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.footer-contact a:hover {
|
|
color: #FFC107;
|
|
}
|
|
|
|
.site-footer hr {
|
|
border-color: rgba(255,255,255,.15);
|
|
margin: 40px 0 20px;
|
|
}
|
|
|
|
.footer-bottom {
|
|
color: #b8a6b3;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.animate {
|
|
animation-duration: 0.2s;
|
|
animation-fill-mode: both;
|
|
}
|
|
|
|
@keyframes slideIn {
|
|
0% {
|
|
transform: translateY(1rem);
|
|
opacity: 0;
|
|
}
|
|
100% {
|
|
transform: translateY(0rem);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
.slideIn {
|
|
animation-name: slideIn;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<nav class="navbar navbar-expand-lg">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="/">
|
|
<i class="fa-solid fa-car-side"></i> AutoEdu
|
|
</a>
|
|
|
|
<button class="navbar-toggler bg-light"
|
|
type="button"
|
|
data-bs-toggle="collapse"
|
|
data-bs-target="#menu"
|
|
aria-controls="menu"
|
|
aria-expanded="false"
|
|
aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
|
|
<div class="collapse navbar-collapse" id="menu">
|
|
<ul class="navbar-nav ms-auto mb-2 mb-lg-0 align-items-lg-center">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/">Home</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/courses">Courses</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/students">Student</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/abouts">About Us</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/contact">Contact</a>
|
|
</li>
|
|
|
|
<li class="nav-item ms-lg-3 mt-3 mt-lg-0">
|
|
@if(Auth::check())
|
|
@php
|
|
$displayName = Auth::user()->first_name . ' ' . Auth::user()->last_name;
|
|
@endphp
|
|
<div class="dropdown">
|
|
<a class="user-dropdown-toggle dropdown-toggle text-white"
|
|
href="#"
|
|
role="button"
|
|
id="userMenu"
|
|
data-bs-toggle="dropdown"
|
|
aria-expanded="false">
|
|
<i class="fa-solid fa-circle-user" style="font-size: 24px;"></i>
|
|
<span class="user-profile-name">{{ $displayName }}</span>
|
|
</a>
|
|
|
|
<ul class="dropdown-menu dropdown-menu-end shadow animate slideIn" aria-labelledby="userMenu">
|
|
<li>
|
|
<a class="dropdown-item" href="/profile">
|
|
<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
|
|
<div class="d-flex gap-2">
|
|
<a href="/signin" class="btn btn-outline-light">Sign In</a>
|
|
<a href="/signup" class="btn btn-warning">Register</a>
|
|
</div>
|
|
@endif
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<main>
|
|
@yield('content')
|
|
</main>
|
|
|
|
<footer class="site-footer" role="contentinfo">
|
|
<div class="container">
|
|
<div class="row g-4">
|
|
<div class="col-md-4">
|
|
<h4>Automobile Academic</h4>
|
|
<p>Providing excellence in Automotive Engineering Education, Innovation and Research.</p>
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<h4>Quick Links</h4>
|
|
<nav aria-label="Footer quick links">
|
|
<ul class="list-unstyled footer-links">
|
|
<li><a href="/">Home</a></li>
|
|
<li><a href="{{ Route::has('courses') ? route('courses') : '/courses' }}">Courses</a></li>
|
|
<li><a href="{{ Route::has('research') ? route('research') : '/students' }}">Students</a></li>
|
|
<li><a href="{{ Route::has('faculty') ? route('faculty') : '/abouts' }}">Abouts</a></li>
|
|
<li><a href="{{ Route::has('contact') ? route('contact') : '/contact' }}">Contact</a></li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<h4>Contact</h4>
|
|
<ul class="list-unstyled footer-contact">
|
|
<li>
|
|
<i class="fa-solid fa-location-dot" aria-hidden="true"></i>
|
|
<span>Automobile Engineering Campus</span>
|
|
</li>
|
|
<li>
|
|
<i class="fa-solid fa-envelope" aria-hidden="true"></i>
|
|
<a href="mailto:info@autoedu.edu">info@autoedu.edu</a>
|
|
</li>
|
|
<li>
|
|
<i class="fa-solid fa-phone" aria-hidden="true"></i>
|
|
<a href="tel:+94112345678">+94 11 2345678</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div class="text-center footer-bottom">
|
|
© {{ now()->year }} Automobile Academic Website
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<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('/custom-logout', {
|
|
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 = '/';
|
|
} else {
|
|
alert('Logout failed. Please try again.');
|
|
}
|
|
})
|
|
.catch(err => {
|
|
console.error('Error:', err);
|
|
alert('Server side error occurred during logout.');
|
|
});
|
|
}
|
|
|
|
function toggleUserDropdown(event) {
|
|
event.stopPropagation();
|
|
const dropdown = document.getElementById('userDropdownContent');
|
|
if (dropdown) {
|
|
dropdown.style.display = dropdown.style.display === 'block' ? 'none' : 'block';
|
|
}
|
|
}
|
|
|
|
window.addEventListener('click', function () {
|
|
const dropdown = document.getElementById('userDropdownContent');
|
|
if (dropdown) { dropdown.style.display = 'none'; }
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html> |