<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Apotik Pharmacy
            <small><?= $abdulradjak['NamaPerusahaan']; ?></small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Vclaim</a></li>
            <li class="active">Data Pasien</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <!-- Default box -->
        <div class="box">
            <div class="box-body">
                <table id="example1" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>Transaction ID</th>
                            <th>Case ID</th>
                            <th>Ketegori</th>
                            <th>In Take</th>
                            <th>Nama</th>
                            <th>Transaction Date</th>
                            <th>Dokter Pengirim</th>
                            <th>Opsi</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        foreach ($pasien as $data) :
                            $categ = $data['Case ID'];
                            $sCateg = $this->db->query("SELECT * FROM Cases WHERE [Case ID] = '$categ'")->row_array();
                        ?>
                            <tr>
                                <td><?= $data['TransactionID']; ?></td>
                                <td><?= $data['Case ID']; ?></td>
                                <td>
                                    <?php
                                    if ($sCateg['Category'] == "IP") {
                                        echo "R.Inap";
                                    } else if ($sCateg['Category'] == "OP") {
                                        echo "R.Jalan";
                                    } else {
                                        echo "";
                                    }
                                    ?>
                                </td>
                                <td><?= date('d-m-Y', strtotime($data['Intake Date'])); ?></td>
                                <td><?= $data['Description']; ?></td>
                                <td><?= $data['Transaction_Date']; ?></td>
                                <td><?= $data['FirstName']; ?></td>
                                <td>
                                    <a href="<?= base_url('apotik/record/' . $data['Case ID']); ?>" class="btn btn-sm btn-primary"> Lihat</a>
                                </td>
                            </tr>
                        <?php
                        endforeach;
                        ?>
                    </tbody>

                </table>
            </div><!-- /.box-body -->
        </div><!-- /.box -->

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


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