Ejemplo n.º 1
0
require_once "../initialize.php";
require_once "../vendor/autoload.php";
use Carbon\Carbon;
$dt = Carbon::now();
$session = new Session();
$orderId = $_POST['orderId'];
// Obtain application_no from orderId
$application_no = $orderId;
$amount = $_POST['amt'];
$ResponseCode = $_POST['ResponseCode'];
$ResponseDescription = $_POST['ResponseDescription'];
$payerName = $_POST['payerName'];
$serial_payment_brakdown = $_SESSION["payment_breakdown"];
# Unset payment breakdown session variable
unset($_SESSION["payment_breakdown"]);
# Update acceptance_log
if (isset($_POST['action']) && $_POST['action'] == 'insertlog') {
    # Instance of Acceptance
    $acceptance = new AcceptanceLog();
    $acceptance->student_id = $application_no;
    $acceptance->applicant_id = $session->id;
    $acceptance->PaymentReference = $orderId;
    $acceptance->ResponseCode = $ResponseCode;
    $acceptance->ResponseDescription = $ResponseDescription;
    $acceptance->Amount = $amount;
    $acceptance->Initiating_date = $dt->toDateTimeString();
    $acceptance->returned_paymentreference = $serial_payment_brakdown;
    # Save Record into Table acceptance_log
    $acceptance->save();
}
Ejemplo n.º 2
0
require_once "../initialize.php";
$amount = $_POST['Amount'];
$ResponseCode = $_POST['ResponseCode'];
$CardNumber = $_POST['CardNumber'];
$RefNumb = $_POST['RefNumb'];
$RetRefNumb = $_POST['RetRefNumb'];
$TranxDate = $_POST['TranxDate'];
$ResponseDescription = $_POST['ResponseDescription'];
$PaymentReference = $_POST['PaymentReference'];
$form_no = substr($RefNumb, 2, sizeof($RefNumb) - 3);
$sql_fullname = "SELECT applicant_id, surname, first_name, middle_name, student_status FROM `personal_details` WHERE `form_id` = '" . $form_no . "'";
$Applicant_details = User::find_by_sql($sql_fullname);
$Applicant_detail = array_shift($Applicant_details);
if (isset($_POST['action']) && $_POST['action'] == 'updateit') {
    $acceptance = new AcceptanceLog();
    $acceptance->db_fields = array('student_id', 'ResponseCode', 'ResponseDescription', 'Amount', 'returned_amount', 'MerchantReference', 'PaymentReference', 'Initiating_date', 'Interswitch_date', 'status');
    $sql_acc_id = "SELECT id FROM `acceptance_log` WHERE student_id='" . $form_no . "'";
    $acc_id = $acceptance->find_by_sql($sql_acc_id);
    $acc_id_final = array_shift($acc_id);
    $acceptance->student_id = $form_no;
    $acceptance->ResponseCode = $ResponseCode;
    $acceptance->ResponseDescription = $ResponseDescription;
    $acceptance->Amount = $amount / 100;
    $acceptance->returned_amount = $amount . '.00';
    $acceptance->MerchantReference = $PaymentReference;
    $acceptance->PaymentReference = $RefNumb;
    $acceptance->Interswitch_date = $TranxDate;
    $acceptance->status = $Applicant_detail->student_status;
    if (!empty($acc_id_final)) {
        $acceptance->id = $acc_id_final->id;
Ejemplo n.º 3
0
}
# 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
$filename = $PNG_TEMP_DIR . $orderId . md5($errorCorrectionLevel . '|' . $matrixPointSize . '|' . $orderId) . '.png';
# Create QR Code
QRcode::png($data, $filename, $errorCorrectionLevel, $matrixPointSize, 2);
$imgqrcode = '<img src="' . $PNG_WEB_DIR . basename($filename) . '" />';
?>
<section class="slice">
    <!-- Invoice wrapper -->
    <div id="invoice" class="paid">
Ejemplo n.º 4
0
$fullname = $result["surname"] . ' ' . $result["first_name"] . ' ' . $result["middle_name"];
echo '
                        <td>' . $fullname . '</td>
                        <td>' . $result["faculty_name"] . '</td>
                        <td>' . $result["department_name"] . '</td>
                        <td>&#8358;' . $result["amount"] . '</td>
                        <td>&#8358;' . $transaction_charge . '</td>
                        <td>&#8358;' . ($result["amount"] + $transaction_charge) . '</td>';
?>
                    </tr>
                </tbody>
            </table>
            <div class="row">
                <div class="span4 offset5">
                <?php 
$acceptance = new AcceptanceLog();
$sql = "SELECT * FROM acceptance_log WHERE student_id = '" . $applicantFormId->form_id . "' AND ResponseDescription = 'Pending...' LIMIT 1";
//$checks = AcceptanceLog::find_by_sql($sql);
$checks = $acceptance->find_by_sql($sql);
$check = array_shift($checks);
if (!empty($check) and $check->ResponseDescription == "Pending...") {
    ?>
  								 
  								 <button id="Exit" onClick="location.replace('logout.php?logoff=logoff');" class="btn btn-danger">
									Oppsy - You Have a Pending Transaction clear it to avoid double payment
  								 </button>


					  

					 <?php 
Ejemplo n.º 5
0
		<br>
		<br>

		<!-- Content -->
		<div class="row-fluid">

			<?php 
include_layout_template('admin_menu.php');
?>

			<div class="span9">
				<h2>Form Transaction Log</h2>
				<hr>
						<?php 
//$acc_log = new AcceptanceLog();
$result = AcceptanceLog::find_by_sql("SELECT * FROM `acceptance_log` WHERE `student_id` = '" . customDecrypt($_GET['q']) . "'");
$result = array_shift($result);
?>
						<!-- Begining of acceptance log form -->
				<form class="form-horizontal acceptance_log_details">
					<input type="hidden" name="acceptance_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->student_id;
Ejemplo n.º 6
0
$history_count = $db->fetch_array($result_count);
$count = array_shift($history_count);
// 1. the current page number ($current_page)
$page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
// 2. records per page ($per_page)
$per_page = 4;
// 3. total record count ($total_count)
$total_count = $count;
// use pagination instead
$pagination = new Pagination($page, $per_page, $total_count);
// Instead of finding all records, just find the records
// for this page
$sql = "SELECT * FROM `acceptance_log` WHERE applicant_id ='" . $session->id . "'  ORDER BY `student_id` DESC ";
$sql .= "LIMIT {$per_page} ";
$sql .= "OFFSET {$pagination->offset()}";
$Users = AcceptanceLog::find_by_sql($sql);
// Need to add ?page=$page to all links we want to
// maintain the current page (or store $page in $session)
$counter = 1;
?>
<h4> <p class="label label-info">Transaction History</p></h4>
<table class="table table-hover table-striped table-bordered">
		<thead>
				<tr>
  					<th>SN</th>
  					<th>Application No</th>
  					<th>Response Description</th>
  					<th>Amount</th>
  					<th>Initiating Date</th>
  				</tr>
		</thead>
<?php

require_once "../../inc/initialize.php";
$database = new MySQLDatabase();
if (isset($_POST)) {
    $acceptance_log = new AcceptanceLog();
    $acceptance_log->student_id = $_POST['applicant_number'];
    $acceptance_log->ResponseCode = $_POST['response_code'];
    $result = $database->query("SELECT * FROM `interswitch_error_code` WHERE `response_code` = '" . $acceptance_log->ResponseCode . "'");
    $result = $database->fetch_array($result);
    $acceptance_log->ResponseDescription = $result['response_description'];
    $acceptance_log->PaymentReference = $_POST['payment_reference'];
    $acceptance_log->Amount = $_POST['amount'];
    $acceptance_log->returned_amount = $_POST['amount'] * 100 . ".00";
    $acceptance_log->status = $_POST['student_status'];
    if ($acceptance_log->save()) {
        echo '<h4 class="alert alert-success">Success</h4>';
        echo '<hr>';
        echo "<p>You have successfully added a new record into acceptance log for applicant with application number: " . $acceptance_log->student_id . ".</p>";
        echo '<hr>';
    } else {
        echo '<h4 class="alert alert-error">Error</h4>';
        echo '<hr>';
        echo "Failed to insert into acceptance log.";
        echo '<hr>';
    }
}
Ejemplo n.º 8
0
		<thead>
				<tr>
  					<th>SN</th>
  					<th>Application No</th>
  					<th>Response Description</th>
  					<th>Amount</th>
  					<th>Initiating Date</th>
  					<th>View</th>
				</tr>
		</thead>
    <?php 
if (isset($Users)) {
    $serial_no = 1;
    foreach ($Users as $user_record) {
        $sql_trans = "SELECT * FROM `acceptance_log` WHERE `student_id` = '" . $user_record->application_no . "'";
        $transaction = AcceptanceLog::find_by_sql($sql_trans);
        $transaction_rec = array_shift($transaction);
        ?>
                <tbody data-provides="rowlink">
                    <tr class="rowlink">
                        <td><?php 
        echo $serial_no;
        ?>
</td>
                        <td><?php 
        if (isset($transaction_rec->student_id)) {
            echo $transaction_rec->student_id;
        }
        ?>
</td>
                        <td><?php