<script type="text/javascript">
    $(document).ready(function() {
        $("#id_shift").select2({
            placeholder: "Pilih",
            allowClear: true,
            ajax: {
                url: '<?= route("dropdown.shift.nama")."/".$data->id_cabang ?>',
                dataType: 'json',
                delay: 250,
                processResults:function(data) {
                    return {
                            results: data
                        };
                },
                cache: false
            }
        });
    });
</script>

<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>
    <input type="hidden" id="id_shift_karyawan" class="form-control" value="<?= md5($data->id_shift_karyawan) ?>">

    <div class="form-group">
        <label>Nama Karyawan</label>
        <p class="font-weight-bold"><?= $data->nik." - ".$data->nama_karyawan ?></p>
    </div>
    <div class="form-group">
        <label>Tanggal</label>
        <p class="font-weight-bold"><?= date_format(date_create($data->tanggal),"d-m-Y") ?></p>
    </div>
    <div class="form-group">
        <label>Shift <i class="text-danger">*</i></label>
        <select id="id_shift"  class="form-control" class="select2 form-control" style="width:100%">
            <?php
                $jam_masuk  = date_format(date_create($data->jam_masuk),"H:i");
                $jam_pulang = date_format(date_create($data->jam_pulang),"H:i");
            ?>
            <option value="<?=$data->id_master_shift?>" selected><?= $data->kode_shift." - ".$data->nama_shift."(".$jam_masuk." - ".$jam_pulang.")" ?></option>
        </select>
    </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 id="btn_update" onclick="edit()" class="btn btn-warning ladda-button" data-style="expand-left">
                <i class="fa fa-edit (alias)"></i> PERBARUI
            </button>
        </div>
    </div>
</div>