<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>

<?php $urut = 0; foreach ($data as $key){ $urut++; ?>

  <div class="card">
    <div class="card-header">
      <h5><?php echo $key->tgl_daftar ?> <a class="btn btn-sm btn-default float-right" onclick="ambil_riwayat_kunjungan('<?php echo $key->bpjs_keluhan ?>', '<?php echo $key->bpjs_sistole ?>', '<?php echo $key->bpjs_diastole ?>', '<?php echo $key->bpjs_beratBadan ?>', '<?php echo $key->bpjs_tinggiBadan ?>', '<?php echo $key->bpjs_respRate ?>', '<?php echo $key->bpjs_heartRate ?>', '<?php echo $key->bpjs_lingkarPerut ?>', '<?php echo $key->bpjs_suhu ?>')"><i class="fas fa-download"> Copy data</i></a>
      </h5>
    </div>
    <div class="card-body">            
      <div class="row">
        <div class="col-12 col-sm-12 col-md-12 col-lg-4"> 
          <table width="100%">
            <tr>
              <td width="100px">Nomor Rawat</td>
              <td width="10px" align="center">:</td>
              <td><?php echo $key->no_rawat;  ?></td>
            </tr>
            <tr>
              <td>Keluhan</td>
              <td width="10px" align="center">:</td>
              <td><?php $keluhan = $key->bpjs_keluhan; echo $keluhan; ?></td>
            </tr>
            <tr>
              <td>Alergi</td>
              <td width="10px" align="center">:</td>
              <td><?php $alergi = $key->alergi; echo $alergi;  ?></td>
            </tr>
          </table>
        </div>

        <div class="col-12 col-sm-12 col-md-12 col-lg-4"> 
          <table width="100%">
            <tr>
              <td width="100px">Tensi</td>
              <td width="10px" align="center">:</td>
              <td><?php $sistole = $key->bpjs_sistole;  $diastole = $key->bpjs_diastole; echo $sistole.'/'.$diastole; ?></td>                   
              <td>mmHg</td>
            </tr>
            <tr>
              <td>Tinggi Badan</td>
              <td width="10px" align="center">:</td>
              <td><?php $tinggiBadan = $key->bpjs_tinggiBadan; echo $tinggiBadan; ?></td>                  
              <td>cm</td>
            </tr>
            <tr>
              <td>Lingkar Perut</td>
              <td width="10px" align="center">:</td>
              <td><?php $lingkarPerut = $key->bpjs_lingkarPerut; echo $lingkarPerut; ?></td>                 
              <td>cm</td>
            </tr>
          </table>
        </div>
        <div class="col-12 col-sm-12 col-md-12 col-lg-4"> 
          <table width="100%">
            <tr>
              <td width="100px">Resp Rate</td>
              <td width="10px" align="center">:</td>
              <td><?php $respRate = $key->bpjs_respRate; echo $respRate; ?></td>                         
              <td>/ minute</td>                    
            </tr>
            <tr>
              <td>Heart Rate</td>
              <td width="10px" align="center">:</td>
              <td><?php $heartRate = $key->bpjs_heartRate; echo $heartRate; ?></td>
              <td>bpm</td>   
            </tr>
            <tr>
              <td>Suhu</td>
              <td width="10px" align="center">:</td>
              <td><?php $suhu = $key->bpjs_suhu; echo $suhu; ?></td>                         
              <td><sup>o</sup>C</td>
            </tr>
          </table>
        </div>

      </div>
    </div>
  </div>

  <?php } ?>