<section class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h1>
                </h1>
            </div>
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="<?php echo base_url();?>">Dashboard</a></li>
                    <li class="breadcrumb-item"><?php echo $parent;?></li>
                    <li class="breadcrumb-item active"><?php echo $title;?></li>
                </ol>
            </div>
        </div>
    </div>
</section>
<!-- Main content -->
<section class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="card card-default">
                    <div class="card-header">
                        <h3 class="card-title"><?php 
                        echo $title;
                        $tglawal = $awal;
                        $tglakhir= $akhir;
                        $tglgabung = date("m/d/Y", strtotime($awal))." - ".date("m/d/Y", strtotime($akhir));
                        ?></h3>
                    </div>
                    <form action="<?php echo(base_url()); ?>index.php/lp_ppi/iskanak" method="post" autocomplete="off">
                        <div class="card-body">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">Tanggal :</label>
                                <div class="col-sm-4">
                                    <div class="input-group">
                                        <div class="input-group-prepend">
                                            <span class="input-group-text">
                                                <i class="far fa-calendar-alt"></i>
                                            </span>
                                        </div>
                                        <input type="text" name="tanggalmonitoring" class="form-control float-right" id="reservation" value="<?php echo $tglgabung;?>">
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <button type="submit" class="btn btn-outline-info">Search </button>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="card-body">
                        <?php if($this->session->flashdata('message')){?>
                        <div id="alert" class="alert alert-success alert-dismissable">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                            <i class="icon fa fa-check"></i> Alert!
                            <?php echo $this->session->flashdata('message');?>
                        </div>
                        <?php }?>
                        <script> 
                            setTimeout(function() {
                                $('#alert').hide('fast');
                            }, 3000);
                        </script>
                        <table id="example1" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>No</th>
                                    <th>Data Pasien</th>
                                    <th>Ruang Ranap</th>
                                    <th>Created</th>
                                    <th>Datecreated</th>
                                    <th>MRS</th>
                                    <th>KRS</th>
                                    <th>Monitoring</th>
                                    <th>Tanggal</th>
                                    <th>Tgl Pasang</th>
                                    <th>Tgl Lepas</th>
                                    <th>Lama Pakai</th>
                                    <th>Ruang Pasang</th>
                                    <th>Diagnosa PPI</th>
                                    <th>Diagnosa DPJP</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                    $no=0;
                                    foreach ($iskanak as $dat) {
                                        $no++;
                                        if($dat->Diagnosa_nilai_isk_anak_ppi == 1){
                                            $diagnosappi = "<span class='badge bg-yellow'> Positif</span>";
                                        }else{
                                            $diagnosappi = "<span class='badge bg-gray'> Tidak</span>";
                                        }

                                        if($dat->Diagnosa_ppi_dpjp == "TIDAK"){
                                            $diagnosadpjp = "<span class='badge bg-gray'> ".$dat->Diagnosa_ppi_dpjp."</span>";
                                        }else{
                                            $diagnosadpjp = "<span class='badge bg-red'> ".$dat->Diagnosa_ppi_dpjp."</span>";
                                        }

                                        $ruangpasang = "-";
                                        foreach($rua as $row){
                                            if($row->id == $dat->Ruang_pemasangan_catheter_urine){
                                                $ruangpasang = $row->Kode." - ".$row->Nama." - Kelas ".$row->Kelas;
                                            }
                                        }

                                        echo("
                                            <tr>
                                                <input type='hidden' id='isi".$dat->id."' value='".$dat->status."'>
                                                <td>".$no."</td>
                                                <td>".$dat->No_rekam_medis." - ".$dat->Nama_pasien." / ".$dat->Umur." Th / ".$dat->Jenis_kelamin."</td>
                                                <td>".$dat->Kode." - ".$dat->Nama." - Kelas ".$dat->Kelas."</td>
                                                <td>".$dat->first_name."</td>
                                                <td>".$dat->date_created."</td>
                                                <td>".$dat->Tanggal_mrs."</td>
                                                <td>".$dat->Tanggal_krs."</td>
                                                <td>".$dat->Monitoring_ke."</td>
                                                <td>".$dat->Tanggal_monitoring."</td>
                                                <td>".$dat->Tanggal_pemasangan_catheter_urine."</td>
                                                <td>".$dat->Tanggal_pelepasan_catheter_urine."</td>
                                                <td>".$dat->Lama_pemakaian_catheter_urine."</td>
                                                <td>".$ruangpasang."</td>
                                                <td>".$diagnosappi."</td>
                                                <td>".$diagnosadpjp."</td>
                                            </tr>
                                        ");
                                    }
                                ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
