<table class='table table-sm'>
    <tbody>
        <?php
        foreach ($data as $d) {
            echo "<tr>";
            //echo "<td><button onclick='scrap(" . $d['id_retur_det'] . ",\"" . $d['no_lot'] . "\")' data-bs-toggle='modal' data-bs-target='#f_scrap' type='button' style='float:right;' class='btn btn-danger btn-sm'><i class='bi bi-trash'></i></button></td>";
            if ($d['sts_retur'] == 1) {
                echo "<td>";
                echo "<b>" . $d['no_lot'] . "</b><br>" . $d['barang'] . "<br>";
                echo "<div style='float:right;' class='btn-group' role='group' aria-label='Basic outlined example'>
                <button onclick='kirim_gudang(" . $d['id_retur_det'] . ",\"" . $d['no_lot'] . "\")' type='button' class='btn btn-outline-primary'><i class='bi bi-hand-thumbs-up'></i>&nbsp;Kirim Gudang</button>                
                <button onclick='scrap(" . $d['id_retur_det'] . ",\"" . $d['no_lot'] . "\")' data-bs-toggle='modal' data-bs-target='#f_scrap' type='button' class='btn btn-outline-secondary'><i class='bi bi-hand-thumbs-down'></i>&nbsp;Barang Scrap</button>
              </div>";
                echo "</td>";
            }
            if ($d['sts_retur'] == 2) {
                echo "<td colspan='2'><b>" . $d['no_lot'] . "</b><br>" . $d['barang'] . "<span style='float:right;' class='badge rounded-pill bg-primary'>Gudang</span></td>";
            }
            if ($d['sts_retur'] == 3) {
                echo "<td colspan='2'><b>" . $d['no_lot'] . "</b><br>" . $d['barang'] . "<span style='float:right;' class='badge rounded-pill bg-secondary'>Scrap</span></td>";
            }
            echo "</tr>";
        }
        ?>
    </tbody>
</table>