<thead> <tr> <th>SN</th> <th>Application No</th> <th>Amount</th> <th>Payment Date</th> <th>Application Status</th> </tr> </thead> <?php if (isset($histories) && !empty($histories)) { $serial_no = 1; # Loop through applicantion history for an applicant foreach ($histories as $history) { $sql_trans = "SELECT * FROM `adm_access_code` WHERE `jamb_rem_no` = '" . $history->application_no . "'"; $transaction = AdmAccess::find_by_sql($sql_trans); $tranx_record = array_shift($transaction); ?> <tbody> <tr> <td><?php echo $serial_no; ?> </td> <td><?php if (isset($tranx_record->jamb_rem_no)) { echo $tranx_record->jamb_rem_no; } ?> </td> <td><?php
$PNG_TEMP_DIR = 'inc/qrcode/temp/'; # HTML PNG location prefix $PNG_WEB_DIR = 'inc/qrcode/temp/'; # QR Code Library include "inc/qrcode/qrlib.php"; # ofcourse we need rights to create temp dir if (!file_exists($PNG_TEMP_DIR)) { mkdir($PNG_TEMP_DIR); } # QR Code properties $errorCorrectionLevel = 'H'; $matrixPointSize = 4; # Get payment record for an application form // $sql = "SELECT * FROM `adm_access_code` WHERE `jamb_rem_no`='".$orderId."' AND `reg_num`='".$orderId."'"; $sql = "SELECT * FROM `adm_access_code` WHERE `jamb_rem_no`='" . $orderId . "'"; $payment = AdmAccess::find_by_sql($sql); $payment_record = array_shift($payment); # Redirect applicant to make payment if no user is found if (empty($payment_record)) { redirect_to('payment.php'); } # Get log record for payment $sql_log = "SELECT * FROM `acceptance_log` WHERE `student_id` = '" . $orderId . "'"; $log_payment = AcceptanceLog::find_by_sql($sql_log); $log = array_shift($log_payment); $payment_breakdown = unserialize($log->returned_paymentreference); // $naira = ₦ # Data to be inserted into QR Code $data = $user->full_name; $data .= ' ' . $orderId . ' ' . $payment_record->amount; # QR Code image path on server
redirect_to("index.php"); } # Instance of user class $user = User::find_by_id($session->id); # Get application history form app_histories table $sql_history = "SELECT * FROM app_histories WHERE applicant_id =" . $user->id . " and application_flag = 0"; $history_details = AppHistory::find_by_sql($sql_history); $app_history_details = array_shift($history_details); $application_no = $app_history_details->application_no; # Check if the application history exist if (empty($app_history_details)) { redirect_to("payment.php"); } else { # Get adm payment details from adm_access_code table $sql_adm = "SELECT * FROM adm_access_code WHERE jamb_rem_no ='" . $app_history_details->application_no . "'"; $adm_details = AdmAccess::find_by_sql($sql_adm); # Check if payment details exist if (empty($adm_details)) { redirect_to("payment.php"); } } ?> <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>University of Jos, Nigeria - Transcript System</title> <?php require_once LIB_PATH . DS . 'javascript.php'; require_once LIB_PATH . DS . 'css.php';
if (!$session->is_logged_in()) { redirect_to("index.php"); } # Instance of Carbon Class with the current time $date_now = new Carbon('now'); $label = customDecrypt($_GET['app']); if ($label) { // $database = new MySQLDatabase(); // $sql_user_details="SELECT * from app_histories aph Join adm_access_code adm, applicant_status aps WHERE aph.application_no = '".$label."' AND adm.application_no=aph.application_no AND aps.application_no= aph.application_no"; // $user_history=$database->query($sql_user_details); // $myhistory = $database->fetch_array($user_history); $sql_app = "SELECT * FROM `app_histories` WHERE `application_no` = '" . $label . "'"; $application = AppHistory::find_by_sql($sql_app); $myapp = array_shift($application); $sql_amount = "SELECT * FROM `adm_access_code` WHERE `jamb_rem_no` = '" . $label . "'"; $transaction = AdmAccess::find_by_sql($sql_amount); $amount = array_shift($transaction); $sql = "SELECT * FROM `applicant_status` WHERE `application_no` = '" . $label . "'"; $process = ApplicantStatus::find_by_sql($sql); } ?> <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>University of Jos, Nigeria - Transcript System</title> <?php require_once LIB_PATH . DS . 'javascript.php'; require_once LIB_PATH . DS . 'css.php'; ?> <style type="text/css">
<br> <br> <!-- Content --> <div class="row-fluid"> <?php include_layout_template('admin_menu.php'); ?> <div class="span9"> <h2>Transaction Log (Successful Payment)</h2> <hr> <?php //$acc_log = new AcceptanceLog(); $result = AdmAccess::find_by_sql("SELECT * FROM `adm_access_code` WHERE `jamb_rem_no` = '" . customDecrypt($_GET['q']) . "' AND reg_num = '" . customDecrypt($_GET['q']) . "'"); $result = array_shift($result); ?> <!-- Begining of acceptance log form --> <form class="form-horizontal adm_access_details"> <input type="hidden" name="adm_id" value="<?php echo $result->id; ?> "/> <div class="control-group"> <label class="control-label">Application Number</label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-chevron-down"></i></span> <input type="text" readonly name="applicant_number" placeholder="Applicant Number" class="input-xlarge" value="<?php echo $result->jamb_rem_no;
echo ' <h4 class="alert alert-info">Interswitch says</h4> <table class="table table-hover"> <tr ><td>Response Code:</td><td>' . $ResponseCode . '</td></tr> <tr ><td>Response Description:</td><td>' . $ResponseDescription . '</td></tr> <tr ><td>Amount:</td><td>' . $amount . '</td></tr> <tr ><td>Merchant Reference:</td><td>' . $PaymentReference . '</td></tr> <tr ><td>Payment Reference:</td><td>' . $RefNumb . '</td></tr> <tr ><td>Returned Ref Number:</td><td>' . $RetRefNumb . '</td></tr> <tr ><td>Transaction Date:</td><td>' . $TranxDate . '</td></tr> </table>'; if ($ResponseCode == '00') { //get fullname of applicant $adm = new AdmAccess(); $sqlcheck = "SELECT id FROM `adm_access_code` WHERE `jamb_rem_no` = '" . $_POST['number'] . "'"; $check = $adm->find_by_sql($sqlcheck); // Check if the record does not exist in both acceptance_log and adm_access_code then insert and if they do update it if (empty($check)) { $sql_fullname = "SELECT applicant_id, surname, first_name, middle_name, student_status "; $sql_fullname .= "FROM `personal_details` WHERE `form_id` = '" . $_POST['number'] . "'"; $Applicant_details = User::find_by_sql($sql_fullname); $Applicant_detail = array_shift($Applicant_details); $acceptance = new AcceptanceLog(); $acceptance->db_fields = array('ResponseCode', 'ResponseDescription', 'Amount', 'returned_amount', 'MerchantReference', 'PaymentReference', 'status'); $sql_acc_id = "SELECT id FROM `acceptance_log` WHERE student_id='" . $_POST['number'] . "'"; $acc_id = $acceptance->find_by_sql($sql_acc_id); $acc_id_final = array_shift($acc_id); $acceptance->ResponseCode = $ResponseCode; $acceptance->ResponseDescription = $ResponseDescription; $acceptance->Amount = $amount / 100; $acceptance->returned_amount = $amount . '.00';