query($query); if ($result->num_rows == 0) { header("Location: generate_certificate.php?msg=notfound"); exit; } $cert = $result->fetch_assoc(); // Class based header title $class = $cert['class']; if ($class == '10') { $header_title = "MATRICULATION CERTIFICATE"; $bg_image = "uploads/backgrounds/migration_10th.jpg"; } elseif ($class == '12') { $header_title = "SECONDARY SCHOOL CERTIFICATE"; $bg_image = "uploads/backgrounds/migration_12th.jpg"; } else { $header_title = "MIGRATION CERTIFICATE"; $bg_image = "uploads/backgrounds/migration_default.jpg"; } if (!file_exists($bg_image)) { $bg_image = "uploads/backgrounds/migration_default.jpg"; } $serial_no = $cert['serial_no'] ?? 'N/A'; $migration_no = $cert['migration_no'] ?? 'MIG/' . date('Y') . '/' . str_pad($cert['id'], 4, '0', STR_PAD_LEFT); $dob_formatted = date('d/m/Y', strtotime($cert['date_of_birth'])); $issue_date_formatted = date('d-m-Y', strtotime($cert['issue_date'])); $last_institution = $cert['last_institution'] ?? 'PUNJAB STATE OPEN SCHOOL, HOSHIARPUR'; $admitted_to = $cert['admitted_to'] ?? 'ELIGIBLE FOR HIGHER STUDIES'; $character = $cert['character_conduct'] ?? 'GOOD'; $date_of_leaving = isset($cert['date_of_leaving']) ? date('d/m/Y', strtotime($cert['date_of_leaving'])) : $issue_date_formatted; $class_studied = $cert['class_studied'] ?? 'CLASS ' . $cert['class']; ?> Migration - <?= $cert['student_name'] ?>
Back to List
:
: HOSHIARPUR