<table class='table table-striped table-hover datatable' width='100%' cellspacing='0' style='font-size: 12px;'>
    <thead>
        <tr>
        </tr>
    </thead>
    <?php
    date_default_timezone_set('asia/jakarta');
    include "model/koneksi.php";

    $id_pasien = $_GET['idx'];
    $query = mysqli_query($openinmut, "SELECT * FROM tb_tranfusi WHERE id_pasien='$id_pasien' ");
    $array = array();
    $no = 0;
    $statuscode = '200';

    while ($data = mysqli_fetch_assoc($query)) {
        $checkdata = mysqli_num_rows(mysqli_query($openinmut, "SELECT*FROM tb_tranfusi"));
        if ($checkdata > 0) {
            $site = "<div class='btn btn-sm btn-success'><i class='fas fa-check'></i></div>";
        } else {
            $site = "";
        }
        if ($data['reaksi'] == 1) {
            $reaksi = "Ya";
        } else {
            $reaksi = "Tidak";
        }
        $no++;
        echo "
        <tbody>
        <tr>
        <td><div>$no</div></td>
        <td><div>$data[ruang]</div></td>
        <td><div>$data[register]</div></td>
        <td><div>$data[nama]</div></td>
        <td><div>$data[komponen]</div></td>
        <td><div>$data[unit]</div></td>
        <td><div>$reaksi</div></td>
        <td><div>$site</div></td>
        </tbody>
        </table>
        </tr>";
    }
