<?= $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>View Service</h1>
      </div>
      <div class="col-sm-6 text-right">
        <?php if (hasPermissions('shop_services_manage')): ?>
          <a href="<?php echo url('rewarderServices/edit/'.$service->id) ?>" class="btn btn-primary btn-sm"><i class="fas fa-edit pr-1"></i> Edit</a>
        <?php endif ?>
      </div>
    </div>
  </div>
</section>

<section class="content">
  <div class="card">
    <div class="card-body">
      <table class="table table-bordered">
        <tbody>
          <tr>
            <th width="220">ID</th>
            <td><?php echo $service->id ?></td>
          </tr>
          <tr>
            <th>Shop</th>
            <td><?php echo esc($service->shop_name) ?></td>
          </tr>
          <tr>
            <th>Category</th>
            <td><?php echo esc($service->category_name) ?></td>
          </tr>
          <tr>
            <th>Name</th>
            <td><?php echo esc($service->name) ?></td>
          </tr>
          <tr>
            <th>Price</th>
            <td><?php echo esc($service->price) ?></td>
          </tr>
          <tr>
            <th>Status</th>
            <td><?php echo $service->status ? 'Active' : 'Inactive' ?></td>
          </tr>
          <tr>
            <th>Image</th>
            <td>
              <?php if (!empty($service->img_type)): ?>
                <img src="<?php echo urlUpload('services/'.$service->id.'.'.$service->img_type, true) ?>" style="max-height: 120px;">
              <?php else: ?>
                -
              <?php endif ?>
            </td>
          </tr>
          <tr>
            <th>Created At</th>
            <td><?php echo esc($service->created_at) ?></td>
          </tr>
          <tr>
            <th>Updated At</th>
            <td><?php echo esc($service->updated_at) ?></td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="card-footer">
      <a href="<?php echo url('rewarderServices') ?>" class="btn btn-flat btn-danger">Back</a>
    </div>
  </div>
</section>

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