<form method="POST" class="form-horizontal" action="/shopCoupon/use_coupon">
  <div class="input-group">
    <?
      if ( $this -> coupon -> name )
      {
        $coupon_value = $this -> coupon -> name;
        if ( $this -> coupon -> type == 1 )
          $coupon_value .= ' (' . $this -> coupon -> amount . '%)';
      };
    ?>
    <input type="text" name="coupon" class="form-control" placeholder="Kod rabatowy" value="<?= $coupon_value;?>">
    <div class="input-group-append">
      <? if ( $this -> coupon -> name ):?>
        <a href="/shopCoupon/delete_coupon" class="btn btn-danger">
          <span class="text">usuń</span>
        </a>
      <? else:?>
        <button class="btn btn-success" type="submit">
          <span class="text">użyj</span>
        </button>
      <? endif;?>
    </div>
  </div>
</form>