<?= view('customer/menu', ['func' => $func, 'db' => $db]) ?>

<main class="wrap">
  <div class="ppob-page">
    <div class="ppob-card">
      <div class="ppob-head">
        <div class="ppob-title">Paket SMS &amp; Telepon</div>
        <div class="ppob-subtitle">Pilih provider untuk lanjut ke pembelian paket.</div>
      </div>

      <div class="ppob-grid">
        <?php
        $ppobList = $db->table("ppob")->where("idprodukdigital", 14)->where("aktif", 1)->get();

        if ($ppobList->getNumRows() == 0) {
          echo "<div class='ppob-empty'>Paket SMS/Telepon belum tersedia.</div>";
        }

        foreach ($ppobList->getResult() as $res) {
          $link = site_url("ppob/prabayar/" . $res->idprodukdigital . "/" . $res->digiflazz);
          $logo = site_url("admin/kategori/" . $res->logo);
          $nama = trim((string)$res->nama);
        ?>
          <a href="<?= $link ?>" class="ppob-grid-card" title="<?= htmlspecialchars($nama, ENT_QUOTES, 'UTF-8') ?>">
            <div class="ppob-grid-icon">
              <img src="<?= $logo ?>" alt="<?= htmlspecialchars($nama, ENT_QUOTES, 'UTF-8') ?>">
            </div>
            <div class="ppob-grid-name"><?= htmlspecialchars($nama, ENT_QUOTES, 'UTF-8') ?></div>
          </a>
        <?php } ?>
      </div>
    </div>
  </div>
</main>
