<?php
$currentPage = basename($_SERVER['PHP_SELF'], '.php');
$role        = $_SESSION['role'] ?? 'cashier';
$morePages   = ['more','members','register','camera-help','card-generator'];
$isMore      = in_array($currentPage, $morePages);
?>
</div><!-- /m-content -->

<!-- Bottom Navigation -->
<nav class="m-bottom-nav">
  <a href="<?= BASE_URL ?>/mobile/index.php"
     class="m-nav-item <?= $currentPage==='index'?'active':'' ?>">
    <i class="bi bi-speedometer2"></i>
    <span>Home</span>
  </a>
  <a href="<?= BASE_URL ?>/mobile/purchase.php"
     class="m-nav-item <?= $currentPage==='purchase'?'active':'' ?>">
    <i class="bi bi-bag-check"></i>
    <span>Purchase</span>
  </a>
  <a href="<?= BASE_URL ?>/mobile/scan.php"
     class="m-nav-item m-nav-center <?= $currentPage==='scan'?'active':'' ?>">
    <div class="m-nav-center-btn">
      <i class="bi bi-qr-code-scan"></i>
    </div>
    <span>Scan</span>
  </a>
  <a href="<?= BASE_URL ?>/mobile/redeem.php"
     class="m-nav-item <?= $currentPage==='redeem'?'active':'' ?>">
    <i class="bi bi-gift"></i>
    <span>Redeem</span>
  </a>
  <a href="<?= BASE_URL ?>/mobile/more.php"
     class="m-nav-item <?= $isMore?'active':'' ?>">
    <i class="bi bi-grid"></i>
    <span>More</span>
  </a>
</nav>

<!-- JS Libraries -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js"></script>
<!-- html5-qrcode — full Android camera support (jsdelivr, same CDN as all other libs) -->
<script src="https://cdn.jsdelivr.net/npm/html5-qrcode@2.3.8/html5-qrcode.min.js"></script>
<script src="<?= BASE_URL ?>/mobile/assets/mobile.js"></script>
<?php if (!empty($mExtraJS)) echo $mExtraJS; ?>
</body>
</html>
