Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
148
add_student.php
148
add_student.php
@ -1,148 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
$errors = [];
|
|
||||||
$firstName = '';
|
|
||||||
$lastName = '';
|
|
||||||
$gender = '';
|
|
||||||
$dateOfBirth = '';
|
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
||||||
$firstName = trim($_POST['firstName'] ?? '');
|
|
||||||
$lastName = trim($_POST['lastName'] ?? '');
|
|
||||||
$gender = trim($_POST['gender'] ?? '');
|
|
||||||
$dateOfBirth = trim($_POST['dateOfBirth'] ?? '');
|
|
||||||
|
|
||||||
if (empty($firstName)) {
|
|
||||||
$errors[] = 'First name is required.';
|
|
||||||
}
|
|
||||||
if (empty($lastName)) {
|
|
||||||
$errors[] = 'Last name is required.';
|
|
||||||
}
|
|
||||||
if (empty($dateOfBirth)) {
|
|
||||||
$errors[] = 'Date of birth is required.';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($errors)) {
|
|
||||||
try {
|
|
||||||
$studentCode = 'STU-' . uniqid();
|
|
||||||
|
|
||||||
$stmt = db()->prepare("INSERT INTO students (studentCode, firstName, lastName, gender, dateOfBirth) VALUES (?, ?, ?, ?, ?)");
|
|
||||||
$stmt->execute([$studentCode, $firstName, $lastName, $gender, $dateOfBirth]);
|
|
||||||
|
|
||||||
header('Location: students.php?success=1');
|
|
||||||
exit;
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$errors[] = 'Database error: ' . $e->getMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Add Student</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div class="d-flex">
|
|
||||||
<!-- Sidebar -->
|
|
||||||
<div class="sidebar d-flex flex-column p-3">
|
|
||||||
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
|
|
||||||
<i class="bi bi-exclude me-2"></i>
|
|
||||||
<span class="fs-4">Admin Panel</span>
|
|
||||||
</a>
|
|
||||||
<hr>
|
|
||||||
<ul class="nav nav-pills flex-column mb-auto">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="index.php" class="nav-link text-white" aria-current="page">
|
|
||||||
<i class="bi bi-speedometer2 me-2"></i>
|
|
||||||
Dashboard
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="students.php" class="nav-link active">
|
|
||||||
<i class="bi bi-people me-2"></i>
|
|
||||||
Students
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-calendar-event me-2"></i>
|
|
||||||
Academic Years
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-building me-2"></i>
|
|
||||||
Grades & Classrooms
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-person-badge me-2"></i>
|
|
||||||
Enrollments
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-journal-bookmark me-2"></i>
|
|
||||||
Subjects
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<hr>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main content -->
|
|
||||||
<main class="main-content p-4">
|
|
||||||
<h1 class="h3 mb-4 text-gray-800">Add New Student</h1>
|
|
||||||
|
|
||||||
<?php if (!empty($errors)): ?>
|
|
||||||
<div class="alert alert-danger">
|
|
||||||
<?php foreach ($errors as $error): ?>
|
|
||||||
<p class="mb-0"><?= htmlspecialchars($error) ?></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
|
||||||
<form action="add_student.php" method="POST">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="firstName" class="form-label">First Name</label>
|
|
||||||
<input type="text" class="form-control" id="firstName" name="firstName" value="<?= htmlspecialchars($firstName) ?>" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="lastName" class="form-label">Last Name</label>
|
|
||||||
<input type="text" class="form-control" id="lastName" name="lastName" value="<?= htmlspecialchars($lastName) ?>" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="gender" class="form-label">Gender</label>
|
|
||||||
<select class="form-select" id="gender" name="gender">
|
|
||||||
<option value="Male" <?= $gender === 'Male' ? 'selected' : '' ?>>Male</option>
|
|
||||||
<option value="Female" <?= $gender === 'Female' ? 'selected' : '' ?>>Female</option>
|
|
||||||
<option value="Other" <?= $gender === 'Other' ? 'selected' : '' ?>>Other</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="dateOfBirth" class="form-label">Date of Birth</label>
|
|
||||||
<input type="date" class="form-control" id="dateOfBirth" name="dateOfBirth" value="<?= htmlspecialchars($dateOfBirth) ?>" required>
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="btn btn-primary">Add Student</button>
|
|
||||||
<a href="students.php" class="btn btn-secondary">Cancel</a>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
:root {
|
|
||||||
--primary-color: #4A90E2;
|
|
||||||
--accent-color: #50E3C2;
|
|
||||||
--background-color: #F8F9FA;
|
|
||||||
--surface-color: #FFFFFF;
|
|
||||||
--text-color: #343A40;
|
|
||||||
--sidebar-bg: #2c3e50;
|
|
||||||
--sidebar-text: #ecf0f1;
|
|
||||||
--sidebar-active: #4A90E2;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
background-color: var(--background-color);
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar {
|
|
||||||
width: 280px;
|
|
||||||
height: 100vh;
|
|
||||||
background-color: var(--sidebar-bg);
|
|
||||||
color: var(--sidebar-text);
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar .nav-link {
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--sidebar-text);
|
|
||||||
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar .nav-link:hover {
|
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar .nav-link.active {
|
|
||||||
background-color: var(--sidebar-active);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar .nav-link .bi {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-content {
|
|
||||||
margin-left: 280px;
|
|
||||||
width: calc(100% - 280px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
border: none;
|
|
||||||
border-radius: .5rem;
|
|
||||||
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary {
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary:hover {
|
|
||||||
background-color: #357ABD;
|
|
||||||
border-color: #357ABD;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -15,19 +15,3 @@ function db() {
|
|||||||
}
|
}
|
||||||
return $pdo;
|
return $pdo;
|
||||||
}
|
}
|
||||||
|
|
||||||
function init_db() {
|
|
||||||
$pdo = db();
|
|
||||||
$pdo->exec("CREATE TABLE IF NOT EXISTS students (
|
|
||||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
studentCode VARCHAR(255) UNIQUE,
|
|
||||||
firstName VARCHAR(255) NOT NULL,
|
|
||||||
lastName VARCHAR(255) NOT NULL,
|
|
||||||
gender VARCHAR(50),
|
|
||||||
dateOfBirth DATE,
|
|
||||||
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
updatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
|
||||||
)");
|
|
||||||
}
|
|
||||||
|
|
||||||
init_db();
|
|
||||||
|
|||||||
208
index.php
208
index.php
@ -1,72 +1,150 @@
|
|||||||
<!DOCTYPE html>
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
@ini_set('display_errors', '1');
|
||||||
|
@error_reporting(E_ALL);
|
||||||
|
@date_default_timezone_set('UTC');
|
||||||
|
|
||||||
|
$phpVersion = PHP_VERSION;
|
||||||
|
$now = date('Y-m-d H:i:s');
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>Admin Dashboard</title>
|
<title>New Style</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
<?php
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
// Read project preview data from environment
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
|
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||||
<link rel="stylesheet" href="assets/css/custom.css">
|
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||||
|
?>
|
||||||
|
<?php if ($projectDescription): ?>
|
||||||
|
<!-- Meta description -->
|
||||||
|
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||||
|
<!-- Open Graph meta tags -->
|
||||||
|
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
|
<!-- Twitter meta tags -->
|
||||||
|
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($projectImageUrl): ?>
|
||||||
|
<!-- Open Graph image -->
|
||||||
|
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
|
<!-- Twitter image -->
|
||||||
|
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
|
<?php endif; ?>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-color-start: #6a11cb;
|
||||||
|
--bg-color-end: #2575fc;
|
||||||
|
--text-color: #ffffff;
|
||||||
|
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||||
|
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||||
|
color: var(--text-color);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
body::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||||
|
animation: bg-pan 20s linear infinite;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
@keyframes bg-pan {
|
||||||
|
0% { background-position: 0% 0%; }
|
||||||
|
100% { background-position: 100% 100%; }
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
background: var(--card-bg-color);
|
||||||
|
border: 1px solid var(--card-border-color);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 2rem;
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
-webkit-backdrop-filter: blur(20px);
|
||||||
|
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.loader {
|
||||||
|
margin: 1.25rem auto 1.25rem;
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||||
|
border-top-color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
@keyframes spin {
|
||||||
|
from { transform: rotate(0deg); }
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
.hint {
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
.sr-only {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px; height: 1px;
|
||||||
|
padding: 0; margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
white-space: nowrap; border: 0;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 3rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
letter-spacing: -1px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
|
}
|
||||||
|
footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<main>
|
||||||
<div class="d-flex">
|
<div class="card">
|
||||||
<!-- Sidebar -->
|
<h1>Analyzing your requirements and generating your website…</h1>
|
||||||
<div class="sidebar d-flex flex-column p-3">
|
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||||
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
|
<span class="sr-only">Loading…</span>
|
||||||
<i class="bi bi-exclude me-2"></i>
|
</div>
|
||||||
<span class="fs-4">Admin Panel</span>
|
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||||
</a>
|
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||||
<hr>
|
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||||
<ul class="nav nav-pills flex-column mb-auto">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="index.php" class="nav-link active" aria-current="page">
|
|
||||||
<i class="bi bi-speedometer2 me-2"></i>
|
|
||||||
Dashboard
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="students.php" class="nav-link text-white">
|
|
||||||
<i class="bi bi-people me-2"></i>
|
|
||||||
Students
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-calendar-event me-2"></i>
|
|
||||||
Academic Years
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-building me-2"></i>
|
|
||||||
Grades & Classrooms
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-person-badge me-2"></i>
|
|
||||||
Enrollments
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-journal-bookmark me-2"></i>
|
|
||||||
Subjects
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<hr>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main content -->
|
|
||||||
<main class="main-content p-4">
|
|
||||||
<h1 class="h3 mb-4 text-gray-800">Dashboard</h1>
|
|
||||||
<p>Welcome to the School Assessment Management System. Use the sidebar to navigate to different management sections.</p>
|
|
||||||
</main>
|
|
||||||
</div>
|
</div>
|
||||||
|
</main>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
<footer>
|
||||||
|
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||||
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
120
students.php
120
students.php
@ -1,120 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
$stmt = db()->query('SELECT * FROM students ORDER BY lastName, firstName');
|
|
||||||
$students = $stmt->fetchAll();
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Students Management</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div class="d-flex">
|
|
||||||
<!-- Sidebar -->
|
|
||||||
<div class="sidebar d-flex flex-column p-3">
|
|
||||||
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
|
|
||||||
<i class="bi bi-exclude me-2"></i>
|
|
||||||
<span class="fs-4">Admin Panel</span>
|
|
||||||
</a>
|
|
||||||
<hr>
|
|
||||||
<ul class="nav nav-pills flex-column mb-auto">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="index.php" class="nav-link text-white" aria-current="page">
|
|
||||||
<i class="bi bi-speedometer2 me-2"></i>
|
|
||||||
Dashboard
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="students.php" class="nav-link active">
|
|
||||||
<i class="bi bi-people me-2"></i>
|
|
||||||
Students
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-calendar-event me-2"></i>
|
|
||||||
Academic Years
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-building me-2"></i>
|
|
||||||
Grades & Classrooms
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-person-badge me-2"></i>
|
|
||||||
Enrollments
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-white disabled">
|
|
||||||
<i class="bi bi-journal-bookmark me-2"></i>
|
|
||||||
Subjects
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<hr>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main content -->
|
|
||||||
<main class="main-content p-4">
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
||||||
<h1 class="h3 mb-0 text-gray-800">Students Management</h1>
|
|
||||||
<a href="add_student.php" class="btn btn-primary"><i class="bi bi-plus-circle me-2"></i>Add Student</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if (isset($_GET['success'])): ?>
|
|
||||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
||||||
Student added successfully!
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
|
||||||
<table class="table table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Student Code</th>
|
|
||||||
<th>First Name</th>
|
|
||||||
<th>Last Name</th>
|
|
||||||
<th>Gender</th>
|
|
||||||
<th>Date of Birth</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php if (empty($students)): ?>
|
|
||||||
<tr>
|
|
||||||
<td colspan="5" class="text-center">No students found.</td>
|
|
||||||
</tr>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php foreach ($students as $student): ?>
|
|
||||||
<tr>
|
|
||||||
<td><?= htmlspecialchars($student['studentCode']) ?></td>
|
|
||||||
<td><?= htmlspecialchars($student['firstName']) ?></td>
|
|
||||||
<td><?= htmlspecialchars($student['lastName']) ?></td>
|
|
||||||
<td><?= htmlspecialchars($student['gender']) ?></td>
|
|
||||||
<td><?= htmlspecialchars($student['dateOfBirth']) ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user