<?php require_once("includes/initialize.php");

$transRec = mysql_query("SELECT * FROM acceptance_tranzact ORDER BY id DESC LIMIT 0,100");


?>
<?php //require("template/header.php");
include_layout_template('header.php'); ?>


<!-- admin trans dash-->


<div class="spaceUp">
    <div class="row">
        <div class="col-md-12">
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>
                            S/N
                        </th>
                        <th>
                            Student Name
                        </th>
                        <th>
                            Transaction Ref No
                        </th>
                        <th>
                            Description
                        </th>
                        <th>
                            Amount
                        </th>
                        <th>
                            Status
                        </th>
                        <th>
                            TimeStamp
                        </th>
                        <th>
                            Response Code
                        </th>
                        <th>
                            Response Description
                        </th>
                        <th>
                            Action
                        </th>
                    </tr>

                    </thead>
                    <tbody class="text-center">

                    <?php $sn = 1;
                    while ($rec = mysql_fetch_array($transRec)): ?>
                        <tr
                                class="<?php if ($rec['status'] == 'PAID') {
                                    echo("success");
                                } else {
                                    echo("danger");
                                } ?> text-center">
                            <td class="text-align-center"><?php echo($sn);
                                $sn++; ?></td>
                            <td class="text-align-center"><?php echo(ucwords($rec['surname'] . " " . $rec['othernames'])) ?></td>
                            <td class="text-align-center"><?php echo(strtoupper($rec['txt_ref'])) ?></td>

                            <td class="text-align-center">
                                Acceptance Payment
                            </td>
                            <td class="text-align-center">
                                <?php echo(floatval($rec['amount'] + $rec['txt_fees'] + $rec['overhead'])) ?>
                            </td>
                            <td class="text-align-center"><?php
                                if ($rec['status'] == 'PAID') {
                                    echo("Paid");
                                } else {
                                    echo("UnSuccessful");
                                }
                                ?></td>
                            <td class="text-align-center"><?php $cd = new DateTime($rec['datetime']);
                                $cd->format('Y-m-d H:i:s');
                                echo(date_format($cd, 'Y-m-d H:i:s')) ?></td>
                            <td class="text-align-center">
                                <?php echo($rec['responsecode']) ?>
                            </td>
                            <td class="text-align-center">
                                <?php echo($rec['status']) ?>
                            </td>
                            <td class="text-align-center">
                                <?php if ($rec['status'] != 'PAID') : ?>
                                    <a href="./pages/requerybase.php?transid=<?php echo($rec['txt_ref']) ?>"
                                       class="pointer">
                                        <button ng-hide="t.loading" type="button"
                                                class="btn btn-primary center-block">
                                            ReQuery
                                        </button>
                                    </a>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endwhile; ?>
                    </tbody>
                </table>
            </div>

        </div>

    </div>

</div>


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

                
                
           