<div class="col-lg-12">
    <div class="row">
        <?php
        foreach ($data as $d) {
            if ($d['no_pol_exp'] == '') {
        ?>
                <div class="col-xxl-4 col-md-4" style="cursor:pointer;" <?php echo "onclick='f_scan(" . $d['id_kendaraan'] . "," . $d['doc_sj'] . ")'" ?>>
                    <div class="card info-card sales-card">
                        <div class="card-header">
                            <span class="badge rounded-pill bg-primary" style="float:right;color:white;"><i class='bi bi-person-circle'></i>&nbsp;<?= $d['sopir'] ?></span>
                        </div>
                        <div class="card-body">
                            <h5 class="card-title"><i class='bi bi-truck'></i>&nbsp;<?= $d['no_pol'] ?> <span>| <?= $d['kota'] ?></span>
                            </h5>
                            <div class="d-flex align-items-center">
                                <div class="ps-0">
                                    <h6><?= $d['no_sj'] ?></h6>

                                </div>
                            </div>
                            <?php
                            $data = $this->M_sub_klero->hitung_fg_nopol($d['doc_sj']);

                            echo "<table class='table table-sm table-striped'>";
                            $i = 1;
                            foreach ($data as $d) {
                                echo "<tr>";
                                echo "<td>" . $d['barang'] . "</td>";
                                echo "<td style='text-align: right;'><span class='badge bg-success rounded-pill'>" . $d['hitung'] . "</span></td>";
                                echo "</tr>";
                                $i++;
                            }
                            echo "</table>";
                            ?>
                        </div>
                    </div>
                </div>
            <?php } else { ?>
                <div class="col-xxl-4 col-md-4" style="cursor:pointer;" <?php echo "onclick='f_scan_exp(" . $d['doc_sj'] . ")'" ?>>
                    <div class="card info-card sales-card">
                        <div class="card-header">
                            <span class="badge rounded-pill bg-warning" style="float:right;color:white;"><i class='bi bi-person-circle'></i>&nbsp;<?= $d['sopir'] ?></span>
                        </div>
                        <div class="card-body">
                            <h5 class="card-title"><i class='bi bi-truck'></i>&nbsp;<?= $d['no_pol'] ?> <span>| <?= $d['no_resi'] ?></span>
                            </h5>
                            <div class="d-flex align-items-center">
                                <div class="ps-0">
                                    <h6><?= $d['no_sj'] ?></h6>

                                </div>
                            </div>
                            <?php
                            $data = $this->M_sub_klero->hitung_fg_nopol($d['doc_sj']);

                            echo "<table class='table table-sm table-striped'>";
                            $i = 1;
                            foreach ($data as $d) {
                                echo "<tr>";
                                echo "<td>" . $d['barang'] . "</td>";
                                echo "<td style='text-align: right;'><span class='badge bg-success rounded-pill'>" . $d['hitung'] . "</span></td>";
                                echo "</tr>";
                                $i++;
                            }
                            echo "</table>";
                            ?>
                        </div>
                    </div>
                </div>
        <?php }
        } ?>
    </div>
</div>