<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_m_group_product" class="card-body" disabled>
    <input type="hidden" id="id_product_group_m" class="form-control" value="<?= ((isset($data)) ? md5($data->id_product_group_m) : '') ?>">
    
    <div class="form-group">
        <label><?= $this->lang->line('kode_group_product') ?> <span class="text-danger">*</span></label>
        <input type="text" id="kode" class="form-control" placeholder="Inputkan kode group" value="<?= ((isset($data->kode)) ? $data->kode : '') ?>">
    </div>

    <div class="form-group">
        <label><?= $this->lang->line('nama_group_product') ?> <span class="text-danger">*</span></label>
        <input type="text" id="nama" class="form-control" placeholder="Inputkan nama group" value="<?= ((isset($data->nama)) ? $data->nama : '') ?>">
    </div>

    <?php if($this->fungsi->cek_adm_satu_grup() == false) : ?>
        <div class="form-group">
            <label><?= $this->lang->line('area_group_product'); ?> <span class="text-danger">*</span></label>
            <select class="form-control" id="id_group_m" style="width: 100%" <?= $disabled ?>>
                <?php echo '<option value="' . $data->id_group_m . '" selected>' . $data->kode_group_area . ' - ' . $data->nama_group_area . '</option>' ?>;
            </select>
        </div>
    <?php endif; ?>
</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_new_input_m_group_product" class="btn" style="display:none"><?= $this->lang->line('button_form_tambah_baru') ?></button>
            <button class="btn_save_m_group_product ladda-button" data-style="expand-left"></button>
        </div>
    </div><!-- ./row -->
</div>

<script>
    $(document).ready(function() {
        dropdown_group_area();
    });

    function dropdown_group_area(){
        $("#id_group_m").select2({
            placeholder: "<?= $this->lang->line('pilih_group_area'); ?>",
            allowClear: true,
            ajax: {
                url: '<?= route("sales_activity.master.dropdown.group.area") ?>',
                dataType: 'json',
                delay: 250,
                processResults: function(data) {
                    return {
                        results: data
                    };
                },
                cache: false
            }
        });
    }
</script>
