<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><?= $this->lang->line('nama_dokumen') ?> <i class="text-danger">*</i></label><br>
                <p><?= ((isset($data)) ? $data->nama_dokumen : '') ?></p>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="row">
            <div class="col-12">
                <label>Upload File <i class="text-danger">*</i></label>
            </div>
            <div class="col-12">
                <?php
                if (empty($data->file)) {
                    $file = "";
                } else {
                    $file = $this->config->item('base_image') . 'imagebiodata?_t=file&_d=' . $data->file;
                }
                ?>
                <a href="<?= $file ?>" target="_blank"><img src="<?= $file ?>" style="max-width:450px;width:100%"></a>
            </div>
        </div>
    </div>

</div>
<div class="card-footer">
    <div class="row">
        <div class="col-md-6 text-left">
            <div id="message_modal"></div>
        </div>
        <div class="col-md-6 text-right">
            <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-close"></i> <?= $this->lang->line('button_form_tutup') ?></button>
        </div><!-- ./row -->
    </div>

    <script>
        $(document).ready(function() {
            $('.dropify').dropify(
                <?php if ($this->code_lang == 'id') { ?> {
                        messages: {
                            'default': 'Seret dan lepas atau klik disini',
                            'replace': 'Seret dan lepas atau klik disini',
                            'remove': 'Hapus',
                            'error': 'Ooops, terjadi kesalahaan.'
                        },
                        error: {
                            'fileSize': 'The file size is too big ({{ value }} max).',
                            'minWidth': 'The image width is too small ({{ value }}}px min).',
                            'maxWidth': 'The image width is too big ({{ value }}}px max).',
                            'minHeight': 'The image height is too small ({{ value }}}px min).',
                            'maxHeight': 'The image height is too big ({{ value }}px max).',
                            'imageFormat': 'Format file tidak diperbolehkan ({{ value }} only).'
                        }
                    }
                <?php } ?>
            );

            sertifikat = $('#form_input #file').dropify();

            sertifikat.on('dropify.afterClear', function(event, element) {
                $("#file_lama").val("");
            });

            sertifikat = $('#form_input #sertifikat').dropify();

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