<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"></script>
<?php echo $this->Html->script('bootstrap-datetimepicker.min.js'); ?>
<?php echo $this->Html->script('bootstrap-datepicker.js'); ?>


<style>
    .icon-password {
        position: relative;
        display: table;
        border-collapse: separate;
    }

    label.error {
        position: absolute;
    }
</style>


<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-body">
                <div class="row">
                    <div class="col-md-4">
                        <h3 class="box-title no-margin"><?php echo __('&nbspStudent Registration Form'); ?></h3>
                    </div>

                    <div class="col-md-8">


                        <div class="row">

                            <div class="col-md-12 text-right">
                                <a href="<?php echo $this->Url->build('/student'); ?>"
                                   class="btn btn-success btn-flat btn-grid">
                                    <i class="fa fa-list"></i>
                                    <?php echo __('LIST'); ?>
                                </a>
                            </div>
                        </div>

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


<div class="container-fluid box box-primary">

    <ul class="nav nav-tabs">
        <?php if (!empty($check_lists)) { ?>
            <?php foreach ($check_lists as $check_list):
                $class = '';
                $disabled = '';
                if ($check_list['sequence'] == $Student['current_checklist_id']) {
                    $class = 'active';
                }
                if ($check_list['sequence'] > $Student['current_checklist_id']) {
                    $disabled = 'disabled';
                }
                ?>
                <!-- Nav tabs -->

                <li class="<?php echo $class . ' ' . $disabled ?> "><a
                            href="<?php echo '#' . (FORM_SEQUENCE)[$check_list['sequence']] ?>"
                            data-toggle="tab"><?php echo $check_list['name'] ?> </a></li>

            <?php endforeach;
        } ?>
    </ul>
    <!--            --><?php //= $this->Form->create($Student, ['id' => 'student_form', 'class'=> 'input-form-section']) ?>
    <!-- Tab panes -->
    <div class="tab-content" style="padding: 15px; border: 1px solid #ddd; border-top: none;">
        <?php if (!empty($check_lists)) { ?>
            <?php foreach ($check_lists as $check_list):
                $active_class = '';
                if ($check_list['sequence'] == $Student['current_checklist_id']) {
                    $active_class = 'in active';
                }
                ?>
                <div class="tab-pane fade <?php echo $active_class ?>"
                     id="<?php echo (FORM_SEQUENCE)[$check_list['sequence']] ?>">
                    <h4><?php echo $check_list['name'] ?> </h4>

                    <?php if ((FORM_SEQUENCE)[$check_list['sequence']] == 'First') { ?>
                        <?php echo $this->element('student_registration/application') ?>
                    <?php } ?>
                    <?php if ((FORM_SEQUENCE)[$check_list['sequence']] == 'Second') { ?>
                        <?php echo $this->element('student_registration/application_reference') ?>
                    <?php } ?>
                    <?php if ((FORM_SEQUENCE)[$check_list['sequence']] == 'Third') { ?>
                        <?php echo $this->element('student_registration/student_details') ?>
                    <?php } ?>
                    <?php if ((FORM_SEQUENCE)[$check_list['sequence']] == 'Fourth') { ?>
                        <?php echo $this->element('student_registration/offer_letter_form') ?>
                    <?php } ?>
                    <?php if ((FORM_SEQUENCE)[$check_list['sequence']] == 'Fifth') { ?>
                        <?php echo $this->element('student_registration/offer_letter_sent') ?>
                    <?php } ?>
                    <?php if ((FORM_SEQUENCE)[$check_list['sequence']] == 'Sixth') { ?>
                        <?php echo $this->element('student_registration/visa_letter_form') ?>
                    <?php } ?>
                    <?php if ((FORM_SEQUENCE)[$check_list['sequence']] == 'Seventh') { ?>
                        <?php echo $this->element('student_registration/visa_letter_sent') ?>
                    <?php } ?>
                </div>
            <?php endforeach;
        } ?>
    </div>
    <!--            --><?php //= $this->Form->end() ?>

</div>


<?php echo $this->element('tinymce_js'); ?>
<script>
    $(document).ready(function () {
        $('.nav-tabs li.disabled a').on('click', function (e) {
            e.preventDefault();
            return false;
        });
    });

</script>

