Refactor + BugFix

1. Fix a bug in Admin Panel that you can edit by yourself your rank, now you cannot edit your rank anymore.

2. Now Alliance Leader can edit his own Position

3. Fix negative value on Demolition Building, now in database at lvl is appear new level not -1

4. Refactor Ajax map, now all is alligned (Ajax folder and Map folder)

5. Fix bug from Palace (when change capital now Automation recount population automaticaly on old capital and new capital)
This commit is contained in:
novgorodschi catalin
2026-05-18 09:18:35 +03:00
parent 2bce101a27
commit 55e6dd60b5
96 changed files with 6176 additions and 6763 deletions
+58 -33
View File
@@ -1,34 +1,59 @@
<?php
$trainlist = $technology->getTrainingList(4);
if(count($trainlist) > 0) {
echo "
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
<thead><tr>
<td>".TRAINING."</td>
<td>".DURATION."</td>
<td>".FINISHED."</td>
</tr></thead>
<tbody>";
$TrainCount = 0;
foreach($trainlist as $train) {
$TrainCount++;
echo "<tr><td class=\"desc\">";
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
if($time[0] != "today") {
echo "on ".$time[0]." at ";
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
<?php
// 26_progress.tpl - PALACE / TRAIN PROGRESS
global $technology, $generator, $session;
$trainList = $technology->getTrainingList(4); // unit 4 = pentru chief? păstrez ID-ul tău
if (!empty($trainList)):
$trainCount = 0;
$nextFinished = '';
?>
<table cellpadding="1" cellspacing="1" class="under_progress">
<thead>
<tr>
<td><?php echo TRAINING;?></td>
<td><?php echo DURATION;?></td>
<td><?php echo FINISHED;?></td>
</tr>
</thead>
<tbody>
<?php foreach ($trainList as $train):
$trainCount++;
$isFirst = ($trainCount === 1);
// timp rămas
$remaining = max(0, (int)$train['timestamp'] - time());
$duration = $isFirst? $remaining : (int)$train['eachtime'] * (int)$train['amt'];
$time = $generator->procMTime((int)$train['timestamp']);
if ($isFirst) {
$nextFinished = $generator->getTimeFormat(max(0, (int)$train['timestamp2'] - time()));
$timerMain = ++$session->timer;
}
?>
<tr>
<td class="desc">
<img class="unit u<?php echo (int)$train['unit'];?>" src="img/x.gif" alt="<?php echo htmlspecialchars($train['name']);?>" title="<?php echo htmlspecialchars($train['name']);?>" />
<?php echo (int)$train['amt'];?> <?php echo htmlspecialchars($train['name']);?>
</td>
<td class="dur">
<?php if ($isFirst):?>
<span id="timer<?php echo $timerMain;?>"><?php echo $generator->getTimeFormat($remaining);?></span>
<?php else:?>
<?php echo $generator->getTimeFormat($duration);?>
<?php endif;?>
</td>
<td class="fin">
<?php if ($time[0]!== "today") echo "on ".$time[0]." at "; echo $time[1];?>
</td>
</tr>
<?php endforeach;?>
<tr class="next">
<td colspan="3">
<?php echo UNIT_FINISHED;?>
<span id="timer<?php echo ++$session->timer;?>"><?php echo $nextFinished;?></span>
</td>
</tr>
</tbody>
</table>
<?php endif;?>