<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">
                <label>Nama Perusahaan <i class="text-danger">*</i></label>
                <input type="text" id="nama" class="form-control" value="<?= ((isset($data))?$data->nama:'') ?>">
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <div class="col-md-12">
                <label>Deskripsi Perusahaan <i class="text-danger">*</i></label>
                <textarea id="deskripsi" class="form-control"><?= ((isset($data))?$data->deskripsi:'') ?></textarea>
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <div class="col-md-12">
                <label>Alamat Perusahaan <i class="text-danger">*</i></label>
                <textarea id="alamat" class="form-control"><?= ((isset($data))?$data->alamat:'') ?></textarea>
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <div class="col-md-6">
                <label>Logo Perusahaan <i class="text-danger">*</i></label>
                <?php 
                    $logo = $this->config->item('base_image').'image?_t=file&_d='.$data->url_logo;
                ?>
                <input type="file" name="file" id="file" id="input-file-now-custom-1" class="dropify file" data-default-file="<?= $logo ?>" data-allowed-file-extensions="jpg png jpeg gif" />
                <input type="hidden" name="file_lama" id="file_lama" value="<?= $data->url_logo ?>">
            </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 id="btn_new_input" class="btn" style="display:none">TAMBAH BARU</button>
            <button class="btn_save_profil ladda-button" id="btn_save_profil" data-style="expand-left"></button>
        </div>
    </div><!-- ./row -->
</div>

<script>
    $(document).ready(function() {
        dropify();
        
        file = $('#form_input #file').dropify();

        file.on('dropify.afterClear', function(event, element){
            $("#file_lama").val("");
        });
    });
</script>  