<?php $htmls = [] ?>
<?php foreach ($serverPartCellDatas['types'] as $type): ?>
  <?php $htmls[$type] = [] ?>
  <?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
    <?php foreach ($entities as $entity): ?>
      <?php $serverPartCellDatas['entity'] = $entity ?>
      <?php $htmls[$type][] = [
        'view' => $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas),
        'amount' => $entity->getTotalAmount(),
        'entity' => $entity
      ] ?>
    <?php endforeach ?>
  <?php endforeach ?>
<?php endforeach ?>
<table class="table table-bordered table-striped m-0 p-0">
  <?php foreach ($serverPartCellDatas['types'] as $type): ?>
    <tr class="m-0 p-0">
      <th class="text-end m-0 p-0" width="15%"><?= $serverPartCellDatas['service']->getHelper()->getListButton($type, '', $serverPartCellDatas) ?></th>
      <td class="text-start m-0 p-0">
        <?php foreach ($htmls[$type] as $html): ?>
          <?= $html['view'] ?>[<?= number_format($html['amount']) ?>원]<a href="/admin/equipment/serverpart/delete/<?= $html['entity']->getPK() ?>">❌</a><BR>
        <?php endforeach ?>
      </td>
    </tr>
  <?php endforeach ?>
</table>