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
+29 -32
View File
@@ -1,37 +1,34 @@
<?php
// 28.tpl - TRADEOFFICE
global $village, $building, $bid28, $id, $loopsame, $doublebuild, $master;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
$current = $level > 0 ? (int)$bid28[$level]['attri'] : 100;
?>
<div id="build" class="gid28"><a href="#" onClick="return Popup(28,4);" class="build_logo">
<img class="building g28" src="img/x.gif" alt="Trade Office" title="<?php echo TRADEOFFICE; ?>" />
</a>
<h1><?php echo TRADEOFFICE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc"><?php echo TRADEOFFICE_DESC; ?></p>
<div id="build" class="gid28">
<a href="#" onClick="return Popup(28,4);" class="build_logo">
<img class="building g28" src="img/x.gif" alt="Trade Office" title="<?php echo TRADEOFFICE;?>" />
</a>
<h1><?php echo TRADEOFFICE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo TRADEOFFICE_DESC;?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo CURRENT_MERCHANT; ?></th>
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid28[$village->resarray['f'.$id]]['attri'] : 100; ?></b> <?php echo PERCENT; ?></td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id] + 1 + $loopsame + $doublebuild + $master;
if($next<=20){
?>
<th><?php echo MERCHANT_LEVEL; ?> <?php echo $next; ?>:</th>
<td><b><?php echo $bid28[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
<?php
}else{
?>
<th><?php echo MERCHANT_LEVEL; ?> 20:</th>
<td><b><?php echo $bid28[20]['attri']; ?></b> <?php echo PERCENT; ?></td>
<?php
}}
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo CURRENT_MERCHANT;?></th>
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
</tr>
<tr>
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
$next = $level + 1 + $loopsame + $doublebuild + $master;
$next = $next > 20 ? 20 : $next;
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
<th><?php echo MERCHANT_LEVEL;?> <?php echo $next;?>:</th>
<td><b><?php echo (int)$bid28[$next]['attri'];?></b> <?php echo PERCENT;?></td>
<?php endif;?>
</tr>
</table>
<?php include("upgrade.tpl");?>
</div>