<?php
extract($_GET);
$detailApotik = $this->db->query("SELECT * FROM [Activity Drugs] AA, Pharmacy P WHERE AA.DrugsID=P.PharmacyCode AND TransactionID = '$isi'")->result_array();
$case = $this->uri->segment(3);
$qcase = $this->db->query("select [Case Status] from Cases where [Case ID] = '$case'")->row_array();
?>
<style>
    .containers {
        width: 100%;
        height: 200px;
        overflow: scroll;
    }
</style>
<div class="box">
    <div class="box-body">
        <div class="row">
            <div class="col-md-6">
                Transaction ID ~ <?= $isi; ?>
            </div>
            <div class="col-md-6" align="right">
                <?php if($qcase['Case Status'] == 'CLOSED'){ ?>
                    <a style="margin-bottom: 5px;" href="#" class="btn btn-sm btn-danger" disabled><i class="fa fa-fw fa-edit"></i></a>
                <?php }else{ ?>
                <a style="margin-bottom: 5px;" href="<?= base_url('apotik/addPharmacy/' . $pasienDetail['Case ID'] . '?isi=' . $isi); ?>" class="btn btn-sm btn-success"><i class="fa fa-fw fa-edit"></i></a>
                <?php } ?>
            </div>
        </div>

        <small>

            <div class="containers">

                <div style="width: 800px;">
                    <table class="table table-striped table-responsive">
                        <tr>
                            <th>Drugs</th>
                            <th>Qty</th>
                            <th>Charge</th>
                            <th>Aturan</th>
                            <th>Cara</th>
                            <th>Ket.</th>
                        </tr>
                        <?php
                        foreach ($detailApotik as $details) :
                        ?>
                            <tr>
                                <td><?= $details['Description']; ?></td>
                                <td><?= $details['Qty']; ?></td>
                                <td><?= $details['Charge']; ?></td>
                                <td><?= $details['Dosis']; ?></td>
                                <td><?= $details['Cara']; ?></td>
                                <td><?= $details['Ket']; ?></td>

                            </tr>
                        <?php
                        endforeach;
                        ?>
                    </table>
                </div>

            </div>



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

<!-- Modal -->
<div class="modal fade" id="tambahActivity" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <form action="<?= base_url('apotek/prosesHeader/' . $pasienDetail['Case ID']); ?>" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Transaksi Baru</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="row" style="margin-top: 5px;">
                        <div class="col-md-3">Room</div>
                        <div class="col-md-9">
                            <input type="text" name="Room" value="" class="form-control" required>
                        </div>
                    </div>


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