<?php
date_default_timezone_set("Asia/Jakarta");
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            List Cliam Obat
            <small>Klinik</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Claim</a></li>
            <li class="active">Record</li>
        </ol>
    </section>

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

        <!-- SELECT2 EXAMPLE -->
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title"></h3>
                <div class="box-tools pull-right">
                    <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
                </div>
            </div><!-- /.box-header -->
            <div class="box-body">
                <small>
                    <table id="example1" class="table table-bordered table-hover table-striped">
                        <thead>
                            <tr>
                                <th>No.</th>
                                <th>Case ID</th>
                                <th>Nama</th>
                                <th>Penjamin</th>
                                <th>Status Pasien</th>
                                <th>Case Status</th>
                                <th>Status Obat</th>
                                <th>Opsi</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $no = 1;
                            foreach ($claim as $data) :
                            ?>
                            <tr>
                                <td><?= $no++; ?></td>
                                <td><?= $data['Case ID']; ?></td>
                                <td><?= $data['Description']; ?></td>
                                <td><?= $data['CompanyName']; ?></td>
                                <td><?= $data['Case Status']; ?></td>
                                <td><?= $data['RegStatus']; ?></td>
                                <td><div class="text-primary">Telah dibuat dan diberikan</div></td>
                                <td>
                                    <?php 
                                    if($user['dept'] == 1 || $user['dept'] == 13){
                                        ?>
                                        <a href="<?= base_url('rekamMedis/pemeriksaan/'.$data['Case ID']); ?>" style="width: 100%" class="btn btn-sm btn-success"><i class="fa fa-fw fa-book"></i> Lihat Detail</a>
                                        <?php 
                                    }else if($user['dept'] == 2){
                                        ?>
                                        <a href="<?= base_url('apotek/pasien/'.$data['Case ID']); ?>" style="width: 100%" class="btn btn-sm btn-success"><i class="fa fa-fw fa-book"></i> Lihat</a>
                                        <?php 
                                    }
                                    ?>
                                </td>
                            </tr>
                            <?php
                            endforeach;
                            ?>
                        </tbody>
                        <tfoot>
                            <tr>
                                <th>No.</th>
                                <th>Case ID</th>
                                <th>Nama</th>
                                <th>Penjamin</th>
                                <th>Status Pasien</th>
                                <th>Case Status</th>
                                <th>Status Obat</th>
                                <th>Opsi</th>
                            </tr>
                        </tfoot>
                    </table>
                </small>
            </div><!-- /.box-body -->
            <div class="box-footer">
                <small>Daftar Pasien <?= date('d F Y'); ?> - @Klinik <?= date('Y'); ?></small>
            </div>
        </div><!-- /.box -->

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