query("SELECT * FROM students WHERE id = $student_id")->fetch_assoc(); if (!$student) { header('Location: students.php'); exit; } $page_title = 'View Student - ' . $student['student_name']; $page_subtitle = 'Complete student information'; $current_user = getCurrentUser(); // Get all marks for student $marks = $conn->query(" SELECT s.subject_name, s.subject_name_pb, m.marks_obtained, s.max_marks, m.exam_year, m.exam_type, s.passing_marks FROM marks m JOIN subjects s ON m.subject_id = s.id WHERE m.student_id = $student_id ORDER BY m.exam_year DESC, FIELD(m.exam_type, 'Annual', 'Half Yearly', 'Supplementary'), s.subject_name "); // Get certificates for student $certificates = $conn->query(" SELECT * FROM certificates WHERE student_id = $student_id ORDER BY issue_date DESC "); // Calculate overall statistics $total_marks = 0; $total_max = 0; $subject_count = 0; $passed_subjects = 0; $marks_data = $conn->query(" SELECT m.marks_obtained, s.max_marks, s.passing_marks FROM marks m JOIN subjects s ON m.subject_id = s.id WHERE m.student_id = $student_id AND m.exam_type = 'Annual' AND m.exam_year = 2024 "); while($row = $marks_data->fetch_assoc()) { $total_marks += $row['marks_obtained']; $total_max += $row['max_marks']; $subject_count++; if ($row['marks_obtained'] >= $row['passing_marks']) { $passed_subjects++; } } $percentage = $total_max > 0 ? ($total_marks / $total_max) * 100 : 0; $result_status = $passed_subjects == $subject_count ? 'PASS' : 'FAIL'; $division = ''; if ($result_status == 'PASS') { if ($percentage >= 75) $division = 'Distinction'; elseif ($percentage >= 60) $division = 'First Division'; elseif ($percentage >= 45) $division = 'Second Division'; elseif ($percentage >= 33) $division = 'Third Division'; } include 'includes/header.php'; include 'includes/sidebar.php'; ?>
Student Photo

Class Roll No: Reg No: Season
Date of Birth
Admission Date
School/Centre
Overall Percentage %

Parent Information

Father's Name
Mother's Name

Academic Records

num_rows > 0): ?> fetch_assoc()) { $exam_key = $row['exam_year'] . '|' . $row['exam_type']; $exam_data[$exam_key][] = $row; } ?> $subject_marks): list($exam_year, $exam_type) = explode('|', $exam_key); $exam_total = 0; $exam_max = 0; $exam_passed = 0; foreach($subject_marks as $mark) { $exam_total += $mark['marks_obtained']; $exam_max += $mark['max_marks']; if ($mark['marks_obtained'] >= $mark['passing_marks']) { $exam_passed++; } } $exam_percentage = ($exam_total / $exam_max) * 100; $exam_result = $exam_passed == count($subject_marks) ? 'PASS' : 'FAIL'; ?>

Examination

Total: / Percentage: % Result:
= $mark['passing_marks'] ? 'PASS' : 'FAIL'; ?>
Subject ਵਿਸ਼ਾ Max Marks Passing Marks Marks Obtained Percentage Result
% PASS FAIL

No Marks Found

This student doesn't have any marks records yet.

Add Marks

Certificates Issued

Generate New
num_rows > 0): ?>
fetch_assoc()): ?>

Serial No:

Issued:

No certificates issued yet