<!-- Content Wrapper. Contains page content -->
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script> -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Detail Cases
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> KLINIK</a></li>
            <li class="active">Detail Case Umum</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <?= $this->session->flashdata('message'); ?>
                <div class="box box-success" id="divHeadAction">
                    <div class="box-header with-border">
                        <h3 class="box-title">Status Pasien - <b> <?= $detailCaseUmum['Case Status']; ?> </b> (
                            <?php
                            extract($_GET);
                            $us = $this->db->query("SELECT * FROM Cases WHERE [Case ID] = '$case'")->row_array();
                            if ($us['UserCreated'] == '' || $us['UserCreated'] == NULL) {
                                echo "<i class='fa fa-desktop fa-fw'></i> Bridging";
                            } else {
                                echo "<i class='fa fa-user fa-fw'></i> " . $us['UserCreated'];
                            }
                            ?>
                            ) |
                    </div>
                    <div class="box-body">

                        <?php
                        extract($_GET);
                        if ($countCaseUmum > 0) {
                        ?>
                            <div class="row">
                                <div class="col-md-6">
                                    <table class="table table-striped">
                                        <tr>
                                            <th width="25%">
                                                <small>Case ID / MR</small>
                                            </th>
                                            <td width="5%">:</td>
                                            <td><small><?= $detailCaseUmum['Case ID']; ?> /
                                                    <?php
                                                    if ($detailCaseUmum['PatientCode'] == '') {
                                                        echo "OB, APS";
                                                    } else {
                                                    ?>
                                                        <!-- <a href="<?= base_url('sep/buatSep?nomr=' . $detailCaseUmum['PatientCode']); ?>"><?= $detailCaseUmum['PatientCode']; ?></a> -->
                                                        <?= $detailCaseUmum['PatientCode']; ?>
                                                    <?php
                                                    }
                                                    ?>
                                                </small></td>
                                        </tr>

                                        <tr>
                                            <th>
                                                <small>Nama</small>
                                            </th>
                                            <td>:</td>
                                            <td><small><?= $detailCaseUmum['Description']; ?>
                                                    (
                                                    <?php
                                                    $qK = $detailCaseUmum['PatientCode'];
                                                    $ptn = $this->db->query("SELECT * FROM Patient WHERE PatientCode = '$qK'")->row_array();

                                                    if ($ptn['Sex'] == 1) {
                                                        echo "P";
                                                    } else if ($ptn['Sex'] == 2) {
                                                        echo "L";
                                                    }
                                                    ?>
                                                    )
                                                </small></td>
                                        </tr>
                                        <tr>
                                            <th>
                                                <small>Tanggal Kunjungan</small>
                                            </th>
                                            <td>:</td>
                                            <td><small><?= date('d/m/Y', strtotime($detailCaseUmum['Intake Date'])) . ' ' . $detailCaseUmum['Intake Time']; ?>
                                                    <?php
                                                    if ($detailCaseUmum['Closed Date'] == '') {
                                                    } else {
                                                        echo " - " . date('d/m/Y', strtotime($detailCaseUmum['Closed Date'])) . ' ' . $detailCaseUmum['Closed Time'];
                                                    }
                                                    ?>
                                                </small>

                                                <!-- <a href="" data-toggle="modal" data-target="#editTanggal"><i class="fa fa-fw fa-edit"></i> Edit</a> -->

                                            </td>
                                        </tr>
                                        <tr>
                                            <th>
                                                <small>Pelayanan</small>
                                            </th>
                                            <td>:</td>
                                            <?php
                                            if ($detailCaseUmum['Category'] == "IP") {
                                                $room = "" . $detailCaseUmum['Room'];
                                                $layan = "R.Inap" . " (Time IP : " . $detailCaseUmum['IP Time'] . ")";
                                            } else {
                                                $room = "";
                                                $layan = "R.Jalan";
                                            }
                                            ?>
                                            <td>
                                                <small><?= $layan; ?>
                                                    <!-- <input type="checkbox" id="myCheck" onclick="myFunction()"> <small style="color: red;">sep inap</small> -->
                                                </small>

                                            </td>
                                        </tr>
                                        <tr>
                                            <th><small>Penjamin</small></th>
                                            <td>:</td>
                                            <td><small>
                                                    <?php
                                                    $cs = $detailCaseUmum['Case ID'];
                                                    $deskripisPenjamin = $this->db->query("SELECT C.CompanyCode, P.CompanyName FROM Cases C,Company P WHERE C.CompanyCode=P.CompanyCode AND [Case ID]='$cs' ")->row_array();
                                                    echo $deskripisPenjamin['CompanyCode'] . '~' . $deskripisPenjamin['CompanyName'];
                                                    ?>

                                                    <a href="<?= base_url('pasien/editPenjaminCase/' . $detailCaseUmum['Case ID']); ?>"><i class="fa fa-fw fa-edit"></i> Edit</a>


                                                </small></td>
                                        </tr>
                                        <tr>
                                            <th>
                                                <small>No.SEP</small>
                                            </th>
                                            <td>:</td>
                                            <td>
                                                <small>
                                                    <?php
                                                    if ($detailCaseUmum['NoSEP'] == '') {
                                                    ?>
                                                        <a href="" data-toggle="modal" data-target="#edit"><i class="fa fa-fw fa-edit"></i> Edit SEP</a>
                                                    <?php
                                                    } else {
                                                        echo $detailCaseUmum['NoSEP'];
                                                    ?> | <a href="" data-toggle="modal" data-target="#edit"><i class="fa fa-fw fa-edit"></i> Edit SEP</a>
                                                    <?php
                                                    }
                                                    ?>
                                                </small>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>
                                                <small>No.Antrian</small>
                                            </th>
                                            <td>:</td>
                                            <td><small><?= $detailCaseUmum['FRNo']; ?>
                                                    <a href="" data-target="#editAntri" data-toggle="modal"><i class="fa fa-fw fa-edit"></i> Edit Antrian</a>
                                                </small></td>
                                        </tr>

                                        <tr>
                                            <th>
                                                <small>No. Telpon</small>
                                            </th>
                                            <td>:</td>
                                            <td><small><?= $detailCaseUmum['CellPhone']; ?>
                                                </small></td>
                                        </tr>


                                        <tr>
                                            <th>
                                                <small>Alamat Domisili</small>
                                            </th>
                                            <td>:</td>
                                            <td><small><?= $detailCaseUmum['HomeAddress1']; ?>
                                                </small></td>
                                        </tr>


                                        <tr>
                                            <th>
                                                <small>Alamat KTP</small>
                                            </th>
                                            <td>:</td>
                                            <td><small><?= $detailCaseUmum['HomeAddress1']; ?>
                                                </small></td>
                                        </tr>

                                        <tr>
                                            <th>
                                                <small>Catatan</small>
                                            </th>
                                            <td>:</td>
                                            <td><small><?= $detailCaseUmum['Note']; ?>
                                                    <a href="" data-toggle="modal" data-target="#editNote"><i class="fa fa-fw fa-edit"></i> Edit Note</a>
                                                </small></td>
                                        </tr>

                                        <tr>
                                            <td colspan="3">

                                                <!-- <a href="" class="btn btn-sm btn-success bg-green-gradient" target="popup" onclick="window.open('<?= base_url('sep/tambahAntrian?case=' . $detailCaseUmum['Case ID']); ?>','popup','width=600,height=600'); return false;">
                                                    <i class="fa fa-fw fa-desktop"></i> Claim Antrian Admisi
                                                </a> -->

                                                <!-- <?php
                                                        if ($countKontrolStatus > 0) {
                                                        ?>
                                                    <a href="<?= base_url('sep/checkin/' . $kontrolStatus['kdBooking'] . '/' . $detailCaseUmum['PlanNo'] . '/' . $detailCaseUmum['Case ID']); ?>" class="btn btn-sm btn-success bg-green-gradient">
                                                        <i class="fa fa-fw fa-desktop"></i> Claim Antrian Admisi
                                                    </a>
                                                <?php
                                                        } else {
                                                ?>
                                                    <a href="" class="btn btn-sm btn-success bg-green-gradient" target="popup" onclick="window.open('<?= base_url('sep/tambahAntrian?case=' . $detailCaseUmum['Case ID']); ?>','popup','width=600,height=600'); return false;">
                                                        <i class="fa fa-fw fa-desktop"></i> Claim Antrian Admisi
                                                    </a>
                                                <?php

                                                        }
                                                ?> -->
                                                <!-- <a href="" class="btn btn-sm btn-primary bg-blue-gradient">
                                                    <i class="fa fa-fw fa-edit"></i> Cetak FR
                                                </a> -->


                                                <!-- <?php
                                                        if ($cekSepKontrol > 0) {
                                                        ?> -->
                                                <!-- <a href="<?= base_url('sep/cekKontrol/' . $detailCaseUmum['NoSEP']); ?>" class="btn bg-yellow-gradient btn-sm btn-warning">
                                                        <i class="fa fa-fw fa-calendar"></i> Jadwal Kontrol
                                                    </a> -->
                                                <!-- <?php
                                                        } else {
                                                        ?> -->
                                                <!-- <a href="<?= base_url('kontrol/formBuatKontrol?nosep=' . $detailCaseUmum['NoSEP']); ?>" class="btn btn-sm btn-warning bg-yellow-gradient">
                                                        <i class="fa fa-fw fa-calendar"></i> Jadwal Kontrol
                                                    </a> -->
                                                <!-- <?php
                                                        }
                                                        ?> -->

                                                    <!-- <a href="<?= base_url('sep/hapusSep/' . $detailCaseUmum['NoSEP'] . '/' . $detailCaseUmum['Case ID']); ?>" onclick="return confirm('Hapus SEP <?= $detailCaseUmum['NoSEP']; ?> ?')" class="btn btn-sm btn-danger bg-red-gradient">
                                                        <i class="fa fa-fw fa-trash"></i> Hapus SEP
                                                    </a>

                                                    <a href="<?= base_url('sep/detailCaseUmum?case=' . $case . '&histori=' . $ptn['EmployeeID']); ?>" class="btn bg-yellow-gradient btn-sm btn-warning">
                                                        <i class="fa fa-fw fa-calendar"></i> Histori SEP
                                                    </a> -->

                                                <?php
                                                if (isset($histori)) {
                                                ?>
                                                    <hr>

                                                    <?php
                                                    if ($code == 200) {
                                                        foreach ($history as $histori) :
                                                    ?>
                                                            <div class="card bg-success" style="padding: 8px; margin-bottom: 8px;">
                                                                <div class="card-body">
                                                                    <b><small title="SEP">No.SEP : <?= $histori['noSep']; ?></small></b> <br>
                                                                    <small title="Tgl SEP">Tgl.SEP : <?= $histori['tglSep']; ?></small> <br>
                                                                    <small title="Nama">Nama : <?= $histori['namaPeserta']; ?></small> <br>
                                                                    <small title="Kelas">Kelas : <?= $histori['kelasRawat']; ?></small> <br>
                                                                    <small title="Rujukan">No.Rujukan : <?= $histori['noRujukan']; ?></small> <br>
                                                                    <small title="Jenis Pelayanan"> Jenis Pelayanan :
                                                                        <?php
                                                                        if ($histori['jnsPelayanan'] == 2) {
                                                                            echo "Rawat Jalan";
                                                                        } else {
                                                                            echo "Rawat Inap";
                                                                        }
                                                                        ?>
                                                                    </small><br>

                                                                    <small title="Poli">Poli : <?= $histori['poli']; ?></small> <br>
                                                                    <small title="PPK Pelayanan">PPK Pelayanan : <?= $histori['ppkPelayanan']; ?></small> <br>
                                                                </div>
                                                            </div>
                                                    <?php
                                                        endforeach;
                                                    }
                                                    ?>

                                                    <a href="<?= base_url('Pendaftaran/detailCaseUmum?case=' . $case); ?>" class="btn bg-yellow-gradient btn-sm btn-warning">
                                                        <i class="fa fa-fw fa-remove"></i> Tutup Histori SEP
                                                    </a>
                                                <?php
                                                }
                                                ?>
                                                <!-- UPDATE 12/20/2022 -->
                                                <!-- ====================================== -->
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="col-md-6">
                                    <small>
                                        <?php
                                        extract($_GET);
                                        $unit = $this->db->query("SELECT * FROM Category WHERE Status = 'Y'")->result_array();
                                        $dokter = $this->db->query("SELECT * FROM Doctor ORDER BY FirstName ASC")->result_array();
                                        if (isset($tujuan)) {
                                            $dataAdmin = $this->db->query("SELECT * FROM CaseAdmin WHERE AdminID = '$tujuan'")->row_array();
                                        ?>
                                            <form onsubmit="btnSimpan.disabled = true; return true;" action="<?= base_url('Pendaftaran/updateTujuanKunjungan/' . $dataAdmin['AdminID'] . '/' . $detailCaseUmum['Case ID']); ?>" method="post">
                                                <table class="table table-striped">
                                                    <tr>
                                                        <th>Poli</th>
                                                        <th>Dokter</th>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <select name="Unit" class="form-control">
                                                                <option value=""></option>
                                                                <?php
                                                                foreach ($unit as $sUnit) :
                                                                    if ($dataAdmin['Unit'] == $sUnit['ActivityClass']) {
                                                                ?>
                                                                        <option selected value="<?= $sUnit['ActivityClass']; ?>">
                                                                            <?= $sUnit['ActivityClass']; ?>
                                                                        </option>
                                                                    <?php
                                                                    } else {
                                                                    ?>
                                                                        <option value="<?= $sUnit['ActivityClass']; ?>">
                                                                            <?= $sUnit['ActivityClass']; ?>
                                                                        </option>
                                                                <?php
                                                                    }
                                                                endforeach;
                                                                ?>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <select name="DoctorID" class="form-control">
                                                                <?php
                                                                foreach ($dokter as $sDokter) :
                                                                    if ($dataAdmin['DoctorID'] == $sDokter['DoctorID']) {
                                                                ?>
                                                                        <option selected value="<?= $sDokter['DoctorID']; ?>"><?= $sDokter['FirstName']; ?></option>
                                                                    <?php
                                                                    } else {
                                                                    ?>
                                                                        <option value="<?= $sDokter['DoctorID']; ?>"><?= $sDokter['FirstName']; ?></option>
                                                                <?php
                                                                    }
                                                                endforeach;
                                                                ?>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" align="right">
                                                            <a href="<?= base_url('pendaftaran/detailCaseUmum?case=' . $case); ?>" class="btn bg-yellow-gradient btn-sm btn-warning">Batal</a>
                                                            <button type="submit" id="btnSimpan" class="btn btn-sm bg-blue-gradient btn-primary">Update</button>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </form>
                                        <?php
                                        } else if (isset($add)) {
                                        ?>
                                            <form onsubmit="btnSimpan.disabled = true; return true;" action="<?= base_url('Pendaftaran/addTujuanKunjungan/' . $detailCaseUmum['Case ID']); ?>" method="post">
                                                <table class="table table-striped">
                                                    <tr>
                                                        <th>Poli</th>
                                                        <th>Dokter</th>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <select name="Unit" class="form-control">
                                                                <option value=""></option>
                                                                <?php
                                                                foreach ($unit as $sUnit) :
                                                                ?>
                                                                    <option value="<?= $sUnit['ActivityClass']; ?>">
                                                                        <?= $sUnit['ActivityClass']; ?>
                                                                    </option>
                                                                <?php
                                                                endforeach;
                                                                ?>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <select name="DoctorID" class="form-control">
                                                                <?php
                                                                foreach ($dokter as $sDokter) :
                                                                ?>
                                                                    <option value="<?= $sDokter['DoctorID']; ?>"><?= $sDokter['FirstName']; ?></option>
                                                                <?php
                                                                endforeach;
                                                                ?>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" align="right">
                                                            <a href="<?= base_url('Pendaftaran/detailCaseUmum?case=' . $case); ?>" class="btn bg-yellow-gradient btn-sm btn-warning">Batal</a>
                                                            <button type="submit" id="btnSimpan" class="btn btn-sm btn-primary bg-blue-gradient">Add</button>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </form>
                                        <?php
                                        } else {
                                        }
                                        ?>
                                        <table class="table table-striped">
                                            <?php
                                            $id = $detailCaseUmum['Case ID'];
                                            $ugd = $this->db->query("SELECT * FROM CaseAdmin where [Case ID] = '$id'")->row_array();
                                            if ($ugd['Unit'] == 'UGD' || $ugd['Unit'] == 'IGD') {
                                                $display = "style='display:block'";
                                            } else {
                                                $display = "style='display:none'";
                                            }
                                            ?>
                                            <tr>
                                                <th colspan="4">Tujuan
                                                    <a href="<?= base_url('pendaftaran/detailCaseUmum?case=' . $detailCaseUmum['Case ID'] . '&add'); ?>"><i class="fa fa-fw fa-plus"></i> Tambah Tujuan / Dokter</a>

                                                    |
                                                    <a <?= $display; ?> href="<?= base_url('sep/cetakSep?nosep=' . $detailCaseUmum['NoSEP']); ?>" target="_blank"> Cetak SEP IGD</a>
                                                </th>
                                            </tr>
                                            <tr>
                                                <th>No.</th>
                                                <th>Poli</th>
                                                <th>Dokter</th>
                                                <th></th>
                                            </tr>
                                            <?php
                                            $stujuan = $this->db->query("SELECT * FROM CaseAdmin c,Doctor d WHERE c.DoctorID=d.DoctorID AND [Case ID] = '$id'")->result_array();
                                            $no = 1;
                                            foreach ($stujuan as $data) :
                                            ?>
                                                <tr>
                                                    <td><?= $no++; ?>.</td>
                                                    <td><?= $data['Unit']; ?></td>
                                                    <td><?= $data['FirstName']; ?></td>
                                                    <td>
                                                        <a class="btn btn-sm btn-success bg-green-gradient" href="<?= base_url('Pendaftaran/detailCaseUmum?case=' . $detailCaseUmum['Case ID'] . '&tujuan=' . $data['AdminID']); ?>">
                                                            <i class="fa fa-fw fa-edit"></i>
                                                        </a>
                                                        <a onclick="return confirm('Hapus tujuan ini ?')" class="btn btn-sm bg-red-gradient btn-danger" href="<?= base_url('Pendaftaran/hapusTujuan/' . $data['AdminID']); ?>"><i class="fa fa-fw fa-trash"></i></a>
                                                    </td>
                                                </tr>
                                            <?php
                                            endforeach;
                                            ?>
                                        </table>
                                    </small>

                                    <?php
                                    if ($detailCaseUmum['FRNo'] == '') {
                                    } else {
                                    ?>
                                        <a href="<?= base_url('umum/antrian/' . $detailCaseUmum['Case ID']); ?>" style="width:100%" target="_blank" class="btn btn-primary bg-blue-gradient btn-sm"><i class="fa fa-fw fa-print"></i> Cetak Antrian</a>
                                        <br>
                                    <?php
                                    }
                                    ?>

                                    <div style="display:none" id="text">
                                        <a href="<?= base_url('sep/cetakSepInap?nosep=' . $detailCaseUmum['NoSEP']); ?>" style="width:100%; margin-top:5px" target="_blank" class="btn bg-yellow-gradient btn-warning btn-sm"><i class="fa fa-fw fa-print"></i> Cetak SEP Inap (Waiting List)</a>
                                    </div>

                                    <?php
                                    if ($detailCaseUmum['NoSEP'] == '') {
                                    } else {

                                        if ($detailCaseUmum['Category'] == 'IP') {
                                    ?>
                                            <a href="<?= base_url('sep/cetakSepInap?nosep=' . $detailCaseUmum['NoSEP']); ?>" style="width:100%; margin-top:5px" target="_blank" class="btn bg-green-gradient btn-success btn-sm"><i class="fa fa-fw fa-print"></i> Cetak SEP Inap</a>
                                            <?php
                                        } else {

                                            if ($detailCaseUmum['task'] == '' || $detailCaseUmum['task'] == NULL) {
                                            } else {
                                            ?>
                                                <a href="<?= base_url('sep/cetakSep?nosep=' . $detailCaseUmum['NoSEP']); ?>" style="width:100%; margin-top:5px" target="_blank" class="btn bg-green-gradient btn-success btn-sm"><i class="fa fa-fw fa-print"></i> Cetak SEP</a>
                                    <?php
                                            }
                                        }
                                    }
                                    ?>

                                    <!-- sementara -->
                                    <!-- <a href="<?= base_url('sep/cetakSep?nosep=' . $detailCaseUmum['NoSEP']); ?>" style="width:100%; margin-top:5px" target="_blank" class="btn bg-green-gradient btn-success btn-sm"><i class="fa fa-fw fa-print"></i> Cetak SEP</a> -->

                                </div>
                            </div>
                        <?php
                        } else {
                        ?>
                            <div class="row">
                                <div class="col-md-12">
                                    Data tidak ditemukan !
                                </div>
                            </div>
                        <?php
                        }
                        ?>

                    </div>

                </div>
            </div>
            <!-- -->

        </div>

    </section><!-- /.content -->
</div><!-- /.content-wrapper -->

<!-- Modal -->
<div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <form action="<?= base_url('umum/UpdateSEP/' . $detailCaseUmum['Case ID']); ?>" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Isi No SEP</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <input type="text" class="form-control" name="noSep" value="<?= $detailCaseUmum['NoSEP']; ?>" placeholder="Isi Nomor SEP...">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Save changes</button>
                    <a href="" class="btn btn-success">Edit By BPJS</a>
                </div>
        </form>
    </div>
</div>
</div>

<!-- Modal -->
<div class="modal fade" id="editNote" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <form action="<?= base_url('umum/UpdateNote/' . $detailCaseUmum['Case ID']); ?>" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Isi Catatan</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <textarea class="form-control" name="Note" placeholder="Catatan..."><?= $detailCaseUmum['Note']; ?></textarea>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Save changes</button>
                </div>
        </form>
    </div>
</div>
</div>

<!-- Modal -->
<div class="modal fade" id="editAntri" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <form action="<?= base_url('umum/UpdateAntri/' . $detailCaseUmum['Case ID']); ?>" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Edit Nomor Antrian</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <input type="text" class="form-control" name="FRNo" value="<?= $detailCaseUmum['FRNo']; ?>" placeholder="Nomor Antrian...">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Save changes</button>
                </div>
        </form>
    </div>
</div>
</div>

<!-- Modal -->
<div class="modal fade" id="editTanggal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <form action="<?= base_url('umum/UpdateTanggal/' . $detailCaseUmum['Case ID']); ?>" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Edit Kunjungan</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <label for="">Tanggal</label>
                    <input type="date" class="form-control" name="intakeDate" value="<?= date('Y-m-d', strtotime($detailCaseUmum['Intake Date'])); ?>" required>

                    <label for="">Jam</label>
                    <input type="time" class="form-control" name="intakeTime" value="<?= date('H:i', strtotime($detailCaseUmum['Intake Time'])); ?>" required> <br>

                    <?php
                    if ($detailCaseUmum['Closed Date'] == '') {
                    } else {
                    ?>
                        <label for="">Tanggal Close</label>
                        <input type="date" class="form-control" name="closeDate" value="<?= date('Y-m-d', strtotime($detailCaseUmum['Closed Date'])); ?>" required>

                        <label for="">Jam Close</label>
                        <input type="time" class="form-control" name="closeTime" value="<?= date('H:i', strtotime($detailCaseUmum['Closed Time'])); ?>" required> <br>
                    <?php
                    }
                    ?>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Save changes</button>
                </div>
        </form>
    </div>
</div>
</div>
<script>
    function myFunction() {
        // Get the checkbox
        var checkBox = document.getElementById("myCheck");
        // Get the output text
        var text = document.getElementById("text");

        // If the checkbox is checked, display the output text
        if (checkBox.checked == true) {
            text.style.display = "block";
        } else {
            text.style.display = "none";
        }
    }
</script>