-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
318 lines (296 loc) · 12.8 KB
/
index.php
File metadata and controls
318 lines (296 loc) · 12.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<?php include('config.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>College Management System</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/js/all.min.js"></script>
<style>
body {
font-family: 'Poppins', sans-serif;
background-color: #f8f9fa;
}
.hero {
background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3)), url('assets/college-banner.jpg') center/cover no-repeat;
color: white;
padding: 120px 0;
text-align: center;
}
.hero h1 {
font-size: 3.5rem;
font-weight: bold;
animation: fadeInDown 1s ease-in-out;
}
.hero p {
font-size: 1.2rem;
animation: fadeInUp 1s ease-in-out;
}
@keyframes fadeInDown {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.section {
padding: 80px 0;
margin-top: 60px;
}
.navbar {
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}
/* Navbar brand animation */
.navbar-brand {
transition: transform 0.3s ease, color 0.3s ease;
}
.navbar-brand:hover {
transform: scale(1.1);
color: #ffc107 !important;
}
.btn-custom {
padding: 10px 25px;
font-size: 1.1rem;
font-weight: bold;
transition: all 0.3s ease-in-out;
border-radius: 50px;
}
.btn-custom:hover {
transform: translateY(-3px);
box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.1);
}
/* Courses Section Styling */
.course-card {
transition: all 0.4s ease-in-out;
border: none;
border-radius: 15px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background-color: #fff;
overflow: hidden;
padding: 20px;
}
.course-card:hover {
transform: translateY(-10px);
box-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
}
/* Icon Circle Styling */
.icon-circle {
width: 80px;
height: 80px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
transition: transform 0.3s ease;
}
.icon-circle:hover {
transform: rotate(360deg);
}
/* News Hover Animation */
.news-item {
transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer;
position: relative;
}
.news-item:hover {
transform: scale(1.05);
background-color: #e9f7ef;
}
/* Side Popup Styling */
.news-popup {
display: none;
position: absolute;
z-index: 1000;
background-color: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
padding: 10px;
border-radius: 10px;
width: 300px;
animation: fadeIn 0.3s ease;
left: 100%;
top: 0;
margin-left: 10px;
}
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.9); }
to { opacity: 1; transform: scale(1); }
}
</style>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="#"><i class="fas fa-graduation-cap"></i> XYZ College</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="#">Home</a></li>
<li class="nav-item"><a class="nav-link" href="about.php">About Us</a></li> <!-- Added About Us -->
<li class="nav-item"><a class="nav-link" href="courses.php">Courses</a></li>
<li class="nav-item"><a class="nav-link" href="#news">News</a></li>
<li class="nav-item"><a class="nav-link" href="navigation/map.php">Campus Map</a></li>
<li class="nav-item"><a class="nav-link" href="contact.php">Contact</a></li>
<li class="nav-item"><a class="btn btn-primary btn-custom" href="auth/login.php">Login</a></li>
<li class="nav-item"><a class="btn btn-success btn-custom ms-2" href="auth/register.php">Register</a></li>
</ul>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="hero">
<div class="container">
<h1>Welcome to XYZ College</h1>
<p>Empowering students with knowledge, innovation, and excellence.</p>
<a href="courses.php" class="btn btn-light btn-lg btn-custom mt-3">Explore Courses</a>
</div>
</section>
<!-- Section Divider -->
<hr class="section-divider">
<!-- Courses Section -->
<section class="section bg-white" id="courses">
<div class="container">
<h2 class="text-center mb-5">Our Courses</h2>
<div class="row g-4">
<!-- Computer Science -->
<div class="col-md-4">
<div class="card course-card h-100">
<div class="card-body text-center">
<div class="icon-circle bg-primary mb-3">
<i class="fas fa-laptop-code fa-3x text-white"></i>
</div>
<h5 class="card-title">Computer Science</h5>
<p class="card-text">Learn programming, AI, and cybersecurity with hands-on projects.</p>
<button class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#courseModal"
onclick="showCourseDetails('Computer Science', 'This course covers programming languages, algorithms, AI, and cybersecurity. Perfect for tech enthusiasts and future developers.')">
Learn More
</button>
</div>
</div>
</div>
<!-- Business Administration -->
<div class="col-md-4">
<div class="card course-card h-100">
<div class="card-body text-center">
<div class="icon-circle bg-success mb-3">
<i class="fas fa-briefcase fa-3x text-white"></i>
</div>
<h5 class="card-title">Business Administration</h5>
<p class="card-text">Master business strategies, leadership, and entrepreneurial skills.</p>
<button class="btn btn-outline-success btn-sm" data-bs-toggle="modal" data-bs-target="#courseModal"
onclick="showCourseDetails('Business Administration', 'Learn about business leadership, management, and entrepreneurship. Ideal for future business leaders and managers.')">
Learn More
</button>
</div>
</div>
</div>
<!-- Electrical Engineering -->
<div class="col-md-4">
<div class="card course-card h-100">
<div class="card-body text-center">
<div class="icon-circle bg-warning mb-3">
<i class="fas fa-bolt fa-3x text-white"></i>
</div>
<h5 class="card-title">Electrical Engineering</h5>
<p class="card-text">Explore circuits, power systems, and electronics with practical labs.</p>
<button class="btn btn-outline-warning btn-sm" data-bs-toggle="modal" data-bs-target="#courseModal"
onclick="showCourseDetails('Electrical Engineering', 'Explore circuits, power systems, and electronics with hands-on lab work. Ideal for aspiring engineers.')">
Learn More
</button>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Course Details Modal -->
<div class="modal fade" id="courseModal" tabindex="-1" aria-labelledby="courseModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="courseModalLabel">Course Details</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="courseModalContent">
<!-- Course details will be injected here -->
</div>
</div>
</div>
</div>
<!-- News Section -->
<section class="section bg-light" id="news">
<div class="container text-center">
<h2 class="mb-4">Latest News</h2>
<ul class="list-group">
<?php
$query = "SELECT * FROM news ORDER BY created_at DESC LIMIT 5";
$result = $conn->query($query);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<li class='list-group-item news-item' data-title='" . htmlspecialchars($row['title'], ENT_QUOTES) . "' data-content='" . htmlspecialchars($row['content'], ENT_QUOTES) . "'>
<strong>" . $row['title'] . ":</strong> " . substr($row['content'], 0, 50) . "... (Hover to read more)
<div class='news-popup'></div>
</li>";
}
} else {
echo "<li class='list-group-item'>No news available.</li>";
}
?>
</ul>
</div>
</section>
<!-- Contact Section -->
<section class="section" id="contact">
<div class="container text-center">
<h2 class="mb-4">Contact Us</h2>
<p class="lead">Email: info@xyzcollege.com | Phone: +123 456 7890</p>
<div class="mt-3">
<a href="#" class="btn btn-primary btn-custom"><i class="fab fa-facebook"></i> Facebook</a>
<a href="#" class="btn btn-info btn-custom"><i class="fab fa-twitter"></i> Twitter</a>
<a href="#" class="btn btn-danger btn-custom"><i class="fab fa-instagram"></i> Instagram</a>
</div>
</div>
</section>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- JavaScript for Course Modal and News Popup -->
<script>
// Course Modal
function showCourseDetails(title, description) {
document.getElementById('courseModalLabel').innerText = title;
document.getElementById('courseModalContent').innerHTML = `<p>${description}</p>`;
}
// News Hover Popup
document.addEventListener('DOMContentLoaded', () => {
const newsItems = document.querySelectorAll('.news-item');
newsItems.forEach(item => {
const popup = item.querySelector('.news-popup');
// Show popup on hover
item.addEventListener('mouseenter', () => {
const title = item.getAttribute('data-title');
const content = item.getAttribute('data-content');
popup.innerHTML = `<strong>${title}</strong><p>${content}</p>`;
popup.style.display = 'block';
// Adjust position if no space on the right
const rect = item.getBoundingClientRect();
const popupWidth = popup.offsetWidth;
if (rect.right + popupWidth > window.innerWidth) {
popup.style.left = 'auto';
popup.style.right = '100%';
popup.style.marginRight = '10px';
} else {
popup.style.left = '100%';
popup.style.marginLeft = '10px';
}
});
// Hide popup when mouse leaves
item.addEventListener('mouseleave', () => {
popup.style.display = 'none';
});
});
});
</script>
</body>
</html>