<?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>
            Cari Pasien
            <small>Klinik</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">Cari</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">Pencarian</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>Alert</th>
                                <th>Opsi</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $no = 1;
                            foreach ($cariMr as $data) :
                            ?>
                            <tr>
                                <td><?= $no++; ?></td>
                                <td><?= $data['Case ID']; ?></td>
                                <td><?= $data['Description']; ?></td>
                                <td><?= $data['CompanyName']; ?></td>
                                <td><?= $data['RegStatus']; ?></td>
                                <td>
                                <?php
                                        if($data['diagnosa_primer'] == 'A16' || $data['diagnosa_primer'] == 'B18' || $data['diagnosa_primer'] == 'O98.7' || $data['diagnosa_primer'] == 'O98.4' || $data['diagnosa_primer'] == 'O98.1' || $data['diagnosa_primer'] == 'B20.1' || $data['diagnosa_primer'] == 'B20.0' || $data['diagnosa_primer'] == 'B20.2' || $data['diagnosa_primer'] == 'B20.3' || $data['diagnosa_primer'] == 'B20.4' || $data['diagnosa_primer'] == 'B20.5' || $data['diagnosa_primer'] == 'B20.6'|| $data['diagnosa_primer'] == 'B20.7' || $data['diagnosa_primer'] == 'B20.8' || $data['diagnosa_primer'] == 'B20.9' || $data['diagnosa_primer'] == 'B20'){
                                        ?>
                                        <span class="badge bg-red">Pasien infectious !!!</span>
                                        <?php }else{ ?>

                                        <?php } ?>
                                </td>
                                <td>
                                    <a href="<?= base_url('rekamMedis/pemeriksaan/'.$data['Case ID']).'/'.$data['PatientCode']; ?>" style="width: 100%" class="btn btn-sm btn-success"><i class="fa fa-fw fa-book"></i> Lihat Detail</a>
                                </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>Alert</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 -->