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

<?= $this->section('title') ?>Detail Calon 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 Calon Nasabah</li>
    <li class="breadcrumb-item">Detail Calon Nasabah</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</h2>
                <div class="panel-toolbar pr-3">
                    
                </div>
            </div>

            <div class="panel-container show">
                <div class="panel-content">
                    <div class="row">
                        <div class="col-12 col-sm-6">
                            
                            <?= form_open("", 'id="calonasabah_form"', ['id' => $id]) ?>
                                <div class="row mb-3">
                                    <label class="col-3 col-sm-3 col-form-label text-right">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">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 class="row mb-3">
                                    <label class="col-3 col-sm-3 col-form-label text-right">Tanggal 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">Nama Calon:</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">Tanggal 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. WhatsApp:</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">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 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: 200px; 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 class="row mb-3">
                                    <label class="col-3 col-sm-3 col-form-label text-right">Closing:</label>
                                    <div class="col-9 col-sm-9">
                                        <?php if ($closing == 1) { ?>
                                            <div class="alert alert-success" role="alert">
                                                <strong>Sudah!</strong>
                                            </div>
                                        <?php } else { ?>
                                            <div class="alert alert-warning" role="alert">
                                                <strong>Belum!</strong>
                                            </div>
                                        <?php } ?>
                                    </div>
                                </div>
   
                                <hr>
                                <div class="clearfix">
                                    <a href="<?= $back ?>" class="btn btn-secondary">
                                        <i class="fal fa-arrow-left"></i> KEMBALI
                                    </a>
                                </div>
                            </form>

                        </div>
                        <div class="col-12 col-sm-6">
                            <div class="card">
                                <div class="card-header">Detail Kegiatan</div>
                                <div class="card-body">
                                    <div class="table-responsive">
                                        <table class="table table-bordered table-sm">
                                            <tr>
                                                <td><strong>Nama Kegiatan:</strong></td>
                                                <td><?= $nama_giat ?></td>
                                            </tr>
                                            <tr>
                                                <td><strong>Tanggal Mulai:</strong></td>
                                                <td><?= date('d/m/Y', strtotime($tgl_1)) ?></td>
                                            </tr>
                                            <tr>
                                                <td><strong>Tanggal Selesai:</strong></td>
                                                <td><?= date('d/m/Y', strtotime($tgl_2)) ?></td>
                                            </tr>
                                            <tr>
                                                <td><strong>Jenis Promosi:</strong></td>
                                                <td><?= $nama_kegiatan ?></td>
                                            </tr>
                                            <tr>
                                                <td><strong>Nama Lokasi:</strong></td>
                                                <td><?= $nama_lokasi ?></td>
                                            </tr>
                                            <tr>
                                                <td><strong>Kategori Lokasi:</strong></td>
                                                <td><?= $nama_kat ?></td>
                                            </tr>
                                        </table>
                                    </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') ?>
<?= $this->endSection() ?>
<!-- pageScripts section end-->
