Files
TravianZ/Templates/goldClub/trooplist.tpl
T
novgorodschi catalin dd64b1e6c7 Refactor GoldClub
Refactor GoldClub
2026-05-21 13:41:48 +03:00

49 lines
1.2 KiB
Smarty

<?php
$start = ($session->tribe - 1) * 10 + 1;
$end = $start + 5;
/* build unit list once (keeps alignment safe) */
$units = [];
for ($i = $start; $i <= $end; $i++) {
if (in_array($i, [4, 14, 23])) {
continue;
}
$units[] = $i;
}
?>
<table class="transparent" id="raidList" cellspacing="1" cellpadding="1">
<tr>
<?php foreach ($units as $i): ?>
<td>
<label for="t<?php echo $i - $start + 1; ?>">
<img class="unit u<?php echo $i; ?>"
title="<?php echo $technology->getUnitName($i); ?>"
src="img/x.gif">
</label>
</td>
<?php endforeach; ?>
</tr>
<tr>
<?php foreach ($units as $i): ?>
<?php $index = $i - $start + 1; ?>
<td>
<input class="text"
id="t<?php echo $index; ?>"
type="text"
name="t<?php echo $index; ?>"
value="<?php echo (isset(${'t'.$index}) && ${'t'.$index} > 0) ? ${'t'.$index} : 0; ?>">
</td>
<?php endforeach; ?>
</tr>
</table>