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

$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";

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

//$biodata = Biodata::find_by_id($session->user_id);


//$transact = Transaction::t_processing($id);
$transaction = Certificate::authenticate($biodata->formno, $biodata->email);


?>

<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, your details will be forwarded to Academic Affairs for further processes </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;">
                Certificate fees payment
            </div>
            <!--<hr style="width:100%;">
            <br />-->
            <?php if ($message != 'Approved Successful') {
                echo output_message($message);
            } elseif ($message == 'Approved Successful') {
                echo "<script>window.open('certificate_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/infooter.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:37px ">Department:</label><?php echo $biodata->courses; ?>
            </div>
            <div style="font-size:16px; margin-right:20px "><label
                        style="font-size:16px; margin-right:83px ">Level:</label><?php echo $biodata->programme; ?>
            </div>

            <!--<div style=" font-size:16px; font-weight:bolder;"><label style="font-size:16px; margin-right:105px" >Certificate fees: </label><?php //echo $pay_settings->amount;
            ?></div>-->

            <!--<div style=" font-size:16px; font-weight:bolder;"><label style="font-size:16px; margin-right:95px" >Additional charges: </label><?php //echo "0.00";
            //$pay_settings->charge_interswitch + $pay_settings->charge_omoluabi
            ?></div>
-->
            <div style=" font-size:16px; font-weight:bolder;"><label style="font-size:16px">Total payable certificate
                    fees: </label>
                <?php echo $pay_settings->amount;
                //+$pay_settings->charge_interswitch + $pay_settings->charge_omoluabi
                ?></div>


            <a href="certificate_tranzact.php" 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">
                Pay Now</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>
</div>
</div>


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