<?php if (!$session->is_logged_in()) {
    redirect_to("../index.php");
}
?>
<?php require_once("includes/initialize.php");

global $database;

//$tag="";
//if ((isset($_GET['type'])))
//$tag=$_GET['type'];

$id = $session->user_id;
$user_data = Userdata::find_by_id($session->user_id);

$biodata = Biodata::find_by_id($user_data->formno, $user_data->email);

//echo  $user_data->std_process_id." level";

$dp = DEPARTMENTCLASS::department_authenticate($biodata->courses);

$alldp = DEPARTMENTCLASS::find_all($dp->faculty);
foreach ($alldp as $aldp) {
    $faculty = $aldp->faculty;
}
$pay_cat = '';
if ($faculty == 'Engineering' or $faculty == 'Applied Sciences' or $faculty == 'Enviromental Studies') {
    $pay_cat = 'science';
} elseif ($faculty == 'Management Sciences') {
    $pay_cat = 'nonscience';
}
$level = $biodata->programme;
$level = $level . " " . "I";

 $adm_type = (substr($user_data->formno, 0, 2));
if (($adm_type == 'PU') or ($adm_type == 'FT')) {
            $adm_type = 'regular';

        } elseif ($adm_type == 'DP') {

            $adm_type = 'dailypt';
        }

//$pay_settings = Pay_settings::authenticate(1, $level, $pay_cat);

$ftransaction = Schoolfees::find_by_txnref_failed($_SESSION['txn_ref']);
if (!$ftransaction) {
    $ftransaction = Schoolfees::find_by_txnref_failed_by_formno($user_data->formno);
}


?>

<div class="art-content-layout">


    <div class="art-content-layout-row">

        <div class="art-layout-cell layout-item-0" style="width: 100%">

            <marquee behavior="alternate" scrolldelay="200" onmouseover="this.setAttribute('scrollamount',0,0);"
                     onmouseout="this.setAttribute('scrollamount',6,0);">
                <div style="color:#F00; font-style:italic; font-weight:bolder;">NOTE: <span
                            style="color:#F00; font-style:italic;">Upon successful payment of the School fees, Click Registration Module to register for your semester courses</span>
                </div>
            </marquee>


        </div>
    </div>
</div>
<div class="art-content-layout">
    <div class="art-content-layout-row">

        <div class="art-layout-cell layout-item-0" style="width: 100%">


            <div style="text-transform:uppercase; color:#099; font-weight:bolder; border-bottom:inset #000 thin;">
                Transaction requery
            </div>
            <!--<hr style="width:100%;">
            <br />-->
            <?php if ($message != 'Approved Successful') {
                // echo output_message($message);
            } elseif ($message == 'Approved Successful') {
               // echo "<script>window.open('acceptance_receipt.php')</script>";
                echo "<span style=\"color:#060; font-weight:bolder \">{$message}</span>";
            } else {
                // echo output_message($message);
                //echo "<br/>";
            }
            //$message =$transaction->responsecode;


            ?>
        </div>
    </div>
</div>


<div class="art-content-layout">
    <div class="art-content-layout-row">
        <div class="art-layout-cell layout-item-0" style="width: 30%; background-color:#FFF; margin:0; padding:0;">
            <div>
                <div style="border-bottom:inset thin #0FC; width:100%; margin:0;background-color:#096 "><a
                            href="javascript:void(0)"
                            style="color:#FFF; font-size:17px; text-decoration:none; display:block ">Make
                        payment</a></div>

                <!-- <div style="border-bottom:inset thin #0FC;background-color:#096 "><a href="javascript:void(0)" style="color:#FFF; font-size:17px; text-decoration:none;display:block ">Re-query</a></div>

                 <div style="border-bottom:inset thin #0FC;background-color:#096 "><a href="javascript:void(0)" style="color:#FFF; font-size:17px; text-decoration:none; display:block">Re-generate pin</a></div>
                 <div  style="border-bottom:inset thin #0FC;background-color:#096 "><a href="javascript:void(0)" style="color:#FFF; font-size:17px; text-decoration:none; display:block">Create ticket</a></div>
                 <div style="margin-bottom:0; padding:0; background-color:#FFF; margin:0" ></div>-->
            </div>
             <img src="images/image001.png" width="231" height="70" style="margin-top:0px; padding:0; margin-left:0px; margin-right:0px; margin-bottom:0; background-color:#FFF; " />

        </div>


        <div class="art-layout-cell layout-item-0" style="width: 70%">


            <div style="font-size:16px; margin-right:20px "><label style="font-size:16px">Your details are:</label>
            </div>
            <div style="font-size:16px; margin-right:20px "><label style="font-size:16px; margin-right:23px ">Form
                    Number:</label><?php echo $biodata->formno; ?></div>

            <div style="font-size:16px; margin-right:20px "><label
                        style="font-size:16px; margin-right:54px ">Fullname:</label><?php echo $biodata->surname . ", " . $biodata->othernames; ?>
            </div>
            <!--<div style="font-size:16px; margin-right:20px "><label style="font-size:16px; margin-right:64px ">Tran
                    ref:</label><?php //echo $ftransaction->txt_ref; ?></div>-->
            <div style="font-size:16px; margin-right:20px "><label style="font-size:16px; margin-right:50px ">Tran
                    desc:</label><?php echo $ftransaction->status; ?></div>

<table id="schltable" border="2" align="center" class="" width="100%">
                <tr>
                    <th>S/N</th>
                    <th>Fees Description</th>
                    <th>Amount</th>

                </tr>

                <?php

                $count = 0;
                $total_sc_fees = 0;
				$total = Pay_settings::find_sch_fees(3, $level, $pay_cat, $adm_type);
                //$total = Pay_settings::find_all(3, $level, $pay_cat);

                foreach ($total as $samount) {
                    $total_sc_fees += $samount->amount;


                    echo '<tr>'
                        . '<td>' . ++$count . '</td>'
                        . '<td>' . ucfirst($samount->fees_description) . '</td>'
                        . '<td>' . ucfirst($samount->amount) . '</td>'
                        . '</tr>';
                } ?>

            </table>


            <hr/>


            <div style=" font-size:16px; font-weight:bolder;"><label style="font-size:16px" >Total payable acceptance fees: </label>
<?php echo $total_sc_fees . ".00";
            ?></div>
            <hr/>
            <?php ?>

            <a href="pages/requerybase2.php?transid=<?php echo($ftransaction->txt_ref) ?>" id="accept"
               style="background-color:#030; color:#FFF; font-weight:bolder; border-radius:5px;padding:5px; margin-top:5; text-decoration:none; font-size:17px; font-stretch:extra-expanded">Requery</a>

            <a href="dashboard.php" id="back"
               style="background-color:#030; color:#FFF; font-weight:bolder; border-radius:5px;padding:5px; margin-top:5; margin-left:20px ; text-decoration:none; font-size:17px; font-stretch:extra-expanded">
                Back</a>

            <!--<input type="submit" name="submit" style="background-color:#069; color:#FFF; font-weight:bolder; border-radius:5px;padding:5px; margin-top:35" value="Bank branch payment">
            -->
            </form>
            <div>
                <div class="row">
                    <span class="col-md-3 col-lg-3 col-sm-3 col-xs-3">
                        <img src="images/image001.png" class="img-responsive bankImg" alt="">
                    </span>
                    <span class="col-md-3 col-lg-3 col-sm-3 col-xs-3">
                        <img src="./images/mc.jpg" class="img-responsive bankImg bankFix" alt="">

                    </span>
                    <span class="col-md-3 col-lg-3 col-sm-3 col-xs-3">
                        <img src="./images/visa.png" class="img-responsive bankImg" alt="">

                    </span>
                    <span class="col-md-3 col-lg-3 col-sm-3 col-xs-3">
                        <img src="./images/verve.jpg" class="img-responsive bankImg" alt="">

                    </span>
                </div>
            </div>

        </div>

    </div>
</div>
</div>


</article></div>
<style>
    #accept:hover {
        text-decoration: none;
        font-style: italic;
    }
</style>

<script type="text/javascript">

    var mes = <?php echo json_encode($message);?>
        $(document).ready(function () {
             alert(mes)
             if (mes=='Approved Successful'){
            $('#accept').attr('disabled', 'disabled');
        }
    });
</script>