
<?php
use Cake\I18n\FrozenTime;
if(!empty($student['date_of_birth'])) {
    $dateOfBirth = new FrozenTime($student['date_of_birth']);
    $dateOfBirth = $dateOfBirth->format('d-m-Y');
}
?>

        <!-- Header End -->
        <div class="container-fluid py-5 bg-dark page-header mb-5">
            <div class="container my-5 pt-5 pb-4">
                <h1 class="display-3 text-white mb-3 animated slideInDown">Verification</h1>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb text-uppercase">
                        <li class="breadcrumb-item"><a href="<?php echo $this->Url->build(["controller" => "Learninghub","action" => "index"]);?>">Home</a></li>
                        <li class="breadcrumb-item text-white active" aria-current="page">Verification</li>
                    </ol>
                </nav>
            </div>
        </div>
        <!-- Header End -->


        <!-- About Start -->
        <div class="container-xxl py-5">
            <div class="container">
                <div class="row g-5 align-top">

                    <div class="col-lg-4 wow fadeIn">
                        <div class="wow">
                            <h3 class="mb-4">Check Registration Status</h3>
                            <?= $this->Form->create(null, ['id' => 'verification_form', 'class'=> 'form-horizontal row registration-form']) ?>
                                <div class="row g-3">
                                    <div class="col-md-12">
                                        <div class="form-floating">
                                            <input type="text" class="form-control" name="reference_number" id="reference_number" value="<?= $student['reference_number'] ?>" placeholder="Enter Your Reference Number">
                                            <label class="text_label" for="reference_number">Your Reference Number</label>
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <div class="form-floating">
                                            <input type="text" class="form-control" name="date_of_birth" id="date_of_birth" value="<?= $dateOfBirth ?>"  placeholder="15-02-1990">
                                            <label class="text_label" for="date_of_birth">Your Birth Date(DD-MM-YYYY)</label>
                                        </div>
                                    </div>

                                    <div class="col-12">
                                        <button class="btn btn-primary w-100 py-3" type="submit">Check Status</button>
                                    </div>
                                </div>
                            <?= $this->Form->end() ?>
                            <?php

                            if(!empty($student)){
                            ?>
                            <h4 class="text-center alert alert-success pt-4 mt-3">Congrates! You have been enrolled</h4>
                            <?php } ?>

                            <?php if(!empty($message)){
                            ?>
                            <h4 class="text-center alert alert-danger pt-4 mt-3"><?= $message ?></h4>
                            <?php } ?>


                        </div>
                    </div>

                    <?php

                    if(!empty($student)){
                    ?>
                    <div class="col-lg-8 wow fadeIn" data-wow-delay="0.5s">
                        <table class="table table-bordered">
                            <thead>
                              <tr>
                                <th class="bg-light" scope="col">Ref. No:</th>
                                <th scope="col"><?= $student['reference_number']?></th>
                              </tr>
                            </thead>
                            <tbody>
                              <tr>
                                <th class="bg-light" scope="row">Given Name:</th>
                                <td><?= $student['first_name']?></td>
                              </tr>
                              <tr>
                                <th class="bg-light" scope="row">Surname:</th>
                                  <td><?= $student['surname']?></td>
                              </tr>
                              <tr>
                                <th class="bg-light" scope="row">Nationality:</th>
                                <td colspan="2"><?= $student['nationality']?></td>
                              </tr>
                              <tr>
                                <th class="bg-light" scope="row">Course:</th>
                                <td colspan="2"><?= $course['name']?></td>
                              </tr>
                              <tr>
                                <th class="bg-light" scope="row">Session:</th>
                                <td colspan="2"><?= $session['name']?></td>
                              </tr>
                            </tbody>
                          </table>
                        
                    </div>

                    <?php } ?>
                </div>
            </div>
        </div>
        <!-- About End -->

