<?= $this->extend('template/layout') ?>

<?= $this->section('title') ?>Detail Data Nasabah - <?= env('app.name') ?><?= $this->endSection() ?>

<!-- main section start-->
<?= $this->section('main') ?>
<?php
    $uri      = current_url(true);
    $segment1 = $uri->setSilent()->getSegment(1);
    $segment2 = $uri->setSilent()->getSegment(2);
    $segment3 = $uri->setSilent()->getSegment(3);
?>
<!-- Breadcumb -->
<ol class="breadcrumb page-breadcrumb">
    <li class="breadcrumb-item"><a href="javascript:void(0);"><?= env('app.name') ?></a></li>
    <li class="breadcrumb-item"><?= ucfirst($segment1) ?></li>
    <li class="breadcrumb-item">Data Nasabah</li>
    <li class="breadcrumb-item">Detail</li>
    <li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
</ol>
<div class="row">
    <div class="col-xl-12">
        <div id="panel-1" class="panel">
            <div class="panel-hdr border-faded border-top-1 border-right-0 border-left-0 shadow-0">
                <h2>Detail Data Nasabah - <?= $nama_calon ?></h2>
                <div class="panel-toolbar pr-3">
                    <a href="<?= $back ?>" class="btn btn-secondary btn-sm"><i class="fal fa-arrow-left"></i> KEMBALI</a>
                </div>
            </div>

            <div class="panel-container show">
                <div class="panel-content">
                    <ul class="nav nav-tabs" role="tablist">
                        <li class="nav-item">
                            <a class="nav-link active" data-toggle="tab" href="#data-nasabah" role="tab">Data Nasabah</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" data-toggle="tab" href="#data-kegiatan" role="tab">Detail Kegiatan</a>
                        </li>
                    </ul>
                    
                    <div class="tab-content">
                        <!-- Tab 1: Data Nasabah -->
                        <div class="tab-pane fade show active" id="data-nasabah" role="tabpanel">
                            <div class="row mt-3">
                                <div class="col-12 col-sm-6">
                                    
                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">No CIF:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $no_cif ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Nama:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $nama_calon ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Tgl. Lahir:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= date('d/m/Y', strtotime($tgl_lahir)) ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Alamat:</label>
                                        <div class="col-9 col-sm-9">
                                            <textarea class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" rows="3" disabled><?= $alamat ?></textarea>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">No. WA:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $no_wa ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">NIK:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $nik ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Email:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $emailx ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Nama Ibu:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $maiden ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Pekerjaan:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $pekerjaan ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Keterangan:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $ket ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Tgl Closing:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= date('d/m/Y', strtotime($tgl_closing)) ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Referal:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $referal ?>" disabled>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-12 col-sm-6">
                                    
                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Foto KTP:</label>
                                        <div class="col-9 col-sm-9">
                                            <?php if (!empty($foto_ktp) && file_exists(ROOTPATH . 'public/fotoktp/' . $foto_ktp)) { ?>
                                                <div class="mb-2">
                                                    <img src="<?= base_url('fotoktp/' . $foto_ktp) ?>" alt="Foto KTP" class="img-thumbnail" style="max-width: 300px; max-height: 200px;">
                                                </div>
                                                <small class="text-muted"><?= $foto_ktp ?></small>
                                            <?php } else { ?>
                                                <span class="text-muted">Tidak ada foto</span>
                                            <?php } ?>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Foto Closing:</label>
                                        <div class="col-9 col-sm-9">
                                            <?php if (!empty($foto_closing) && file_exists(ROOTPATH . 'public/fotoclosing/' . $foto_closing)) { ?>
                                                <div class="mb-2">
                                                    <img src="<?= base_url('fotoclosing/' . $foto_closing) ?>" alt="Foto Closing" class="img-thumbnail" style="max-width: 300px; max-height: 200px;">
                                                </div>
                                                <small class="text-muted"><?= $foto_closing ?></small>
                                            <?php } else { ?>
                                                <span class="text-muted">Tidak ada foto</span>
                                            <?php } ?>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Foto Kegiatan:</label>
                                        <div class="col-9 col-sm-9">
                                            <?php if (!empty($foto_kegiatan) && file_exists(ROOTPATH . 'public/fotokegiatan/' . $foto_kegiatan)) { ?>
                                                <div class="mb-2">
                                                    <img src="<?= base_url('fotokegiatan/' . $foto_kegiatan) ?>" alt="Foto Kegiatan" class="img-thumbnail" style="max-width: 300px; max-height: 200px;">
                                                </div>
                                                <small class="text-muted"><?= $foto_kegiatan ?></small>
                                            <?php } else { ?>
                                                <span class="text-muted">Tidak ada foto</span>
                                            <?php } ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Tab 2: Detail Kegiatan -->
                        <div class="tab-pane fade" id="data-kegiatan" role="tabpanel">
                            <div class="row mt-3">
                                <div class="col-12 col-sm-6">
                                    
                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Nama Kegiatan:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $nama_giat ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Jenis:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $nama_kegiatan ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Lokasi:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $nama_lokasi ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Kategori:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $nama_kat ?>" disabled>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-12 col-sm-6">
                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Tgl. Mulai:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= date('d/m/Y', strtotime($tgl_1)) ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Tgl. Selesai:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= date('d/m/Y', strtotime($tgl_2)) ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Tgl. Kegiatan:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= date('d/m/Y', strtotime($tgl_kegiatan)) ?>" disabled>
                                        </div>
                                    </div>

                                    <div class="row mb-3">
                                        <label class="col-3 col-sm-3 col-form-label text-right">Produk:</label>
                                        <div class="col-9 col-sm-9">
                                            <input type="text" class="form-control rounded-0 border-top-0 border-left-0 border-right-0 px-0 bg-transparent" value="<?= $uraian ?>" disabled>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div><!-- end panel 1 -->
    </div><!-- end col-xl-6 -->
</div><!-- end row -->
<?= $this->endSection() ?>
<!-- main section end-->

<!-- pageScripts section start-->
<?= $this->section('pageScripts') ?>
<script type="text/javascript">
    // Tab functionality is handled by Bootstrap automatically
</script>
<?= $this->endSection() ?>
<!-- pageScripts section end-->
