dbmsv4/app/Views/cells/serverpart/parttable.php
2026-03-03 12:57:17 +09:00

40 lines
1.6 KiB
PHP

<?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['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas),
'amount' => $entity->getCalculatedAmount(),
'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="10%">
<?= $serverPartCellDatas['helper']->getListButton($type, '', $serverPartCellDatas) ?>
</th>
<th>
<table class="table table-striped m-0 p-0">
<?php foreach ($htmls[$type] as $html): ?>
<tr>
<td class="text-start m-0 p-0">
<?= $html['view'] ?>
</td>
<td class="text-end m-0 p-0 w-25">
<?= $html['entity']->getBilling() == PAYMENT['BILLING']['BASE'] ? "" : number_format($html['amount']) . "원" ?>
</td>
<td class="text-center m-0 p-0 w-5">
<?= $html['entity']->getBilling() == PAYMENT['BILLING']['BASE'] ? "" : "<a href=\"/admin/equipment/serverpart/delete/{$html['entity']->getPK()}\">❌</a>" ?>
</td>
</tr>
<?php endforeach ?>
</table>
</th>
</tr>
<?php endforeach ?>
</table>