<div class="rounded border border-gray p-2 mt-3">
  <table class="table table-bordered table-striped">
    <tr class="text-center">
      <th style="width: 120px">서비스정보</th>
      <th>서버파트정보</th>
      <th style="width: 600px">서비스 비고</th>
      <th style="width: 200px">결제관련사항</th>
    </tr>
    <?php foreach ($serviceCellDatas['entities'] as $entity): ?>
      <?php $serviceCellDatas['entity'] = $entity ?>
      <tr class="text-left">
        <td class="text-center" nowrap>
          <div><?= $serviceCellDatas['helper']->getFieldView('site', $entity->getSite(), $serviceCellDatas) ?> /
            <?= $serviceCellDatas['helper']->getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?>
          </div>
          <div><?= $serviceCellDatas['helper']->getListButton('detail', $entity->getCode(), $serviceCellDatas) ?></div>
          <div><?= $entity->getTitle() ?></div>
          <div>상면비 : <span class="text-danger"><?= number_format($entity->getRack()) ?></span>원</div>
          <div>회선비 : <span class="text-danger"><?= number_format($entity->getLine()) ?></span>원</div>
          <div>할인액 : <span class="text-danger"><?= number_format($entity->getSale()) ?></span>원</div>
          <div class=" mt-3">
            <?= $serviceCellDatas['helper']->getListButton('addServer', '대체서버추가', ['entity' => $entity], ['class' => 'btn btn-sm btn-primary']) ?>
          </div>
        </td>
        <td class="text-center" nowrap>
          <?= view_cell("\App\Cells\Equipment\ServerCell::detail", ['serviceEntity' => $entity]) ?>
        </td>
        <td class="text-center" nowrap>
          <?= form_open("/admin/customer/service/history/{$entity->getPK()}?return_url=" . urlencode(current_url()), ['method' => "post"]) ?>
          <?= $serviceCellDatas['helper']->getFieldForm('history', $entity->getHistory(), $serviceCellDatas) ?>
          <?= form_submit('', '저장', array("class" => "btn btn-outline btn-primary m-3")); ?>
          <?= form_close() ?>
        </td>
        <td><?= view('cells/service/payment', ['serviceEntity' => $entity]) ?></td>
      </tr>
    <?php endforeach; ?>
  </table>
</div>