<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Sistem Klinik
            <small>Rekam Medis</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Klinik</a></li>
            <li class="active">Dashboard</li>
        </ol>
    </section>

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

        <!-- Default box -->
        <div class="box">
            <div class="box-header with-border">
            <div class="box-tools pull-right">
               <a href="" data-toggle="modal" data-target="#pencarian" class="btn btn-sm btn-primary bg-blue-gradient" data-backdrop="static" data-keyboard="false"><i class="fa fa-fw fa-search"></i> Cari</a>
            </div>
            <br>
            <div class="box-body">
            <small>
                    <table id="example1" class="table table-bordered table-hover table-striped">
                        <thead>
                            <tr class="bg-blue-gradient" >
                                <th>No.</th>
                                <th>Case ID</th>
                                <th>No. Mr</th>
                                <th>Nama</th>
                                <th>Category</th>
                                <th>Intake Date</th>
                                <th>Close Date</th>
                                <th>Penjamin</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                            $no = 1;
                            foreach ($kasir as $data) :
                            ?>
                            <tr>
                                <td><?= $no++; ?></td>
                                <td><?= $data['Case ID']; ?></td>
                                <td><?= $data['PatientCode']; ?></td>
                                <td><?= $data['Description']; ?></td>
                                <td><?= $data['Category']; ?></td>
                                <td><?= date('d-m-Y', strtotime($data['Intake Date'])); ?></td>
                                <td><?= date('d-m-Y', strtotime($data['Closed Date'])); ?></td>
                                <td><?= $data['CompanyName']; ?></td>
                                <td><?= $data['Case Status']; ?></td>
                                <td><a href="<?= base_url('kasir/detailchasir/'.$data['Case ID']); ?>" class="btn btn-sm btn-primary bg-blue-gradient" data-backdrop="static" data-keyboard="false"><i class="fa fa-tv"></i> Pilih</a></td>
                            </tr>
                            <?php
                            endforeach;
                            ?>
                        </tbody>
                        <tfoot>
                            <tr>
                                <th>No.</th>
                                <th>Case ID</th>
                                <th>No. Mr</th>
                                <th>Nama</th>
                                <th>Category</th>
                                <th>Intake Date</th>
                                <th>Close Date</th>
                                <th>Penjamin</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </tfoot>
                    </table>
                </small>
                </div>
            </div>
            </div>
        </div>
    </section>
</div>

<!-- Modal -->
<div class="modal fade" id="pencarian" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">FILTER</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">

                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab"></span> Case ID</a></li>
                        <li><a href="#tab_2" data-toggle="tab"></span> No.MR</a></li>
                        <li><a href="#tab_3" data-toggle="tab"></span> Tanggal Masuk</a></li>
                    </ul>
                    <div class="tab-content">
                    <div class="tab-pane active" id="tab_1">
                            <form action="<?= base_url('kasir/caribycaseid'); ?>" method="get">
                                <input type="text" class="form-control" required placeholder="Case ID" name="src">
                                <button style="margin-top:10px" type="submit" class="btn btn-sm btn-primary"> Cari
                                </button>
                            </form>
                        </div>
                        <div class="tab-pane" id="tab_2">
                            <form action="<?= base_url('kasir/caribymr'); ?>" method="get">
                                <input type="text" class="form-control" required placeholder="No.MR" name="src">
                                <button style="margin-top:10px" type="submit" class="btn btn-sm btn-primary"> Cari
                                </button>
                            </form>
                        </div>
                        <div class="tab-pane" id="tab_3">
                            <form action="<?= base_url('kasir/caribytgl'); ?>" method="get">
                                <input value="" type="date" class="form-control" required value='<?= date('Y-m-d'); ?>' name="tgl">
                                <button style="margin-top:10px" type="submit" class="btn btn-sm btn-primary"> Cari
                                </button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>