<style>

</style>
<div class="container mt-5">

    <?php
    if ($this->session->flashdata('alert_success')) {
    ?>
        <div class="alert alert-success alert-dismissible fade show" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">×</span>
            </button>
            <?php echo $this->session->flashdata('alert_success'); ?>
        </div>
    <?php
    }

    if ($this->session->flashdata('alert_danger')) {
    ?>
        <div class="alert alert-danger alert-dismissible fade show" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">×</span>
            </button>
            <?php echo $this->session->flashdata('alert_danger'); ?>
        </div>
    <?php
    }
    ?>
    <div class="card">

        <div class="card-body">
            <div class="d-flex justify-content-between">
                <h4 class="header-title mb-3"> Application Form</h4>
                <!-- <h6><strong id="cousrsefee"><?= isset($personalInfo) ? 'Course Fees:' . $personalInfo['application_fees'] : '' ?></strong></h6> -->
            </div>
            <!-- data-bs-toggle="tab" data-toggle="tab" -->




            <form id="applicationForm1" method="POST" action="<?php echo base_url(); ?>ApplicationController/updateApplication" enctype="multipart/form-data">
                <h5>Personal Info</h5>
                <div class="row mt-3">

                    <div class="col-md-12">
                        <input type="hidden" name="applicationId" value="<?= isset($personalInfo) ? $personalInfo['id'] : '' ?>">
                        <input type="hidden" name="academicYear" value="<?= isset($academicYear) ? $academicYear['year'] : '' ?>">
                        <input type="hidden" name="draft" class="draftVal1" value="0">
                        <input type="hidden" name="tab_status" class="tab_statusVal1" value="0">
                        <!-- if draft = 1 then it is active, not draft -->


                    </div>

                    <!-- <div class="col-md-4">
                                    <div class="form-group">
                                        <b><span class="mg-b-10">Application Fees<span class="text-danger">*</span></b>
                                        <input type="text" id="applicationfee" readonly name="application_fee" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['application_fees'] : '' ?>" placeholder="">
                                    </div>
                                </div> -->
                    <input type="hidden" id="applicationfee" readonly name="application_fee" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['application_fees'] : '' ?>" placeholder="">

                    <div class="col-md-10">
                        <div class="row">

                            <div class="col-md-8">
                                <div class="form-group">
                                    <b><span class="mg-b-10">Choose Course <span class="text-danger">*</span></b> <br>
                                    <select class="form-control select2-with-search" name="course_id" onchange="getCourse(event)">
                                        <option value="">--select--</option>
                                        <?php foreach ($courses as $item) { ?>
                                            <option value="<?= $item->id ?>" <?= isset($personalInfo) && $personalInfo['course_id'] == $item->id ? 'selected' : '' ?>><?= $item->course_name ?> </option>
                                        <?php } ?>
                                    </select>


                                </div>

                            </div>
                            <div class="col-md-4">
                                <div class="form-group">
                                    <b><span class="mg-b-10">Application Number <span class="text-danger">*</span></b> <br>

                                    <input type="text" name="application_no" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['application_no'] : '' ?>" placeholder="Application Number">


                                </div>

                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <b><span class="mg-b-10">First Name<span class="text-danger">*</span></b>
                                    <input type="text" name="first_name" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['first_name'] : '' ?>" placeholder="First Name">
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <b><span class="mg-b-10">Middle Name</b>
                                    <input type="text" name="middle_name" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['middle_name'] : '' ?>" placeholder="Middle Name">
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <b><span class="mg-b-10">Last Name<span class="text-danger">*</span></b>
                                    <input type="text" name="last_name" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['last_name'] : '' ?>" placeholder="Last Name">
                                </div>
                            </div>


                            <div class="col-md-4">
                                <div class="form-group">
                                    <b><span class="mg-b-10">Gender <span class="text-danger">*</span></b> <br>
                                    <select class="form-control select2 select2-with-search" name="gender">
                                        <option value="">--select--</option>
                                        <option value="Male" <?= isset($personalInfo) && $personalInfo['gender'] == 'Male' ? 'selected' : '' ?>>Male</option>
                                        <option value="Female" <?= isset($personalInfo) && $personalInfo['gender'] == 'Female' ? 'selected' : '' ?>>Female</option>
                                        <option value="Third Gender" <?= isset($personalInfo) && $personalInfo['gender'] == 'Third Gender' ? 'selected' : '' ?>>Third Gender</option>
                                    </select>
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <b><span class="mg-b-10">Date Of Birth<span class="text-danger">*</span></b>
                                    <input type="date" name="dob" id="dob" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['dob'] : '' ?>" placeholder="dd/mm/yyyy">
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <b><span class="mg-b-10">Nationality<span class="text-danger">*</span></b>
                                    <input type="text" name="nationality" id="nationality" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['nationality'] : '' ?>" placeholder="Enter Nationality">
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                <p style="  color: blue; font-size:17px" id="" autocomplete="off">Note : Upload recent passport size, colour digital photo in JPEG/PNG format. The face should be clear and facing upfront. Selfies will not be accepted. </p>
                                </div>
                            </div>

                        </div>
                    </div>




                    <div class="col-md-2 mt-3"><span class="h8"></soan>
                            <label for="photo" style="cursor: pointer;">
                                <img style="height: 150px;width:120px;" id="previewImg" src="<?= isset($personalInfo) ? $personalInfo['image_url'] : 'https://www.lifewire.com/thmb/TRGYpWa4KzxUt1Fkgr3FqjOd6VQ=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/cloud-upload-a30f385a928e44e199a62210d578375a.jpg' ?>" />
                            </label>
                            <div class="form-group">
                                <b><span class="mg-b-10">Upload Photo<span class="text-danger">*</span></b> 
                                <!-- <?= $personalInfo['image_url'] ? '<a class="ti-eye ml-2 text-info" target="_blank" href="' . $personalInfo['image_url'] . '" style="font-size: 22px;"></a>' : '' ?> -->
                                <input type="file" onchange="setPreview()" id="photo" name="photo" autocomplete="off" class="form-control d-none" value="<?= isset($personalInfo) ? $personalInfo['image_url'] : '' ?>" placeholder=" Landline Number" required>
                                <input type="hidden" name="oldPhoto" autocomplete="off" id="oldPhoto" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['image_url'] : '' ?>" placeholder=" Landline Number">
                                <input type="hidden" name="check_image" id="check_image" value="">

                            </div>

                    </div>


                    <div class="col-md-6">
                        <div class="form-group">
                            <b><span class="mg-b-10">Residential Address<span class="text-danger">*</span></b>
                            <textarea name="communication_address" style="height: 12rem;" id="" autocomplete="off" class="form-control" placeholder=""><?= isset($personalInfo) ? $personalInfo['communication_address'] : '' ?></textarea>
                        </div>
                    </div>

                    <div class="col-md-6 mt-3">
                        <div class="form-group ">
                            <!-- <b><span class="mg-b-10">Country <span class="text-danger">*</span></b> <br> -->
                            <!-- <select class="form-control select2-with-search" name="cuntry" id="cuntry" onchange="getcountrycode()"> -->
                            <select class="form-control select2-with-search" name="cuntry" id="cuntry">

                                <option value="">--Select Country--</option>
                                <?php foreach ($countries as $item) { ?>
                                    <option value="<?= $item->name ?>" data-info="<?= $item->id ?>" <?= isset($personalInfo) && $personalInfo['cuntry'] == $item->name ? 'selected' : '' ?>><?= $item->name ?> </option>
                                <?php } ?>
                            </select>
                        </div>
                        <div class="form-group ">
                            <!-- <b><span class="mg-b-10">State <span class="text-danger">*</span></b> <br> -->
                            <input type="text" name="state" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['state'] : $userDetails['state'] ?>" placeholder="Enter State">

                        </div>



                        <div class="form-group">
                            <!-- <b><span class="mg-b-10">City <span class="text-danger">*</span></b> <br> -->
                            <input type="text" name="city" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['city'] : $userDetails['city'] ?>" placeholder="Enter City">

                        </div>



                        <div class="form-group">
                            <!-- <b><span class="mg-b-10">Pincode <span class="text-danger">*</span></b> <br> -->
                            <input type="text" name="pincode" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['pincode'] : $userDetails['pincode'] ?>" placeholder="Enter Pincode">
                        </div>


                    </div>





                    <div class="col-md-4 mt-3">
                        <div class="form-group">
                            <b><span class="mg-b-10">Landline (optional)<span class="text-danger"></span></b>
                            <input type="number" name="landline" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['landline'] : '' ?>" placeholder=" Landline Number">
                        </div>
                    </div>




                    <div class="col-md-4 mt-3 ">
                        <div class="form-group  ">Mobile Number (Country Code)<span class="text-danger">*</span></b>
                            <div class="input-group">

                                <select class="form-select  " id="countrycode" name="countrycode" style="width:25%">
                                    <?php foreach ($countries as $item) { ?>
                                        <option value="<?= $item->phonecode ?>" data-info="<?= $item->id ?>" <?= '91' == $item->phonecode ? 'selected' : '' ?>><?= $item->phonecode  ?> </option>
                                    <?php } ?>
                                </select>

                                <input type="text" id="mobile" name="mobile" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['mobile'] : $userDetails['mobile'] ?>" placeholder="Enter Mobile">

                            </div>
                            <span class="text-danger mobile_error"></span>

                        </div>
                        <div>
                        </div>

                    </div>

                    <div class="col-md-4 mt-3">
                        <div class="form-group">
                            <b><span class="mg-b-10">Email<span class="text-danger">*</span></b>
                            <input type="email" name="email" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['email'] : $userDetails['email'] ?>" placeholder="Enter Email Id">
                            <span class="text-danger email_error"></span>
                        </div>
                    </div>
                </div>

                <!-- <div class="col mt-3 mb-3 d-flex justify-content-between">
                                <div></div>
                                <div>
                                    <button type="button" class="btn btn-primary next-button" onclick="draftFunction('applicationForm1','draftVal1')">Save Draft</button>
                                    <button type="button" id="nextBtn1" class="btn btn-secondary next-button save1" onclick="submitForm1()">Save & Next </button>
                                </div>
                            </div> -->
                <!-- </form> -->


                <h5 class="mt-2">Parent/ Guardian Info </h5><br>

                <!-- <h5 class="mt-2">Father Information </h5> -->

                <!-- <form class="mt-3" id="applicationForm2" method="POST" action="<?php echo base_url(); ?>ApplicationController/addApplication2" enctype="multipartform-data"> -->

                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <input type="hidden" name="applicationId" value="<?= isset($personalInfo) ? $personalInfo['id'] : '' ?>">
                            <input type="hidden" name="parentId" value="<?= isset($parentInfo) ? $parentInfo['id'] : '' ?>">
                            <input type="hidden" name="draft" class="draftVal2" value="1">
                            <input type="hidden" name="tab_status" class="tab_statusVal2" value="0">

                            <b><span class="mg-b-10">Father/ Guardian/ Spouse Name</b><span class="text-danger">*</span></b>
                            <input type="text" name="father_name" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['father_name'] : '' ?>" placeholder="Name">

                        </div>
                    </div>


                    <div class="col-md-6 pb-3">
                        <div class="form-group">
                            <b><span class="mg-b-10">Occupation</b><span class="text-danger">*</span></b>
                            <input type="text" name="father_occupation" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['father_occupation'] : '' ?>" placeholder="Occupation">

                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <!-- <h5>Father's Home Information</h5> -->
                        <div class="mt-2">
                            <div class="form-group">
                                <b><span class="mg-b-10">Residential Address<span class="text-danger">*</span></b>


                                <textarea name="father_home_address" id="father_home_address" autocomplete="off" class="form-control" placeholder=""><?= isset($parentInfo) ? $parentInfo['father_home_address'] : '' ?></textarea>


                            </div>
                        </div>
                    </div>
                </div>
                <div class="row ">
                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Landline (optional)</b>
                            <input type="number" name="father_home_landline" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['father_home_landline'] : '' ?>" placeholder=" Landline Number">

                        </div>
                    </div>


                    <div class="col-md-4">
                        <div class="form-group">Mobile Number (Country Code)</b><span class="text-danger">*</span></b>
                            <div class="input-group ">
                                <select class="form-select  select2  countrycode " id="countrycode" name="father_countrycode" style="width:25%">
                                    <?php foreach ($countries as $item) { ?>
                                        <option value="<?= $item->phonecode ?>" data-info="<?= $item->id ?>" <?= '91' == $item->phonecode ? 'selected' : '' ?>><?= $item->phonecode  ?> </option>
                                    <?php } ?>
                                </select>

                                <input type="text" name="father_home_mobile" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['father_home_mobile'] : '' ?>" placeholder=" Mobile">

                            </div>

                        </div>
                    </div>





                    <!-- <div class="col-md-4">
                                    <div class="form-group">Mobile Number (Country Code)</b>


                                        <div class="input-group conuntry-code">
                                            <select class="form-select  select2  " id="countrycode" name="countrycode" style="width:15%">
                                                <?php foreach ($countries as $item) { ?>
                                                    <option value="<?= $item->phonecode ?>" data-info="<?= $item->id ?>" <?= '91' == $item->phonecode ? 'selected' : '' ?>><?= $item->phonecode  ?> </option>
                                                <?php } ?>
                                            </select>


                                        </div>

                                    </div>
                                </div> -->

                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Email</b><span class="text-danger">*</span></b>
                            <input type="email" name="father_home_email" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['father_home_email'] : '' ?>" placeholder=" Email Id">

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


                <div class="row mt-3 ">
                    <div class="col-md-12">
                        <!-- <h5>Office Information</h5> -->
                    </div>

                    <div class="col-md-12 mt-2">
                        <div class="form-group">
                            <b><span class="mg-b-10">Office Address</b><span class="text-danger">*</span></b>
                            <textarea name="father_office_address" autocomplete="off" class="form-control" placeholder=""><?= isset($parentInfo) ? $parentInfo['father_office_address'] : '' ?></textarea>

                        </div>
                    </div>


                </div>


                <div class="row mt-3">
                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Landline (optional)</b>
                            <input type="number" name="father_office_landline" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['father_office_landline'] : '' ?>" placeholder=" Landline Number">

                        </div>
                    </div>


                    <div class="col-md-4">
                        <div class="form-group">Mobile Number (Country Code)</b><span class="text-danger">*</span></b>
                            <div class="input-group ">
                                <select class="form-select  select2  " id="countrycode" name="fatherofficecountrycode" style="width:25%">
                                    <?php foreach ($countries as $item) { ?>
                                        <option value="<?= $item->phonecode ?>" data-info="<?= $item->id ?>" <?= '91' == $item->phonecode ? 'selected' : '' ?>><?= $item->phonecode  ?> </option>
                                    <?php } ?>
                                </select>

                                <input type="text" name="father_office_mobile" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['father_office_mobile'] : '' ?>" placeholder=" Mobile">

                            </div>

                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Email</b><span class="text-danger">*</span></b>
                            <input type="email" name="father_office_email" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['father_office_email'] : '' ?>" placeholder=" Email Id"></input>

                        </div>
                    </div>
                </div>
                <hr>
                <!-- <h4>Mother Information</h4> -->
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <b><span class="mg-b-10">Mother's Name <span class="text-danger"></span></b>
                            <input type="text" name="mother_name" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['mother_name'] : '' ?>" placeholder=" Mother's Name">

                        </div>
                    </div>


                    <div class="col-md-6 pb-3">
                        <div class="form-group">
                            <b><span class="mg-b-10">Occupation<span class="text-danger"></span></b>
                            <input type="text" name="mother_occupation" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['mother_occupation'] : '' ?>" placeholder="Mother's Occupation">

                        </div>
                    </div><br>
                </div>
                <div class="row">
                    <div class="col-12">
                        <!-- <h4 class="">Mother's Home Information</h4> -->
                    </div>
                    <div class="col ps-2 mb-3">
                        <input type="checkbox" id="addressCheckbox" name="addressCheckbox" <?= isset($parentInfo) && $parentInfo['addressCheckbox'] == 1 ? 'checked' : '' ?>> <label class="ml-3 pl-3"> Home Address same as father's Home Information </label>
                    </div>
                </div>

                <div class="">
                    <div class="row">
                        <div class="col-md-12 ">
                            <b><span class="mg-b-10">Residential Address<span class="text-danger"></span></b>

                            <div class="form-group hiddenDiv">
                                <textarea name="mother_home_addressss" autocomplete="off" class="form-control " placeholder=""><?= isset($parentInfo) ? $parentInfo['mother_home_addressss'] : '' ?></textarea>
                            </div>

                            <div class="card-body border ps-2 hiddenDiv2 d-none">

                            </div>
                        </div>


                        <!-- <div class="col-md-3">
                                        <div class="form-groHome Informationup">
                                            <b><span class="mg-b-10">Country Code <span class="text-danger"></span></b> <br>
                                            <select class="form-control select2-with-search" name="mother_home_country_code">
                                                <option value="">--select--</option>
                                                <option value="101">101</option>
                                            </select>
                                        </div>
                                    </div> -->
                    </div>
                </div>


                <div class="row mt-3">
                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Landline (optional)<span class="text-danger"></span></b>
                            <input type="number" name="mother_home_land_line" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['mother_home_land_line'] : '' ?>" placeholder=" Landline Number">

                        </div>
                    </div>



                    <div class="col-md-4">
                        <div class="form-group">Mobile Number (Country Code)<span class="text-danger"></span></b>

                            <div class="input-group ">
                                <select class="form-select  select2  " id="countrycode" name="motherhomecountrycode" style="width:25%">
                                    <?php foreach ($countries as $item) { ?>
                                        <option value="<?= $item->phonecode ?>" data-info="<?= $item->id ?>" <?= '91' == $item->phonecode ? 'selected' : '' ?>><?= $item->phonecode  ?> </option>
                                    <?php } ?>
                                </select>

                                <input type="text" name="mother_home_mobile" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['mother_home_mobile'] : '' ?>" placeholder=" Mobile">

                            </div>

                        </div>
                    </div>

                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Email<span class="text-danger"></span></b>
                            <input type="email" name="mother_home_email" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['mother_home_email'] : '' ?>" placeholder=" Email Id">

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




                <div class="row mt-3">
                    <div class="col-12">
                        <!-- <h4>Office Information</h4> -->
                    </div>


                    <div class="col-md-12">
                        <div class="form-group">
                            <b><span class="mg-b-10">Office Address<span class="text-danger"></span></b>
                            <textarea name="mother_office_address" autocomplete="off" class="form-control" placeholder=""><?= isset($parentInfo) ? $parentInfo['mother_office_address'] : '' ?><?= isset($parentInfo) ? $parentInfo['first_name'] : '' ?></textarea>

                        </div>
                    </div>




                </div>

                <div class="row mt-3">



                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Landline (optional)<span class="text-danger"></span></b>
                            <input type="number" name="mother_office_land_line" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['mother_office_land_line'] : '' ?>" placeholder=" Landline Number">

                        </div>
                    </div>



                    <div class="col-md-4">
                        <div class="form-group">Mobile Number (Country Code)<span class="text-danger"></span></b>

                            <div class="input-group ">
                                <select class="form-select  " id="countrycode" name="motherofficecountrycode" style="width:25%">
                                    <?php foreach ($countries as $item) { ?>
                                        <option value="<?= $item->phonecode ?>" data-info="<?= $item->id ?>" <?= '91' == $item->phonecode ? 'selected' : '' ?>><?= $item->phonecode  ?> </option>
                                    <?php } ?>
                                </select>

                                <input type="text" name="mother_office_mobile" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['mother_office_mobile'] : '' ?>" placeholder=" Mobile">

                            </div>

                        </div>
                    </div>
                    <div class="col-md-4 " style="display:none">
                        <div class="input-group ">
                            <select type="hidden" id="countrycode">

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


                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Email<span class="text-danger"></span></b>
                            <input type="email" name="mother_office_email" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['mother_office_email'] : '' ?>" placeholder=" Email Id"></input>

                        </div>
                    </div>
                </div>
                <hr>
                <!-- <b class="mb-2"></b> -->
                <h4>Family Income</h4>

                <div class="row mb-2">
                    <div class="col-md-4">
                        <div class="form-group">
                            <b><span class="mg-b-10">Annual family income in INR<span class="text-danger">*</span></b>
                            <input type="number" name="annual_income_rs" autocomplete="off" class="form-control" onkeyup="convertNumberToWords(event)" value="<?= isset($parentInfo) ? $parentInfo['annual_income_rs'] : '' ?>" placeholder="Annual family income In INR">
                        </div>
                    </div>

                    <div class="col-md-8">
                        <div class="form-group">
                            <b><span class="mg-b-10">Amount in words<span class="text-danger"></span></b>
                            <input type="text" id="annual_income_words" readonly name="annual_income_words" autocomplete="off" class="form-control" value="<?= isset($parentInfo) ? $parentInfo['annual_income_words'] : '' ?>" placeholder=" Amount in words">
                        </div>
                    </div>

                    <!-- <div class="col-md-4">
                                    <div class="form-group">
                                        <b><span class="mg-b-10">Do you intend to apply scholarship?<span class="text-danger"></span></b>
                                        <select class="form-control select2-with-search" name="apply_scholarship" id="scholarship">
                                            {{-- <option value="">--select--</option> --}}
                                            <option value="0" <?= $personalInfo['apply_scholarship'] == 0 ? 'selected' : '' ?>>No</option>
                                            <option value="1" <?= $personalInfo['apply_scholarship'] == 1 ? 'selected' : '' ?>>Yes</option>
                                        </select>
                                    </div>
                                </div> -->
                </div>

                <div class="row mt-3 mb-2" style="display:none" id="s_file">
                    <div class="col-md-3">
                        <div class="form-group">
                            <b><span class="mg-b-10">Community Certificate<span class="text-danger"></span></b>
                            <?= $personalInfo['community_certificate'] ? '<a class="ti-eye ml-2 text-info" target="_blank" href="' . $personalInfo['community_certificate'] . '" style="font-size: 22px;"></a>' : '' ?>
                            <input type="file" name="community_certificate" id="community_certificate" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['community_certificate'] : '' ?>">
                            <input type="hidden" name="oldCommunity" id="oldCommunity" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['community_certificate'] : '' ?>" placeholder=" Landline Number">

                        </div>
                    </div>



                    <div class="col-md-3">
                        <div class="form-group">
                            <b><span class="mg-b-10">Income Certificate<span class="text-danger"></span></b>
                            <?= $personalInfo['income_certificate'] ? '<a class="ti-eye ml-2 text-info" target="_blank" href="' . $personalInfo['income_certificate'] . '" style="font-size: 22px;"></a>' : '' ?>
                            <input type="file" name="income_certificate" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['income_certificate'] : '' ?>">
                            <input type="hidden" name="oldIncome" autocomplete="off" class="form-control" value="<?= isset($personalInfo) ? $personalInfo['income_certificate'] : '' ?>" placeholder=" Landline Number">
                        </div>

                    </div>

                </div>

                <!-- <div class="row d-flex justify-content-between">
                                <div class="">
                                    <a href="#first" onclick="previewclick('first')" class="preview btn  btn-secondary ml-2 mr-2">Previous</a>
                                </div>
                                <div class="">
                                    <ul class="list-inline wizard mb-0 ">
                                        <div>
                                            <li class="next list-inline-item float-end">
                                                <a href="#" id="draft_button" class="btn btn-primary mr-2" onclick="draftFunction('applicationForm2','draftVal2')">Save as Draft</a>
                                            </li>
                                            <li class="next list-inline-item float-end mr-2">
                                                <button type="button" href="#" class="btn btn-secondary" id="nextBtn" onclick="submitForm2()">Save & Next</a>
                                            </li>
                                        </div>
                                    </ul>
                                </div>

                            </div> -->
                <!-- </form> -->















                <h4 class="">Education</h4>
                <!-- <form id="applicationForm3" method="POST" action="<?php echo base_url(); ?>ApplicationController/addApplication3" enctype="multipart/form-data"> -->
                <br>
                <h6 class="mt-2">Education <b>(Start with last College/University attended)</b> <span class="text-danger">*</span></h6></b>

                <input type="hidden" name="applicationId" value="<?= $personalInfo['id'] ?>">

                <input type="hidden" name="draft" class="draftVal3" value="1">
                <input type="hidden" name="tab_status" class="tab_statusVal3" value="0">

                <!-- <div class="row">
                                                            <div class="col-md-1"></div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Institution<span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Year<span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Subjects<span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Degree<span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Marks / Grade<span class="text-danger"></span></b> </div>
                                                        </div> -->

                <?php if (empty($educationInfo)) { ?>
                    <div class="row mt-3">

                        <div class="col-md-3">
                            <div class="form-group">
                                <b><span class="mg-b-10">Institution<span class="text-danger"></span></b>
                                <input type="text" name="education_institution[]" autocomplete="off" class="form-control" placeholder="Institution 1">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10">Year<span class="text-danger"></span></b>
                                <input type="number" min="1" name="education_year[]" autocomplete="off" class="form-control" placeholder=" Year">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10">Subjects<span class="text-danger"></span></b>
                                <input type="text" name="education_subject[]" autocomplete="off" class="form-control" placeholder=" Main Subjects">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10">Degree<span class="text-danger"></span></b>
                                <input type="text" name="education_degree[]" autocomplete="off" class="form-control" placeholder=" Degree">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10">Marks / Grade<span class="text-danger"></span></b>
                                <input type="text" name="education_marks[]" autocomplete="off" class="form-control" placeholder=" Mark/Grade">

                            </div>

                        </div>
                    </div>




                    <div class="row mt-3">
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="education_institution[]" autocomplete="off" class="form-control" placeholder="Institution 2">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="number" min="1" name="education_year[]" autocomplete="off" class="form-control" placeholder=" Year">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="education_subject[]" autocomplete="off" class="form-control" placeholder=" Main Subjects">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="education_degree[]" autocomplete="off" class="form-control" placeholder=" Degree">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="education_marks[]" autocomplete="off" class="form-control" placeholder=" Mark/Grade">
                            </div>
                        </div>
                    </div>

                    <div class="row mt-3">
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="education_institution[]" autocomplete="off" class="form-control" placeholder="Institution 3">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="number" min="1" name="education_year[]" autocomplete="off" class="form-control" placeholder=" Year">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="education_subject[]" autocomplete="off" class="form-control" placeholder=" Main Subjects">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="education_degree[]" autocomplete="off" class="form-control" placeholder=" Degree">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="education_marks[]" autocomplete="off" class="form-control" placeholder=" Mark/Grade">
                            </div>
                        </div>
                    </div>

                    <?php } else {
                    $eduworkcount = 0;
                    foreach ($educationInfo as $key => $info) {
                        if ($info->education_institution) {
                    ?>

                            <div class="row mt-3">
                                <input type="hidden" name="educationInstitutionChildId[]" value="<?= $info->id ?>" id="childId">


                                <div class="col-md-3">
                                    <div class="form-group">

                                        <input type="text" name="education_institution[]" value="<?= $info->education_institution ? $info->education_institution : '' ?>" autocomplete="off" class="form-control" placeholder="Institution">

                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">

                                        <input type="number" min="1" name="education_year[]" value="<?= $info->education_year ? $info->education_year : '' ?>" autocomplete="off" class="form-control" placeholder=" Year">


                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">

                                        <input type="text" name="education_subject[]" value="<?= $info->education_subject ? $info->education_subject : '' ?>" autocomplete="off" class="form-control" placeholder=" Main Subjects">


                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">

                                        <input type="text" name="education_degree[]" value="<?= $info->education_degree ? $info->education_degree : '' ?>" autocomplete="off" class="form-control" placeholder=" Degree">


                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">

                                        <input type="text" name="education_marks[]" value="<?= $info->education_marks ? $info->education_marks : '' ?>" autocomplete="off" class="form-control" placeholder=" Mark/Grade">


                                    </div>

                                </div>

                            </div>

                        <?php $eduworkcount++;
                        }
                    }

                    for ($i = $eduworkcount; $i < 3; $i++) {  ?>

                        <div class="row mt-3">


                            <div class="col-md-3">
                                <div class="form-group">
                                    <input type="text" name="education_institution[]" autocomplete="off" class="form-control" placeholder="Institution ">

                                </div>

                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="number" min="1" name="education_year[]" autocomplete="off" class="form-control" placeholder=" Year">

                                </div>

                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="text" name="education_subject[]" autocomplete="off" class="form-control" placeholder=" Main Subjects">

                                </div>

                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="text" name="education_degree[]" autocomplete="off" class="form-control" placeholder=" Degree">

                                </div>

                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="text" name="education_marks[]" autocomplete="off" class="form-control" placeholder=" Mark/Grade">

                                </div>

                            </div>

                        </div>



                <?php }
                } ?>




                <hr>

                <h6>Higher Secondary or Equivalent <span class="text-danger">*</span></h6>


                <?php if (empty($educationInfo)) { ?>

                    <div class="row mt-3">


                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="higher_secondary_name[]" autocomplete="off" class="form-control" placeholder=" School Name">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="number" min="0" name="higher_secondary_year[]" autocomplete="off" class="form-control" placeholder=" Year of Passing ">

                            </div>

                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="higher_school_education_boards[]" autocomplete="off" class="form-control" placeholder="Board (ex:CBSE)">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="higher_secondary_marks[]" autocomplete="off" class="form-control" placeholder=" Marks/Grades">

                            </div>

                        </div>

                    </div>




                    <?php } else {
                    $educout = 0;
                    foreach ($educationInfo as $info) {
                        if ($info->higher_secondary_name) {
                    ?>


                            <div class="row mt-2">
                                <input type="hidden" name="highSecondaryChild[]" value="<?= $info->id ?>">

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="text" name="higher_secondary_name[]" value="<?= $info->higher_secondary_name ? $info->higher_secondary_name : '' ?>" autocomplete="off" class="form-control" placeholder=" School Name">

                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <input type="number" min="0" name="higher_secondary_year[]" value="<?= $info->higher_secondary_year ? $info->higher_secondary_year : '' ?>" autocomplete="off" class="form-control" placeholder=" Year of Passing ">
                                    </div>

                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="text" name="higher_school_education_boards[]" value="<?= $info->higher_school_education_boards ? $info->higher_school_education_boards : '' ?>" autocomplete="off" class="form-control" placeholder="Board (ex:CBSE)">
                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <input type="text" name="higher_secondary_marks[]" value="<?= $info->higher_secondary_marks ? $info->higher_secondary_marks : '' ?>" autocomplete="off" class="form-control" placeholder=" Marks/Grades">
                                    </div>
                                </div>
                                <div class="col-md-1">
                                </div>
                            </div>
                        <?php $educout++;
                        }
                    }

                    if ($educout == 0) {  ?>

                        <div class="row mt-3">

                            <div class="col-md-3">
                                <div class="form-group">
                                    <input type="text" name="higher_secondary_name[]" autocomplete="off" class="form-control" placeholder=" School Name">
                                </div>

                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="number" min="0" name="higher_secondary_year[]" autocomplete="off" class="form-control" placeholder=" Year of Passing ">
                                </div>

                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <input type="text" name="higher_school_education_boards[]" autocomplete="off" class="form-control" placeholder="Board (ex:CBSE)">
                                </div>

                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="text" name="higher_secondary_marks[]" autocomplete="off" class="form-control" placeholder=" Marks/Grades">
                                </div>
                            </div>
                        </div>

                <?php
                    }
                }
                ?>

                <HR>


                <h6>High School<span class="text-danger">*</span></h6>

                <!-- <div class="row mt-2">
                                                            <div class="col-md-1"></div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">School Name <span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b> <span class="mg-b-10">Year of Passing  <span class="text-danger"></span></b></div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Board<span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Marks / Grades<span class="text-danger"></span></b> </div>
                                                        </div> -->

                <?php if (empty($educationInfo)) { ?>

                    <div class="row mt-3">


                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="high_school_name[]" autocomplete="off" class="form-control" placeholder=" School Name">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="number" min="0" name="high_school_year[]" autocomplete="off" class="form-control" placeholder=" Year of Passing ">

                            </div>

                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="educational_boards[]" autocomplete="off" class="form-control" placeholder="Board (ex:CBSE)">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="high_school_marks[]" autocomplete="off" class="form-control" placeholder=" Marks/Grades">

                            </div>

                        </div>

                    </div>


                    <!-- <div class="row mt-3">

                                                <div class="col-md-1">
                                                </div>
                                                <div class="col-md-2">
                                                    <div class="form-group">
                                                        <input type="text" name="high_school_name[]" autocomplete="off" class="form-control" placeholder=" School Name">

                                                    </div>

                                                </div>
                                                <div class="col-md-2">
                                                    <div class="form-group">
                                                        <input type="text" name="high_school_year[]" autocomplete="off" class="form-control" placeholder=" Year of Passing ">

                                                    </div>

                                                </div>
                                                <div class="col-md-2">
                                                    <div class="form-group">
                                                        <input type="text" name="educational_boards[]" autocomplete="off" class="form-control" placeholder=" Board (ex:CBSE)">

                                                    </div>

                                                </div>

                                                <div class="col-md-2">
                                                    <div class="form-group">
                                                        <input type="text" name="high_school_marks[]" autocomplete="off" class="form-control" placeholder=" Marks/Grades">

                                                    </div>

                                                </div>

                                            </div> -->

                    <!-- <div class="row mt-3">

                                                <div class="col-md-1">
                                                </div>
                                                <div class="col-md-2">
                                                    <div class="form-group">
                                                        <input type="text" name="high_school_name[]" autocomplete="off" class="form-control" placeholder=" School Name">

                                                    </div>

                                                </div>
                                                <div class="col-md-2">
                                                    <div class="form-group">
                                                        <input type="text" name="high_school_year[]" autocomplete="off" class="form-control" placeholder=" Year of Passing ">

                                                    </div>

                                                </div>
                                                <div class="col-md-2">
                                                    <div class="form-group">
                                                        <input type="text" name="educational_boards[]" autocomplete="off" class="form-control" placeholder="Board (ex:CBSE)">

                                                    </div>

                                                </div>
                                                <div class="col-md-2">
                                                    <div class="form-group">
                                                        <input type="text" name="high_school_marks[]" autocomplete="off" class="form-control" placeholder=" Marks/Grades">

                                                    </div>

                                                </div>

                                            </div> -->

                    <?php } else {
                    foreach ($educationInfo as $info) {
                        if ($info->high_school_name) {
                    ?>


                            <div class="row mt-2">
                                <input type="hidden" name="highSchoolChild[]" value="<?= $info->id ?>">

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="text" name="high_school_name[]" value="<?= $info->high_school_name ? $info->high_school_name : '' ?>" autocomplete="off" class="form-control" placeholder=" School Name">

                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">

                                        <input type="number" min="0" name="high_school_year[]" value="<?= $info->high_school_year ? $info->high_school_year : '' ?>" autocomplete="off" class="form-control" placeholder=" Year of Passing ">

                                    </div>

                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="text" name="educational_boards[]" value="<?= $info->educational_boards ? $info->educational_boards : '' ?>" autocomplete="off" class="form-control" placeholder="Board (ex:CBSE)">

                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <input type="text" name="high_school_marks[]" value="<?= $info->high_school_marks ? $info->high_school_marks : '' ?>" autocomplete="off" class="form-control" placeholder=" Marks/Grades">

                                    </div>

                                </div>
                                <div class="col-md-1">
                                </div>
                            </div>
                <?php
                        }
                    }
                }

                ?>

                <hr>

                <h6>Other Educational Qualifications<b>(Languages, Cultural, Music Education etc)</b></h6>


                <!-- <div class="row">
                                                            <div class="col-md-1"></div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Institution <span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b> <span class="mg-b-10">Year <span class="text-danger"></span></b></div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Subject<span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Certificate<span class="text-danger"></span></b> </div>
                                                            <div class="col-md-2"><b><span class="mg-b-10">Award<span class="text-danger"></span></b> </div>
                                                        </div> -->

                <?php if (empty($educationInfo)) { ?>

                    <div class="row mt-3">


                        <div class="col-md-3">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Institution<span class="text-danger"></span></b>
                                <input type="text" name="other_education_institution[]" autocomplete="off" class="form-control" placeholder="Institution ">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Year<span class="text-danger"></span></b>
                                <input type="number" min="0" name="other_education_year[]" autocomplete="off" class="form-control" placeholder="  Year of Passing ">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Subject<span class="text-danger"></span></b>
                                <input type="text" name="other_education_subject[]" autocomplete="off" class="form-control" placeholder="  Subject">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Certificate<span class="text-danger"></span></b>
                                <input type="text" name="other_education_certificate[]" autocomplete="off" class="form-control" placeholder="  Certificate">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Award<span class="text-danger"></span></b>
                                <input type="text" name="other_education_award[]" autocomplete="off" class="form-control" placeholder="  Award">

                            </div>

                        </div>

                    </div>

                    <div class="row mt-3">


                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="other_education_institution[]" autocomplete="off" class="form-control" placeholder="Institution ">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="number" min="0" name="other_education_year[]" autocomplete="off" class="form-control" placeholder="  Year of Passing ">
                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="other_education_subject[]" autocomplete="off" class="form-control" placeholder="  Subject">
                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="other_education_certificate[]" autocomplete="off" class="form-control" placeholder="  Certificate">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="other_education_award[]" autocomplete="off" class="form-control" placeholder="  Award">

                            </div>

                        </div>

                    </div>

                    <div class="row mt-3">
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="other_education_institution[]" autocomplete="off" class="form-control" placeholder="Institution ">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="number" min="0" name="other_education_year[]" autocomplete="off" class="form-control" placeholder="  Year">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="other_education_subject[]" autocomplete="off" class="form-control" placeholder="  Subject">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="other_education_certificate[]" autocomplete="off" class="form-control" placeholder="  Certificate">
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="text" name="other_education_award[]" autocomplete="off" class="form-control" placeholder="  Award">
                            </div>
                        </div>
                    </div>






                    <?php } else {
                    $educount = 0;
                    foreach ($educationInfo as $info) {
                        if ($info->other_education_institution) {
                    ?>




                            <div class="row mt-3">
                                <input type="hidden" name="otherEducationChild[]" value="<?= $info->id ?>">

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="text" name="other_education_institution[]" value="<?= $info->other_education_institution ? $info->other_education_institution : '' ?>" autocomplete="off" class="form-control" placeholder="Institution ">
                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <input type="number" min="0" name="other_education_year[]" value="<?= $info->other_education_year ? $info->other_education_year : '' ?>" autocomplete="off" class="form-control" placeholder="  Year">
                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <input type="text" name="other_education_subject[]" value="<?= $info->other_education_subject ? $info->other_education_subject : '' ?>" autocomplete="off" class="form-control" placeholder="  Subject">
                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <b><span class="mg-b-10"> <span class="text-danger"></span></b>
                                        <input type="text" name="other_education_certificate[]" value="<?= $info->other_education_certificate ? $info->other_education_certificate : '' ?>" autocomplete="off" class="form-control" placeholder="  Certificate">
                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <input type="text" name="other_education_award[]" value="<?= $info->other_education_award ? $info->other_education_award : '' ?>" autocomplete="off" class="form-control" placeholder="  Award">
                                    </div>
                                </div>
                            </div>
                        <?php
                            $educount++;
                        }
                    }

                    for ($i = $educount; $i < 3; $i++) {
                        ?>
                        <div class="row mt-3">
                            <div class="col-md-3">
                                <div class="form-group">
                                    <input type="text" name="other_education_institution[]" autocomplete="off" class="form-control" placeholder="Institution 3">
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="number" min="0" name="other_education_year[]" autocomplete="off" class="form-control" placeholder="  Year">
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="text" name="other_education_subject[]" autocomplete="off" class="form-control" placeholder=" Main Subjects">
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="text" name="other_education_certificate[]" autocomplete="off" class="form-control" placeholder="  Certificate">
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="text" name="other_education_award[]" autocomplete="off" class="form-control" placeholder="  Award">
                                </div>
                            </div>
                        </div>
                <?php }
                } ?>

                <div class="row">

                    <div class="col-md-12 mt-3">
                        <label for="mediaProfessional1">Academic distinctions/awards, if any</label>
                        <textarea class="form-control" name="academic_awards" id="academic_awards" cols="35"><?= isset($personalInfo) ? $personalInfo['academic_awards'] : '' ?></textarea>
                    </div>

                </div>
                <div class="row">


                    <div class="col-md-12 mt-3">
                        <label for="mediaProfessional2">Extracurricular interests, hobbies, sports, etc</label>
                        <textarea class="form-control" name="extracurricular" id="extracurricular" cols="35"><?= isset($personalInfo) ? $personalInfo['extracurricular'] : '' ?></textarea>
                    </div>
                </div>

                <hr>

                <h6>Work experience, if any <b>(including part-time)</b></h6>

                <!-- <div class="row">
                                                <div class="col-md-1"></div>
                                                <div class="col-md-3"><b><span class="mg-b-10">Organisation<span class="text-danger"></span></b> </div>
                                                <div class="col-md-2"><b> <span class="mg-b-10">Year <span class="text-danger"></span></b></div>
                                                <div class="col-md-2"><b><span class="mg-b-10">Title<span class="text-danger"></span></b> </div>
                                                <div class="col-md-2"><b><span class="mg-b-10">Responsbilities<span class="text-danger"></span></b> </div>
                                            </div> -->
                <?php if (empty($educationInfo)) { ?>
                    <div class="row mt-3">

                        <div class="col-md-3">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Organisation<span class="text-danger"></span></b>
                                <input type="text" name="worked_organisation[]" autocomplete="off" class="form-control" placeholder="  Organisation">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Year<span class="text-danger"></span></b>
                                <input type="number" min="0" name="worked_year[]" autocomplete="off" class="form-control" placeholder="  Year">

                            </div>

                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Title<span class="text-danger"></span></b>
                                <input type="text" name="worked_title[]" autocomplete="off" class="form-control" placeholder="  Title">

                            </div>

                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <b><span class="mg-b-10"> Responsbilities<span class="text-danger"></span></b>
                                <input type="text" name="worked_responsibilities[]" autocomplete="off" class="form-control" placeholder="  Responsbilities">

                            </div>

                        </div>


                    </div>

                    <div class="row mt-3">



                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="worked_organisation[]" autocomplete="off" class="form-control" placeholder="  Organisation">

                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="number" min="0" name="worked_year[]" autocomplete="off" class="form-control" placeholder="  Year">

                            </div>

                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="worked_title[]" autocomplete="off" class="form-control" placeholder="  Title">

                            </div>

                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="worked_responsibilities[]" autocomplete="off" class="form-control" placeholder="  Responsbilities">

                            </div>

                        </div>


                    </div>

                    <div class="row mt-3">

                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="worked_organisation[]" autocomplete="off" class="form-control" placeholder="  Organisation">
                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="form-group">
                                <input type="number" min="0" name="worked_year[]" autocomplete="off" class="form-control" placeholder="  Year">

                            </div>

                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="worked_title[]" autocomplete="off" class="form-control" placeholder="  Title">

                            </div>

                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <input type="text" name="worked_responsibilities[]" autocomplete="off" class="form-control" placeholder="  Responsbilities">
                            </div>
                        </div>
                    </div>

                    <?php } else {
                    $workedCount = 0;
                    foreach ($educationInfo as $info) {
                        if ($info->worked_organisation) {
                    ?>


                            <div class="row mt-3">

                                <input type="hidden" name="workedChild[]" value="<?= $info->id ?>">


                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="text" name="worked_organisation[]" value="<?= $info->worked_organisation ? $info->worked_organisation : '' ?>" autocomplete="off" class="form-control" placeholder="  Organisation">
                                    </div>

                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <input type="number" min="0" name="worked_year[]" value="<?= $info->worked_year ? $info->worked_year : '' ?>" autocomplete="off" class="form-control" placeholder="  Year">
                                    </div>

                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="text" name="worked_title[]" value="<?= $info->worked_title ? $info->worked_title : '' ?>" autocomplete="off" class="form-control" placeholder="  Title">
                                    </div>

                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="text" name="worked_responsibilities[]" value="<?= $info->worked_responsibilities ? $info->worked_responsibilities : '' ?>" autocomplete="off" class="form-control" placeholder="  Responsbilities">
                                    </div>
                                </div>
                            </div>




                        <?php
                            $workedCount++;
                        }
                    }

                    for ($i = $workedCount; $i < 3; $i++) {
                        ?>
                        <div class="row mt-3">



                            <div class="col-md-3">
                                <div class="form-group">
                                    <input type="text" name="worked_organisation[]" autocomplete="off" class="form-control" placeholder="  Organisation">

                                </div>

                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <input type="text" name="worked_year[]" autocomplete="off" class="form-control" placeholder="  Year">

                                </div>

                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <input type="text" name="worked_title[]" autocomplete="off" class="form-control" placeholder="  Title">

                                </div>

                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <input type="text" name="worked_responsibilities[]" autocomplete="off" class="form-control" placeholder="  Responsbilities">
                                </div>
                            </div>
                        </div>
                <?php
                    }
                }
                ?>



                <!-- <div class="row d-flex justify-content-between">
                                            <div class="">
                                                <a href="#second" onclick="previewclick('second')" class="preview btn  btn-secondary ml-2 mr-2">Previous</a>
                                            </div>
                                            <div class="">
                                                <ul class="list-inline wizard mb-0">
                                                    <li class="next list-inline-item float-end">
                                                        <a href="#" id="draft_button" class="btn btn-primary mr-2" onclick="draftFunction('applicationForm3','draftVal3')">Save as Draft</a>
                                                    </li>
                                                    <li class="next list-inline-item float-end mr-2">
                                                        <button type="button" href="#" class="btn btn-secondary" id="nextBtn" onclick="submitForm3()">Save & Next</button>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div> -->
                <!-- </form> -->



















                <h5 class="mt-3">Other Info</h5>
                <div class="tab-pane" id="basictab4">
                    <!-- <form id="applicationForm4" method="POST" action="<?php echo base_url(); ?>ApplicationController/addApplication4" enctype="multipart/form-data"> -->

                    <div class="row">
                        <div class="col-md-12 mt-3">
                            <input type="hidden" name="applicationId" value="<?= (isset($personalInfo) ? $personalInfo['id'] : '') ?>">
                            <input type="hidden" name="otherId" value="<?= (isset($otherInfo) ? $otherInfo['id'] : '') ?>">

                            <input type="hidden" name="draft" class="draftVal4" value="1">
                            <input type="hidden" name="tab_status" class="tab_statusVal4" value="0">

                            <label for="mediaProfessional1">Name three leading media professionals and explain in a sentence or two, why they have impressed you:<span class="text-danger">*</span></label>
                            <textarea class="form-control textarea" name="media_professionals" required id="media_professionals" cols="35"><?= (isset($otherInfo) ? $otherInfo['media_professionals'] : '') ?> </textarea>
                        </div>

                        <div class="col-md-12 mt-4 ">
                            <label for="mediaProfessional3">Tell us in 100 words why you wish to be a journalist and why you think you will be good at it :<span class="text-danger">*</span></label>
                            <textarea class="form-control textarea" name="journalist_reason" required id="journalist_reason"><?= (isset($otherInfo) ? $otherInfo['journalist_reason'] : '') ?></textarea>
                        </div>

                        <div class="col-md-12 mt-4  mb-3">
                            <label for="mediaProfessional2">Has any of your work been published/broadcast/podcast? If yes, specify:</label>
                            <textarea class="form-control textarea" name="broadcast_podcast" id="broadcast_podcast"><?= (isset($otherInfo) ? $otherInfo['broadcast_podcast'] : '') ?></textarea>
                        </div>

                    </div>

                    <!-- <div class="row d-flex justify-content-between">
                                            <div class="">
                                                <a href="#third" onclick="previewclick('third')" class="preview btn  btn-secondary ml-2 mr-2">Previous</a>
                                            </div>
                                            <div class="">
                                                <ul class="list-inline wizard mb-0">
                                                    <li class="next list-inline-item float-end">
                                                        <a href="#" id="draft_button" class="btn btn-primary mr-2" onclick="draftFunction('applicationForm4','draftVal4')">Save as Draft</a>
                                                    </li>
                                                    <li class="next list-inline-item float-end mr-2">
                                                        <button type="button" id="nextBtn" class="btn btn-secondary next-button" onclick="submitForm4()">Save & Next </button>
                                                    </li>
                                                </ul>
                                            </div>


                                        </div> -->
                    <!-- </form> -->







                    <h5>Accommodation Info</h5>
                    <br>
                    <div class="tab-pane" id="basictab5">
                        <!-- <form id="applicationForm5" method="POST" action="<?php echo base_url(); ?>ApplicationController/addApplication5" enctype="multipart/form-data"> -->

                        <div class="row mt-2">

                            <input type="hidden" name="applicationId" value="<?= (isset($personalInfo) ? $personalInfo['id'] : '') ?>">
                            <input type="hidden" name="accomodationId" value="<?= (isset($accomodation_info) ? $accomodation_info['id'] : '') ?>">

                            <input type="hidden" name="draft" class="draftVal5" value="1">
                            <input type="hidden" name="tab_status" class="tab_statusVal5" value="0">

                            <div class="col-md-12"> <b class="h6">Will you need residential accommodation?</b> </div>
                            <div class="col-md-12">(Air-conditioned residential accommodation for students on room sharing basis including food is available on the college campus and the Residential Annexe)</div>
                            <div class="col-md-12 mb-3">
                                <div class="form-group col-5 mt-2">
                                    <select class="form-control select2-with-search" name="residential_accommodation">
                                        <option value="">--select--</option>
                                        <option value="1" <?= (isset($accomodation_info) && $accomodation_info['residential_accommodation'] == 1 ? 'selected' : '') ?>>YES</option>
                                        <option value="0" <?= (isset($accomodation_info) && $accomodation_info['residential_accommodation'] == 0 ? 'selected' : '') ?>>NO</option>
                                    </select>

                                    <span class="text-danger mt-1"></span>

                                </div>
                            </div>

                            <!-- <div class="p-3"></div> -->
                            <div class="p-3 ">
                                <?php //isset($personalInfo) ? $personalInfo['application_fees'] : '' 
                                ?>
                                <p class="h6">Application Fee</p>The prescribed application fee of <b> Rs 2360/- </b> (inclusive of GST @ 18%) can be paid either as an online transfer or in the form of Demand Draft. Candidates applying for both programmes need to pay only one application fee.
                            </div>
                            <div class="row">
                                <div class="col-12 ps-3">
                                    <div class="card p-3">
                                        <div class="card-body border ps-4">
                                            <div>SC/ST applicants are exempt from the application fee on production of their community certificates. If yes please upload the community certificate.</div>
                                            <div class="p-3">

                                                <input type="radio" class="form-check-input p-2 application_fee_checked" name="application_fee_checked" value="1" <?= (isset($accomodation_info) && $accomodation_info['application_fee_checked'] == 1 ? 'checked' : '') ?> onclick="toggleCardVisibility(event)" id="yes"> <label for="yes" class="mr-4">Yes</label>&nbsp; &nbsp; &nbsp;
                                                <input type="radio" class="form-check-input p-2 application_fee_checked" name="application_fee_checked" value="0" <?= (isset($accomodation_info) && $accomodation_info['application_fee_checked'] == 0 ? 'checked' : '') ?>  onclick="toggleCardVisibility(event)" id="no"> <label for="no">No</label>
                                            </div>

                                         <?php if( $personalInfo['community_certificate'] !="" ) { ?>

                                            <img style="height: 150px;width:120px;"  src="<?=   $personalInfo['community_certificate']?>" />

                                       <?php   }  ?>

                                            

                                            <!-- <div class="p-3">
                                                                <label for="yes">Yes</label> 
                                                                <input type="radio" class="form-check-input p-2" name="application_fee_checked" value="1" <?= (isset($accomodation_info) && $accomodation_info['application_fee_checked'] == 1 ? 'checked' : '') ?> onclick="toggleCardVisibility(event)" id="yes"> 
                                                                &nbsp; &nbsp; &nbsp;
                                                                <label for="no">No</label>
                                                                <input type="radio" class="form-check-input p-2" name="application_fee_checked" value="0" <?= (isset($accomodation_info) && $accomodation_info['application_fee_checked'] == 0 ? 'checked' : '') ?> onclick="toggleCardVisibility(event)" id="no"> 
                                                            </div> -->

                                        </div>
                                        <div class="card-body border mt-3    <?= (isset($accomodation_info) && $accomodation_info['application_fee_checked'] == 0 ? 'd-none' : '') ?>"  id="myCard">
                                            <div>Upload community certificate, if not uploaded already.</div>
                                            <div class="my-2"><input name="community_certificate" id="community_certificate" value="" class="form-control" type="file">
                                                <input name="oldcommunity_certificate" id="oldcommunity_certificate" value="<?= isset($accomodation_info) ? $accomodation_info['community_certificate'] : '' ?>" class="form-control" type="hidden">
                                            </div>

                                            <span class="text-danger mt-1"></span>
                                        </div>
                                    </div>
                                </div>

                                <!-- <div class="col-md-12 ">
                                                    
                                                </div> -->
                            </div>
                        </div>
                        <div class=""><b>PAYMENT MODE </b></div>

                        <div class="row mb-3">
                            <div class="col-6">
                                <div class="card-body border">
                                    <div class="p-3">
                                        <input type="radio" class="form-check-input mr-5 pr-5" name="payment_mode" id="online" <?= $accomodation_info['payment_mode'] == 1 ? 'checked' : '' ?> value="1" onclick="togglePaymentDiv(event)">
                                        <label>Online</label>
                                    </div>
                                    <div class="p-3">
                                        <input type="radio" class="form-check-input" <?= $accomodation_info['payment_mode'] == 0 ? 'checked' : '' ?> name="payment_mode" value="0" onclick="togglePaymentDiv(event)">
                                        <label>Demand Draft</label>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="card-body border" id="paymentDiv">
                                    Payment should be made in the form of Demand Draft in favour of "Media Development Foundation", payable at Chennai with your reference number, full name and address written on the back of the DD. </div>

                            </div>
                        </div>
                        <hr>
                        <div class=" d-flex justify-content-between">

                            <div class=" border preview mb-3 ps-5">
                                <div class="mt-1 p-2 ">On submitting the application form you will receive an acknowledgement email.</div>
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="form-group">
                                <b><span class="mg-b-10">Payment Status <span class="text-danger">*</span></b> <br>
                                <select class="form-control select2-with-search" name="payment_status_select" onchange="getCourse(event)">
                                    <option value="">--select--</option>
                                    <option value="2" <?= isset($personalInfo) && $personalInfo['payment_status'] == 2 ? 'selected' : '' ?>>Paid </option>
                                    <option value="1" <?= isset($personalInfo) && $personalInfo['payment_status'] == 1 ? 'selected' : '' ?>>Not Paid</option>
                                    <!-- <option value="" <?= isset($personalInfo) && $personalInfo['payment_status'] == 0 ? 'selected' : '' ?>>Draft</option> -->
                                </select>


                            </div>

                        </div>

                        <div class="row p-3">
                            <input type="checkbox" id="self_certificationCheckbox" name="self_certification" <?= ($accomodation_info['self_certification'] == 1 ? 'checked' : '') ?>> <label class="ml-3 pl-3 mt-2"> &nbsp; I hereby declare that the information given above is true to the best of my knowledge.</label>

                        </div>



                        <input type="hidden" id="draft" name="draft" value="">

                        <ul class="list-inline wizard mb-0">
                            <!-- <li class="previous list-inline-item">
                                                        <a href="#" class="btn btn-secondary" id="prevBtn">Previous</a>
                                                    </li> -->



                        </ul>
                        <div class="form-group d-flex justify-content-end mt-5 ">
                            <!-- <div class="">
                                                <a href="#fourth" onclick="previewclick('fourth')" class="preview btn  btn-secondary ml-2 mr-2">Previous</a>
                                            </div> -->
                            <div class="">
                                <!-- <a href="<?php echo base_url(); ?>applicationController/preview" id="preview" value="1" onclick="preview()" class="preview btn  btn-primary ml-2 mr-2">Preview</a> -->

                                <!-- <button id="preview" type="submit" value="" onclick="submit_form()" class="preview btn  btn-primary ml-2 mr-2">Preview</button>
                                                <input type="hidden" id="preview_clicked" value="" name="preview_clicked"> -->
                                <button type="submit" href="javascript:void(0)" onclick="submit_form()" class="btn btn-danger">Submit</button>
                            </div>
                        </div>


                    </div> <!-- tab-content -->
                </div> <!-- end #rootwizard-->
            </form>


        </div> <!-- end card-body -->
    </div>
</div>


<div class="modal fade" id="self_certificationModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title text-danger" id="exampleModalLongTitle">Alert</h3>

            </div>
            <div class="modal-body justify-content-center">

                <b>Agree to:</b>" I hereby declare that the information given above is true to the &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;best of my knowledge."
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal" onclick="closeModal('self_certificationModal')">Close</button>
            </div>
        </div>
    </div>
</div>



<script>
    
    // var preview = ('#preview').val();
    // alert(preview);

    var formSaved = false;
    window.addEventListener('beforeunload', function(e) {
        if (!formSaved) {
            // Cancel the event
            e.preventDefault();
            // Chrome requires returnValue to be set
            e.returnValue = '';

            // Show the confirmation message
            var confirmationMessage = 'You have unsaved changes. Are you sure you want to leave?';
            e.returnValue = confirmationMessage; // For some browsers
            return confirmationMessage; // For others
        }
    });
</script>

<script>
    function previewclick(event) {

        if (event == 'first') {
            $('#secondHeader').removeClass('active');
            $('#firstHeader').addClass('active');

            $('#second').removeClass('active show');
            $('#first').addClass('active show');
        } else if (event == 'second') {
            $('#thirdHeader').removeClass('active');
            $('#secondHeader').addClass('active');

            $('#third').removeClass('active show');
            $('#second').addClass('active show');
        } else if (event == 'third') {
            $('#fourthHeader').removeClass('active');
            $('#thirdHeader').addClass('active');

            $('#fourth').removeClass('active show');
            $('#third').addClass('active show');
        } else if (event == 'fourth') {
            $('#fifthHeader').removeClass('active');
            $('#fourthHeader').addClass('active');

            $('#fifth').removeClass('active show');
            $('#fourth').addClass('active show');
        }

    }


    document.addEventListener("DOMContentLoaded", function() {
        let previewClicked = false;

        const applicationForm = document.querySelector('#applicationForm5');

        document.getElementById("preview").addEventListener('click', function(event) {
            document.getElementById("preview_clicked").value = "1";
            previewClicked = true;
        });

        applicationForm.addEventListener('submit', function(event) {
            event.preventDefault();

            if ($('#applicationForm5').valid()) {
                if (previewClicked || $('#self_certificationCheckbox').is(':checked')) {
                    applicationForm.submit(); // Submit the form
                } else {
                    $('#self_certificationModal').modal('show');
                }
            }

            previewClicked = false;
        });
    });

    function preview() {
        formSaved = true;
    }

    function submit_form() {
        formSaved = true;
        $('#applicationForm5').submit();

    }





    // var form1Val = 0;

    function draftFunction(formId, draftInputClass) {
        $('.' + draftInputClass).val('0');
        formSaved = true;
        if ($('#' + formId).valid()) {
            $('#' + formId).submit();

        } else {
            $('#' + formId).submit();
        }
    }

    function submitForm1() {
        $('.tab_statusVal1').val('1');
        if ($('#applicationForm1').valid()) {
            formSaved = true;

            var image = $('#check_image').val();
            var oldPhoto = $('#oldPhoto').val();
            if (oldPhoto != '') {
                $('#applicationForm1').submit();
            } else if (image == 1) {

                $('#applicationForm1').submit();
            } else {
                alert('Image field is Mandatory .Please Upload Image !!');
            }

        }
    }


    function submitForm2() {
        if ($('#applicationForm2').valid()) {
            $('.tab_statusVal2').val('1');
            formSaved = true;
            $('#applicationForm2').submit();
        }
    }

    function submitForm3() {
        if ($('#applicationForm3').valid()) {
            $('.tab_statusVal3').val('1');
            formSaved = true;
            $('#applicationForm3').submit();
        }
    }

    function submitForm4() {
        if ($('#applicationForm4').valid()) {
            $('.tab_statusVal4').val('1');
            formSaved = true;
            $('#applicationForm4').submit();
        }
    }

    function submitFormCommon(formId, tabStatusClass) {
        alert($('#' + formId).valid());
        if ($('#applicationForm5').validate()) {
            $('.' + tabStatusClass).val('1');
            formSaved = true;
            $('#' + formId).submit();
        }
    }


    // $(document).ready(function() {
    //     var tab = '<?= $this->input->get('tab5') ?>';
    //     if (tab == 5) {
    //         $('#fifthHeader').addClass('active');
    //         $('#fifth').addClass('active show');
    //         $('#firstHeader').removeClass('active');
    //         $('#first').removeClass('active show');
    //     }

    // });

    $(document).ready(function() {
  
        $('.summernote').summernote({
            height: 100, // set editor height
            minHeight: null, // set minimum height of editor
            maxHeight: null, // set maximum height of editor
            focus: true, // set focus to editable area after initializing summernote
            callbacks: {
                onChange: function(contents, $editable) {
                    $('#media_professionals').val(contents).trigger('change');

                    $("#applicationForm4").validate().element("#media_professionals");
                }
            }
        });
        var form4 = $('form[id="applicationForm4"]');


        // $.validator.addMethod("wordRange", function(value, element, params) {
        //     var numberOfWords = value.match(/\b[-?(\w+)?]+\b/gi) ? value.match(/\b[-?(\w+)?]+\b/gi).length : 0;
        //     // alert(numberOfWords);
        //     return this.optional(element) || (numberOfWords <= 100);
        // }, $.validator.format("Your response should be in 100 words."));



        $('#applicationForm4').validate({
            ignore: ':hidden:not(textarea)',
            rules: {

                media_professionals: {
                    required: true,
                },

                journalist_reason: {
                    required: true,
                    // wordRange: {
                    //     // min: 100,
                    //     max: 100
                    // }, // Applying the updated validation rule
                },
                communijournalist_reasonty_certificate: {
                    required: true,
                    maxlength: 100,
                },


            },
            messages: {
                media_professionals: {
                    required: 'This Field  is required',
                },
                journalist_reason: {
                    required: 'This field is required',
                    // wordRange: 'Please enter less than 100  words',
                },



            },
            errorPlacement: function(label, element) {
                label.addClass('mt-2 text-danger');
                if (element.hasClass('form-select') && element.next('.select2-container').length) {
                    label.insertAfter(element.next('.select2-container'));
                } else {
                    // Use append to insert the error message after the select element
                    label.appendTo(element.parent());
                }
            },
            highlight: function(element, errorClass) {
                $(element).parent().addClass('has-danger ')
                $(element).addClass('form-control form-control-danger')
            },
            unhighlight: function(element) {
                $(element).parent().removeClass('has-danger ')
                $(element).parent().removeClass('form-control form-control-danger')
            },

            submitHandler: function(form) {
                form.submit();

                $('#fifthHeader').removeClass('active');
                $('#fourthHeader').addClass('active');

                $('#fifth').removeClass('active show');
                $('#fourth').addClass('active show');


            }
        });


        var form = $('form[id="applicationForm1"]');


        form.validate({
            rules: {
                // mobile: {
                //     required: true,
                //     maxlength: 10,
                //     minlength: 10
                // },
                rules: {
                    photo: {
                        imageRequired: true
                    },
                },


                email: 'required',
                country_code: 'required',
                communication_address: 'required',
                dob: 'required',
                // photo: {
                //     required: function() {
                //         // Check if oldPhoto is empty and photo is empty
                //         return $('#oldPhoto').val() == '' && $('#photo').val() == '';
                //     }
                // },
                gender: 'required',
                first_name: 'required',
                last_name: 'required',
                application_fee: 'required',
                course_id: 'required',
                cuntry: 'required',
                state: 'required',
                city: 'required',
                pincode: 'required',


            },
            messages: {
                mobile: {
                    required: 'Mobile number is required',
                    maxlength: 'Must be 10 digits'
                },

                photo: "Please upload an image.",
                email: 'Email is required',
                email: 'Enter a valid email',
                cuntry: 'Country is required',
                state: 'State is required',
                city: 'City is required',
                pincode: 'Pincode is required',
                country_code: 'Country Code is required',
                communication_address: 'Address is required',
                dob: 'Date of Birth is required',
                gender: 'Gender is required',
                first_name: 'First Name is required',
                last_name: 'Last Name is required',
                application_fee: 'Application Fees is required',
                course_id: 'Course Name is required',
            },
            errorPlacement: function(label, element) {
                label.addClass('mt-2 text-danger');
                if (element.hasClass('form-select') && element.next('.select2-container').length) {
                    label.insertAfter(element.next('.select2-container'));
                } else {
                    // Use append to insert the error message after the select element
                    label.appendTo(element.parent());
                }
            },
            highlight: function(element, errorClass) {
                $(element).parent().addClass('has-danger small')
                $(element).addClass('form-control form-control-sm-danger')
            },
            unhighlight: function(element) {
                $(element).parent().removeClass('has-danger small')
                $(element).parent().removeClass('form-control form-control-sm-danger')
            },
            submitHandler: function(form) {
                form.submit();

            }
        });





        var form2 = $('form[id="applicationForm2"]');


        form2.validate({


            rules: {
                annual_income_rs: 'required',
                father_name: 'required',
                father_occupation: 'required',
                father_home_address: 'required',
                // father_home_landline: 'required',
                // father_home_mobile: 'required',
                father_home_email: 'required',
                father_office_address: 'required',
                // father_office_landline: 'required',
                // father_office_mobile: 'required',
                father_office_email: 'required',
                // mother_name:'required',
                // mother_occupation: 'required',
                // mother_home_addressss:'required',
                // mother_home_land_line:'required',
                // mother_home_mobile:'required',
                // mother_home_email:'required',
                // mother_office_address:'required',
                // mother_office_land_line:'required',
                // mother_office_mobile:'required',
                // mother_office_email:'required'
            },
            messages: {
                annual_income_rs: 'Annual Income is required',
                father_name: 'Father name is required',
                father_occupation: ' Father Occupation is required',
                // father_home_landline: 'landline is required',
                // mother_occupation: 'Mother Occupation is required',
                father_home_mobile: {
                    required: 'Mobile number is required',
                    maxlength: 'Maximum 10 digits'
                },
                father_home_email: 'Father email required',
                // mother_name:'mother name is required',
                // mother_occupation:'mother occupation is required',
                father_home_address: 'Address is required',
                // mother_home_land_line:'landline required',
                // mother_home_mobile:{
                //     required: 'Mobile number is required',
                //     maxlength: 'Maximum 10 digits'
                // },
                // mother_home_email:'email is required',
                father_office_address: 'Address is required',
                // father_office_land_line: 'landline is required',
                father_office_mobile: {
                    required: 'Mobile number is required',
                    maxlength: 'Maximum 10 digits'
                },
                father_office_email: 'Email is requied',


            },
            errorPlacement: function(label, element) {
                label.addClass('mt-2 text-danger');
                if (element.hasClass('form-select') && element.next('.select2-container').length) {
                    label.insertAfter(element.next('.select2-container'));
                } else {
                    // Use append to insert the error message after the select element
                    label.appendTo(element.parent());
                }
            },
            highlight: function(element, errorClass) {
                $(element).parent().addClass('has-danger small')
                $(element).addClass('form-control form-control-sm-danger')
            },
            unhighlight: function(element) {
                $(element).parent().removeClass('has-danger small')
                $(element).parent().removeClass('form-control form-control-sm-danger')
            },
            submitHandler: function(form) {
                form.submit();

            }
        });


        var form3 = $('form[id="applicationForm3"]');



        form3.validate({
            rules: {
                'education_institution[]': { // Assuming the name attribute is education_institution[]
                    required: true
                },
                'education_year[]': 'required',
                'education_subject[]': 'required',
                'education_degree[]': 'required',
                'education_marks[]': 'required',

                'higher_secondary_name[]': 'required',
                'higher_secondary_year[]': 'required',
                'higher_school_education_boards[]': 'required',
                'higher_secondary_marks[]': 'required',

                'high_school_name[]': 'required',
                'high_school_year[]': 'required',
                'educational_boards[]': 'required',
                'high_school_marks[]': 'required',



            },
            messages: {
                'education_institution[]': {
                    required: 'Insitute name  is required'
                },
                'education_year[]': 'Year is required',
                'education_subject[]': 'Main subject is required',
                'education_degree[]': 'Degree is required',
                'education_marks[]': 'Mark   is required',

                'higher_secondary_name[]': 'Higher Secondary  name is required',
                'higher_secondary_year[]': 'Year is required',
                'higher_school_education_boards[]': 'Board is required',
                'higher_secondary_marks[]': 'Mark   is required',

                'high_school_name[]': 'School name is required',
                'high_school_year[]': 'Year is required',
                'educational_boards[]': 'Board is required',
                'high_school_marks[]': 'Mark   is required',


            },
            errorPlacement: function(label, element) {
                label.addClass('mt-2 text-danger');
                if (element.hasClass('select2') && element.next('.select2-container').length) {
                    label.insertAfter(element.next('.select2-container'));
                } else {
                    label.insertAfter(element);
                }
            },
            highlight: function(element, errorClass) {
                $(element).addClass('is-invalid'); // Use Bootstrap's is-invalid class or your own
            },
            unhighlight: function(element, errorClass) {
                $(element).removeClass('is-invalid');
            },
            submitHandler: function(form) {
                form.submit();
            }
        });

        var form5 = $('form[id="applicationForm5"]');


        form5.validate({
            rules: {
                residential_accommodation: {
                    required: true,


                },
                application_fee_checked: {
                    required: true,


                },
                community_certificate: {
                    required: true,
                },
                payment_mode: 'required',

            },
            messages: {
                residential_accommodation: {
                    required: 'This Field  is required',
                },
                application_fee_checked: {
                    required: 'This Field is required',
                },
                community_certificate: {
                    // required: 'This Field is required',
                    required: function() {
                        // Check if oldPhoto is empty and photo is empty
                        return $('#oldcommunity_certificate').val() == '' && $('#community_certificate').val() == '';
                    }
                },
                payment_mode: {
                    required: 'This Field is required',
                },

            },
            errorPlacement: function(label, element) {
                label.addClass('mt-2 text-danger');
                if (element.hasClass('form-select') && element.next('.select2-container').length) {
                    label.insertAfter(element.next('.select2-container'));
                } else {
                    // Use append to insert the error message after the select element
                    label.appendTo(element.parent());
                }
            },
            highlight: function(element, errorClass) {
                $(element).parent().addClass('has-danger ')
                $(element).addClass('form-control form-control-danger')
            },
            unhighlight: function(element) {
                $(element).parent().removeClass('has-danger ')
                $(element).parent().removeClass('form-control form-control-danger')
            },
            submitHandler: function(form) {



                if ($('#self_certificationCheckbox').is(':checked')) {

                    $('.tab_statusVal5').val('1');
                    // $('#applicationForm5').submit();

                    form.submit();

                } else {

                    // $('#self_certificationModal').modal('show')

                }

            }
        });

    });








    function getCourse(event) {
        var id = event.target.value;

        if (id) {
            var url = "<?php echo base_url(); ?>ApplicationController/getFees/" + id;
            $.ajax({
                type: 'GET',
                url: url,
                contentType: false,
                processData: false,
                success: function(data) {
                    // Assuming 'data' is the base amount of fees
                    var baseAmount = parseFloat(data);
                    var totalAmount = baseAmount;

                    $('#applicationfee').val(totalAmount);
                    $('#cousrsefee').text('Course Fees :' + totalAmount);
                },
                error: function(data) {
                    console.log(data);
                }
            });
        } else {
            $('#applicationfee').val('')

        }
    }

    function getcountrycode(event) {

        var selectedOption = $('#cuntry option:selected');
        var id = selectedOption.data('info');


        if (id) {
            var url = "<?php echo base_url(); ?>ApplicationController/getCuntryCode/" + id;
            $.ajax({
                type: 'GET',
                url: url,
                contentType: false,
                processData: false,
                success: function(data) {
                    $('#mobile').val(data)
                },
                error: function(data) {
                    console.log(data);
                }
            });
        } else {
            $('#applicationfee').val('')

        }
    }



    function setPreview() {


        const file = $('#photo')[0].files[0];
        if (file) {

            const reader = new FileReader();
            reader.onload = function(e) {
                $('#previewImg').attr('src', e.target.result);
            }
            reader.readAsDataURL(file);

            var image = $('#check_image').val('1');
        }


    }

    // function setPreview() {

    //     var fileInput = document.getElementById('photo');
    //     var file = fileInput.files[0];
    //     var validator = $("#applicationForm1").validate(); // Ensure your form ID is correct

    //     // Preview the image
    //     if (file) {
    //         var reader = new FileReader();
    //         reader.onload = function(e) {
    //             $('#previewImg').attr('src', e.target.result);
    //         };
    //         reader.readAsDataURL(file);
    //     }

    //     // Trigger validation manually for the photo input
    //     validator.element("#photo");
    // }

    // // Bind the setPreview function to the change event of the file input
    // $('#photo').change(setPreview);





    document.addEventListener('DOMContentLoaded', function() {
        const form = document.getElementById('stepForm');
        const steps = form.querySelectorAll('.step');
        const prevButtons = form.querySelectorAll('.prev');
        const nextButtons = form.querySelectorAll('.next');
        const submitButton = form.querySelector('.submit');
        const reviewName = document.getElementById('reviewName');
        const reviewEmail = document.getElementById('reviewEmail');

        let currentStep = 1;

        function showStep(step) {
            steps.forEach((stepElement) => {
                stepElement.style.display = 'none';
            });

            steps[step - 1].style.display = 'block';
        }

        function updateReview() {
            const name = form.querySelector('[name="name"]').value;
            const email = form.querySelector('[name="email"]').value;

            reviewName.textContent = name;
            reviewEmail.textContent = email;
        }

        function validateStep(step) {
            // Add your validation logic here
            if (step === 1) {
                const name = form.querySelector('[name="name"]').value;
                return name.trim() !== '';
            } else if (step === 2) {
                const email = form.querySelector('[name="email"]').value;
                return email.trim() !== '';
            }
            return true; // Default to true if no specific validation is needed
        }

        nextButtons.forEach((button) => {
            button.addEventListener('click', function() {
                if (validateStep(currentStep)) {
                    currentStep++;
                    showStep(currentStep);
                    if (currentStep === 3) {
                        updateReview();
                    }
                } else {
                    alert('Please fill in all required fields.');
                }
            });
        });

        prevButtons.forEach((button) => {
            button.addEventListener('click', function() {
                currentStep--;
                showStep(currentStep);
            });
        });

        submitButton.addEventListener('click', function() {
            // Add your final submission logic here
            alert('Form submitted successfully!');
        });

        showStep(currentStep);
    });


    $(document).ready(function() {

        var certificateDiv = '<?= $personalInfo['apply_scholarship'] ?>';

        if (certificateDiv == 1) {
            $('#s_file').show();
        }


        // application fee div hide and show
        var application_fee_checked = '<?= $personalInfo['application_fee_checked'] ?>';

        var payment = $('#online').val();

        if (payment == 1) {
            $('#paymentDiv').html("Online payment can be made using Internet banking/credit or debit card/UPI");
        } else {
            $('#paymentDiv').html("Payment should be made in the form of Demand Draft in favour of 'Media Development Foundation', payable at Chennai with your reference number, full name, and address written on the back of the DD.");
        }






        $('#addressCheckbox').change(function() {
            // $('.hiddenDiv').toggle(!this.checked);
            if (this.checked) {

                var fatherAddress = $('#father_home_address').val();
                // alert(fatherAddress)
                $('.hiddenDiv').hide();
                $('.hiddenDiv2').removeClass('d-none');
                $('.hiddenDiv2').html(fatherAddress);
            } else {
                $('.hiddenDiv').show();
                $('.hiddenDiv2').addClass('d-none');

            }
        });

        $('#scholarship').change(function() {

            if (this.value == 0) {
                $('#s_file').hide();
            } else {
                $('#s_file').show();
            }
        });
    });


    function toggleCardVisibility(event) {
        // alert(event.target.value);
        var card1 = document.querySelector('#myCard');
        $('#myCard').removeClass('d-none');
        card1.style.display = event.target.value == '1' ? 'block' : 'none';
    }

    function togglePaymentDiv(event) {
        var paymentDiv = document.getElementById("paymentDiv");
        if (event.target.value == 1) {
            $('#paymentDiv').html("Online payment can be made using Internet banking/credit or debit card/UPI");
        } else if (event.target.value == 0) {
            $('#paymentDiv').html("Payment should be made in the form of Demand Draft in favour of 'Media Development Foundation', payable at Chennai with your reference number, full name, and address written on the back of the DD.");
        }
    }





    function convertNumberToWords(event) {
        // alert(event.target.value)

        var amount = event.target.value;
        var words = new Array();
        words[0] = '';
        words[1] = 'One';
        words[2] = 'Two';
        words[3] = 'Three';
        words[4] = 'Four';
        words[5] = 'Five';
        words[6] = 'Six';
        words[7] = 'Seven';
        words[8] = 'Eight';
        words[9] = 'Nine';
        words[10] = 'Ten';
        words[11] = 'Eleven';
        words[12] = 'Twelve';
        words[13] = 'Thirteen';
        words[14] = 'Fourteen';
        words[15] = 'Fifteen';
        words[16] = 'Sixteen';
        words[17] = 'Seventeen';
        words[18] = 'Eighteen';
        words[19] = 'Nineteen';
        words[20] = 'Twenty';
        words[30] = 'Thirty';
        words[40] = 'Forty';
        words[50] = 'Fifty';
        words[60] = 'Sixty';
        words[70] = 'Seventy';
        words[80] = 'Eighty';
        words[90] = 'Ninety';
        amount = amount.toString();
        var atemp = amount.split(".");
        var number = atemp[0].split(",").join("");
        var n_length = number.length;
        var words_string = "";
        if (n_length <= 9) {
            var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
            var received_n_array = new Array();
            for (var i = 0; i < n_length; i++) {
                received_n_array[i] = number.substr(i, 1);
            }
            for (var i = 9 - n_length, j = 0; i < 9; i++, j++) {
                n_array[i] = received_n_array[j];
            }
            for (var i = 0, j = 1; i < 9; i++, j++) {
                if (i == 0 || i == 2 || i == 4 || i == 7) {
                    if (n_array[i] == 1) {
                        n_array[j] = 10 + parseInt(n_array[j]);
                        n_array[i] = 0;
                    }
                }
            }
            value = "";
            for (var i = 0; i < 9; i++) {
                if (i == 0 || i == 2 || i == 4 || i == 7) {
                    value = n_array[i] * 10;
                } else {
                    value = n_array[i];
                }
                if (value != 0) {
                    words_string += words[value] + " ";
                }
                if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) {
                    words_string += "Crores ";
                }
                if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) {
                    words_string += "Lakhs ";
                }
                if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) {
                    words_string += "Thousand ";
                }
                if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) {
                    words_string += "Hundred and ";
                } else if (i == 6 && value != 0) {
                    words_string += "Hundred ";
                }
            }
            words_string = words_string.split("  ").join(" ");
        }
        $("#annual_income_words").val(words_string);
    }




    $(document).ready(function() {


        var tabstaus = '<?= $this->input->get('tab'); ?>';


        if (tabstaus == 'first') {

        } else if (tabstaus == 'second') {
            $('#firstHeader').removeClass('active');
            $('#secondHeader').addClass('active');

            $('#first').removeClass('active show');
            $('#second').addClass('active show');

            $('#firstHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#secondHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

        } else if (tabstaus == 'third') {
            $('#firstHeader').removeClass('active');
            $('#thirdHeader').addClass('active');

            $('#first').removeClass('active show');
            $('#third').addClass('active show');

            $('#firstHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#secondHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#thirdHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

        } else if (tabstaus == 'fourth') {
            $('#firstHeader').removeClass('active');
            $('#fourthHeader').addClass('active');

            $('#first').removeClass('active show');
            $('#fourth').addClass('active show');


            $('#firstHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#secondHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#thirdHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#fourthHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });
        } else if (tabstaus == 'fifth') {
            $('#firstHeader').removeClass('active');
            $('#fifthHeader').addClass('active');

            $('#first').removeClass('active show');
            $('#fifth').addClass('active show');

            $('#firstHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#secondHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#thirdHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#fourthHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });

            $('#fifthHeader').attr({
                'data-bs-toggle': 'tab',
                'data-toggle': 'tab'
            });
        }





        <?php foreach ($educationInfo as $info) {
            $educationTabStatus = $info->tab_status;
        } ?>

        var applicationTabStatus = '<?= $personalInfo['tab_status'] ?>';
        var parentTabStatus = '<?= $parentInfo['tab_status'] ?>';

        var educationTabStatus = '<?= $educationTabStatus ?>';

        var otherTabStatus = '<?= $otherInfo['tab_status'] ?>';
        var accomodationTabStatus = '<?= $accomodation_info['tab_status'] ?>';

        // if (applicationTabStatus == 0) {

        // } else if (parentTabStatus == 0) {
        //     $('#firstHeader').removeClass('active');
        //     $('#secondHeader').addClass('active');

        //     $('#first').removeClass('active show');
        //     $('#second').addClass('active show');

        //     $('#firstHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#secondHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        // } else if (educationTabStatus == 0) {
        //     $('#firstHeader').removeClass('active');
        //     $('#thirdHeader').addClass('active');

        //     $('#first').removeClass('active show');
        //     $('#third').addClass('active show');

        //     $('#firstHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#secondHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#thirdHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        // } else if (otherTabStatus == 0) {
        //     $('#firstHeader').removeClass('active');
        //     $('#fourthHeader').addClass('active');

        //     $('#first').removeClass('active show');
        //     $('#fourth').addClass('active show');


        //     $('#firstHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#secondHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#thirdHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#fourthHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });
        // } else if (accomodationTabStatus == 0 || accomodationTabStatus == 1) {
        //     $('#firstHeader').removeClass('active');
        //     $('#fifthHeader').addClass('active');

        //     $('#first').removeClass('active show');
        //     $('#fifth').addClass('active show');

        //     $('#firstHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#secondHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#thirdHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#fourthHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });

        //     $('#fifthHeader').attr({
        //         'data-bs-toggle': 'tab',
        //         'data-toggle': 'tab'
        //     });
        // }
    });
</script>