diff --git a/includes/header.php b/includes/header.php index 3e53a30..aa5560b 100644 --- a/includes/header.php +++ b/includes/header.php @@ -27,10 +27,17 @@ $is_logged_in = isset($_SESSION['user_id']); +
- \ No newline at end of file diff --git a/parent.php b/parent.php index d1e0e92..a13f2c7 100644 --- a/parent.php +++ b/parent.php @@ -7,6 +7,7 @@ $pageTitle = 'Parent Portal | SOMS'; $learner = null; $school = null; $attendance_history = []; +$assessment_results = []; $search_id = $_GET['student_id'] ?? ''; if ($search_id) { @@ -23,6 +24,17 @@ if ($search_id) { $stmt = $db->prepare("SELECT * FROM attendance WHERE learner_id = ? ORDER BY date DESC LIMIT 30"); $stmt->execute([$learner['id']]); $attendance_history = $stmt->fetchAll(); + + // Fetch Assessment Results + $stmt = $db->prepare(" + SELECT a.name, a.type, a.total_marks, m.marks_obtained, a.created_at + FROM marks m + JOIN assessments a ON m.assessment_id = a.id + WHERE m.learner_id = ? + ORDER BY a.created_at DESC + "); + $stmt->execute([$learner['id']]); + $assessment_results = $stmt->fetchAll(); } } @@ -68,11 +80,11 @@ include 'includes/header.php';Grade
Attendance (30d)
= $rate ?>%Status
- Enrolled +Academic Avg
+ 0 ? round($total_perc / $count, 1) : 0; + ?> +| Assessment | +Score | +Percentage | +
|---|---|---|
| No assessment results recorded yet. | +||
|
+ = htmlspecialchars($res['name']) ?>
+ = htmlspecialchars($res['type']) ?> (= date('d M Y', strtotime($res['created_at'])) ?>) + |
+ = $res['marks_obtained'] ?> / = $res['total_marks'] ?> | ++ = $p ?>% + | +
Generate academic transcripts and class performance reports
+Academic history for a specific student
+ +Full class results for a specific assessment
+ += htmlspecialchars($school['location'] ?? 'South Africa') ?>
+Generated on: = date('d F Y, H:i') ?>
+Name: = htmlspecialchars($learner_info['full_name']) ?>
+Student ID: = htmlspecialchars($learner_info['student_id']) ?>
+Grade: = htmlspecialchars($learner_info['grade']) ?>
+Status: Active
+| Date | +Assessment | +Type | +Score | +Percentage | +
|---|---|---|---|---|
| = date('d M Y', strtotime($row['created_at'])) ?> | += htmlspecialchars($row['name']) ?> | += htmlspecialchars($row['type']) ?> | += $row['marks_obtained'] ?> / = $row['total_marks'] ?> | += round($perc, 1) ?>% | +
| Average Performance: | += round($total_perc / $count, 1) ?>% | +|||
Grade = htmlspecialchars($assessment_info['grade']) ?> | = htmlspecialchars($assessment_info['type']) ?> | Max Marks: = $assessment_info['total_marks'] ?>
+| Student ID | +Learner Name | +Marks Obtained | +Percentage | +Status | +
|---|---|---|---|---|
| = htmlspecialchars($row['student_id']) ?> | += htmlspecialchars($row['full_name']) ?> | += $has_marks ? $row['marks_obtained'] : 'N/A' ?> | += $has_marks ? ''.round($perc, 1).'%' : '-' ?> | ++ + + = $perc >= 50 ? 'Pass' : 'Fail' ?> + + + = $perc >= 50 ? 'Pass' : 'Fail' ?> + + + Absent/Pending + + | +
| Class Average: | += round($total_marks / $present_count, 1) ?>% | ++ | ||