if ($personal_details['student_status'] == 'PGA') {
    ?>
            <h4 align="center">A-Level</h4>
            <table class="table table-bordered table-hover">
            	<thead>
                	<th>S/N</th>
                    <th>Institution Name</th>
                    <th>Class of Degree</th>
                    <th>From</th>
                    <th>To</th>
                    <th>Degree Earned</th>
                    <th>CGPA</th>
                    <th>Course of Study</th>
                </thead>
            <?php 
    $tertiary_institution = HigherInstitutions::find_by_sql("SELECT * FROM higher_institutions WHERE applicant_id='" . $applicant_id . "'");
    $index = 1;
    echo '<tbody>';
    foreach ($tertiary_institution as $higher_institution) {
        echo '
					<tr>
						<td width="4%">' . $index . '</td>
						<td width="30%">' . $higher_institution->institution_name . '</td>
						<td width="15%">' . $higher_institution->class_of_degree . '</td>
						<td width="5%">' . $higher_institution->year_of_attendance . '</td>
						<td width="5%">' . $higher_institution->graduation_year . '</td>
						<td width="8%">' . $higher_institution->degree_earned . '</td>
						<td width="5%">' . $higher_institution->cgpa . '</td>
						<td>' . $higher_institution->course_of_study . '</td>
					</tr>';
        $index++;
<?php

$db_academic = new MySQLDatabase();
$session = new Session();
$sql_high_insti = "SELECT * FROM higher_institutions WHERE applicant_id=" . $session->applicant_id;
$result_high_insti = HigherInstitutions::find_by_sql($sql_high_insti);
$applicant_details = User::find_by_sql("SELECT student_status FROM personal_details WHERE applicant_id='" . $session->applicant_id . "'");
foreach ($applicant_details as $applicant) {
    $applicant->student_status;
}
?>
<h3 align="center">Academic Qualification</h3>
<hr>

<form action="" method="POST" class="academic_qualification" >
<input type="hidden" name="applicant_status" value="<?php 
echo $applicant->student_status;
?>
" />
	<!-- Beginning of Tertiary Institution -->
    
    <?php 
if ($applicant->student_status == "PGA") {
    ?>
    
	<table class="table table-hover">
		<caption><h4>Tertiary Institution</h4></caption>
		<thead>
			<tr>
			  	<th>Institution Name</th>
			  	<th>Degree Earned</th>
foreach ($admissions as $admission) {
    $time = $admission->time_completed_application;
    $academic_session = $admission->academic_session;
    $status = $admission->status;
}
if ($status < 5) {
    redirect_to('confirmation.php');
}
$student_status = $user->get_student_status();
$database = new MySQLDatabase();
?>

<?php 
$higher_institutions = new HigherInstitutions();
$query = "SELECT * FROM higher_institutions\r\n          WHERE applicant_id='" . $session->applicant_id . "'";
$myschool = $higher_institutions->find_by_sql($query);
$myschool = array_shift($myschool);
?>



<?php 
$personal_details = $database->query("SELECT * FROM personal_details p, title t, lga l, state s, religion r, nationality n, department d, faculty f, next_of_kin next, marital mar, photographs photo WHERE p.applicant_id='" . $session->applicant_id . "' AND p.title_id=t.title_id AND p.lga_id=l.lga_id AND l.state_id=s.state_id AND p.religion_id=r.religion_id AND p.country_id=n.country_id AND p.programme_applied_id=d.department_id AND d.faculty_id=f.faculty_id AND p.applicant_id=next.applicant_id AND p.applicant_id=photo.applicant_id AND p.marital_status=mar.marital_status_id");
$personal_details = $database->fetch_array($personal_details);
$admission = $database->query("SELECT * FROM `admission_letter_date` WHERE visible = 1");
$admission = $database->fetch_array($admission);
// $programme = $database->query("SELECT * FROM `department` WHERE `department_id` = ");
?>
<!DOCTYPE HTML>
<html>
<head>