<?= $this->extend('admin/layout/default') ?>
<?= $this->section('content') ?>
<section class="content-header">
  <div class="container-fluid">
    <h1>Edit Tax</h1>
  </div>
</section>
<section class="content">
  <div class="card">
    <div class="card-body">
      <?= form_open('taxes/update/'.$row->id, ['method' => 'post']) ?>
        <div class="form-group">
          <label>Name</label>
          <input type="text" name="name" class="form-control" value="<?= esc($row->name) ?>" required>
        </div>
        <div class="form-group">
          <label>Rate Type</label>
          <select name="rate_type" class="form-control">
            <option value="PERCENT" <?= $row->rate_type == 'PERCENT' ? 'selected' : '' ?>>Percent</option>
            <option value="FIXED" <?= $row->rate_type == 'FIXED' ? 'selected' : '' ?>>Fixed</option>
          </select>
        </div>
        <div class="form-group">
          <label>Rate</label>
          <input type="number" step="0.01" name="rate" class="form-control" value="<?= esc($row->rate) ?>" required>
        </div>
        <div class="form-group">
          <label>Status</label>
          <select name="status" class="form-control">
            <option value="1" <?= $row->status ? 'selected' : '' ?>>Active</option>
            <option value="0" <?= !$row->status ? 'selected' : '' ?>>Inactive</option>
          </select>
        </div>
        <button type="submit" class="btn btn-primary">Update</button>
      <?= form_close() ?>
    </div>
  </div>
</section>
<?= $this->endSection() ?>

