<?php require_once("../includes/initialize.php");
if (!$session->is_logged_in()) {
    redirect_to("../index.php");
}
$id = $session->user_id;
$user_data = Userdata::find_by_id($session->user_id);
$biodata = Biodata::find_by_id($user_data->formno, $user_data->email);
//$transact_feedback = Transaction::authenticate($biodata->formno, $biodata->email);
$status = Status::check_status($user_data->formno);
$transact_feedback = Transaction::findacceptance($biodata->formno, $biodata->email);
if (!$transact_feedback){
redirect_to ("http://eportal.oscotechesaoke.edu.ng/student_portal/dashboard.php");
}else { 
    $transact_feedback = Transaction::authenticate($biodata->formno, $biodata->email);
}
if ($user_data->std_process_id < 3) {
    $level = $user_data->std_process_id + 1;
    $update_process = Userdata::update($id, $level);
}

$pix = substr($biodata->pix, 11);
$regex = "/F+/";
if (preg_match($regex, $biodata->formno)) {
    $programmeType = "FULL-TIME";
} else {
    $programmeType = "DAILY PART-TIME";
}
// concessionary

if ($status->type == 'C')
{
    $adm_type = 'concessionary';
}
elseif ($status->type == 'P')
{
    $adm_type= 'provisional';
}
?>

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Osun State College Of Technology | Advance Certificate Admission Letter</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="style001.css" rel="stylesheet" type="text/css"/>
    <!-- CuFon ends -->
</head>
<body style="background-image:url(../images/img2.png); background-repeat:no-repeat; background-position:430px 480px; background-size: 370px 370px">
<div class="cbtborder no-cbtborder">
    <div class="headert">
        <img src="../images/logo00.jpg" width="750px">
    </div>
    <center>
        <section align="center" style="color:#000;"><h4>OFFICE OF THE REGISTRAR</h4></section>
        <hr>
        <table class="table  table-condensed table-responsive" style="width:700px; font-size:14px; color:#000;">
            <tr>
                <td colspan="1" class="td"><strong>Admitted
                        on:</strong> <?php echo date("jS \of F, Y", strtotime($user_data->adm_date)); ?></td>
                <td rowspan="5" width="100" class="td">
                    <div class="DIVimagesl"><img src="<?php echo '../../Oscotech-Wallet/passport/' . $pix; ?>" width="100" height="100">
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="1" class="td"><strong>Form No:</strong> <?php echo $biodata->formno; ?><br/></td>
            </tr>
            <tr>
                <td colspan="1" class="td"><strong>Full
                        Name:</strong> <?php echo strtoupper($biodata->surname) . " " . strtoupper($biodata->othernames); ?>
                </td>
            </tr>
        </table>
    </center>
    <div class="letter">
        <h2>OFFER OF  <?php echo strtoupper($adm_type)?> ADMISSION INTO ADVANCE CERTIFICATE<br><?php echo $programmeType; ?> PROGRAMME
            FOR&nbsp<?php echo $biodata->session; ?> SESSION</h2>
        I am pleased to inform you that you have been offered a <?php echo $adm_type ?> admission into
        the <?php echo $programmeType; ?> programme of Osun State College of Technology, Esa-Oke
        for a 1-year Advance Certificate in the <strong>Department of <?php echo strtoupper($biodata->courses); ?> with
            effect from <?php echo $biodata->session; ?> Session.</strong>
        <p> 1. This offer of admission will be valid only if you fulfill the underlisted conditions:<br> <br>
            a) Possession of the minimum entry requirements for the course.<br><br>
            b) You will present to your faculty officer, at the time of registration, the originals of your credentials
            and six recent passport photographs for scrutiny and authentication. However you shall be required to verify
            through the college Directorate of Information and Communication Technology the original certificate(s) or
            the result slip(s) as the case may be from the appropriate examining bodies after the payment of necessary
            verification fee as part of registration.<br>
            <br>
            c) If at any time, even after your registration, it is discovered that you do not satisfy the minimum entry
            requirements, or that any of the qualifications you claimed to have is false, forged or incorrect, you will
            be required to withdraw from the institution forthwith and be handed over to the Police.<br>
            <br>
            d) You are equally required to produce the following documents for registration:</p>
        <ul type="circle">
            <li>Original and photocopy of Tax Clearance Certificate of your Parent/Guardian.</li>
            <li>Original and photocopy of your birth certificate or sworn declaration of age.</li>
            <li>Original and photocopy of Development Levy Receipt of your Parent/Guardian</li>
        </ul>
        <p> e) The names by which you are hereby admitted and by which you will be registered are the ones which will
            appear on the certificate that the Institution will issue to you on the successful completion of your course
            except the change of name is for the purpose of marriage.</p>
        <p align="justify"> 2.&nbsp; All fees are to be paid within the specified period and on no condition will any
            fees paid be refunded.<br>
        <p><b><i>Please accept my congratulations.</i></b></p>
        <p><img src="../images/registar.jpg"></p>
        <p>Elder J.O Ogunsuyi</p>
        <p>Registrar </p>
    </div>
</div>
</body>
</html>
