<style>
  .table-responsive {
    margin: 0 auto;
    width: 100%;
  }

  .table-bordered {
    border: 1px solid #ddd;
  }

  .table-bordered th,
  .table-bordered td {
    border: 1px solid #ddd;
    text-align: center;
  }

  .table-bordered th {
    background-color: #f2f2f2;
  }
</style>
@if ($client)
<h3>고객명 : <a href="/serviceDetail.sev?client_code={{$client->getClientCode()}}">{{$client->getTitle()}}</a> / 쿠폰발급대상 : {{count($entities)}} 대</h3>
@endif
<div class="table-responsive" id="table">
  <input type="hidden" id="token">
  <table class="table table-bordered table-hover table-striped">
    <thead>
      <tr>
        <th>No</th>
        <th>고객명</th>
        <th>서비스코드</th>
        <th>장비명</th>
        <th>사용내역</th>
        <th>남은 쿠폰수</th>
        <th>사용된 쿠폰수</th>
        <th>비고</th>
        <th>작업</th>
      </tr>
    </thead>
    <tbody>
      @php $i=0 @endphp
      @foreach($entities as $key=>$entity)
      <form method="post" action="{{DBMS_SITE_HOST}}/dbms/client/coupon/update">
        <input type="hidden" name="service_code" value="{{$entity->getServiceCode()}}">
        <input type="hidden" name="member_code" value="{{$member ? $member->getPK() : ""}}">
        <tr>
          <td>{{$total-(($curPage-1)*$perPage+$i)}}</td>
          <td>{{$clients[$entity->getClientCode()]->getTitle()}}</td>
          <td><a href="/serviceDetailSolo.sev?client_code={{$entity->getClientCode()}}&service_code={{$entity->getServiceCode()}}">{{$entity->getServiceCode()}}</td>
          <td>{{$entity->getServerCode()}}</td>
          <td><input type="text" name="title" value="" style="width:100%"></td>
          <td><input type="text" name="coupon" value="{{$entity->getCoupon()}}" maxlength="3" size="3"></td>
          <td><input type="text" name="coupon_use" value="{{$entity->getUsedCoupon()}}" maxlength="3" size="3"></td>
          <td><textarea name="coupon_note" rows="2" cols="40"></textarea></td>
          <td><a href="/IdcOnetimeList.sev?service_code={{$entity->getServiceCode()}}">내역보기</a>&nbsp;&nbsp;&nbsp;<input type="submit" value="수정"></td>
        </tr>
      </form>
      @php $i++ @endphp
      @endforeach
    </tbody>
  </table>
</div>
<div style=" text-align:center">{!!$pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $client ? $client->getClientCode() : "", 'mkid' => $member ? $member->getPK() : "", 'curPage' => $curPage, 'perPage' => $perPage])!!}
</div>