<?= 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">Semua Kategori</div>
        <div class="ppob-subtitle">Pilih layanan yang ingin Anda gunakan.</div>
      </div>

      <div class="svc-grid">
        <?php
        $kategoriList = $db->table("produkdigital")->whereIn("idcat", [1, 2])->where("status", 1)->get();

        foreach ($kategoriList->getResult() as $res) {
          $url = ($res->idcat == 1)
              ? site_url("ppob/" . strtolower(trim($res->url)))
              : site_url("ppob/pascabayar/" . rawurlencode(trim($res->deskripsi)));
        ?>
          <div class="svc" data-name="Layanan" data-key="<?= htmlspecialchars($res->nama, ENT_QUOTES, 'UTF-8') ?>">
            <a href="<?= $url ?>" class="svc-link">
              <div class="svc-ic">
                <img src="<?= site_url("admin/kategori/" . $res->variasi) ?>" alt="ppob"
                  width="50" height="50" style="object-fit:contain;">
              </div>
              <div class="svc-txt"><?= htmlspecialchars($res->nama, ENT_QUOTES, 'UTF-8') ?></div>
            </a>
          </div>
        <?php } ?>
      </div>
    </div>
  </div>
</main>
