<?php
  $caseID = $this->uri->segment(3);
  $cekid = $this->db->query("select* from erm_Asesmentanastesi where case_id = '$caseID'")->row_array();
?>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Form Asesment Anastesi
            <?php
                if($cekid > 0 ){
            ?>
            - <a href="<?= base_url('Form/cetakasesmentanastesi/'.$this->uri->segment(3)) ?>" target="_blank" class="btn btn-primary"><i class="fa fa-print"></i> Cetak </a><br>
            <?php }else{ ?>
            
            <?php } ?>
        </h1>
        <ol class="breadcrumb">
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="card" style="padding: 15px; background-color: white;border-radius: 5px;">
            <div class="card-body">
            <?= $this->session->flashdata('message'); ?>
                <div class="row text-center">
                    <div class="col-md-2"></div>
                    <div class="col-md-2">
                        <img src="<?= base_url('images/logo.png'); ?>" height="80px">
                    </div>
                    <div class="col-md-6">
                        <h4 style="font-weight: bold;">
                            <?= $unit['NamaPerusahaan']; ?><br>
                            ASESMENT ANASTESI
                        </h4>
                    </div>
                    <div class="col-md-2"></div>
                </div>
                <div class="row text-center">
                    <div class="col-md-2"></div>
                    <div class="col-md-8">
                        <hr>
                    </div>
                    <div class="col-md-2"></div>
                </div>
                <div class="row text-center">
                    <div class="col-md-2"></div>
                    <div class="col-md-8">
                        <h4 style="font-weight: bolder;">

                        </h4>
                    </div>
                    <div class="col-md-2"></div>
                </div>
                <b>Riwayat Medis</b><br><br>
                <form action="<?= base_url('Form/SimpanAsesmentanastesi/' .$this->uri->segment(3)); ?>" method="post">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Rencana Oprasi</label>
                            <input type="text" class="form-control" name="Rencanaop" placeholder="RencanaOprasi ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Diagnosa</label>
                           <select class="form-control teanganData" name="diagnosa" id="js-example-basic-single" required="" data-select2-id="js-example-basic-single" tabindex="-1" aria-hidden="true">
                            <option>--Pilih Diagnosa--</option>
                            <?php foreach($diagnosa as $d) : ?>
                            <option value="<?= $d['ICD_CODE']; ?>"><?= $d['DESCRPTION']; ?></option>
                            <?php endforeach; ?>
                           </select>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Medikasi</label>
                            <input type="text" class="form-control" name="Medikasi" placeholder="Medikasi ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Perokok</label>
                           <select name="Perokok" id="" class="form-control">
                            <option value="">-- Pilih --</option>
                            <option value="Ya"> Ya</option>
                            <option value="Tidak"> Tidak</option>
                           </select>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Pemakaian Obat-Obatan</label>
                            <input type="text" class="form-control" name="Obatobatan" placeholder="Pemakaian Obat-obatan ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Keluarga</label>
                            <input type="text" class="form-control" name="Keluarga" placeholder="Keluarga ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Makan minum terakhir</label>
                            <input type="text" class="form-control" name="Makan" placeholder="Makan dan minum ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Alergi</label>
                            <input type="text" class="form-control" name="Alergi" placeholder="Alergi ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label>Riwayat Anestesi</label>
                        <input type="text" class="form-control" name="tgl1" placeholder="Tgl ...">
                    </div>
                </div>
                <div class="col-md-6">
                     <div class="form-group">
                        <label for="">-</label>
                        <input type="text" class="form-control" name="tgl2" placeholder="Tgl ...">
                    </div>
                </div>
                </div>
                <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label>-</label>
                        <input type="text" class="form-control" name="tgl3" placeholder="Tgl ...">
                    </div>
                </div>
                <div class="col-md-6">
                     <div class="form-group">
                        <label for="">-</label>
                        <input type="text" class="form-control" name="tgl4" placeholder="Tgl ...">
                    </div>
                </div>
                </div>

                <b>Problem saat ini</b><br><br>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Kardiovaskular</label>
                            <input type="text" class="form-control" name="kardiovaskular" placeholder="Kardiovaskular ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Pernafasan</label>
                            <input type="text" class="form-control" name="pernafasan" placeholder="Pernafasan ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Diabetes</label>
                            <input type="text" class="form-control" name="diabetes" placeholder="Diabetes ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Neurologis</label>
                            <input type="text" class="form-control" name="neurologis" placeholder="Neurologis ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Artritis/otot & rangka</label>
                            <input type="text" class="form-control" name="artritis" placeholder="Artritis/otot & rangka ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Ginjal</label>
                            <input type="text" class="form-control" name="Ginjal" placeholder="Ginjal ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label>Lainya..</label>
                            <textarea class="form-control" name="lainya1" placeholder="Lainya..."></textarea>
                        </div>
                    </div>
                </div>

                <b>Pemeriksaan Fisik</b><br><br>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>TD</label>
                            <input type="text" class="form-control" name="TD" placeholder="TD  mmHg...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Jantung</label>
                            <input type="text" class="form-control" name="Jantung" placeholder="Jantung ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Paru</label>
                            <input type="text" class="form-control" name="Paru" placeholder="Paru ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Jalan Nafas</label>
                            <input type="text" class="form-control" name="Nafas" placeholder="Jantung ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label>N</label>
                            <input type="text" class="form-control" name="N" placeholder="x/menit ...">
                        </div>
                    </div>
                </div>

                <b>Dosis</b><br><br>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Dosis</label>
                            <input type="text" class="form-control" name="Dosis" placeholder="Dosis ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Jenis Anastesi</label>
                            <input type="text" class="form-control" name="Jenisanastesi" placeholder="Jenis Anastesi ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label>Cara Pemberian Anastesi</label>
                          <textarea name="carapemberian" id="" class="form-control"></textarea>
                        </div>
                    </div>
                </div> 

                <b>Penunjang</b><br><br>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>EKG</label>
                            <input type="text" class="form-control" name="Ekg" placeholder="Ekg ...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>X-Foto</label>
                            <input type="text" class="form-control" name="xfoto" placeholder="xFoto ...">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Lain-Lain</label>
                            <input type="text" class="form-control" name="Lainya3" placeholder="Lainya...">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Monitor Invasive</label>
                            <input type="text" class="form-control" name="invasive" placeholder="Monitor Invasive ...">
                        </div>
                    </div>
                </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>Tehnik Khusus</label>
                                <input type="text" class="form-control" name="Tehnik" placeholder="Tehnik Khusus...">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>Klafikasi ASA</label>
                                <input type="text" class="form-control" name="Asa" placeholder="Klasifikasi ASA ...">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>Rencana</label>
                                <input type="checkbox" name="Rencana" class="minimal" checked="" value="Ok" style="position: absolute; opacity: 0;"> Anastesi Local
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <a href="#" onclick="openWin()" class="btn btn-success">Tanda Tangan</a>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                        <?php
                        if($cekid > 0 ){
                    ?>
                     <button type="submit" class="btn btn-sm btn-danger" style="width: 100%;" disabled>Data Sudah Di Input</button> 
                    <?php }else{ ?>
                        <button onclick="return confirm('Apakah pengisian sudah benar?')" type="submit" class="btn btn-sm btn-primary" style="width: 100%;">Simpan</button>                 
                    <?php } ?>
                        </div>
                    </div>
                </form>
                </div>
                </div>
            </div>
            </div>
        </div>
    </section>
</div>
<script>
    let myWindow;

    function openWin() {
        myWindow = window.open("<?= base_url('Form/signatureanastesi/' . $this->uri->segment(3)); ?>", "_blank", "width=1000, height=800");
    }
</script>