
<?php
$student_titles = h(json_decode(STUDENT_TITLE));
$days = h(json_decode(DAYS));
$years = array_combine(range(1970, date('Y')), range(1970, date('Y')));
$genders = h(json_decode(STUDENT_GENDER));

?>
<style>
    .registration-form .form-control {
        padding: 0.5625rem 1.125rem !important;
    }

</style>
        <!-- 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">Application Form</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">Application Form</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-11 m-auto well shadow p-lg-5 p-4 rounded" style="margin-top:-100px !important">
                        <div class="pane panel-info">
                            <div class="panel-body">
                                <?= $this->Form->create(null, ['id' => 'student_form', 'class'=> 'form-horizontal row registration-form']) ?>

                                    <div class="col-12 pt-5">
                                        <h4 class="text-center rounded text-white fw-bold pt-2 pb-2 hd-line-height bg-secondary">
                                            <b>Course Information</b>
                                        </h4>
                                    </div>
                                    <div class="form-group col-lg-6">
                                        <label for="course_id" class="control-label d-block">Course Applied For:<span
                                                class="text-danger">*</span></label>
                                        <select required name="course_id" id="course_id" class="form-control">
                                            <option selected="" disabled="" value="">Select One</option>
                                            <?php foreach ($courses as $id => $name): ?>
                                                <option value="<?= h($id) ?>"><?= h($name) ?></option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>
                                    <div class="form-group col-lg-6">
                                        <label for="session_id" class="control-label d-block">Session:<span
                                                class="text-danger">*</span></label>
                                        <select required name="session_id" id="session_id" class="form-control">
                                            <option selected="" disabled="" value="">Select One</option>
                                            <?php foreach ($sessions as $id => $name): ?>
                                                <option value="<?= h($id) ?>"><?= h($name) ?></option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>
                                    
                                    <div class="col-12 py-3">
                                        <h4 class="text-center rounded text-white fw-bold pt-2 pb-2 hd-line-height bg-secondary">
                                            <b>Basic Information</b>
                                        </h4>
                                    </div>
                                    <div class="col-12">
                                        <div class="form-group">
                                            <div class="row">
                                                <div class="col-md-4 mb-1">
                                                    <label for="title" class="control-label">Title<span
                                                            class="text-danger">*</span></label>
                                                    <!-- <input required type="text" name="title" id="title" class="form-control" placeholder="Title"> -->
                                                    <select required name="title" id="title" class="form-control">
                                                        <option selected="" disabled="" value="">Select One</option>
                                                        <?php foreach ($student_titles as $key => $value): ?>
                                                            <option value="<?= h($value) ?>" ><?= h($value) ?></option>
                                                        <?php endforeach; ?>
                                                    </select>
                                                </div>
                                                <div class="col-md-4 mb-1">
                                                    <label for="first_name" class="control-label">First Name<span
                                                            class="text-danger">*</span></label>
                                                    <input required type="text" name="first_name" id="first_name"
                                                        class="form-control" placeholder="First Name" maxlength="100">
                                                </div>
                                                <div class="col-md-4 mb-1">
                                                    <label for="surname" class="control-label">Surname<span
                                                            class="text-danger">*</span></label>
                                                    <input required type="text" name="surname" id="surname"
                                                        class="form-control" placeholder="Surname" maxlength="100">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
        
                                    <div class="form-group col-lg-6">
                                        <label for="date_day" class="control-label">Date of Birth<span
                                                class="text-danger">*</span></label>
                                        <div class="row custom-gutter">
                                            <div class="col-4 mb-1">
                                                <select required name="date_day" id="day_of_birth" class="form-control">
                                                    <option selected="" disabled="" value="">Day</option>
                                                    <?php foreach ($days as $key => $value): ?>
                                                        <option value="<?= h($value) ?>"><?= h($value) ?></option>
                                                    <?php endforeach; ?>
                                                </select>
                                                <span class="help-inline"></span>
                                            </div>
                                            <div class="col-4 mb-1">
                                                <select required name="date_month" id="month_of_birth" class="form-control">
                                                    <option selected="" disabled="" value="">Month</option>
                                                    <?php foreach (MONTHS as $key => $value): ?>
                                                        <option value="<?= h($key) ?>" ><?= h($value) ?></option>
                                                    <?php endforeach; ?>
                                                </select>
                                            </div>
                                            <div class="col-4 mb-1">
                                                <select required name="date_year" id="year_of_birth" class="form-control">
                                                    <option disabled="" selected="" value="">Year</option>
                                                    <?php foreach ($years as $key => $value): ?>
                                                        <option value="<?= h($key) ?>" ><?= h($value) ?></option>
                                                    <?php endforeach; ?>
        
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-lg-6">
                                        <label for="place_of_birth" class="control-label">Place of Birth<span
                                                class="text-danger">*</span></label>
                                        <input required type="text" name="birth_place" id="birth_place"
                                            class="form-control" placeholder="Place of Birth" maxlength="100">
                                    </div>
                                    <div class="col-12 ">
                                        <div class="">
                                            <div class="row">
                                                <div class="col-md-4 mb-1">
                                                    <label for="gender" class="control-label d-block">Gender<span
                                                            class="text-danger">*</span></label>
                                                    <select required name="gender" id="gender" class="form-control">
                                                        <option selected="" disabled="" value="">Select One</option>
                                                        <?php foreach ($genders as $key => $value): ?>
                                                            <option value="<?= h($value) ?>" ><?= h($value) ?></option>
                                                        <?php endforeach; ?>
                                                    </select>
                                                </div>
                                                <div class="col-md-4 mb-1">
                                                    <div class="form-group">
                                                        <label for="nationality" class="control-label  d-block">Nationality<span
                                                                class="text-danger">* </span></label>
                                                        <select required name="nationality" id="nationality"
                                                            class="form-control">
                                                            <option selected="" disabled="" value="">Select One</option>
                                                            <?php foreach (COUNTRIES as $key => $value): ?>
                                                                <option value="<?= h($key) ?>" ><?= h($value) ?></option>
                                                            <?php endforeach; ?>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-md-4 mb-1">
                                                    <label for="passport_number" class="control-label">Passport Number<span
                                                            class="text-danger">*</span></label>
                                                    <input required type="text" name="passport_number" id="passport_number"
                                                        class="form-control" placeholder="Passport Number" maxlength="20">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
        
                                    <div class="form-group col-lg-6 py-3">
                                        <label for="email" class="control-label d-block">Email<span class="text-danger">*</span></label>
                                        <input required type="email" name="email" id="email" class="form-control" placeholder="abc@domain.com">
                                    </div>
                                    <div class="form-group col-lg-6 py-3">
                                        <label class="control-label d-block" for="phone_number">Phone Number<span
                                                class="text-danger">*</span></label>
                                        <div class="input-group">
                                            <input required type="text" id="phone_number" name="phone_number" class="form-control"
                                                placeholder="+44 (0) 7121348983" maxlength="20">
                                        </div>
                                    </div>
                                    <div class="col-lg-6 mb-3">
                                        <div class="p-4 pb-0 rounded" style="padding-bottom:40px !important; background-color: #eaeaea;">
                                            <div class="form-group">
                                                <label for="address" class="control-label  d-block">Address
                                                    <span class="text-danger">*</span></label>
                                                <input required type="text" name="address1" id="address1" class="form-control mb-3"
                                                    placeholder="Street Address" maxlength="255">
                                                <div class="row">
                                                    <div class="col-lg-6">
                                                        <input required type="text" id="city" name="city" class="form-control mb-3"
                                                            placeholder="City" maxlength="50">
                                                    </div>

                                                    <div class="col-lg-6">
                                                        <input type="text" id="zip_code" name="zip_code" class="form-control mb-3"
                                                            placeholder="Postal Code / Zip Code" maxlength="10">
                                                    </div>
                                                    <div class="col-lg-12">
                                                        <select required name="country" id="country" class="form-control">
                                                            <option value="" selected="" disabled="">Country</option>
                                                            <?php foreach (COUNTRIES as $key => $value): ?>
                                                                <option value="<?= h($key) ?>" ><?= h($value) ?></option>
                                                            <?php endforeach; ?>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-6 mb-3">
                                        <div class="p-4 pb-0 rounded emergency-box-style">
                                            <div class="form-group">
                                                <label for="present_address" class="control-label d-block">Emergency Contact
                                                    <span class="text-danger">*</span></label>
                                                <input required type="text" id="emergency_contact_name" name="emergency_contact_name"
                                                    class="form-control mb-3" placeholder="Name" maxlength="100">
                                                <input required type="text" id="emergency_contact_relation" name="emergency_contact_relation"
                                                    class="form-control mb-3" placeholder="Relation" maxlength="20">
                                                <div class="row">
                                                    <div class="col-lg-12">
                                                        <input required type="email" name="emergency_contact_email"
                                                            id="emergency_contact_email" class="form-control mb-3"
                                                            placeholder="abc@domain.com (Email)" maxlength="100">
                                                    </div>
                                                    <div class="col-lg-12">
                                                        <input required type="text" name="emergency_contact_phone_number" id="emergency_contact_phone_number"
                                                            class="form-control mb-3"
                                                            placeholder="+44 (0) 7121348983 (Phone Number)" maxlength="20">
                                                    </div>
        
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-12 mb-3">
                                        <label class="control-label" for="language">What language do you speak?<span
                                                class="text-danger">*</span></label>
                                        <input required type="text" class="form-control" name="speak_language" id="speak_language" maxlength="100"
                                            placeholder="Language">
                                    </div>
        
                                    <div class="col-12 ">
                                        <h4 class="text-center rounded text-white fw-bold pt-2 pb-2 hd-line-height bg-secondary">
                                            <b>Educational record to date (list your top 3 qualifications)</b>
                                        </h4>
                                    </div>
        
                                    <div class="col-12">
                                        <div class="form-group">
                                            <div class="row">
                                                <div class="col-md-1 mb-1 number-list-style">
                                                    <div class="number-list">1</div>
                                                </div>
                                                <div class="col-md-4 mb-1">
                                                    <label for="education_name1" class="control-label">Education<span
                                                            class="text-danger">*</span></label>
                                                    <input required type="text" name="education_name1" id="education_name1"
                                                        class="form-control" placeholder="Education" maxlength="150">
                                                </div>
                                                <div class="col-md-2 mb-1">
                                                    <label for="education_year1" class="control-label">Year<span
                                                            class="text-danger">*</span></label>
                                                    <select required name="education_year1" id="education_year1"
                                                        class="form-control">
                                                        <option disabled="" selected="" value="">Year</option>
                                                        <?php foreach ($years as $key => $value): ?>
                                                            <option value="<?= h($key) ?>" ><?= h($value) ?></option>
                                                        <?php endforeach; ?>
        
                                                    </select>
                                                </div>
                                                <div class="col-md-5 mb-1">
                                                    <label for="education_institution1" class="control-label">School / College<span
                                                            class="text-danger">*</span></label>
                                                    <input required type="text" name="education_institution1" id="education_institution1"
                                                        class="form-control" placeholder="School / College" maxlength="250">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-1 mb-1 number-list-style">
                                                    <div class="number-list">2</div>
                                                </div>
                                                <div class="col-md-4 mb-1">
                                                    <label for="education_name2" class="control-label"></label>
                                                    <input type="text" name="education_name2" id="education_name2" class="form-control"
                                                        placeholder="Education" maxlength="150">
                                                </div>
                                                <div class="col-md-2 mb-1">
                                                    <label for="education_year2" class="control-label"></label>
                                                    <select name="education_year2" id="education_year2" class="form-control">
                                                        <option disabled="" selected="" value="">Year</option>
                                                        <?php foreach ($years as $key => $value): ?>
                                                            <option value="<?= h($key) ?>"><?= h($value) ?></option>
                                                        <?php endforeach; ?>
        
                                                    </select>
                                                </div>
                                                <div class="col-md-5 mb-1">
                                                    <label for="education_institution2" class="control-label"></label>
                                                    <input type="text" name="education_institution2" id="education_institution2"
                                                        class="form-control" placeholder="School / College" maxlength="250">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-1 mb-1 number-list-style">
                                                    <div class="number-list">3</div>
                                                </div>
                                                <div class="col-md-4 mb-1">
                                                    <label for="education_name3" class="control-label"></label>
                                                    <input type="text" name="education_name3" id="education_name3" class="form-control"
                                                        placeholder="Education" maxlength="150">
                                                </div>
                                                <div class="col-md-2 mb-1">
                                                    <label for="education_year3" class="control-label"></label>
                                                    <select name="education_year3" id="education_year3" class="form-control">
                                                        <option disabled="" selected="" value="">Year</option>
                                                        <?php foreach ($years as $key => $value): ?>
                                                            <option value="<?= h($key) ?>" ><?= h($value) ?></option>
                                                        <?php endforeach; ?>
        
                                                    </select>
                                                </div>
                                                <div class="col-md-5 mb-1">
                                                    <label for="education_institution3" class="control-label"></label>
                                                    <input type="text" name="education_institution3" id="education_institution3"
                                                        class="form-control" placeholder="School / College" maxlength="250">
                                                </div>
                                            </div>
                                        </div>
        
                                    </div>
                                    <div class="col-12 py-3">
                                        <h4 class="text-center rounded text-white fw-bold pt-2 pb-2 hd-line-height bg-secondary">
                                            <b>Employment details (Most Recent Employer)</b>
                                        </h4>
                                    </div>
                                    <div class="form-group col-lg-6">
                                        <label for="employer_name" class="control-label d-block">Name of Employer</label>
                                        <input type="text" name="employer_name" id="employer_name" class="form-control" placeholder="Name of Employer" maxlength="150">
                                    </div>
                                    <div class="form-group col-lg-6">
                                        <label class="control-label d-block" for="position">Position</label>
                                        <div class="input-group">
                                            <input type="text" id="position" class="form-control" value="" placeholder="Position" maxlength="150">
                                        </div>
                                    </div>
                                    <div class="col-12 d-flex justify-content-center g-4">
                                        <input class="btn btn-primary rounded-0 py-2 px-lg-5" type="submit" id="btnSubmit" value="Submit">
                                    </div>
                                    <div class="col-12 mt-5 text-center hd-line-height alert info bg-light">
                                        <strong>NOTE:</strong> Upon complete submission of this form. Please email a copy of your passport, educational documents, and/or experience certificates to <b><?php echo DOCUMENTS_LINK ?></b>
                                    </div>
                                <?= $this->Form->end() ?>

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

                </div>
            </div>
        </div>
        <!-- About End -->
