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

<section class="content-header">
  <div class="container-fluid">
    <div class="row mb-2">
      <div class="col-sm-6">
        <h1>Shop Subscriptions</h1>
      </div>
      <div class="col-sm-6">
        <ol class="breadcrumb float-sm-right">
          <li class="breadcrumb-item"><a href="<?php echo url('/') ?>">Home</a></li>
          <li class="breadcrumb-item active">Shop Subscriptions</li>
        </ol>
      </div>
    </div>
  </div>
</section>

<section class="content">
  <div class="card">
    <div class="card-header with-border">
      <h3 class="card-title">List</h3>
      <div class="card-tools pull-right">
        <a href="<?php echo url('shopSubscriptions/add') ?>" class="btn btn-primary btn-sm"><i class="fa fa-plus pr-1"></i> Assign</a>
      </div>
    </div>
    <div class="card-body">
      <table id="example1" class="table table-bordered table-striped">
        <thead>
          <tr>
            <th width="60">ID</th>
            <th>Shop</th>
            <th>Subscription</th>
            <th width="170">Start</th>
            <th width="170">End</th>
            <th width="110">Status</th>
            <th width="200">Action</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($rows as $row): ?>
            <tr>
              <td><?php echo $row->id ?></td>
              <td><?php echo esc($row->shop_name) ?></td>
              <td><?php echo esc($row->subscription_title) ?></td>
              <td><?php echo esc($row->start_at) ?></td>
              <td><?php echo esc($row->end_at) ?></td>
              <td><?php echo esc($row->status) ?></td>
              <td>
                <a href="<?php echo url('shopSubscriptions/view/'.$row->id) ?>" class="btn btn-sm btn-info" data-toggle="tooltip" title="View Receipt"><i class="fas fa-file-invoice"></i></a>
                <a href="<?php echo url('shopSubscriptions/edit/'.$row->id) ?>" class="btn btn-sm btn-default" data-toggle="tooltip" title="Edit"><i class="fas fa-edit"></i></a>
                <a href="<?php echo url('shopSubscriptions/delete/'.$row->id) ?>" class="btn btn-sm btn-danger" onclick="return confirm('Delete this record?')" data-toggle="tooltip" title="Delete"><i class="fas fa-trash"></i></a>
              </td>
            </tr>
          <?php endforeach ?>
        </tbody>
      </table>
    </div>
  </div>
</section>

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

