<?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>
            Apotek
            <small>Klinik</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Pasien</a></li>
            <li class="active">Apotek</li>
        </ol>
    </section>

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

        <div class="row">
            <div class="col-md-3">


                <!-- ------------------------- -->
                <div class="box box-solid box-success">
                    <div class="box-header with-border">
                        <span><small><i class="fa fa-edit"> Anamnesa</i></small> </span>
                        <div class="box-tools">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                <i class="fa fa-minus"></i>
                            </button>
                        </div>
                    </div>
                    <div class="box-body no-padding">
                        <ul class="nav nav-pills nav-stacked">

                            <li>
                                <a title="Berat Badan">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Berat Badan :
                                        <?= $pasien['BeratBadan']; ?> kg.</small>
                                </a>
                            </li>
                            <li>
                                <a title="Tinggi Badan">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Tinggi Badan :
                                        <?= $pasien['TinggiBadan']; ?> cm.</small>
                                </a>
                            </li>
                            <li>
                                <a title="RespRate">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> RespRate :
                                        <?= $pasien['respRate']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Suhu">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Suhu : <?= $pasien['Suhu']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Tensi">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Tensi :
                                        <?= $pasien['Tensi']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Diastole">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Diastole :
                                        <?= $pasien['Diastole']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="HeartRate">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> HeartRate :
                                        <?= $pasien['heartRate']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Keluhan">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Keluhan :
                                        <?= $pasien['Keluhan']; ?></small>
                                </a>
                            </li>

                        </ul>
                        <label id="lbltglplgsep" class="hidden"></label>
                    </div>
                    <!-- /.box-body -->
                </div>
                <div class="box box-solid box-warning">
                    <div class="box-header with-border">
                        <span><small><i class="fa fa-user"> Pasien</i></small> </span>
                        <div class="box-tools">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                <i class="fa fa-minus"></i>
                            </button>
                        </div>
                    </div>
                    <div class="box-body no-padding">
                        <ul class="nav nav-pills nav-stacked">
                            <li>
                                <a title="No.MR">
                                    <small><i class="fa fa-fw fa-sort-numeric-asc"></i>
                                        <?= $pasien['PatientCode']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Nama">
                                    <small><i class="fa fa-fw fa-medkit"></i>
                                        <?= $pasien['Description']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Tgl.Kunjungan">
                                    <small><i class="fa fa-fw fa-calendar"></i> <?= $pasien['Intake Date']; ?></small>
                                </a>
                            </li>

                            <li>
                                <a title="Poli">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> <?= $pasien['Unit']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Diagnosa">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> <?= $pasien['NoAntrian']; ?></small>
                                </a>
                            </li>

                        </ul>
                        <label id="lbltglplgsep" class="hidden"></label>
                    </div>
                    <!-- /.box-body -->
                </div>
            </div>
            <div class="col-md-9">
                <!-- SELECT2 EXAMPLE -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">Detail Obat </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>
                            <!-- Custom Tabs -->
                            <div class="nav-tabs-custom">
                                
                                <div class="tab-content">
                                   
                                        <table class="table table-striped table-hover">
                                            <thead>
                                                <tr>
                                                    <th>No.</th>
                                                    <th>Nama Obat</th>
                                                    <th>Jumlah</th>
                                                    <th>Satuan</th>
                                                    <th>Dosis</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php 
                                                if($countObat > 0)
                                                {
                                                    $no=1;
                                                    foreach($hasilObat as $obat):
                                                        ?>
                                                        <tr>
                                                            <td><?= $no++; ?>.</td>
                                                            <td><?= $obat['Obat']; ?></td>
                                                            <td><?= $obat['Jumlah']; ?></td>
                                                            <td><?= $obat['Satuan']; ?></td>
                                                            <td><?= $obat['Dosis']; ?></td>
                                                            
                                                        </tr>
                                                        <?php 
                                                    endforeach;
                                                }else{
                                                    ?>
                                                    <tr>
                                                        <td colspan="4">Belum ada resep obat!</td>
                                                    </tr>
                                                    <?php
                                                }
                                                ?>
                                            </tbody>
                                        </table>

                                        <?php 
                                        if($pasien['Obat'] == 1){
                                            ?>
                                            <a target="_blank" href="<?= base_url('rekamMedis/cetakRekamMedis/'.$pasien['Case ID']); ?>" class="btn btn-info btn-sm"><i class="fa fa-fw fa-print"></i> Print List Obat</a>
                                            <?php 
                                        }else{
                                            if($countObat > 0){
                                                ?>
                                                <a href="<?= base_url('apotek/claim/'.$pasien['Case ID']); ?>" class="btn btn-success btn-sm"><i class="fa fa-fw fa-check"></i> Claim Obat</a>
                                                <?php 
                                            }else{
                                                ?>
                                                <a disabled href="#" class="btn btn-success btn-sm"><i class="fa fa-fw fa-check"></i> Claim Obat</a>
                                                <?php 
                                            }
                                            
                                        }
                                        ?>
                                   
                                    
                                    
                                </div><!-- /.tab-content -->
                            </div><!-- nav-tabs-custom -->
                        </small>
                    </div><!-- /.box-body -->
                    <div class="box-footer">
                        <small>Daftar Pemeriksaan <?= date('d F Y'); ?> - @Klinik <?= date('Y'); ?></small>
                    </div>
                </div><!-- /.box -->
            </div>
        </div>



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