<?= $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>Shopkeeper Dashboard</h1>
      </div>
    </div>
  </div>
</section>

<section class="content">
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-6">
        <div class="card">
          <div class="card-header">
            <h3 class="card-title">Shop</h3>
          </div>
          <div class="card-body">
            <?php if ($shop): ?>
              <div><strong><?php echo esc($shop->name) ?></strong></div>
              <div class="text-muted"><?php echo esc($shop->phone) ?></div>
              <div class="text-muted"><?php echo esc($shop->address) ?></div>
            <?php else: ?>
              <div class="text-danger">No shop assigned to this shopkeeper. Ask admin to assign a shop.</div>
            <?php endif ?>
          </div>
        </div>
      </div>

      <div class="col-md-6">
        <div class="card">
          <div class="card-header">
            <h3 class="card-title">Subscription</h3>
          </div>
          <div class="card-body">
            <?php if ($sub): ?>
              <div><strong><?php echo esc($sub->subscription_title) ?></strong></div>
              <div class="text-muted">Status: <?php echo esc($sub->status) ?></div>
              <div class="text-muted">Valid: <?php echo esc($sub->start_at) ?> → <?php echo esc($sub->end_at) ?></div>
            <?php else: ?>
              <div class="text-muted">No subscription assigned yet.</div>
            <?php endif ?>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

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

