<div class="box">
            <div class="box-header with-border">
                <b>OBAT RACIKAN</b>
                <?php 
                     $CaseID =  $this->uri->segment(3);
                     $mr = $this->uri->segment(4);
                     $cases =   $this->db->query("Select * From Cases Where [Case ID] = '$CaseID' ")->row_array();
                ?>
                <?php
                 if($cases['Case Status'] == 'CLOSED' || $cases['Case Status'] == 'CANCEL'  ) {
                ?>
                <div class="box-tools pull-right"><a href="" data-toggle='modal' class="btn btn-sm btn-primary" disabled><i class="fa fa-fw fa-plus"></i> Baru</a></div>
                <?php }else{ ?>
                <div class="box-tools pull-right"><a href="" data-toggle='modal' data-target='.bd-example-modal-lg' class="btn btn-sm btn-primary"><i class="fa fa-fw fa-plus"></i> Baru</a></div>
                 <?php } ?>
            </div><!-- /.box-header -->
            <div class="box-body">
            <table border='0' id="tab_obat" class="table">
                                        <tr>
                                           <b><td width='100px'>IdResep</td>
                                           <b><td width='100px'>Case ID</td>
                                           <td width='200px'>Nama Pasien</td>
                                            <td width='100px'>Jenis</td>
                                            <td width='200px'>Tanggal</td>
                                            <td width='200px'>Category</td>
                                            <td width='200px'>Nama Dokter</td>
                                            <td width='50px'>~</td></b>
                                        </tr>
                                        <?php foreach($trxheaderRacik as $d) : ?>
                                        <tr>
                                            <td><?= $d['ResepId']; ?></td>
                                            <td><?= $d['CaseID']; ?></td>
                                            <td><?= $d['Description']; ?></td>
                                            <td><?= $d['Jenis']; ?></td>
                                            <td><?= $d['Intake Date']; ?></td>
                                            <td><?= $d['Category']; ?></td>
                                            <td><?= $d['FirstName']; ?></td>
                                            <td><a href="<?= base_url('Apotik/rRacikDetail/'.$d['CaseID'].'/'.$d['ResepId']); ?>" class="btn btn-success">Detail</a></td>
                                        </tr>
                                        <?php endforeach; ?>
                                    </table>
            </div>
            <?php 
            $this->load->view('rekamMedis/modalRacik2');
            ?>
</div>