<?php $database = new MySQLDatabase(); $session = new Session(); $referees_details = Referees::find_by_sql("SELECT * FROM referees WHERE applicant_id=" . $session->applicant_id); ?> <form action="" method="POST" class="referees_details" > <table class="table table-hover"> <caption><h3>Referees</h3></caption> <thead> <tr> <th>S/N</th> <th>Title</th> <th>Full Name</th> <th>Email</th> <th>Phone Number</th> </tr> </thead> <tbody> <?php if (!empty($referees_details)) { $counter = 1; foreach ($referees_details as $referees_data) { $referee_title[$counter] = $referees_data->referee_title_id; $referee_name[$counter] = $referees_data->referee_name; $referee_email[$counter] = $referees_data->referee_email; $referee_phone_number[$counter] = $referees_data->referee_phone_number; $referee_id[$counter] = $referees_data->referees_id; $counter++; } }
require_once "../../inc/initialize.php"; $email = htmlspecialchars($_POST['email'], ENT_QUOTES); $user = new User(); $user_exists = $user->find_by_sql("SELECT * FROM `personal_details` WHERE `email`='" . $email . "' LIMIT 1"); if (empty($user_exists)) { echo '<h4 class="alert alert-error">Error</h4>'; echo '<hr>'; echo "This E-mail: <font color='#FF0000'>'" . $email . "'</font> does not exist in our database"; echo '<br>'; echo 'Use the Close Button to Continue'; } else { $user->email = $email; $user_exists = array_shift($user_exists); if ($user_exists->progress == 'Completed') { $referees = new Referees(); $referees_details = $referees->find_by_sql("SELECT * FROM referees WHERE applicant_id='" . $user_exists->applicant_id . "'"); $mail_error = ''; foreach ($referees_details as $referee_info) { $referees->referee_email = $referee_info->referee_email; $referees->referee_name = $referee_info->referee_name; $referees->referees_id = $referee_info->referees_id; if (!$referees->sendRefereeMail()) { $mail_error .= "Mail not sent to " . $referees->referee_email . "<br>"; } } if ($mail_error == '') { echo '<h4 class="alert alert-success">Success</h4>'; echo '<hr>'; echo "Referee mails for applicant with email: <font color='#FF0000'>'" . $email . "'</font> has been successfully sent"; echo '<br>'; echo 'Use the Close Button to Continue';
<tr> <td width="4%">' . $index . '</td> <td width="70%">' . $otherpub->title_of_publication . '</td> <td width="20%">' . $otherpub->publisher . '</td> </tr>'; $index++; } echo '</tbody> </table>'; } ?> <h4 align="center" class="alert alert-success">Referee Details</h4> <?php $referees = Referees::find_by_sql("SELECT * FROM referees WHERE applicant_id='" . $applicant_id . "'"); if (empty($referees)) { echo 'Not applicable'; } else { echo ' <table class="table table-bordered table-hover"> <thead> <th>S/N</th> <th>Referee Name</th> <th>Referee Mail</th> <th>Mobile Number</th> <th>Status</th> </thead>'; $index = 1; echo '<tbody>'; foreach ($referees as $ref) {
$message .= '<span style=" font-weight: bold; text-shadow: 1px 1px 4px Red">' . $key . '</span><br>'; $empty_tab_flag = true; } } if ($empty_tab_flag) { echo '<h4 class="alert alert-error"><i class="iconic-o-x" style="color: red"></i> Error!</h4>'; echo '<hr>'; echo $message; echo '<br><hr>'; echo '<a href="application_form.php" class="btn">Close</a>'; } else { $user->progress = 'Completed'; $user->db_fields = array('progress'); $user->applicant_id = $session->applicant_id; $referees = new Referees(); $referees_details = $referees->find_by_sql("SELECT * FROM referees WHERE applicant_id='" . $session->applicant_id . "'"); $mail_error = ''; $applicant_name = User::find_by_sql("SELECT * FROM personal_details WHERE applicant_id=" . $session->applicant_id); $applicant_name = array_shift($applicant_name); $applicant_name = $applicant_name->surname . ' ' . $applicant_name->first_name . ' ' . $applicant_name->middle_name; foreach ($referees_details as $referee_info) { $referees->referee_email = $referee_info->referee_email; $referees->referee_name = $referee_info->referee_name; $referees->referees_id = $referee_info->referees_id; if (!$referees->sendRefereeMail($applicant_name)) { $mail_error .= "Mail not sent to " . $referees->referee_email . "<br>"; } } if ($user->save()) { $admissions = new Admission(); $sql_adm = "select admission_id from admission_status where applicant_id='" . $session->applicant_id . "'";