<?= $this->extend('frontend/layout/default') ?>
<?= $this->section('content') ?>

<section class="content-header">
  <div class="container-fluid">
    <div class="row mb-2">
      <div class="col-sm-6">
        <h1>Wallet</h1>
      </div>
    </div>
  </div>
</section>

<section class="content">
  <div class="container-fluid">
    <div class="small-box bg-success">
      <div class="inner">
        <h3><?php echo esc($balance) ?></h3>
        <p>Reward Points Balance</p>
      </div>
      <div class="icon">
        <i class="fas fa-wallet"></i>
      </div>
    </div>

    <div class="card">
      <div class="card-header">
        <h3 class="card-title">Ledger</h3>
      </div>
      <div class="card-body">
        <table id="example1" class="table table-bordered table-striped">
          <thead>
            <tr>
              <th width="90">Points</th>
              <th>Description</th>
              <th width="170">Created</th>
            </tr>
          </thead>
          <tbody>
            <?php foreach ($ledger as $l): ?>
              <tr>
                <td><?php echo esc($l->points_delta) ?></td>
                <td><?php echo esc($l->description) ?></td>
                <td><?php echo esc($l->created_at) ?></td>
              </tr>
            <?php endforeach ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</section>

<?= $this->endSection() ?>

