From 8c0b0da67ce1a330cf95b9928bc142b0b281fee1 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 2 Jan 2026 10:20:36 +0000 Subject: [PATCH] 0.0.1 --- add_student.php | 148 +++++++++++++++++++++++++++++ assets/css/custom.css | 66 +++++++++++++ db/config.php | 16 ++++ index.php | 210 +++++++++++++----------------------------- students.php | 120 ++++++++++++++++++++++++ 5 files changed, 416 insertions(+), 144 deletions(-) create mode 100644 add_student.php create mode 100644 assets/css/custom.css create mode 100644 students.php diff --git a/add_student.php b/add_student.php new file mode 100644 index 0000000..420b087 --- /dev/null +++ b/add_student.php @@ -0,0 +1,148 @@ +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(); + } + } +} +?> + + + + + + Add Student + + + + + + + +
+ + + + +
+

Add New Student

+ + +
+ +

+ +
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + Cancel +
+
+
+
+
+ + + + diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..5690242 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,66 @@ +: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; +} + diff --git a/db/config.php b/db/config.php index e276dce..1820da6 100644 --- a/db/config.php +++ b/db/config.php @@ -15,3 +15,19 @@ function db() { } 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(); diff --git a/index.php b/index.php index 7205f3d..a078f6a 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,72 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + Admin Dashboard + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ +
+ + + + +
+

Dashboard

+

Welcome to the School Assessment Management System. Use the sidebar to navigate to different management sections.

+
-
- + + - + \ No newline at end of file diff --git a/students.php b/students.php new file mode 100644 index 0000000..4f18ddf --- /dev/null +++ b/students.php @@ -0,0 +1,120 @@ +query('SELECT * FROM students ORDER BY lastName, firstName'); +$students = $stmt->fetchAll(); +?> + + + + + + Students Management + + + + + + + +
+ + + + +
+
+

Students Management

+ Add Student +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Student CodeFirst NameLast NameGenderDate of Birth
No students found.
+
+
+
+
+ + + +