School Management System Project With | Source Code In Php

Features tools for creating exam schedules, entering marks, and automatically generating report cards.

CREATE TABLE exams (id INT, exam_name VARCHAR(50), class_id INT, term VARCHAR(20)); CREATE TABLE results (id INT, student_id INT, exam_id INT, subject_id INT, marks_obtained DECIMAL(5,2), max_marks DECIMAL(5,2));

// Fetch students of a class $students = $pdo->prepare("SELECT id, first_name, last_name FROM students WHERE class_id = ?"); $students->execute([$_GET['class_id']]); ?> <!-- Table with checkboxes Present/Absent --> <form id="attendanceForm"> <?php while($row = $students->fetch()): ?> <tr> <td><?= $row['first_name'] ?></td> <td><input type="radio" name="status[<?= $row['id'] ?>]" value="Present"> Present <input type="radio" name="status[<?= $row['id'] ?>]" value="Absent"> Absent</td> </tr> <?php endwhile; ?> <input type="hidden" name="class_id" value="<?= $_GET['class_id'] ?>"> <input type="hidden" name="date" value="<?= date('Y-m-d') ?>"> </form> school management system project with source code in php

A robust SMS typically integrates several key modules to ensure smooth operations:

To build this project from scratch, you will need: Features tools for creating exam schedules, entering marks,

// Get classes taught by this teacher $classes_taught = mysqli_query($conn, "SELECT DISTINCT class_id FROM subjects WHERE teacher_id=$teacher_id"); $students = []; if ($class_id) $students = mysqli_query($conn, "SELECT * FROM students WHERE class_id=$class_id");

$student_id = $_SESSION['related_id'];

CREATE TABLE marks ( id INT AUTO_INCREMENT PRIMARY KEY, student_id INT, subject_id INT, exam_type ENUM('FA1', 'FA2', 'SA1', 'SA2') NOT NULL, marks_obtained INT, max_marks INT DEFAULT 100, FOREIGN KEY (student_id) REFERENCES students(id), FOREIGN KEY (subject_id) REFERENCES subjects(id) );

CREATE TABLE attendance ( id INT AUTO_INCREMENT PRIMARY KEY, student_id INT, class_id INT, date DATE, status ENUM('present', 'absent', 'late') DEFAULT 'absent', FOREIGN KEY (student_id) REFERENCES students(id) ON DELETE CASCADE, FOREIGN KEY (class_id) REFERENCES classes(id) ); Features tools for creating exam schedules

if ($_SERVER['REQUEST_METHOD'] == 'POST') foreach ($_POST['attendance'] as $student_id => $status) $check = mysqli_query($conn, "SELECT id FROM attendance WHERE student_id=$student_id AND date='$date'"); if (mysqli_num_rows($check) > 0) mysqli_query($conn, "UPDATE attendance SET status='$status' WHERE student_id=$student_id AND date='$date'"); else mysqli_query($conn, "INSERT INTO attendance (student_id, class_id, date, status) VALUES ($student_id, $class_id, '$date', '$status')");