コード例 #1
0
<?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++;
    }
}
コード例 #2
0
							<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) {
コード例 #3
0
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>';
コード例 #4
0
<?php

require_once '../inc/initialize.php';
$referee = new Referees();
$referee->referees_id = $_POST['referee_id'];
$referee_details = $referee->find_by_id($referee->referees_id);
if ($referee_details->referee_form_status == 1) {
    echo '<h4 class="alert alert-error">Error</h4><br>';
    echo 'You have already filled this before';
} else {
    $referee->professional_rank = $_POST['referee_rank'];
    $referee->referee_address = $_POST['address'];
    $referee->referee_job_description = $_POST['job_description'];
    $referee->how_long = $_POST['how_long'];
    $referee->what_capacity = $_POST['whatcapacity'];
    $referee->comments_on_candidate = $_POST['comment'];
    $referee->rank_candidate = $_POST['rank_candidate'];
    $referee->referee_highest_qualification_obtained = $_POST['referee_rank'];
    $intellectual_capacity = $_POST['intellectual_capactiy'];
    $capactiy_for_persistence = $_POST['capactiy_for_persistence'];
    $ability_for_imagination = $_POST['ability_for_imagination'];
    $promise_of_productive_scholarship = $_POST['promise_of_productive_scholarship'];
    $quality_of_previous_work = $_POST['quality_of_previous_work'];
    $oral_written_expressions = $_POST['oral_written_expressions'];
    $questionnaire = serialize(array('intellectual_capactiy' => $intellectual_capacity, 'capactiy_for_persistence' => $capactiy_for_persistence, 'ability_for_imagination' => $ability_for_imagination, 'promise_of_productive_scholarship' => $promise_of_productive_scholarship, 'quality_of_previous_work' => $quality_of_previous_work, 'oral_written_expressions' => $oral_written_expressions));
    $referee->questionnaire = $questionnaire;
    $referee->referee_form_status = 1;
    $referee->db_fields = array('referee_form_status', 'referee_job_description', 'referee_address', 'referee_highest_qualification_obtained', 'rank_candidate', 'questionnaire', 'comments_on_candidate', 'how_long', 'what_capacity');
    if ($referee->save()) {
        sleep(2);
        echo '<h4 class="alert alert-success">Success</h4><br>';
コード例 #5
0
     if (!in_array($value, $tab_filled)) {
         $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();
コード例 #6
0
<?php

require_once '../inc/initialize.php';
$sqlemail = User::find_by_sql("SELECT email FROM personal_details WHERE applicant_id=" . $session->applicant_id);
$sqlemail = array_shift($sqlemail);
$applicant_email = $sqlemail->email;
$error = false;
$ref_ids = '';
$referee = new Referees();
$error = '';
$i = 1;
while ($i <= 3) {
    if (isset($_POST['referees_id_' . $i]) && !empty($_POST['referees_id_' . $i])) {
        $referee->referees_id = $_POST['referees_id_' . $i];
    }
    $referee->referee_title_id = $_POST['reference_title_id_' . $i];
    $referee->referee_name = $_POST['referees_name_' . $i];
    $referee->referee_email = $_POST['referees_email_' . $i];
    if ($referee->referee_email == $applicant_email) {
        echo '<h4 class="alert alert-error">Error</h4>';
        echo '<hr>';
        echo "The referee email must be different from the applicant's email\n";
        echo '<hr>';
        echo "The referee with the email " . $applicant_email . " was therefore not saved\n";
        die;
    }
    $referee->referee_phone_number = $_POST['referees_phone_number_' . $i];
    $referee->applicant_id = $session->applicant_id;
    $r_id = $referee->save();
    if (!$r_id) {
        $error = true;