<div class="card-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    <h3 class="title modal-title"></h3>
</div>
<div id="form_input" class="card-body" disabled>

    <div class="form-group">
        <div class="row">
            <div class="col-md-12">
                <h4>Nama Karyawan</h4>
                <label><?= ((isset($data))?$data->nama_lengkap:'') ?></label>                
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="row">
            <div class="col-md-6">
                <h4>Cabang</h4>
                <label><?= ((isset($data))? $this->fungsi->get_nama_cab($data->id_cabang) : '') ?></label>   
            </div>
            <div class="col-md-6">
                <h4>Departemen</h4>
                <label><?= ((isset($data))? $this->fungsi->get_data_nama_dep($data->id_departemen) : '') ?></label>   
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="row">
            <div class="col-md-6">
                <h4>Jenis Izin</h4>
                <label><?= ((isset($data))?$data->nama_izin:'') ?></label>   
            </div>
            <div class="col-md-6">
                <h4>Jumlah Izin</h4>
                <label><?= ((isset($data))?$data->jml_izin:'') ?> Hari</label>   
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="row">
            <div class="col-md-6">
                <h4>Tanggal Pengajuan</h4>
                <label><?= ((isset($data))?  $this->fungsi->mysql_date_2_views($data->tgl_pengajuan) : '') ?></label>   
            </div>
            <div class="col-md-6">
                <h4>Periode Izin</h4>
                <label><?= ((isset($data))? $this->fungsi->format_date_strip($data->tgl_mulai_izin) : '')." s/d ".((isset($data))? $this->fungsi->format_date_strip($data->tgl_selesai_izin) : '') ?></label>   
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="row">
            <div class="col-md-12">
                <h4>Keterangan</h4>
                <label><?= ((isset($data))?$data->ket_izin:'') ?></label> 
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="row">
            <div class="col-md-12">
                <h4>Status</h4>
                <b><label><?= ((isset($data))? $this->fungsi->get_approval($data->status) : '') ?></label></b>
            </div>
        </div>
    </div>
     
     <div class="form-group">
        <div class="row">
            <div class="col-md-6">
                <?php 
                    if ($data->file != "") {
                        $file = $data->file;
                ?>
                 <h4>File</h4>
                <input type="file" name="file" id="file" id="input-file-now-custom-1" class="dropify file" data-default-file="<?= $file ?>" data-allowed-file-extensions="jpg png jpeg gif" disabled/>
                <?php
                    }
                ?>
            </div>
        </div>         
     </div>

</div>
<div class="card-footer">
    <div class="row">
        <div class="col-md-7 text-left">
            <div id="message"></div>
        </div>
        <div class="col-md-5 text-right">
            <button class="btn_save ladda-button" id="btn_save" data-style="expand-left"></button>
        </div>
    </div><!-- ./row -->
</div>

<script>
    $(document).ready(function() {
        // Basic
        $('.dropify').dropify();

        // Translated
        $('.dropify-fr').dropify({
            messages: {
                default: 'Glissez-déposez un fichier ici ou cliquez',
                replace: 'Glissez-déposez un fichier ou cliquez pour remplacer',
                remove: 'Supprimer',
                error: 'Désolé, le fichier trop volumineux'
            }
        });

        // Used events
        var drEvent = $('#input-file-events').dropify();

        drEvent.on('dropify.beforeClear', function(event, element) {
            return confirm("Do you really want to delete \"" + element.file.name + "\" ?");
        });

        drEvent.on('dropify.afterClear', function(event, element) {
            alert('File deleted');
        });

        drEvent.on('dropify.errors', function(event, element) {
            console.log('Has Errors');
        });

        var drDestroy = $('#input-file-to-destroy').dropify();
        drDestroy = drDestroy.data('dropify')
        $('#toggleDropify').on('click', function(e) {
            e.preventDefault();
            if (drDestroy.isDropified()) {
                drDestroy.destroy();
            } else {
                drDestroy.init();
            }
        })
    });
</script>  
 