<div class="row">
    <div class="col-sm-12 col-md-12">
        <div class="panel panel-bd">
            <div class="panel-heading">
                <div class="panel-title">
                    <h4><?php echo display('update') ?></h4>
                </div>
            </div>
            <div class="panel-body">

                <?php echo form_open_multipart('leave/Leave/update_leave_request/' . $data->leave_appl_id) ?>

                <input name="leave_appl_id" type="hidden" value="<?php echo $data->leave_appl_id ?>">

                <div class="form-group row">
                    <label for="employee_id" class="col-sm-2 col-form-label"> <?php echo display('employee_name') ?>
                        *</label>
                    <div class="col-sm-4">

                        <input type="text" name="employee_name" class="form-control"
                               value="<?php echo $this->session->userdata('first_name') . ' ' . $this->session->userdata('last_name'); ?>"
                               readonly>
                        <input type="hidden" name="employee_id" class="form-control"
                               value="<?php echo $this->session->userdata('employee_id'); ?>">

                    </div>
                    <label for="leave_type" class="col-sm-2 col-form-label">Select <?php echo display('leave_type') ?>
                        *</label>
                    <div class="col-sm-4">
                        <?php echo form_dropdown('leave_type_id', $type, (!empty($data->leave_type_id) ? $data->leave_type_id : null), 'class="form-control" onchange="leavetypechange(this.value)"') ?>
                        <span id="enjoy"></span><span id="checkleave"></span>
                    </div>
                    <input type="hidden" name="apply_date" class="form-control" id="f"
                           value="<?php echo $data->apply_date ?>">
                </div>
                <div class="form-group row">
                    <!-- for leave leave type -->

                    <label for="apply_strt_date" class="col-sm-2 col-form-label">
                        <?php echo display('apply_strt_date') ?>* </label>
                    <div class="col-sm-4">
                        <input type="text" name="apply_strt_date" class="dp form-control apply_start" id="apply_start"
                               placeholder="<?php echo display('apply_strt_date') ?>"
                               value="<?php echo $data->apply_strt_date ?>">
                    </div>
                    <label for="apply_end_date" class="col-sm-2 col-form-label">
                        <?php echo display('apply_end_date') ?>*</label>
                    <div class="col-sm-4">
                        <input type="text" name="apply_end_date" class="dp form-control apply_end" id="apply_end"
                               value="<?php echo $data->apply_end_date ?>"
                               placeholder="<?php echo display('apply_end_date') ?>">

                    </div>
                </div>

                <div class="form-group row">
                    <label for="apply_day" class="col-sm-2 col-form-label">
                        <?php echo display('apply_day') ?> </label>
                    <div class="col-sm-4">
                        <input type="text" name="apply_day" class="form-control apply_day" id="apply_day"
                               value="<?php echo $data->apply_day ?>" placeholder="<?php echo display('apply_day') ?>"
                               readonly>
                    </div>
                    <label for="apply_hard_copy" class="col-sm-2 col-form-label">
                        <?php echo display('apply_hard_copy') ?></label>
                    <div class="col-sm-4">
                        <input type="file" name="apply_hard_copy" class="form-control">
                        <input type="hidden" name="old_apply_hard_copy" value="<?php echo $data->apply_hard_copy ?>"
                               class="form-control">
                    </div>
                </div>
                <div class="form-group row">

                    <label for="reason" class="col-sm-2 col-form-label"><?php echo display('reason') ?></label>
                    <div class="col-sm-4">
                        <textarea name="reason" class="form-control"
                                  placeholder="<?php echo display('reason') ?>"><?php echo $data->reason; ?></textarea>
                    </div>

                    <label for="leave_time" class="col-sm-2 col-form-label"><?php echo "Leave Time" ?></label>
                    <div class="col-sm-4">
                        <select class="form-control" name="leave_time" id="leave_time" onchange="applyday(this);">
                            <option <?php echo  $data->leave_time == 1 ? "selected" : '' ?> value="1">Half Day</option>
                            <option <?php echo  $data->leave_time == 2 ? "selected" : '' ?> value="2">Full Day</option>
                            <option <?php echo  $data->leave_time == 3 ? "selected" : '' ?> value="3">Quarter Leave</option>
                        </select>
                    </div>

                </div>
                <div class="form-group row">
                    <div class="col-sm-4">
                        <input type="hidden" name="approve_date" class="form-control"
                               value="<?php echo date('Y-m-d') ?>">
                    </div>
                </div>
                <div class="form-group form-group-margin text-right">
                    <button type="reset" class="btn btn-primary w-md m-b-5"><?php echo display('reset') ?></button>
                    <button type="submit" class="btn btn-success w-md m-b-5"><?php echo display('update') ?></button>
                </div>
                <?php echo form_close() ?>

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

<script src="<?php echo base_url('assets/js/leave.js') ?>" type="text/javascript"></script>
