mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-26 22:46:09 +00:00
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:
+47
-51
@@ -1,53 +1,49 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
|
||||
// WOODCUTER
|
||||
|
||||
include 'next.tpl';
|
||||
|
||||
// — pregătire date —
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentProd = $bid1[$currentLevel]['prod'] * SPEED;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = ($village->capital == 1) ? 20 : 10;
|
||||
|
||||
// calculează nivelul următor luând în calcul queue-urile
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextProd = $bid1[$nextLevel]['prod'] * SPEED;
|
||||
?>
|
||||
<div id="build" class="gid1"><a href="#" onClick="return Popup(0,4);" class="build_logo">
|
||||
<img class="building g1" src="img/x.gif" alt="<?php echo WOODCUTTER; ?>" title="<?php echo WOODCUTTER; ?>" />
|
||||
</a>
|
||||
<h1><?php echo WOODCUTTER; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo WOODCUTTER_DESC; ?></p>
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CUR_PROD; ?>:</th>
|
||||
<td><b><?php echo $bid1[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
|
||||
if($village->capital == 1) {
|
||||
if($next<=20){
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid1[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; 20 ?>:</th>
|
||||
<td><b><?php echo $bid1[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}}else{
|
||||
if($next<=10){
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid1[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
|
||||
<td><b><?php echo $bid1[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}}}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid1">
|
||||
<a href="#" onclick="return Popup(0,4);" class="build_logo">
|
||||
<img class="building g1" src="img/x.gif" alt="<?= WOODCUTTER ?>" title="<?= WOODCUTTER ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= WOODCUTTER ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= WOODCUTTER_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CUR_PROD ?>:</th>
|
||||
<td><b><?= $currentProd ?></b> <?= PER_HR ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= NEXT_PROD ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextProd ?></b> <?= PER_HR ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+43
-34
@@ -1,38 +1,47 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid10"><a href="#" onClick="return Popup(10,4);" class="build_logo">
|
||||
<img class="building g10" src="img/x.gif" alt="Warehouse" title="<?php echo WAREHOUSE; ?>" />
|
||||
</a>
|
||||
<h1><?php echo WAREHOUSE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo WAREHOUSE_DESC; ?></p>
|
||||
|
||||
// WAREHOUSE
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CAPACITY; ?></th>
|
||||
<td><b><?php echo $bid10[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo RESOURCE_UNITS; ?></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 CAPACITY_LEVEL; ?> <?php echo $next ?>:</th>
|
||||
<td><b><?php echo $bid10[$next]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo RESOURCE_UNITS; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo CAPACITY_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid10[20]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo RESOURCE_UNITS; ?></td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentCapacity = $bid10[$currentLevel]['attri'] * STORAGE_MULTIPLIER;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 20;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextCapacity = $bid10[$nextLevel]['attri'] * STORAGE_MULTIPLIER;
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid10">
|
||||
<a href="#" onclick="return Popup(10,4);" class="build_logo">
|
||||
<img class="building g10" src="img/x.gif" alt="<?= WAREHOUSE ?>" title="<?= WAREHOUSE ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= WAREHOUSE ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= WAREHOUSE_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_CAPACITY ?>:</th>
|
||||
<td><b><?= $currentCapacity ?></b> <?= RESOURCE_UNITS ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= CAPACITY_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextCapacity ?></b> <?= RESOURCE_UNITS ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+43
-35
@@ -1,39 +1,47 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid11"><a href="#" onClick="return Popup(11,4);" class="build_logo">
|
||||
<img class="building g11" src="img/x.gif" alt="Granary" title="<?php echo GRANARY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo GRANARY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo GRANARY_DESC; ?></p>
|
||||
|
||||
// GRANARY
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CAPACITY; ?></th>
|
||||
<td><b><?php echo $bid11[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo CROP_UNITS; ?></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 CAPACITY_LEVEL; ?> <?php echo $next ?>:</th>
|
||||
<td><b><?php echo $bid11[$next]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo CROP_UNITS; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo CAPACITY_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid11[20]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo CROP_UNITS; ?></td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentCapacity = $bid11[$currentLevel]['attri'] * STORAGE_MULTIPLIER;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 20;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextCapacity = $bid11[$nextLevel]['attri'] * STORAGE_MULTIPLIER;
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid11">
|
||||
<a href="#" onclick="return Popup(11,4);" class="build_logo">
|
||||
<img class="building g11" src="img/x.gif" alt="<?= GRANARY ?>" title="<?= GRANARY ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= GRANARY ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= GRANARY_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_CAPACITY ?>:</th>
|
||||
<td><b><?= $currentCapacity ?></b> <?= CROP_UNITS ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= CAPACITY_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextCapacity ?></b> <?= CROP_UNITS ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+27
-14
@@ -1,16 +1,29 @@
|
||||
<div id="build" class="gid12"><a href="#" onClick="return Popup(12,4);" class="build_logo">
|
||||
|
||||
<img class="building g12" src="img/x.gif" alt="Blacksmith" title="<?php echo BLACKSMITH; ?>" />
|
||||
</a>
|
||||
<h1><?php echo BLACKSMITH; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo BLACKSMITH_DESC; ?></p>
|
||||
<?php
|
||||
if ($building->getTypeLevel(12) > 0) {
|
||||
include("12_upgrades.tpl");
|
||||
} else {
|
||||
echo "<p><b><?php echo UPGRADES_COMMENCE_BLACKSMITH; ?></b><br>\n";
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
|
||||
// BLACKSMITH
|
||||
|
||||
// nu ai next.tpl aici în original, îl las așa
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$hasBlacksmith = $building->getTypeLevel(12) > 0;
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div id="build" class="gid12">
|
||||
<a href="#" onclick="return Popup(12,4);" class="build_logo">
|
||||
<img class="building g12" src="img/x.gif" alt="<?= BLACKSMITH ?>" title="<?= BLACKSMITH ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= BLACKSMITH ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= BLACKSMITH_DESC ?></p>
|
||||
|
||||
<?php if ($hasBlacksmith): ?>
|
||||
<?php include '12_upgrades.tpl'; ?>
|
||||
<?php else: ?>
|
||||
<p><b><?= UPGRADES_COMMENCE_BLACKSMITH ?></b></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+142
-96
@@ -1,99 +1,145 @@
|
||||
<?php
|
||||
|
||||
// BLACKSMITH UPGRADES
|
||||
|
||||
$abdata = $database->getABTech($village->wid);
|
||||
$ABups = $technology->getABUpgrades('b');
|
||||
$totalUps = count($ABups);
|
||||
$blacksmithLevel = $building->getTypeLevel(12);
|
||||
$bsAttri = $bid12[$blacksmithLevel]['attri'] / 100;
|
||||
|
||||
$start = $session->tribe * 10 - 9;
|
||||
$end = $session->tribe * 10 - 2;
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo BLACKSMITH; ?></td>
|
||||
<td><?php echo ACTION; ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
$abdata = $database->getABTech($village->wid);
|
||||
$ABups = $technology->getABUpgrades('b');
|
||||
$totalUps = count($ABups);
|
||||
for($i=($session->tribe*10-9);$i<=($session->tribe*10-2);$i++) {
|
||||
$j = $i % 10 ;
|
||||
if ( $technology->getTech($i) || $j == 1 ) {
|
||||
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> (Level ".$abdata['b'.$j];
|
||||
$ups = 0;
|
||||
if($totalUps > 0){
|
||||
foreach($ABups as $upgrade){
|
||||
if(in_array(("b".$j), $upgrade)) $ups++;
|
||||
}
|
||||
if($ups > 0) echo "+".$ups;
|
||||
}
|
||||
echo ")</div>";
|
||||
|
||||
if($abdata['b'.$j]+$ups != 20) {
|
||||
echo "<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'ab'.$i}[$abdata['b'.$j]+1+$ups]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'ab'.$i}[$abdata['b'.$j]+1+$ups]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'ab'.$i}[$abdata['b'.$j]+1+$ups]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'ab'.$i}[$abdata['b'.$j]+1+$ups]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'ab'.$i}[$abdata['b'.$j]+1+$ups]['time']*($bid12[$building->getTypeLevel(12)]['attri'] / 100)/SPEED));
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'ab'.$i}[$abdata['b'.$j]+1+$ups]['wood'] + ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['clay'] + ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['iron'] + ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['crop']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'ab'.$i}[$abdata['b'.$j]+1+$ups]['wood']."&r2=".${'ab'.$i}[$abdata['b'.$j]+1+$ups]['clay']."&r3=".${'ab'.$i}[$abdata['b'.$j]+1+$ups]['iron']."&r4=".${'ab'.$i}[$abdata['b'.$j]+1+$ups]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
}
|
||||
if($abdata['b'.$j] == 20) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".MAXIMUM_LEVEL."</div></td></tr>";
|
||||
}
|
||||
else if ($building->getTypeLevel(12) <= $abdata['b'.$j]+$ups) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".UPGRADE_BLACKSMITH."</div></td></tr>";
|
||||
}
|
||||
else if(${'ab'.$i}[$abdata['b'.$j]+1+$ups]['wood'] > $village->maxstore || ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['clay'] > $village->maxstore || ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['iron'] > $village->maxstore) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".EXPAND_WAREHOUSE."</div></td></tr>";
|
||||
}
|
||||
else if (${'ab'.$i}[$abdata['b'.$j]+1+$ups]['crop'] > $village->maxcrop) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".EXPAND_GRANARY."</div></td></tr>";
|
||||
}
|
||||
else if (${'ab'.$i}[$abdata['b'.$j]+1+$ups]['wood'] > $village->awood || ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['clay'] > $village->aclay || ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['iron'] > $village->airon || ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0 || $village->acrop > ${'ab'.$i}[$abdata['b'.$j]+1+$ups]['crop']){
|
||||
$time = $technology->calculateAvaliable(12,${'ab'.$i}[$abdata['b'.$j]+1+$ups]);
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">".CROP_NEGATIVE."</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">".TOO_FEW_RESOURCES."</div></td></tr>";
|
||||
}
|
||||
else if ($totalUps == 1 && !$session->plus || $totalUps > 1) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".UPGRADE_IN_PROGRESS."</div></td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "<td class=\"act\"><a class=\"research\" href=\"build.php?id=$id&a=$j&c=".$session->mchecker."\">".UPGRADE."</a>";
|
||||
if($totalUps != 0) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
echo"</td></tr>";
|
||||
}else{
|
||||
echo "<td class=\"act\"><a class=\"research\" href=\"banned.php\">".UPGRADE."</a>";
|
||||
if($totalUps != 0) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
echo"</td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= BLACKSMITH?></td>
|
||||
<td><?= ACTION?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php for ($i = $start; $i <= $end; $i++):
|
||||
$j = $i % 10;
|
||||
if (!($technology->getTech($i) || $j == 1)) continue;
|
||||
|
||||
$unitName = $technology->getUnitName($i);
|
||||
$current = (int)$abdata['b'.$j];
|
||||
|
||||
// câte upgrade-uri sunt deja în coadă pentru unitatea asta
|
||||
$ups = 0;
|
||||
foreach ($ABups as $up) {
|
||||
if (in_array('b'.$j, $up)) $ups++;
|
||||
}
|
||||
$shownLevel = $current + $ups;
|
||||
$nextLevel = $shownLevel + 1;
|
||||
$ab = ${'ab'.$i};
|
||||
$next = $ab[$nextLevel]?? null;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?= $i?>" src="img/x.gif" alt="<?= $unitName?>" title="<?= $unitName?>">
|
||||
<a href="#" onclick="return Popup(<?= $i?>,1);"><?= $unitName?></a>
|
||||
(<?= LEVEL?> <?= $current?><?= $ups > 0? '+'.$ups : ''?>)
|
||||
</div>
|
||||
|
||||
<?php if ($current < 20 && $next):?>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber"> <?= $next['wood']?>|
|
||||
<img class="r2" src="img/x.gif" alt="Clay" title="Clay"> <?= $next['clay']?>|
|
||||
<img class="r3" src="img/x.gif" alt="Iron" title="Iron"> <?= $next['iron']?>|
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop"> <?= $next['crop']?>|
|
||||
<img class="clock" src="img/x.gif" alt="duration" title="duration">
|
||||
<?= $generator->getTimeFormat(round($next['time'] * $bsAttri / SPEED))?>
|
||||
|
||||
<?php
|
||||
$totalRequired = $next['wood'] + $next['clay'] + $next['iron'] + $next['crop'];
|
||||
$canNpc = $session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $totalRequired;
|
||||
?>
|
||||
<?php if ($canNpc):?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?= $next['wood']?>&r2=<?= $next['clay']?>&r3=<?= $next['iron']?>&r4=<?= $next['crop']?>" title="NPC trade">
|
||||
<img class="npc" src="img/x.gif" alt="NPC trade" title="NPC trade">
|
||||
</a>
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
// mesaj resurse insuficiente
|
||||
if ($next['wood'] > $village->awood || $next['clay'] > $village->aclay || $next['iron'] > $village->airon || $next['crop'] > $village->acrop) {
|
||||
if ($village->getProd('crop') > 0 || $village->acrop > $next['crop']) {
|
||||
$time = $technology->calculateAvaliable(12, $next);
|
||||
echo '<br><span class="none">'.ENOUGH_RESOURCES.' '.$time[0].' at '.$time[1].'</span>';
|
||||
} else {
|
||||
echo '<br><span class="none">'.CROP_NEGATIVE.'</span>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
|
||||
<td class="act">
|
||||
<?php if ($current >= 20):?>
|
||||
<div class="none"><?= MAXIMUM_LEVEL?></div>
|
||||
|
||||
<?php elseif ($blacksmithLevel <= $shownLevel):?>
|
||||
<div class="none"><?= UPGRADE_BLACKSMITH?></div>
|
||||
|
||||
<?php elseif ($next && ($next['wood'] > $village->maxstore || $next['clay'] > $village->maxstore || $next['iron'] > $village->maxstore)):?>
|
||||
<div class="none"><?= EXPAND_WAREHOUSE?></div>
|
||||
|
||||
<?php elseif ($next && $next['crop'] > $village->maxcrop):?>
|
||||
<div class="none"><?= EXPAND_GRANARY?></div>
|
||||
|
||||
<?php elseif ($next && ($next['wood'] > $village->awood || $next['clay'] > $village->aclay || $next['iron'] > $village->airon || $next['crop'] > $village->acrop)):?>
|
||||
<div class="none"><?= TOO_FEW_RESOURCES?></div>
|
||||
|
||||
<?php elseif ($totalUps == 1 &&!$session->plus || $totalUps > 1):?>
|
||||
<div class="none"><?= UPGRADE_IN_PROGRESS?></div>
|
||||
|
||||
<?php elseif ($session->access!= BANNED):?>
|
||||
<a class="research" href="build.php?id=<?= $id?>&a=<?= $j?>&c=<?= $session->mchecker?>"><?= UPGRADE?></a>
|
||||
<?php if ($totalUps!= 0):?><span class="none"> <?= WAITING?></span><?php endif;?>
|
||||
|
||||
<?php else:?>
|
||||
<a class="research" href="banned.php"><?= UPGRADE?></a>
|
||||
<?php if ($totalUps!= 0):?><span class="none"> <?= WAITING?></span><?php endif;?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if($totalUps > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".UPGRADING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
foreach($ABups as $black) {
|
||||
$count++;
|
||||
$ABUnit = substr($black['tech'], 1, 2);
|
||||
$abdata['b'.$ABUnit]++;
|
||||
$unit = ($session->tribe - 1) * 10 + $ABUnit;
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit);
|
||||
echo "<span class=\"none\"> (".LEVEL." ".$abdata['b'.$ABUnit].")</span>";
|
||||
if($count > 1) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
echo "</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($black['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($black['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
<?php if ($totalUps > 0):?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= UPGRADING?></td>
|
||||
<td><?= DURATION?></td>
|
||||
<td><?= COMPLETE?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach ($ABups as $black):
|
||||
$count++;
|
||||
$ABUnit = (int)substr($black['tech'], 1, 2);
|
||||
$abdata['b'.$ABUnit]++; // incrementează pentru afișare corectă
|
||||
$unit = ($session->tribe - 1) * 10 + $ABUnit;
|
||||
$unitName = $technology->getUnitName($unit);
|
||||
$date = $generator->procMtime($black['timestamp']);
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<img class="unit u<?= $unit?>" src="img/x.gif" alt="<?= $unitName?>" title="<?= $unitName?>">
|
||||
<?= $unitName?>
|
||||
<span class="none"> (<?= LEVEL?> <?= $abdata['b'.$ABUnit]?>)</span>
|
||||
<?php if ($count > 1):?><span class="none"> <?= WAITING?></span><?php endif;?>
|
||||
</td>
|
||||
<td class="dur"><span id="timer<?= ++$session->timer?>"><?= $generator->getTimeFormat($black['timestamp'] - time())?></span></td>
|
||||
<td class="fin"><span><?= $date[1]?></span><span> hrs</span></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
+26
-14
@@ -1,16 +1,28 @@
|
||||
<div id="build" class="gid13"><a href="#" onClick="return Popup(13,4);" class="build_logo">
|
||||
|
||||
<img class="building g13" src="img/x.gif" alt="Armoury" title="<?php echo ARMOURY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo ARMOURY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo ARMOURY_DESC; ?></p>
|
||||
<?php
|
||||
if ($building->getTypeLevel(13) > 0) {
|
||||
include("13_upgrades.tpl");
|
||||
} else {
|
||||
echo "<p><b><?php echo UPGRADES_COMMENCE_ARMOURY; ?>Upgrades can commence when armoury is completed.</b><br>\n";
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
|
||||
// ARMOURY
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = isset($village->resarray[$field]) ? (int)$village->resarray[$field] : 0;
|
||||
$hasArmoury = $building->getTypeLevel(13) > 0;
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div id="build" class="gid13">
|
||||
<a href="#" onclick="return Popup(13,4);" class="build_logo">
|
||||
<img class="building g13" src="img/x.gif" alt="<?php echo ARMOURY; ?>" title="<?php echo ARMOURY; ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?php echo ARMOURY; ?>
|
||||
<span class="level"><?php echo LEVEL; ?> <?php echo $currentLevel; ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?php echo ARMOURY_DESC; ?></p>
|
||||
|
||||
<?php if ($hasArmoury): ?>
|
||||
<?php include '13_upgrades.tpl'; ?>
|
||||
<?php else: ?>
|
||||
<p><b><?php echo UPGRADES_COMMENCE_ARMOURY; ?></b></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+141
-96
@@ -1,99 +1,144 @@
|
||||
<?php
|
||||
|
||||
// ARMOURY UPGRADES
|
||||
|
||||
$abdata = $database->getABTech($village->wid);
|
||||
$ABups = $technology->getABUpgrades('a');
|
||||
$totalUps = count($ABups);
|
||||
$armouryLevel = $building->getTypeLevel(13);
|
||||
$arAttri = $bid13[$armouryLevel]['attri'] / 100;
|
||||
|
||||
$start = $session->tribe * 10 - 9;
|
||||
$end = $session->tribe * 10 - 2;
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo ARMOURY; ?></td>
|
||||
<td><?php echo ACTION; ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
$abdata = $database->getABTech($village->wid);
|
||||
$ABups = $technology->getABUpgrades('a');
|
||||
$totalUps = count($ABups);
|
||||
for($i=($session->tribe*10-9);$i<=($session->tribe*10-2);$i++) {
|
||||
$j = $i % 10 ;
|
||||
if ( $technology->getTech($i) || $j == 1 ) {
|
||||
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> (Level ".$abdata['a'.$j];
|
||||
$ups = 0;
|
||||
if($totalUps > 0){
|
||||
foreach($ABups as $upgrade){
|
||||
if(in_array(("a".$j), $upgrade)) $ups++;
|
||||
}
|
||||
if($ups > 0) echo "+".$ups;
|
||||
}
|
||||
echo ")</div>";
|
||||
|
||||
if($abdata['a'.$j]+$ups != 20) {
|
||||
echo "<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'ab'.$i}[$abdata['a'.$j]+1+$ups]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'ab'.$i}[$abdata['a'.$j]+1+$ups]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'ab'.$i}[$abdata['a'.$j]+1+$ups]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'ab'.$i}[$abdata['a'.$j]+1+$ups]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'ab'.$i}[$abdata['a'.$j]+1+$ups]['time']*($bid13[$building->getTypeLevel(13)]['attri'] / 100)/SPEED));
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'ab'.$i}[$abdata['a'.$j]+1+$ups]['wood'] + ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['clay'] + ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['iron'] + ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['crop']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'ab'.$i}[$abdata['a'.$j]+1+$ups]['wood']."&r2=".${'ab'.$i}[$abdata['a'.$j]+1+$ups]['clay']."&r3=".${'ab'.$i}[$abdata['a'.$j]+1+$ups]['iron']."&r4=".${'ab'.$i}[$abdata['a'.$j]+1+$ups]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
}
|
||||
if($abdata['a'.$j] == 20) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".MAXIMUM_LEVEL."</div></td></tr>";
|
||||
}
|
||||
else if ($building->getTypeLevel(13) <= $abdata['a'.$j]+$ups) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".UPGRADE_ARMOURY."</div></td></tr>";
|
||||
}
|
||||
else if(${'ab'.$i}[$abdata['a'.$j]+1+$ups]['wood'] > $village->maxstore || ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['clay'] > $village->maxstore || ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['iron'] > $village->maxstore) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".EXPAND_WAREHOUSE."</div></td></tr>";
|
||||
}
|
||||
else if (${'ab'.$i}[$abdata['a'.$j]+1+$ups]['crop'] > $village->maxcrop) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".EXPAND_GRANARY."</div></td></tr>";
|
||||
}
|
||||
else if (${'ab'.$i}[$abdata['a'.$j]+1+$ups]['wood'] > $village->awood || ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['clay'] > $village->aclay || ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['iron'] > $village->airon || ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0 || $village->acrop > ${'ab'.$i}[$abdata['a'.$j]+1+$ups]['crop']){
|
||||
$time = $technology->calculateAvaliable(13,${'ab'.$i}[$abdata['a'.$j]+1+$ups]);
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">".CROP_NEGATIVE."</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">".TOO_FEW_RESOURCES."</div></td></tr>";
|
||||
}
|
||||
else if ($totalUps == 1 && !$session->plus || $totalUps > 1) {
|
||||
echo "<td class=\"act\"><div class=\"none\">".UPGRADE_IN_PROGRESS."</div></td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "<td class=\"act\"><a class=\"research\" href=\"build.php?id=$id&a=$j&c=".$session->mchecker."\">".UPGRADE."</a>";
|
||||
if($totalUps != 0) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
echo"</td></tr>";
|
||||
}else{
|
||||
echo "<td class=\"act\"><a class=\"research\" href=\"banned.php\">".UPGRADE."</a>";
|
||||
if($totalUps != 0) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
echo"</td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= ARMOURY?></td>
|
||||
<td><?= ACTION?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php for ($i = $start; $i <= $end; $i++):
|
||||
$j = $i % 10;
|
||||
if (!($technology->getTech($i) || $j == 1)) continue;
|
||||
|
||||
$unitName = $technology->getUnitName($i);
|
||||
$current = (int)$abdata['a'.$j];
|
||||
|
||||
// câte upgrade-uri sunt deja în coadă pentru unitatea asta
|
||||
$ups = 0;
|
||||
foreach ($ABups as $up) {
|
||||
if (in_array('a'.$j, $up)) $ups++;
|
||||
}
|
||||
$shownLevel = $current + $ups;
|
||||
$nextLevel = $shownLevel + 1;
|
||||
$ab = ${'ab'.$i};
|
||||
$next = $ab[$nextLevel]?? null;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?= $i?>" src="img/x.gif" alt="<?= $unitName?>" title="<?= $unitName?>">
|
||||
<a href="#" onclick="return Popup(<?= $i?>,1);"><?= $unitName?></a>
|
||||
(<?= LEVEL?> <?= $current?><?= $ups > 0? '+'.$ups : ''?>)
|
||||
</div>
|
||||
|
||||
<?php if ($current < 20 && $next):?>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber"> <?= $next['wood']?>|
|
||||
<img class="r2" src="img/x.gif" alt="Clay" title="Clay"> <?= $next['clay']?>|
|
||||
<img class="r3" src="img/x.gif" alt="Iron" title="Iron"> <?= $next['iron']?>|
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop"> <?= $next['crop']?>|
|
||||
<img class="clock" src="img/x.gif" alt="duration" title="duration">
|
||||
<?= $generator->getTimeFormat(round($next['time'] * $arAttri / SPEED))?>
|
||||
|
||||
<?php
|
||||
$totalRequired = $next['wood'] + $next['clay'] + $next['iron'] + $next['crop'];
|
||||
$canNpc = $session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $totalRequired;
|
||||
?>
|
||||
<?php if ($canNpc):?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?= $next['wood']?>&r2=<?= $next['clay']?>&r3=<?= $next['iron']?>&r4=<?= $next['crop']?>" title="NPC trade">
|
||||
<img class="npc" src="img/x.gif" alt="NPC trade" title="NPC trade">
|
||||
</a>
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
if ($next['wood'] > $village->awood || $next['clay'] > $village->aclay || $next['iron'] > $village->airon || $next['crop'] > $village->acrop) {
|
||||
if ($village->getProd('crop') > 0 || $village->acrop > $next['crop']) {
|
||||
$time = $technology->calculateAvaliable(13, $next);
|
||||
echo '<br><span class="none">'.ENOUGH_RESOURCES.' '.$time[0].' at '.$time[1].'</span>';
|
||||
} else {
|
||||
echo '<br><span class="none">'.CROP_NEGATIVE.'</span>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
|
||||
<td class="act">
|
||||
<?php if ($current >= 20):?>
|
||||
<div class="none"><?= MAXIMUM_LEVEL?></div>
|
||||
|
||||
<?php elseif ($armouryLevel <= $shownLevel):?>
|
||||
<div class="none"><?= UPGRADE_ARMOURY?></div>
|
||||
|
||||
<?php elseif ($next && ($next['wood'] > $village->maxstore || $next['clay'] > $village->maxstore || $next['iron'] > $village->maxstore)):?>
|
||||
<div class="none"><?= EXPAND_WAREHOUSE?></div>
|
||||
|
||||
<?php elseif ($next && $next['crop'] > $village->maxcrop):?>
|
||||
<div class="none"><?= EXPAND_GRANARY?></div>
|
||||
|
||||
<?php elseif ($next && ($next['wood'] > $village->awood || $next['clay'] > $village->aclay || $next['iron'] > $village->airon || $next['crop'] > $village->acrop)):?>
|
||||
<div class="none"><?= TOO_FEW_RESOURCES?></div>
|
||||
|
||||
<?php elseif ($totalUps == 1 &&!$session->plus || $totalUps > 1):?>
|
||||
<div class="none"><?= UPGRADE_IN_PROGRESS?></div>
|
||||
|
||||
<?php elseif ($session->access!= BANNED):?>
|
||||
<a class="research" href="build.php?id=<?= $id?>&a=<?= $j?>&c=<?= $session->mchecker?>"><?= UPGRADE?></a>
|
||||
<?php if ($totalUps!= 0):?><span class="none"> <?= WAITING?></span><?php endif;?>
|
||||
|
||||
<?php else:?>
|
||||
<a class="research" href="banned.php"><?= UPGRADE?></a>
|
||||
<?php if ($totalUps!= 0):?><span class="none"> <?= WAITING?></span><?php endif;?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if($totalUps > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".UPGRADING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
foreach($ABups as $arms) {
|
||||
$count++;
|
||||
$ABUnit = substr($arms['tech'], 1, 2);
|
||||
$abdata['a' . $ABUnit]++;
|
||||
$unit = ($session->tribe - 1) * 10 + $ABUnit;
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit);
|
||||
echo "<span class=\"none\"> (".LEVEL." ".$abdata['a'.$ABUnit].")</span>";
|
||||
if($count > 1) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
echo "</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($arms['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($arms['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
<?php if ($totalUps > 0):?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= UPGRADING?></td>
|
||||
<td><?= DURATION?></td>
|
||||
<td><?= COMPLETE?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach ($ABups as $arms):
|
||||
$count++;
|
||||
$ABUnit = (int)substr($arms['tech'], 1, 2);
|
||||
$abdata['a'.$ABUnit]++;
|
||||
$unit = ($session->tribe - 1) * 10 + $ABUnit;
|
||||
$unitName = $technology->getUnitName($unit);
|
||||
$date = $generator->procMtime($arms['timestamp']);
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<img class="unit u<?= $unit?>" src="img/x.gif" alt="<?= $unitName?>" title="<?= $unitName?>">
|
||||
<?= $unitName?>
|
||||
<span class="none"> (<?= LEVEL?> <?= $abdata['a'.$ABUnit]?>)</span>
|
||||
<?php if ($count > 1):?><span class="none"> <?= WAITING?></span><?php endif;?>
|
||||
</td>
|
||||
<td class="dur"><span id="timer<?= ++$session->timer?>"><?= $generator->getTimeFormat($arms['timestamp'] - time())?></span></td>
|
||||
<td class="fin"><span><?= $date[1]?></span><span> hrs</span></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
+43
-33
@@ -1,37 +1,47 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid14"><a href="#" onClick="return Popup(14,4);" class="build_logo">
|
||||
<img class="building g14" src="img/x.gif" alt="Tournament Square" title="<?php echo TOURNAMENTSQUARE; ?>" />
|
||||
</a>
|
||||
<h1><?php echo TOURNAMENTSQUARE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo TOURNAMENTSQUARE_DESC; ?> </p>
|
||||
|
||||
// TOURNAMENT SQUARE
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_SPEED; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid14[$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 SPEED_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid14[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo SPEED_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid14[20]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int)($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentSpeed = $currentLevel > 0 ? $bid14[$currentLevel]['attri'] : 100;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 20;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextSpeed = $bid14[$nextLevel]['attri'];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid14">
|
||||
<a href="#" onclick="return Popup(14,4);" class="build_logo">
|
||||
<img class="building g14" src="img/x.gif" alt="<?= TOURNAMENTSQUARE ?>" title="<?= TOURNAMENTSQUARE ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= TOURNAMENTSQUARE ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= TOURNAMENTSQUARE_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_SPEED ?>:</th>
|
||||
<td><b><?= $currentSpeed ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= SPEED_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextSpeed ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+48
-37
@@ -1,41 +1,52 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid15"><a href="#" onClick="return Popup(15,4);" class="build_logo">
|
||||
<img class="building g15" src="img/x.gif" alt="Main Building" title="<?php echo MAINBUILDING; ?>" />
|
||||
</a>
|
||||
<h1><?php echo MAINBUILDING; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo MAINBUILDING_DESC; ?></p>
|
||||
|
||||
// MAIN BUILDING
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CONSTRUCTION_TIME; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? round($bid15[$village->resarray['f'.$id]]['attri']) : 300; ?></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 CONSTRUCTION_TIME_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo round($bid15[$next]['attri']); ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo CONSTRUCTION_TIME_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo round($bid15[20]['attri']); ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if($village->resarray['f'.$id] >= 10){
|
||||
include("Templates/Build/15_1.tpl");
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int)($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentTime = $currentLevel > 0 ? round($bid15[$currentLevel]['attri']) : 300;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 20;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextTime = round($bid15[$nextLevel]['attri']);
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid15">
|
||||
<a href="#" onclick="return Popup(15,4);" class="build_logo">
|
||||
<img class="building g15" src="img/x.gif" alt="<?= MAINBUILDING ?>" title="<?= MAINBUILDING ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= MAINBUILDING ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= MAINBUILDING_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_CONSTRUCTION_TIME ?>:</th>
|
||||
<td><b><?= $currentTime ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= CONSTRUCTION_TIME_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextTime ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if ($currentLevel >= 10) {
|
||||
include 'Templates/Build/15_1.tpl';
|
||||
}
|
||||
include 'upgrade.tpl';
|
||||
?>
|
||||
</div>
|
||||
+134
-110
@@ -1,123 +1,147 @@
|
||||
<?php
|
||||
$ty = (isset($_GET['ty']))? $_GET['ty']:"";
|
||||
if(isset($_REQUEST["cancel"]) && $_REQUEST["cancel"] == "1") {
|
||||
|
||||
// MAIN BUILDING DEMOLISH
|
||||
|
||||
$ty = isset($_GET['ty'])? $_GET['ty'] : '';
|
||||
|
||||
// cancel demolition
|
||||
if (isset($_REQUEST['cancel']) && $_REQUEST['cancel'] == '1') {
|
||||
$database->delDemolition($village->wid);
|
||||
header("Location: build.php?gid=15&ty=$ty&cancel=0&demolish=0");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
|
||||
if($session->alliance) $memberCount = $database->countAllianceMembers($session->alliance);
|
||||
else $memberCount = 0;
|
||||
$memberCount = $session->alliance? $database->countAllianceMembers($session->alliance) : 0;
|
||||
$VillageLevels = $database->getResourceLevel($village->wid);
|
||||
|
||||
if(!empty($_REQUEST["demolish"]) && $_REQUEST["c"] == $session->mchecker) {
|
||||
if($_REQUEST["type"] != null && ($_REQUEST["type"] >= 19 && $_REQUEST["type"] <= 40 || $_REQUEST["type"] == 99)) {
|
||||
$type = $_REQUEST['type'];
|
||||
$demolish_permitted = $database->addDemolition($village->wid,$type);
|
||||
if ($demolish_permitted === true) {
|
||||
$session->changeChecker();
|
||||
header("Location: build.php?gid=15&ty=$type&cancel=0&demolish=0");
|
||||
}
|
||||
else header("Location: build.php?gid=15&ty=$type&nodemolish=".$demolish_permitted);
|
||||
exit;
|
||||
// start demolition
|
||||
if (!empty($_REQUEST['demolish']) && $_REQUEST['c'] == $session->mchecker) {
|
||||
$type = (int)($_REQUEST['type']?? 0);
|
||||
$instant = isset($_POST['instant']) && $_POST['instant'] == '1';
|
||||
|
||||
if ($type >= 19 && $type <= 40 || $type == 99) {
|
||||
$field = 'f'.$type;
|
||||
$buildType = $VillageLevels[$field.'t'];
|
||||
$currentLvl = $VillageLevels[$field];
|
||||
|
||||
// blocaj ambasada - la fel ca originalul
|
||||
if($buildType == 18 && $session->alliance && $database->isAllianceOwner($session->uid) == $session->alliance && $memberCount > 1){
|
||||
header("Location: build.php?gid=15&ty=$type&nodemolish=18");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($instant){
|
||||
// DEMOLARE COMPLETA CU GOLD
|
||||
if($session->gold < 10){
|
||||
header("Location: build.php?gid=15&ty=$type¬enoughgold=1");
|
||||
exit;
|
||||
}
|
||||
if($currentLvl > 0){
|
||||
// sterge orice demolare in curs
|
||||
$database->delDemolition($village->wid);
|
||||
// setare nivel 0 direct in DB
|
||||
$database->query("UPDATE ".TB_PREFIX."fdata SET `$field` = 0, `{$field}t` = 0 WHERE `vref` = ".$village->wid);
|
||||
// scade gold
|
||||
$database->modifyGold($session->uid, -10, 0);
|
||||
$session->gold -= 10;
|
||||
$session->changeChecker();
|
||||
header("Location: build.php?gid=15&ty=$type&demolished=1");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
// DEMOLARE CLASICA
|
||||
$ok = $database->addDemolition($village->wid, $type);
|
||||
if ($ok === true) {
|
||||
$session->changeChecker();
|
||||
header("Location: build.php?gid=15&ty=$type&cancel=0&demolish=0");
|
||||
} else {
|
||||
header("Location: build.php?gid=15&ty=$type&nodemolish=$ok");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
|
||||
echo "<h2>".DEMOLITION_BUILDING."";
|
||||
$VillageResourceLevels = $database->getResourceLevel($village->wid);
|
||||
$DemolitionProgress = $database->getDemolition($village->wid);
|
||||
if (!empty($DemolitionProgress)) {
|
||||
$Demolition = $DemolitionProgress[0];
|
||||
echo "<b>";
|
||||
echo "<a href='build.php?id=".$_GET['id']."&ty=".$ty."&cancel=1'><img src='img/x.gif' class='del' title='".CANCEL."' alt='cancel'></a> ";
|
||||
echo "".DEMOLITION_OF." ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": <span id=timer1>".$generator->getTimeFormat($Demolition['timetofinish']-time())."</span>";
|
||||
if($session->gold >= 2) {
|
||||
?>
|
||||
<a href="?id=15&buildingFinish=1&ty=<?php echo $ty;?>" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="<?php echo FINISH_GOLD; ?>"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
|
||||
<?php
|
||||
}
|
||||
echo "</b>";
|
||||
} else {
|
||||
if (isset($_GET['nodemolish'])) {
|
||||
switch ($_GET['nodemolish']) {
|
||||
case 18:
|
||||
echo '<p style="color: #ff0000; text-align: left">
|
||||
Because you are the leader of your alliance, demolition of your current Embassy cannot be started,
|
||||
since it still holds all of your <b>'.$memberCount.'</b> alliance members.
|
||||
You can, however <a href="allianz.php?s=5">quit the alliance</a>, while selecting a new leader
|
||||
in the "quit alliance" form, then continue the demolition.
|
||||
</p>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($village->resarray['f'.$id] < DEMOLISH_LEVEL_REQ) return;
|
||||
|
||||
echo "
|
||||
<form action=\"build.php?gid=15&demolish=1&cancel=0&c=".$session->mchecker."\" method=\"POST\" style=\"display:inline\">
|
||||
<select id=\"demolition_type\" name=\"type\" class=\"dropdown\">";
|
||||
for ($i=19; $i<=41; $i++) {
|
||||
$select=($i==$ty)? " SELECTED":"";
|
||||
if (isset($VillageResourceLevels['f'.$i]) && $VillageResourceLevels['f'.$i] >= 1 && !$building->isCurrent($i) && !$building->isLoop($i)) {
|
||||
echo "<option value=".$i.$select.">".$i.". ".$building->procResType($VillageResourceLevels['f'.$i.'t'])." (lvl ".$VillageResourceLevels['f'.$i].")</option>";
|
||||
}
|
||||
}
|
||||
if ($village->natar==1) {
|
||||
$select=($ty==99)? " SELECTED":"";
|
||||
if ($VillageResourceLevels['f99'] >= 1 && !$building->isCurrent(99) && !$building->isLoop(99)) {
|
||||
echo "<option value=99".$select.">99. ".$building->procResType(40)." (lvl ".$VillageResourceLevels['f99'].")</option>";
|
||||
}
|
||||
}
|
||||
echo "</select><input id=\"btn_demolish\" name=\"demolish\" class=\"dynamic_img\" value=\"Demolish\" type=\"image\" src=\"img/x.gif\" alt=\"Demolish\" title=\"".DEMOLISH."\" onClick=\"javascript:return verify_demolition();\" /></form>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
$Demolition = $database->getDemolition($village->wid);
|
||||
$inProgress =!empty($Demolition)? $Demolition[0] : null;
|
||||
?>
|
||||
<h2><?= DEMOLITION_BUILDING?></h2>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function verify_demolition() {
|
||||
var dType = document.getElementById('demolition_type');
|
||||
var warnLvl3 = <?php
|
||||
if (
|
||||
$session->alliance &&
|
||||
$database->isAllianceOwner($session->uid) == $session->alliance &&
|
||||
// don't show the OK/Cancel warning if we have more members, since
|
||||
// that will be handled by the returned value
|
||||
$memberCount == 1 &&
|
||||
$database->getSingleFieldTypeCount($session->uid, 18, '>=', 3) == 1
|
||||
) {
|
||||
echo 'true';
|
||||
} else {
|
||||
echo 'false';
|
||||
}
|
||||
?>;
|
||||
var warnLvl1 = <?php
|
||||
if ($session->alliance && $database->getSingleFieldTypeCount($session->uid, 18, '>=', 1) == 1) {
|
||||
echo 'true';
|
||||
} else {
|
||||
echo 'false';
|
||||
}
|
||||
?>;
|
||||
<?php if ($inProgress):?>
|
||||
<b>
|
||||
<a href="build.php?id=<?= $_GET['id']?? 15?>&ty=<?= $ty?>&cancel=1">
|
||||
<img src="img/x.gif" class="del" title="<?= CANCEL?>" alt="cancel">
|
||||
</a>
|
||||
<?= DEMOLITION_OF?> <?= $building->procResType($VillageLevels['f'.$inProgress['buildnumber'].'t'])?>:
|
||||
<span id="timer1"><?= $generator->getTimeFormat($inProgress['timetofinish'] - time())?></span>
|
||||
<?php if ($session->gold >= 2):?>
|
||||
<a href="?id=15&buildingFinish=1&ty=<?= $ty?>" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="<?= FINISH_GOLD?>">
|
||||
<img class="clock" alt="Finish" src="img/x.gif">
|
||||
</a>
|
||||
<?php endif;?>
|
||||
</b>
|
||||
|
||||
if (warnLvl3 && dType.options[dType.selectedIndex].text.indexOf('Embassy (lvl 3)') > -1) {
|
||||
// check if we really want to demolish a lvl 3 embassy
|
||||
if (!window.confirm('WARNING!\n'
|
||||
+ 'You are about to demolish the last lvl3 Embassy!\n\n'
|
||||
+ 'Since you are the leader of your alliance and because there are no additional members left, the alliance will be disbanded once the demolition completes.\n\n'
|
||||
+ 'After that happens, you can found a new alliance or join one that already exists.\n\n'
|
||||
+ 'Click OK to confirm or Cancel to stop.')) {
|
||||
return false;
|
||||
}
|
||||
} else if (warnLvl1 && dType.options[dType.selectedIndex].text.indexOf('Embassy (lvl 1)') > -1) {
|
||||
// check if we really want to demolish a lvl 1 embassy
|
||||
if (!window.confirm('WARNING!\n'
|
||||
+ 'You are about to demolish your last Embassy!\n\n'
|
||||
+ 'Since you are in an alliance, you will automatically quit that alliance once the demolition completes.\n\n'
|
||||
+ 'After that happens, you can found or join an alliance again.\n\n'
|
||||
+ 'Click OK to confirm or Cancel to stop.')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
//-->
|
||||
<?php else:?>
|
||||
|
||||
<?php if (isset($_GET['nodemolish']) && $_GET['nodemolish'] == 18):?>
|
||||
<p style="color:#ff0000; text-align:left">
|
||||
Because you are the leader of your alliance, demolition of your current Embassy cannot be started,
|
||||
since it still holds all of your <b><?= $memberCount?></b> alliance members.
|
||||
</p>
|
||||
<?php endif;?>
|
||||
<?php if (isset($_GET['notenoughgold'])):?>
|
||||
<p style="color:#ff0000">You don't have enough gold. You need 10 gold for instant demolition.</p>
|
||||
<?php endif;?>
|
||||
<?php if (isset($_GET['demolished'])):?>
|
||||
<p style="color:#008000">The building was completely demolished for 10 gold!</p>
|
||||
<?php endif;?>
|
||||
|
||||
<form action="build.php?gid=15&demolish=1&cancel=0&c=<?= $session->mchecker?>" method="POST" style="display:inline">
|
||||
<select id="demolition_type" name="type" class="dropdown">
|
||||
<?php for ($i = 19; $i <= 41; $i++):
|
||||
if (!isset($VillageLevels['f'.$i]) || $VillageLevels['f'.$i] < 1) continue;
|
||||
if ($building->isCurrent($i) || $building->isLoop($i)) continue;
|
||||
$selected = ($i == $ty)? ' selected' : '';
|
||||
?>
|
||||
<option value="<?= $i?>"<?= $selected?>><?= $i?>. <?= $building->procResType($VillageLevels['f'.$i.'t'])?> (lvl <?= $VillageLevels['f'.$i]?>)</option>
|
||||
<?php endfor;?>
|
||||
<?php if ($village->natar == 1 && isset($VillageLevels['f99']) && $VillageLevels['f99'] >= 1 &&!$building->isCurrent(99) &&!$building->isLoop(99)):
|
||||
$selected = ($ty == 99)? ' selected' : '';
|
||||
?>
|
||||
<option value="99"<?= $selected?>>99. <?= $building->procResType(40)?> (lvl <?= $VillageLevels['f99']?>)</option>
|
||||
<?php endif;?>
|
||||
</select>
|
||||
|
||||
<label style="margin:0 10px;">
|
||||
<input type="checkbox" name="instant" value="1" id="instant_demolish" <?= $session->gold < 10 ? 'disabled' : ''?>>
|
||||
Demolare completă (10 <img src="img/x.gif" class="gold" style="vertical-align:middle">)
|
||||
</label>
|
||||
|
||||
<input id="btn_demolish" name="demolish" class="dynamic_img" value="Demolish" type="image" src="img/x.gif" alt="Demolish" title="<?= DEMOLISH?>" onclick="return verify_demolition();">
|
||||
</form>
|
||||
<?php endif;?>
|
||||
|
||||
<script>
|
||||
function verify_demolition() {
|
||||
var dType = document.getElementById('demolition_type');
|
||||
var instant = document.getElementById('instant_demolish').checked;
|
||||
var warnLvl3 = <?= ($session->alliance && $database->isAllianceOwner($session->uid) == $session->alliance && $memberCount == 1 && $database->getSingleFieldTypeCount($session->uid, 18, '>=', 3) == 1)? 'true' : 'false'?>;
|
||||
var warnLvl1 = <?= ($session->alliance && $database->getSingleFieldTypeCount($session->uid, 18, '>=', 1) == 1)? 'true' : 'false'?>;
|
||||
|
||||
var text = dType.options[dType.selectedIndex].text;
|
||||
|
||||
if (instant) {
|
||||
return confirm('Surely you want to demolish COMPLETELY '+text+' for 10 GOLD?\nThe building will disappear instantly, it cannot be undone.');
|
||||
}
|
||||
|
||||
if (warnLvl3 && text.indexOf('Embassy (lvl 3)') > -1) {
|
||||
return confirm('WARNING!\n\nYou are about to demolish the last lvl3 Embassy!\n\nSince you are the leader of your alliance and because there are no additional members left, the alliance will be disbanded once the demolition completes.');
|
||||
}
|
||||
if (warnLvl1 && text.indexOf('Embassy (lvl 1)') > -1) {
|
||||
return confirm('WARNING!\n\nYou are about to demolish your last Embassy!\n\nSince you are in an alliance, you will automatically quit that alliance once the demolition completes.');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
+200
-311
@@ -1,315 +1,204 @@
|
||||
<?php
|
||||
if(isset($_GET['refresh'])){
|
||||
$village->unitarray = $database->getUnit($village->wid, false);
|
||||
|
||||
// RALLY POINT
|
||||
|
||||
if (isset($_GET['refresh'])) {
|
||||
$village->unitarray = $database->getUnit($village->wid, false);
|
||||
}
|
||||
?><div id="build" class="gid16">
|
||||
<a href="#" onClick="return Popup(16,4);" class="build_logo"> <img
|
||||
class="g16" src="img/x.gif" alt="Rally point"
|
||||
title="<?php echo RALLYPOINT;?>" />
|
||||
</a>
|
||||
<h1><?php echo RALLYPOINT;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span>
|
||||
</h1>
|
||||
<p class="build_desc"><?php echo RALLYPOINT_DESC;?></p>
|
||||
|
||||
<?php
|
||||
if($village->resarray['f39'] > 0){
|
||||
include_once ("16_menu.tpl");
|
||||
$units_type = $database->getMovement(34, $village->wid, 1);
|
||||
$settlers = $database->getMovement(7, $village->wid, 1);
|
||||
$oasis_incoming = 0;
|
||||
$array = $database->getOasis($village->wid);
|
||||
foreach($array as $conqured) $oasis_incoming += count($database->getMovement(6, $conqured['wref'], 0));
|
||||
|
||||
$units_incoming = count($units_type);
|
||||
$settlers_incoming = count($settlers);
|
||||
for($i = 0; $i < $units_incoming; $i++){
|
||||
if($units_type[$i]['attack_type'] == 1 && $units_type[$i]['sort_type'] == 3) $units_incoming -= 1;
|
||||
}
|
||||
if($units_incoming > 0 || $settlers_incoming > 0 || $oasis_incoming > 0){
|
||||
?>
|
||||
<h4><?php echo INCOMING_TROOPS;?> (<?php echo $units_incoming+$settlers_incoming+$oasis_incoming; ?>)</h4>
|
||||
<?php
|
||||
|
||||
include ("16_incomming.tpl");
|
||||
}
|
||||
?>
|
||||
|
||||
<h4><?php echo TROOPS_IN_THE_VILLAGE;?></h4>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a
|
||||
href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td
|
||||
colspan="<?php echo $village->unitarray['hero'] == 0 ? 10 : 11; ?>">
|
||||
<a href="spieler.php?uid=<?php echo $session->uid; ?>"><?php echo OWN_TROOPS;?></a>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
|
||||
include ("16_troops.tpl");
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
if(count($village->enforcetome) > 0){
|
||||
foreach($village->enforcetome as $enforce){
|
||||
$colspan = 10 + $enforce['hero'];
|
||||
if($enforce['from'] != 0){
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
if(LANG == "es"){
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".TROOPS." ".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." </a>";
|
||||
}else{
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." ".TROOPS."</a>";
|
||||
}
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = $start; $i <= ($start + 9); $i++){
|
||||
if($enforce['u'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else{
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}else{
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a>".TASKMASTER."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a> ".VILLAGE_OF_THE_ELDERS_TROOPS."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = 4;
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = $start; $i <= ($start + 9); $i++){
|
||||
if($enforce['u'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else{
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><span class=none><b>".SEND_BACK."</b></span></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
}
|
||||
$enforcevill = array();
|
||||
$enforceoasis = array();
|
||||
$allenforce = $village->enforcetoyou;
|
||||
$enforcemeoasis = $village->enforceoasis;
|
||||
if(count($allenforce) > 0){
|
||||
foreach($allenforce as $enforce){
|
||||
$conquredvid = $database->getOasisField($enforce['vref'], "conqured");
|
||||
if($conquredvid > 0){
|
||||
$enforce['conqured'] = $conquredvid;
|
||||
array_push($enforceoasis, $enforce);
|
||||
}else{
|
||||
array_push($enforcevill, $enforce);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count($enforcemeoasis) > 0){
|
||||
foreach($enforcemeoasis as $enforce){
|
||||
array_push($enforceoasis, $enforce);
|
||||
}
|
||||
}
|
||||
if(count($enforcevill) > 0){
|
||||
echo "<h4>".TROOPS_IN_OTHER_VILLAGE."</h4>";
|
||||
foreach($enforcevill as $enforce){
|
||||
$colspan = 10 + $enforce['hero'];
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".REINFORCEMENTFOR." ".$database->getVillageField($enforce['vref'], "name")." </a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = $start; $i <= ($start + 9); $i++){
|
||||
if($enforce['u'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else{
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if(count($enforceoasis) > 0){
|
||||
echo "<h4>".TROOPS_IN_OASIS."</h4>";
|
||||
foreach($enforceoasis as $enforce){
|
||||
$colspan = 10 + $enforce['hero'];
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".$database->getVillageField($enforce['conqured'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
if(LANG == "es"){
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".TROOPS." ".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." </a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a>";
|
||||
}else{
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." ".TROOPS."</a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a>";
|
||||
}
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = $start; $i <= ($start + 9); $i++){
|
||||
if($enforce['u'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else{
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if(count($database->getPrisoners3($village->wid)) > 0){
|
||||
echo "<h4>".PRISONERS."</h4>";
|
||||
foreach($database->getPrisoners3($village->wid) as $prisoners){
|
||||
$colspan = 10 + $prisoners['t11'];
|
||||
$colspan2 = $colspan + 1;
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".PRISONERSIN." ".$database->getVillageField($prisoners['wref'], "name")."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($prisoners['from'], "owner"), "tribe", 0);
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($prisoners['t11'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = 1; $i <= 10; $i++){
|
||||
if($prisoners['t'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else
|
||||
echo "<td>";
|
||||
echo $prisoners['t'.$i]."</td>";
|
||||
}
|
||||
if($prisoners['t11'] > 0) echo "<td>".$prisoners['t11']."</td>";
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan2\"><div class='sup'>".$technology->getUpkeep($prisoners, $tribe, 0, 1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>".KILL."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if(count($database->getPrisoners($village->wid)) > 0){
|
||||
echo "<h4>".PRISONERS."</h4>";
|
||||
foreach($database->getPrisoners($village->wid) as $prisoners){
|
||||
$colspan = 10 + $prisoners['t11'];
|
||||
$colspan2 = $colspan + 1;
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".PRISONERSFROM." ".$database->getVillageField($prisoners['from'], "name")."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($prisoners['from'], "owner"), "tribe", 0);
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($prisoners['t11'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = 1; $i <= 10; $i++){
|
||||
if($prisoners['t'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else
|
||||
echo "<td>";
|
||||
echo $prisoners['t'.$i]."</td>";
|
||||
}
|
||||
if($prisoners['t11'] > 0) echo "<td>".$prisoners['t11']."</td>";
|
||||
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><td colspan=\"$colspan2\"><div class='sup'><img class=\"r6\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" /></div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$units_type = $database->getMovement(3, $village->wid, 0);
|
||||
$settlers = $database->getMovement(5, $village->wid, 0);
|
||||
$units_incoming = count($units_type);
|
||||
for($i = 0; $i < $units_incoming; $i++){
|
||||
if($units_type[$i]['vref'] != $village->wid) $units_incoming -= 1;
|
||||
}
|
||||
$units_incoming += count($settlers);
|
||||
|
||||
if($units_incoming >= 1){
|
||||
echo "<h4>".TROOPS_ON_THEIR_WAY."</h4>";
|
||||
include ("16_walking.tpl");
|
||||
}
|
||||
}
|
||||
else echo '<b>'.RALLYPOINT_COMMENCE.'</b><br>';
|
||||
|
||||
include ("upgrade.tpl");
|
||||
$hasRally = $village->resarray['f39'] > 0;
|
||||
?>
|
||||
</p>
|
||||
<div id="build" class="gid16">
|
||||
<a href="#" onclick="return Popup(16,4);" class="build_logo">
|
||||
<img class="g16" src="img/x.gif" alt="Rally point" title="<?= RALLYPOINT ?>">
|
||||
</a>
|
||||
<h1><?= RALLYPOINT ?> <span class="level"><?= LEVEL ?> <?= $village->resarray['f'.$id] ?></span></h1>
|
||||
<p class="build_desc"><?= RALLYPOINT_DESC ?></p>
|
||||
|
||||
<?php if ($hasRally): ?>
|
||||
<?php include_once '16_menu.tpl'; ?>
|
||||
|
||||
<?php
|
||||
// --- INCOMING ---
|
||||
$units_type = $database->getMovement(34, $village->wid, 1);
|
||||
$settlers = $database->getMovement(7, $village->wid, 1);
|
||||
$oasis_incoming = 0;
|
||||
foreach ($database->getOasis($village->wid) as $o) {
|
||||
$oasis_incoming += count($database->getMovement(6, $o['wref'], 0));
|
||||
}
|
||||
$units_incoming = count($units_type);
|
||||
foreach ($units_type as $u) if ($u['attack_type'] == 1 && $u['sort_type'] == 3) $units_incoming--;
|
||||
$totalIncoming = $units_incoming + count($settlers) + $oasis_incoming;
|
||||
?>
|
||||
|
||||
<?php if ($totalIncoming > 0): ?>
|
||||
<h4><?= INCOMING_TROOPS ?> (<?= $totalIncoming ?>)</h4>
|
||||
<?php include '16_incomming.tpl'; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- OWN TROOPS -->
|
||||
<h4><?= TROOPS_IN_THE_VILLAGE ?></h4>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $village->wid ?>&c=<?= $generator->getMapCheck($village->wid) ?>"><?= $village->vname ?></a></td>
|
||||
<td colspan="<?= $village->unitarray['hero'] ? 11 : 10 ?>"><a href="spieler.php?uid=<?= $session->uid ?>"><?= OWN_TROOPS ?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units"><?php include '16_troops.tpl'; ?></tbody>
|
||||
</table>
|
||||
|
||||
<!-- REINFORCEMENTS TO ME -->
|
||||
<?php foreach ($village->enforcetome as $e):
|
||||
$isTaskmaster = $e['from'] == 0;
|
||||
$colspan = 10 + $e['hero'];
|
||||
$tribe = $isTaskmaster ? 4 : $database->getUserField($database->getVillageField($e['from'],'owner'),'tribe',0);
|
||||
$start = ($tribe-1)*10+1;
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role">
|
||||
<?php if (!$isTaskmaster): ?>
|
||||
<a href="karte.php?d=<?= $e['from'] ?>&c=<?= $generator->getMapCheck($e['from']) ?>"><?= $database->getVillageField($e['from'],'name') ?></a>
|
||||
<?php else: ?><a><?= TASKMASTER ?></a><?php endif; ?>
|
||||
</td>
|
||||
<td colspan="<?= $colspan ?>">
|
||||
<?php if (!$isTaskmaster):
|
||||
$owner = $database->getVillageField($e['from'],'owner');
|
||||
$uname = $database->getUserField($owner,'username',0);
|
||||
?>
|
||||
<a href="spieler.php?uid=<?= $owner ?>"><?= LANG=='es' ? TROOPS.' '.$uname : $uname.' '.TROOPS ?></a>
|
||||
<?php else: ?><a><?= VILLAGE_OF_THE_ELDERS_TROOPS ?></a><?php endif; ?>
|
||||
</td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++): ?><td><img src="img/x.gif" class="unit u<?= $i ?>" title="<?= $technology->getUnitName($i) ?>"></td><?php endfor; ?><?php if($e['hero']): ?><td><img src="img/x.gif" class="unit uhero" title="Hero"></td><?php endif; ?></tr>
|
||||
<tr><th><?= TROOPS ?></th><?php for($i=$start;$i<$start+10;$i++): ?><td class="<?= $e['u'.$i]==0?'none':'' ?>"><?= $e['u'.$i] ?></td><?php endfor; ?><?php if($e['hero']): ?><td><?= $e['hero'] ?></td><?php endif; ?></tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr><th><?= UPKEEP ?></th><td colspan="<?= $colspan ?>">
|
||||
<div class="sup"><?= $technology->getUpkeep($e,$tribe) ?><img class="r4" src="img/x.gif"> <?= PER_HR ?></div>
|
||||
<div class="sback"><?php if(!$isTaskmaster): ?><a href="a2b.php?w=<?= $e['id'] ?>"><?= SEND_BACK ?></a><?php else: ?><span class="none"><b><?= SEND_BACK ?></b></span><?php endif; ?></div>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php
|
||||
// split my reinforcements
|
||||
$enforcevill = []; $enforceoasis = [];
|
||||
foreach ($village->enforcetoyou as $e) {
|
||||
$conq = (int)$database->getOasisField($e['vref'],'conqured');
|
||||
if ($conq>0) { $e['conqured']=$conq; $enforceoasis[]=$e; } else $enforcevill[]=$e;
|
||||
}
|
||||
foreach ($village->enforceoasis as $e) $enforceoasis[]=$e;
|
||||
?>
|
||||
|
||||
<!-- TROOPS IN OTHER VILLAGES -->
|
||||
<?php if ($enforcevill): ?>
|
||||
<h4><?= TROOPS_IN_OTHER_VILLAGE ?></h4>
|
||||
<?php foreach ($enforcevill as $e):
|
||||
$colspan=10+$e['hero']; $tribe=$database->getUserField($database->getVillageField($e['from'],'owner'),'tribe',0); $start=($tribe-1)*10+1;
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $e['from'] ?>&c=<?= $generator->getMapCheck($e['from']) ?>"><?= $database->getVillageField($e['from'],'name') ?></a></td>
|
||||
<td colspan="<?= $colspan ?>"><a href="karte.php?d=<?= $e['vref'] ?>&c=<?= $generator->getMapCheck($e['vref']) ?>"><?= REINFORCEMENTFOR ?> <?= $database->getVillageField($e['vref'],'name') ?></a></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++): ?><td><img src="img/x.gif" class="unit u<?= $i ?>" title="<?= $technology->getUnitName($i) ?>"></td><?php endfor; ?><?php if($e['hero']): ?><td><img src="img/x.gif" class="unit uhero"></td><?php endif; ?></tr>
|
||||
<tr><th><?= TROOPS ?></th><?php for($i=$start;$i<$start+10;$i++): ?><td class="<?= $e['u'.$i]==0?'none':'' ?>"><?= $e['u'.$i] ?></td><?php endfor; ?><?php if($e['hero']): ?><td><?= $e['hero'] ?></td><?php endif; ?></tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr><th><?= UPKEEP ?></th><td colspan="<?= $colspan ?>">
|
||||
<div class="sup"><?= $technology->getUpkeep($e,$tribe) ?><img class="r4" src="img/x.gif"> <?= PER_HR ?></div>
|
||||
<div class="sback"><a href="a2b.php?r=<?= $e['id'] ?>"><?= SEND_BACK ?></a></div>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- TROOPS IN OASIS -->
|
||||
<?php if ($enforceoasis): ?>
|
||||
<h4><?= TROOPS_IN_OASIS ?></h4>
|
||||
<?php foreach ($enforceoasis as $e):
|
||||
$colspan=10+$e['hero']; $owner=$database->getVillageField($e['from'],'owner'); $tribe=$database->getUserField($owner,'tribe',0); $start=($tribe-1)*10+1;
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $e['vref'] ?>&c=<?= $generator->getMapCheck($e['vref']) ?>"><?= $database->getVillageField($e['conqured'],'name') ?></a></td>
|
||||
<td colspan="<?= $colspan ?>">
|
||||
<a href="spieler.php?uid=<?= $owner ?>"><?= $database->getUserField($owner,'username',0) ?> <?= TROOPS ?></a> <?= FROM ?> <a href="karte.php?d=<?= $e['from'] ?>&c=<?= $generator->getMapCheck($e['from']) ?>"><?= $database->getVillageField($e['from'],'name') ?></a>
|
||||
</td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++): ?><td><img src="img/x.gif" class="unit u<?= $i ?>"></td><?php endfor; ?><?php if($e['hero']): ?><td><img src="img/x.gif" class="unit uhero"></td><?php endif; ?></tr>
|
||||
<tr><th><?= TROOPS ?></th><?php for($i=$start;$i<$start+10;$i++): ?><td class="<?= $e['u'.$i]==0?'none':'' ?>"><?= $e['u'.$i] ?></td><?php endfor; ?><?php if($e['hero']): ?><td><?= $e['hero'] ?></td><?php endif; ?></tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr><th><?= UPKEEP ?></th><td colspan="<?= $colspan ?>">
|
||||
<div class="sup"><?= $technology->getUpkeep($e,$tribe) ?><img class="r4" src="img/x.gif"> <?= PER_HR ?></div>
|
||||
<div class="sback"><a href="a2b.php?r=<?= $e['id'] ?>"><?= SEND_BACK ?></a></div>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- PRISONERS (held by me) -->
|
||||
<?php $p3 = $database->getPrisoners3($village->wid); if($p3): ?>
|
||||
<h4><?= PRISONERS ?></h4>
|
||||
<?php foreach($p3 as $p):
|
||||
$colspan=10+$p['t11']; $tribe=$database->getUserField($database->getVillageField($p['from'],'owner'),'tribe',0); $start=($tribe-1)*10+1;
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $p['wref'] ?>&c=<?= $generator->getMapCheck($p['wref']) ?>"><?= $database->getVillageField($p['wref'],'name') ?></a></td>
|
||||
<td colspan="<?= $colspan ?>"><a href="karte.php?d=<?= $p['wref'] ?>"><?= PRISONERSIN ?> <?= $database->getVillageField($p['wref'],'name') ?></a></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++): ?><td><img src="img/x.gif" class="unit u<?= $i ?>"></td><?php endfor; ?><?php if($p['t11']): ?><td><img src="img/x.gif" class="unit uhero"></td><?php endif; ?></tr>
|
||||
<tr><th><?= TROOPS ?></th><?php for($i=1;$i<=10;$i++): ?><td class="<?= $p['t'.$i]==0?'none':'' ?>"><?= $p['t'.$i] ?></td><?php endfor; ?><?php if($p['t11']): ?><td><?= $p['t11'] ?></td><?php endif; ?></tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr><th><?= UPKEEP ?></th><td colspan="<?= $colspan+1 ?>">
|
||||
<div class="sup"><?= $technology->getUpkeep($p,$tribe,0,1) ?><img class="r4" src="img/x.gif"> <?= PER_HR ?></div>
|
||||
<div class="sback"><a href="a2b.php?delprisoners=<?= $p['id'] ?>"><?= KILL ?></a></div>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- PRISONERS (my troops captured) -->
|
||||
<?php $p = $database->getPrisoners($village->wid); if($p): ?>
|
||||
<h4><?= PRISONERS ?></h4>
|
||||
<?php foreach($p as $pr):
|
||||
$colspan=10+$pr['t11']; $tribe=$database->getUserField($database->getVillageField($pr['from'],'owner'),'tribe',0); $start=($tribe-1)*10+1;
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $pr['from'] ?>&c=<?= $generator->getMapCheck($pr['from']) ?>"><?= $database->getVillageField($pr['from'],'name') ?></a></td>
|
||||
<td colspan="<?= $colspan ?>"><a href="karte.php?d=<?= $pr['from'] ?>"><?= PRISONERSFROM ?> <?= $database->getVillageField($pr['from'],'name') ?></a></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++): ?><td><img src="img/x.gif" class="unit u<?= $i ?>"></td><?php endfor; ?><?php if($pr['t11']): ?><td><img src="img/x.gif" class="unit uhero"></td><?php endif; ?></tr>
|
||||
<tr><th><?= TROOPS ?></th><?php for($i=1;$i<=10;$i++): ?><td class="<?= $pr['t'.$i]==0?'none':'' ?>"><?= $pr['t'.$i] ?></td><?php endfor; ?><?php if($pr['t11']): ?><td><?= $pr['t11'] ?></td><?php endif; ?></tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr><td colspan="<?= $colspan+1 ?>">
|
||||
<div class="sup"><img class="r6" src="img/x.gif"></div>
|
||||
<div class="sback"><a href="a2b.php?delprisoners=<?= $pr['id'] ?>"><?= SEND_BACK ?></a></div>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$out = $database->getMovement(3,$village->wid,0);
|
||||
$set = $database->getMovement(5,$village->wid,0);
|
||||
$cnt = count($set);
|
||||
foreach($out as $u) if($u['vref']==$village->wid) $cnt++;
|
||||
?>
|
||||
<?php if($cnt>=1): ?>
|
||||
<h4><?= TROOPS_ON_THEIR_WAY ?></h4>
|
||||
<?php include '16_walking.tpl'; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php else: ?>
|
||||
<b><?= RALLYPOINT_COMMENCE ?></b><br>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+56
-51
@@ -1,60 +1,65 @@
|
||||
<?php
|
||||
if(!$session->goldclub) include("Templates/Build/16.tpl");
|
||||
else
|
||||
{
|
||||
?>
|
||||
<div id="build" class="gid16"><a href="#" onClick="return Popup(16,4);" class="build_logo">
|
||||
<img class="g16" src="img/x.gif" alt="Rally point" title="<?php echo RALLYPOINT;?>" />
|
||||
</a>
|
||||
<h1><?php echo RALLYPOINT;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo RALLYPOINT_DESC;?></p>
|
||||
<?php include("16_menu.tpl")?>
|
||||
|
||||
<div id="raidList">
|
||||
<?php include("Templates/goldClub/farmlist.tpl"); ?>
|
||||
</div>
|
||||
<br />
|
||||
<?php if( !isset( $hideevasion ) || $hideevasion == 0){ ?>
|
||||
<table id="raidList" cellpadding="1" cellspacing="1">
|
||||
// RALLY POINT GOLD CLUB
|
||||
|
||||
if (!$session->goldclub) {
|
||||
include 'Templates/Build/16.tpl';
|
||||
return;
|
||||
}
|
||||
|
||||
$hideEvasion = isset($hideevasion) ? (int)$hideevasion : 0;
|
||||
$user = $database->getUserArray($session->uid, 1);
|
||||
?>
|
||||
<div id="build" class="gid16">
|
||||
<a href="#" onclick="return Popup(16,4);" class="build_logo">
|
||||
<img class="g16" src="img/x.gif" alt="Rally point" title="<?= RALLYPOINT ?>">
|
||||
</a>
|
||||
<h1><?= RALLYPOINT ?> <span class="level"><?= LEVEL ?> <?= $village->resarray['f'.$id] ?></span></h1>
|
||||
<p class="build_desc"><?= RALLYPOINT_DESC ?></p>
|
||||
|
||||
<?php include '16_menu.tpl'; ?>
|
||||
|
||||
<div id="raidList">
|
||||
<?php include 'Templates/goldClub/farmlist.tpl'; ?>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<?php if ($hideEvasion == 0): ?>
|
||||
<table id="raidList" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4"><?php echo EVASION_SETTINGS;?></th>
|
||||
</tr>
|
||||
<tr><th colspan="4"><?= EVASION_SETTINGS ?></th></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><?php echo VILLAGE; ?></td>
|
||||
<td><?php echo OWN_TROOPS; ?></td>
|
||||
<td><?php echo REINFORCEMENT;?></td>
|
||||
<td><?= VILLAGE ?></td>
|
||||
<td><?= OWN_TROOPS ?></td>
|
||||
<td><?= REINFORCEMENT ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for($i = 0; $i <= count($session->villages) - 1; $i++) {
|
||||
$wref = $session->villages[$i];
|
||||
$vname = $database->getVillageField($wref, "name");
|
||||
$vchecked = $database->getVillageField($wref, "evasion");
|
||||
$reinf = $database->getEnforceVillage($wref, 0);
|
||||
|
||||
if($vchecked == 1) $checked = 'checked';
|
||||
else $checked = '';
|
||||
?>
|
||||
<tbody>
|
||||
<?php foreach ($session->villages as $wref):
|
||||
$vname = $database->getVillageField($wref, 'name');
|
||||
$vchecked = $database->getVillageField($wref, 'evasion');
|
||||
$reinf = $database->getEnforceVillage($wref, 0);
|
||||
$checked = $vchecked == 1 ? 'checked' : '';
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="check" name="hideShow" onclick="window.location.href = '?gid=16&t=99&evasion=<?php echo $wref;?>';" <?php echo $checked; ?>></td>
|
||||
<td><?php echo $vname; ?></td>
|
||||
<td><div style="text-align: center"><?php echo $database->getUnitsNumber($wref); ?></div></td>
|
||||
<td><div style="text-align: center"><?php echo count($reinf); ?></div></td>
|
||||
<td><input type="checkbox" class="check" name="hideShow" onclick="window.location.href='?gid=16&t=99&evasion=<?= $wref ?>';" <?= $checked ?>></td>
|
||||
<td><?= $vname ?></td>
|
||||
<td><div style="text-align:center"><?= $database->getUnitsNumber($wref) ?></div></td>
|
||||
<td><div style="text-align:center"><?= count($reinf) ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$user = $database->getUserArray($session->uid, 1);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<form action="build.php?id=39&t=99" method="POST">
|
||||
<br />
|
||||
<?php echo SEND_TROOPS_AWAY_MAX;?> <input class="text" type="text" name="maxevasion" value="<?php echo $user['maxevasion']; ?>" maxlength="3" style="width:50px;"> <?php echo TIMES;?>
|
||||
<span class="none">(<?php echo COSTS;?>: <img src="<?php echo GP_LOCATE; ?>img/a/gold_g.gif" alt="Gold" title="<?php echo GOLD;?>"/><b>2</b> <?php echo PER_EVASION;?>)</span>
|
||||
<div class="clear"></div><p><button value="ok" name="s1" id="btn_ok" class="trav_buttons" tabindex="8">OK</button></p></form>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<form action="build.php?id=39&t=99" method="POST">
|
||||
<br>
|
||||
<?= SEND_TROOPS_AWAY_MAX ?>
|
||||
<input class="text" type="text" name="maxevasion" value="<?= $user['maxevasion'] ?>" maxlength="3" style="width:50px;">
|
||||
<?= TIMES ?>
|
||||
<span class="none">(<?= COSTS ?>: <img src="<?= GP_LOCATE ?>img/a/gold_g.gif" alt="Gold" title="<?= GOLD ?>"><b>2</b> <?= PER_EVASION ?>)</span>
|
||||
<div class="clear"></div>
|
||||
<p><button value="ok" name="s1" id="btn_ok" class="trav_buttons" tabindex="8">OK</button></p>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
+133
-320
@@ -1,328 +1,141 @@
|
||||
<?php
|
||||
include_once("GameEngine/Data/unitdata.php");
|
||||
|
||||
// RALLY POINT INCOMMING TROOPS
|
||||
|
||||
include_once 'GameEngine/Data/unitdata.php';
|
||||
|
||||
$units = $database->getMovement(34, $village->wid, 1);
|
||||
$total_for = count($units);
|
||||
$send = $database->getMovement(1, $village->wid, 1);
|
||||
$total_for2 = count($send);
|
||||
$artifactsSum = $database->getArtifactsSumByKind($session->uid, $village->wid, 3);
|
||||
for($y = 0; $y < $total_for; $y++){
|
||||
$session->timer++;
|
||||
if($units[$y]['sort_type'] == 3){
|
||||
if($units[$y]['attack_type'] == 2) $actionType = REINFORCEMENTFOR;
|
||||
elseif($units[$y]['attack_type'] == 3) $actionType = ATTACK_ON;
|
||||
elseif($units[$y]['attack_type'] == 4) $actionType = RAID_ON;
|
||||
|
||||
$reinfowner = $database->getVillageField($units[$y]['from'], "owner");
|
||||
if($units[$y]['attack_type'] != 1){
|
||||
if($units[$y]['from'] != 0){
|
||||
if($units[$y]['t11'] > 0 && $reinfowner == $session->uid) $colspan = 11;
|
||||
else $colspan = 10;
|
||||
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$units[$y]['from']."&c=".$generator->getMapCheck($units[$y]['from'])."\">".$database->getVillageField($units[$y]['from'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a href=\"karte.php?d=".$units[$y]['to']."&c=".$generator->getMapCheck($units[$y]['to'])."\">".$actionType." ".$database->getVillageField($units[$y]['to'], "name")."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($units[$y]['from'], "owner"), "tribe", 0);
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($units[$y]['t11'] != 0 && $reinfowner == $session->uid){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = 1; $i <= $colspan; $i++){
|
||||
$totalunits = $units[$y]['t1'] + $units[$y]['t2'] + $units[$y]['t3'] + $units[$y]['t4'] + $units[$y]['t5'] + $units[$y]['t6'] + $units[$y]['t7'] + $units[$y]['t8'] + $units[$y]['t9'] + $units[$y]['t10'] + $units[$y]['t11'];
|
||||
if($units[$y]['attack_type'] == 2){
|
||||
if($reinfowner != $session->uid) echo "<td class=\"none\">?</td>";
|
||||
else
|
||||
{
|
||||
if($units[$y]['t'.$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
echo $units[$y]['t'.$i]."</td>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($artifactsSum['totals'] == 0) echo "<td class=\"none\">?</td>";
|
||||
else
|
||||
{
|
||||
if($units[$y]['t'.$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>?</td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</tr></tbody>";
|
||||
echo '
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th>'.ARRIVAL.'</th>
|
||||
<td colspan='.$colspan.'>
|
||||
<div class="in small"><span id=timer'.$session->timer.'>'.$generator->getTimeFormat($units[$y]['endtime'] - time()).'</span> h</div>';
|
||||
$datetime = $generator->procMtime($units[$y]['endtime']);
|
||||
echo "<div class=\"at small\">";
|
||||
if($datetime[0] != "today") echo "".ON." ".$datetime[0]." ";
|
||||
echo "".AT." ".$datetime[1]." ".HRS."</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>";
|
||||
echo "</table>";
|
||||
}else{
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a>village of the elders</a></td>
|
||||
<td colspan=\"10\">";
|
||||
echo "<a>".VILLAGE_OF_THE_ELDERS_TROOPS."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = 4;
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = 1; $i <= 10; $i++){
|
||||
echo "<td class=\"none\">?</td>";
|
||||
}
|
||||
echo "</tr></tbody>";
|
||||
echo '
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th>'.ARRIVAL.'</th>
|
||||
<td colspan="10">
|
||||
<div class="in small"><span id=timer'.$session->timer.'>'.$generator->getTimeFormat($units[$y]['endtime'] - time()).'</span> h</div>';
|
||||
$datetime = $generator->procMtime($units[$y]['endtime']);
|
||||
echo "<div class=\"at small\">";
|
||||
if($datetime[0] != "today") echo "".ON." ".$datetime[0]." ";
|
||||
echo "".AT." ".$datetime[1]."</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>";
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
}else if($units[$y]['sort_type'] == 4){
|
||||
$actionType = RETURNFROM;
|
||||
|
||||
$isoasis = $database->isVillageOases($units[$y]['from']);
|
||||
if($isoasis == 0) $from = $database->getMInfo($units[$y]['from']);
|
||||
else $from = $database->getOMInfo($units[$y]['from']);
|
||||
|
||||
$to = $database->getMInfo($units[$y]['vref']);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a
|
||||
href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td colspan="<?php echo $units[$y]['t11'] > 0 ? 11 : 10 ?>"><a
|
||||
href="karte.php?d=<?php echo $from['wref']."&c=".$generator->getMapCheck($from['wref']); ?>"><?php echo $actionType." ".$from['name']; ?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<tr>
|
||||
<?php
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($units[$y]['t11'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo TROOPS;?></th>
|
||||
<?php
|
||||
for($i = 1; $i < ($units[$y]['t11'] != 0 ? 12 : 11); $i++){
|
||||
if($units[$y]['t'.$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
echo $units[$y]['t'.$i]."</td>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</tbody>
|
||||
<?php
|
||||
$totalres = $units[$y]['wood'] + $units[$y]['clay'] + $units[$y]['iron'] + $units[$y]['crop'];
|
||||
if($units[$y]['attack_type'] != 2 && $units[$y]['attack_type'] != 1 && $totalres > 0){
|
||||
?>
|
||||
<tbody class="goods">
|
||||
<tr>
|
||||
<th><?php echo BOUNTY;?></th>
|
||||
?>
|
||||
|
||||
<td colspan="<?php echo $units[$y]['t11'] == 0 ? 10 : 11; ?>">
|
||||
<?php
|
||||
$totalcarry = 0;
|
||||
for($i = 0; $i <= 9; $i++) $totalcarry += $units[$y]['t'.($i + 1)] * ${'u'.($start + $i)}['cap'];
|
||||
echo "<div class=\"res\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$units[$y]['wood']." | <img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$units[$y]['clay']." | <img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$units[$y]['iron']." | <img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$units[$y]['crop']."</div>";
|
||||
echo "<div class=\"carry\"><img class=\"car\" src=\"img/x.gif\" alt=\"carry\" title=\"carry\"/>".$totalres."/".$totalcarry."</div>";
|
||||
?>
|
||||
</tr>
|
||||
</tbody>
|
||||
<?php } ?>
|
||||
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th><?php echo ARRIVAL;?></th>
|
||||
<td colspan="<?php echo $units[$y]['t11'] == 0 ? 10 : 11 ?>">
|
||||
<?php
|
||||
echo "<div class=\"in small\"><span id=timer".$session->timer.">".$generator->getTimeFormat($units[$y]['endtime'] - time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($units[$y]['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") echo "".ON." ".$datetime[0]." ";
|
||||
echo "".AT." ".$datetime[1]."</div>";
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
$array = $database->getOasis($village->wid);
|
||||
foreach($array as $conqured){
|
||||
$oasis = $database->getMovement("6", $conqured['wref'], 0);
|
||||
$total_for = count($oasis);
|
||||
for($y = 0; $y < $total_for; $y++){
|
||||
$session->timer++;
|
||||
$to = $database->getOMInfo($oasis[$y]['to']);
|
||||
if($oasis[$y]['attack_type'] == 2) $actionType = REINFORCEMENTFOR;
|
||||
else if($oasis[$y]['attack_type'] == 3) $actionType = ATTACK_ON;
|
||||
else if($oasis[$y]['attack_type'] == 4) $actionType = RAID_ON;
|
||||
|
||||
$reinfowner = $database->getVillageField($oasis[$y]['from'], "owner");
|
||||
if($oasis[$y]['t11'] != 0 && $reinfowner == $session->uid) $colspan = 11;
|
||||
else $colspan = 10;
|
||||
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$oasis[$y]['from']."&c=".$generator->getMapCheck($oasis[$y]['from'])."\">".$database->getVillageField($oasis[$y]['from'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a href=\"karte.php?d=".$oasis[$y]['to']."&c=".$generator->getMapCheck($oasis[$y]['to'])."\">".$actionType." ".$to['name']."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($reinfowner, "tribe", 0);
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($oasis[$y]['t11'] != 0 && $reinfowner == $session->uid){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = 1; $i <= $colspan; $i++){
|
||||
$totalunits = $oasis[$y]['t1'] + $oasis[$y]['t2'] + $oasis[$y]['t3'] + $oasis[$y]['t4'] + $oasis[$y]['t5'] + $oasis[$y]['t6'] + $oasis[$y]['t7'] + $oasis[$y]['t8'] + $oasis[$y]['t9'] + $oasis[$y]['t10'] + $oasis[$y]['t11'];
|
||||
if($oasis[$y]['attack_type'] == 2){
|
||||
if($reinfowner != $session->uid) echo "<td class=\"none\">?</td>";
|
||||
else
|
||||
{
|
||||
if($oasis[$y]['t'.$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
echo $oasis[$y]['t'.$i]."</td>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($artifactsSum['totals'] == 0) echo "<td class=\"none\">?</td>";
|
||||
else
|
||||
{
|
||||
if($oasis[$y]['t'.$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>?</td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</tr></tbody>";
|
||||
echo '
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th>'.ARRIVAL.'</th>
|
||||
<td colspan="'.$colspan.'">
|
||||
<div class="in small"><span id=timer'.$session->timer.'>'.$generator->getTimeFormat($oasis[$y]['endtime'] - time()).'</span> h</div>';
|
||||
$datetime = $generator->procMtime($oasis[$y]['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") echo "".ON." ".$datetime[0]." ";
|
||||
echo "".AT." ".$datetime[1]." ".HRS."</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>";
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
<?php foreach ($units as $u):
|
||||
$session->timer++;
|
||||
$sort = (int)$u['sort_type'];
|
||||
$atk = (int)$u['attack_type'];
|
||||
|
||||
$settlers = $database->getMovement(7, $village->wid, 1);
|
||||
$total_for3 = count($settlers);
|
||||
for($x = 0; $x < $total_for3; $x++){
|
||||
$session->timer++;
|
||||
$to = $database->getMInfo($settlers[$x]['to']);
|
||||
?>
|
||||
if ($sort === 3 && $atk!= 1):
|
||||
$action = ($atk == 2? REINFORCEMENTFOR : ($atk == 3? ATTACK_ON : RAID_ON));
|
||||
$from = (int)$u['from'];
|
||||
$isElders = ($from === 0);
|
||||
$owner = $isElders? 0 : $database->getVillageField($from, 'owner');
|
||||
$isMine = ($owner == $session->uid);
|
||||
$colspan = ($u['t11'] > 0 && $isMine)? 11 : 10;
|
||||
$tribe = $isElders? 4 : $database->getUserField($owner, 'tribe', 0);
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = $tribe * 10;
|
||||
$dt = $generator->procMtime($u['endtime']);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a
|
||||
href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td colspan="10"><a
|
||||
href="karte.php?d=<?php echo $from['wref']."&c=".$generator->getMapCheck($from['wref']); ?>"><?php echo $actionType." ".$from['name']; ?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = ($tribe * 10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i = $start; $i <= ($end); $i++){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo TROOPS;?></th>
|
||||
<?php
|
||||
for($z = 1; $z <= 9; $z++) $settlers[$x]['t'.$z] = 0;
|
||||
$settlers[$x]['t10'] = 3;
|
||||
|
||||
for($i = 1; $i < 11; $i++){
|
||||
if($settlers[$x]['t'.$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
echo $settlers[$x]['t'.$i]."</td>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
|
||||
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th><?php echo ARRIVAL;?></th>
|
||||
<td colspan="10">
|
||||
<?php
|
||||
echo "<div class=\"in small\"><span id=timer".$session->timer.">".$generator->getTimeFormat($settlers[$x]['endtime'] - time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($settlers[$x]['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") echo "".ON." ".$datetime[0]." ";
|
||||
echo "".AT." ".$datetime[1]."</div>";
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead><tr>
|
||||
<td class="role">
|
||||
<?php if (!$isElders):?>
|
||||
<a href="karte.php?d=<?= $from?>&c=<?= $generator->getMapCheck($from)?>"><?= $database->getVillageField($from,'name')?></a>
|
||||
<?php else:?><a>village of the elders</a><?php endif;?>
|
||||
</td>
|
||||
<td colspan="<?= $colspan?>">
|
||||
<?php if (!$isElders):?>
|
||||
<a href="karte.php?d=<?= $u['to']?>&c=<?= $generator->getMapCheck($u['to'])?>"><?= $action?> <?= $database->getVillageField($u['to'],'name')?></a>
|
||||
<?php else:?><a><?= VILLAGE_OF_THE_ELDERS_TROOPS?></a><?php endif;?>
|
||||
</td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th>
|
||||
<?php for ($i=$start;$i<=$end;$i++):?><td><img src="img/x.gif" class="unit u<?= $i?>" title="<?= $technology->getUnitName($i)?>"></td><?php endfor;?>
|
||||
<?php if ($u['t11'] && $isMine):?><td><img src="img/x.gif" class="unit uhero" title="Hero"></td><?php endif;?>
|
||||
</tr>
|
||||
<tr><th><?= TROOPS?></th>
|
||||
<?php for ($i=1;$i<=$colspan;$i++):
|
||||
$val = isset($u['t'.$i])? $u['t'.$i] : 0;
|
||||
if ($isElders) { echo '<td class="none">?</td>'; continue; }
|
||||
if ($atk == 2) {
|
||||
if (!$isMine) echo '<td class="none">?</td>';
|
||||
else echo '<td class="'.($val==0?'none':'').'">'.($val==0?'0':$val).'</td>';
|
||||
} else {
|
||||
if ($artifactsSum['totals']==0) echo '<td class="none">?</td>';
|
||||
else echo '<td class="'.($val==0?'none':'').'">'.($val==0?'0':'?').'</td>';
|
||||
}
|
||||
endfor;?>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr>
|
||||
<th><?= ARRIVAL?></th>
|
||||
<td colspan="<?= $colspan?>">
|
||||
<div class="in small"><span id="timer<?= $session->timer?>"><?= $generator->getTimeFormat($u['endtime']-time())?></span> h</div>
|
||||
<div class="at small"><?= $dt[0]!='today'? ON.' '.$dt[0].' ' : ''?><?= AT?> <?= $dt[1]?> <?= HRS?></div>
|
||||
</td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
<?php } ?>
|
||||
|
||||
<?php elseif ($sort === 4):
|
||||
$fromInfo = $database->isVillageOases($u['from'])? $database->getOMInfo($u['from']) : $database->getMInfo($u['from']);
|
||||
$colspan = $u['t11']? 11 : 10;
|
||||
$tribe = $session->tribe; $start=($tribe-1)*10+1;
|
||||
$totalRes = $u['wood']+$u['clay']+$u['iron']+$u['crop'];
|
||||
$carry = 0; for($i=0;$i<10;$i++) { $t = isset($u['t'.($i+1)])? $u['t'.($i+1)] : 0; $carry += $t * ${'u'.($start+$i)}['cap']; }
|
||||
$dt = $generator->procMtime($u['endtime']);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $village->wid?>&c=<?= $generator->getMapCheck($village->wid)?>"><?= $village->vname?></a></td>
|
||||
<td colspan="<?= $colspan?>"><a href="karte.php?d=<?= $fromInfo['wref']?>&c=<?= $generator->getMapCheck($fromInfo['wref'])?>"><?= RETURNFROM?> <?= $fromInfo['name']?></a></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++):?><td><img src="img/x.gif" class="unit u<?= $i?>"></td><?php endfor;?><?php if($u['t11']):?><td><img src="img/x.gif" class="unit uhero"></td><?php endif;?></tr>
|
||||
<tr><th><?= TROOPS?></th><?php for($i=1;$i<($u['t11']?12:11);$i++): $v = isset($u['t'.$i])? $u['t'.$i] : 0;?><td class="<?= $v==0?'none':''?>"><?= $v?></td><?php endfor;?></tr>
|
||||
</tbody>
|
||||
<?php if ($totalRes>0 && $atk!=1 && $atk!=2):?>
|
||||
<tbody class="goods"><tr><th><?= BOUNTY?></th><td colspan="<?= $colspan?>">
|
||||
<div class="res"><img class="r1" src="img/x.gif"> <?= $u['wood']?> | <img class="r2" src="img/x.gif"> <?= $u['clay']?> | <img class="r3" src="img/x.gif"> <?= $u['iron']?> | <img class="r4" src="img/x.gif"> <?= $u['crop']?></div>
|
||||
<div class="carry"><img class="car" src="img/x.gif"> <?= $totalRes?>/<?= $carry?></div>
|
||||
</td></tr></tbody>
|
||||
<?php endif;?>
|
||||
<tbody class="infos"><tr><th><?= ARRIVAL?></th><td colspan="<?= $colspan?>">
|
||||
<div class="in small"><span id="timer<?= $session->timer?>"><?= $generator->getTimeFormat($u['endtime']-time())?></span> h</div>
|
||||
<div class="at"><?= $dt[0]!='today'? ON.' '.$dt[0].' ' : ''?><?= AT?> <?= $dt[1]?></div>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<?php endif; endforeach;?>
|
||||
|
||||
<?php foreach ($database->getOasis($village->wid) as $o):
|
||||
foreach ($database->getMovement(6,$o['wref'],0) as $m):
|
||||
$session->timer++; $owner=$database->getVillageField($m['from'],'owner'); $isMine=($owner==$session->uid);
|
||||
$colspan=($m['t11']&&$isMine)?11:10; $tribe=$database->getUserField($owner,'tribe',0); $start=($tribe-1)*10+1;
|
||||
$action=($m['attack_type']==2?REINFORCEMENTFOR:($m['attack_type']==3?ATTACK_ON:RAID_ON)); $dt=$generator->procMtime($m['endtime']);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $m['from']?>&c=<?= $generator->getMapCheck($m['from'])?>"><?= $database->getVillageField($m['from'],'name')?></a></td>
|
||||
<td colspan="<?= $colspan?>"><a href="karte.php?d=<?= $m['to']?>&c=<?= $generator->getMapCheck($m['to'])?>"><?= $action?> <?= $database->getOMInfo($m['to'])['name']?></a></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++):?><td><img src="img/x.gif" class="unit u<?= $i?>"></td><?php endfor;?><?php if($m['t11']&&$isMine):?><td><img src="img/x.gif" class="unit uhero"></td><?php endif;?></tr>
|
||||
<tr><th><?= TROOPS?></th><?php for($i=1;$i<=$colspan;$i++): $v = isset($m['t'.$i])? $m['t'.$i] : 0;
|
||||
if($m['attack_type']==2){ echo $isMine? '<td class="'.($v==0?'none':'').'">'.($v?$v:'0').'</td>' : '<td class="none">?</td>'; }
|
||||
else { echo $artifactsSum['totals']==0? '<td class="none">?</td>' : '<td class="'.($v==0?'none':'').'">'.($v==0?'0':'?').'</td>'; }
|
||||
endfor;?></tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr><th><?= ARRIVAL?></th><td colspan="<?= $colspan?>">
|
||||
<div class="in small"><span id="timer<?= $session->timer?>"><?= $generator->getTimeFormat($m['endtime']-time())?></span> h</div>
|
||||
<div class="at"><?= $dt[0]!='today'? ON.' '.$dt[0].' ' : ''?><?= AT?> <?= $dt[1]?> <?= HRS?></div>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<?php endforeach; endforeach;?>
|
||||
|
||||
<?php foreach ($database->getMovement(7,$village->wid,1) as $s):
|
||||
$session->timer++; $tribe=$session->tribe; $start=($tribe-1)*10+1; $dt=$generator->procMtime($s['endtime']);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $village->wid?>&c=<?= $generator->getMapCheck($village->wid)?>"><?= $village->vname?></a></td>
|
||||
<td colspan="10"><a href="karte.php?d=<?= $s['to']?>&c=<?= $generator->getMapCheck($s['to'])?>"><?= $database->getMInfo($s['to'])['name']?></a></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++):?><td><img src="img/x.gif" class="unit u<?= $i?>"></td><?php endfor;?></tr>
|
||||
<tr><th><?= TROOPS?></th><?php for($i=1;$i<=10;$i++): $v=($i==10?3:0);?><td class="<?= $v==0?'none':''?>"><?= $v?></td><?php endfor;?></tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr><th><?= ARRIVAL?></th><td colspan="10">
|
||||
<div class="in small"><span id="timer<?= $session->timer?>"><?= $generator->getTimeFormat($s['endtime']-time())?></span> h</div>
|
||||
<div class="at"><?= $dt[0]!='today'? ON.' '.$dt[0].' ' : ''?><?= AT?> <?= $dt[1]?></div>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<?php endforeach;?>
|
||||
@@ -1,8 +1,16 @@
|
||||
<?php
|
||||
|
||||
// RALLY POINT MENU
|
||||
|
||||
$t = isset($_GET['t']) ? (int)$_GET['t'] : 0;
|
||||
$isOverview = ($t === 0) || ($t === 99 && !$session->goldclub);
|
||||
$isGold = ($t === 99 && $session->goldclub);
|
||||
?>
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>" <?php if(!isset($_GET['t']) || (isset($_GET['t']) && $_GET['t'] == 99 && !$session->goldclub)) echo "class=\"selected\""; ?> ><?php echo OVERVIEW;?></a> |
|
||||
<a href="a2b.php"><?php echo SEND_TROOPS;?></a> |
|
||||
<a href="warsim.php"><?php echo Q20_RESP1;?></a>
|
||||
<?php if($session->goldclub == 1){ ?>|
|
||||
<a href="build.php?id=<?php echo $id; ?>&t=99" <?php if(isset($_GET['t']) && $_GET['t'] == 99) echo "class=\"selected\""; ?> >Gold Club</a>
|
||||
<?php } ?>
|
||||
<a href="build.php?id=<?= $id ?>" <?= $isOverview ? 'class="selected"' : '' ?>><?= OVERVIEW ?></a> |
|
||||
<a href="a2b.php"><?= SEND_TROOPS ?></a> |
|
||||
<a href="warsim.php"><?= Q20_RESP1 ?></a>
|
||||
<?php if ($session->goldclub == 1): ?> |
|
||||
<a href="build.php?id=<?= $id ?>&t=99" <?= $isGold ? 'class="selected"' : '' ?>>Gold Club</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -1,34 +1,34 @@
|
||||
<?php
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($village->unitarray['hero'] != 0) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
|
||||
?>
|
||||
</tr><tr><th><?php echo TROOPS;?></th>
|
||||
<?php
|
||||
for($i=$start;$i<=$end;$i++) {
|
||||
if($village->unitarray['u'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $village->unitarray['u'.$i]."</td>";
|
||||
}
|
||||
<?php
|
||||
|
||||
if($village->unitarray['hero'] != 0) {
|
||||
echo "<td>";
|
||||
echo $village->unitarray['hero']."</td>";
|
||||
}
|
||||
|
||||
?>
|
||||
</tr></tbody>
|
||||
<tbody class="infos"><tr><th><?php echo UPKEEP;?></th>
|
||||
<td colspan="<?php if($village->unitarray['hero'] == 0) {echo"10";}else{echo"11";}?>"><?php echo $technology->getUpkeep($village->unitarray,0); ?><img class="r4" src="img/x.gif" title="Crop" alt="Crop" /><?php echo PER_HR;?></td></tr>
|
||||
// RALLY POINT TROOPS
|
||||
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
$end = $tribe * 10;
|
||||
$hasHero = $village->unitarray['hero'] != 0;
|
||||
$colspan = $hasHero ? 11 : 10;
|
||||
?>
|
||||
<tr><th> </th>
|
||||
<?php for ($i = $start; $i <= $end; $i++): ?>
|
||||
<td><img src="img/x.gif" class="unit u<?= $i ?>" title="<?= $technology->getUnitName($i) ?>" alt="<?= $technology->getUnitName($i) ?>"></td>
|
||||
<?php endfor; ?>
|
||||
<?php if ($hasHero): ?>
|
||||
<td><img src="img/x.gif" class="unit uhero" title="Hero" alt="Hero"></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<tr><th><?= TROOPS ?></th>
|
||||
<?php for ($i = $start; $i <= $end; $i++):
|
||||
$cnt = $village->unitarray['u'.$i] ?? 0;
|
||||
?>
|
||||
<td class="<?= $cnt == 0 ? 'none' : '' ?>"><?= $cnt ?></td>
|
||||
<?php endfor; ?>
|
||||
<?php if ($hasHero): ?>
|
||||
<td><?= $village->unitarray['hero'] ?></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th><?= UPKEEP ?></th>
|
||||
<td colspan="<?= $colspan ?>"><?= $technology->getUpkeep($village->unitarray, 0) ?><img class="r4" src="img/x.gif" title="Crop" alt="Crop"><?= PER_HR ?></td>
|
||||
</tr>
|
||||
+71
-159
@@ -1,170 +1,82 @@
|
||||
<?php
|
||||
$units = $database->getMovement(3,$village->wid,0);
|
||||
$total_for = count($units);
|
||||
|
||||
for($y=0;$y<$total_for;$y++){
|
||||
$session->timer++;
|
||||
// RALLY POINT WALKING
|
||||
|
||||
if($units[$y]['attack_type'] == 2){
|
||||
$attack_type = REINFORCEMENTFOR;
|
||||
}
|
||||
if($units[$y]['attack_type'] == 1){
|
||||
$attack_type = SCOUTING;
|
||||
}
|
||||
if($units[$y]['attack_type'] == 3){
|
||||
$attack_type = ATTACK_ON;
|
||||
}
|
||||
if($units[$y]['attack_type'] == 4){
|
||||
$attack_type = RAID_ON;
|
||||
}
|
||||
$isoasis = $database->isVillageOases($units[$y]['to']);
|
||||
if ($isoasis ==0){
|
||||
$to = $database->getMInfo($units[$y]['to']);
|
||||
} else {
|
||||
$to = $database->getOMInfo($units[$y]['to']);}
|
||||
$outgoing = $database->getMovement(3, $village->wid, 0);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo $attack_type." ".$to['name']; ?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
echo "<tr><th> </th>";
|
||||
for($i=($session->tribe-1)*10+1;$i<=$session->tribe*10;$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($units[$y]['t11'] != 0) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr><th><?php echo TROOPS;?></th>
|
||||
<?php
|
||||
if($units[$y]['t11'] != 0) {
|
||||
$end = 12;
|
||||
}else{
|
||||
$end = 11;
|
||||
}
|
||||
for($i=1;$i<$end;$i++) {
|
||||
if($units[$y]['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $units[$y]['t'.$i]."</td>";
|
||||
}
|
||||
?>
|
||||
</tr></tbody>
|
||||
<?php if(NEW_FUNCTIONS_DISPLAY_CATAPULT_TARGET){
|
||||
if($units[$y]['t8'] > 0 && $units[$y]['attack_type'] == 3 && !$database->isVillageOases($units[$y]['to'])){ ?>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo CATAPULT_TARGET;?></th>
|
||||
<td style="text-align: center" colspan="5">
|
||||
<?php echo $units[$y]['ctar1'] == 0 ? "Random" : Building::procResType($units[$y]['ctar1']); ?>
|
||||
</td>
|
||||
<td style="text-align: center" colspan="<?php if($units[$y]['t11'] == 0) {echo"5";}else{echo"6";}?>">
|
||||
<?php echo $units[$y]['ctar2'] == 99 ? "Random" : ($units[$y]['ctar2'] == 0 ? "-" : Building::procResType($units[$y]['ctar2'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<?php }
|
||||
} ?>
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th><?php echo ARRIVAL;?></th>
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<?php
|
||||
echo "<div class=\"in small\"><span id=timer$session->timer>".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($units[$y]['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "".ON." ".$datetime[0]." ";
|
||||
}
|
||||
echo "".AT." ".$datetime[1]."</div>";
|
||||
if (($units[$y]['starttime']+90)>time()){
|
||||
?>
|
||||
<div class="abort"><a href="build.php?id=<?php echo $_GET['id']."&mode=troops&cancel=1&moveid=".$units[$y]['moveid']; ?>"><img src="img/x.gif" class="del" /></a></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$settlers = $database->getMovement(5,$village->wid,0);
|
||||
if($settlers){
|
||||
$total_for = count($settlers);
|
||||
|
||||
for($y=0;$y<$total_for;$y++){
|
||||
<?php foreach ($outgoing as $m):
|
||||
$session->timer++;
|
||||
$atk = (int)$m['attack_type'];
|
||||
if ($atk == 1) $action = SCOUTING;
|
||||
elseif ($atk == 2) $action = REINFORCEMENTFOR;
|
||||
elseif ($atk == 3) $action = ATTACK_ON;
|
||||
elseif ($atk == 4) $action = RAID_ON;
|
||||
else $action = '';
|
||||
|
||||
$to = $database->isVillageOases($m['to'])? $database->getOMInfo($m['to']) : $database->getMInfo($m['to']);
|
||||
$colspan = $m['t11']? 11 : 10;
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe-1)*10+1;
|
||||
$dt = $generator->procMtime($m['endtime']);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td colspan="10"><a href="karte.php?d=<?php echo $settlers[$y]['to']."&c=".$generator->getMapCheck($settlers[$y]['to']); ?>"><?php echo FOUNDNEWVILLAGE;?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $village->wid?>&c=<?= $generator->getMapCheck($village->wid)?>"><?= $village->vname?></a></td>
|
||||
<td colspan="<?= $colspan?>"><a href="karte.php?d=<?= $to['wref']?>&c=<?= $generator->getMapCheck($to['wref'])?>"><?= $action?> <?= $to['name']?></a></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr><th><?php echo TROOPS;?></th>
|
||||
<?php
|
||||
for($x=1;$x<=9;$x++) {
|
||||
$units[$y]['t'.$x]=0;
|
||||
}
|
||||
$units[$y]['t10']=3;
|
||||
for($i=1;$i<=10;$i++) {
|
||||
if($units[$y]['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">0</td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
echo $units[$y]['t'.$i]."</td>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr></tbody>
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th><?php echo ARRIVAL;?></th>
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<?php
|
||||
echo "<div class=\"in small\"><span id=timer$session->timer>".$generator->getTimeFormat($settlers[$y]['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($settlers[$y]['endtime']);
|
||||
echo "<div class=\"at small\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "".ON." ".$datetime[0]." ";
|
||||
}
|
||||
echo "".AT." ".$datetime[1]."</div>";
|
||||
if (($settlers[$y]['starttime']+90)>time()){
|
||||
?>
|
||||
<div class="abort"><a href="build.php?id=<?php echo $_GET['id']."&mode=troops&cancel=1&moveid=".$settlers[$y]['moveid']; ?>"><img src="img/x.gif" class="del" /></a></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tr><th> </th>
|
||||
<?php for($i=$start;$i<$start+10;$i++):?><td><img src="img/x.gif" class="unit u<?= $i?>" title="<?= $technology->getUnitName($i)?>"></td><?php endfor;?>
|
||||
<?php if($m['t11']):?><td><img src="img/x.gif" class="unit uhero" title="Hero"></td><?php endif;?>
|
||||
</tr>
|
||||
<tr><th><?= TROOPS?></th>
|
||||
<?php for($i=1;$i<($m['t11']?12:11);$i++): $v = isset($m['t'.$i])? $m['t'.$i] : 0;?><td class="<?= $v==0?'none':''?>"><?= $v?></td><?php endfor;?>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<?php if (defined('NEW_FUNCTIONS_DISPLAY_CATAPULT_TARGET') && NEW_FUNCTIONS_DISPLAY_CATAPULT_TARGET && $m['t8']>0 && $atk==3 &&!$database->isVillageOases($m['to'])):?>
|
||||
<tbody><tr>
|
||||
<th><?= CATAPULT_TARGET?></th>
|
||||
<td style="text-align:center" colspan="5"><?= $m['ctar1']==0?'Random':Building::procResType($m['ctar1'])?></td>
|
||||
<td style="text-align:center" colspan="<?= $m['t11']?6:5?>"><?= $m['ctar2']==99?'Random':($m['ctar2']==0?'-':Building::procResType($m['ctar2']))?></td>
|
||||
</tr></tbody>
|
||||
<?php endif;?>
|
||||
|
||||
<tbody class="infos"><tr>
|
||||
<th><?= ARRIVAL?></th>
|
||||
<td colspan="<?= $colspan?>">
|
||||
<div class="in small"><span id="timer<?= $session->timer?>"><?= $generator->getTimeFormat($m['endtime']-time())?></span> h</div>
|
||||
<div class="at"><?= $dt[0]!='today'?ON.' '.$dt[0].' ':''?><?= AT?> <?= $dt[1]?></div>
|
||||
<?php if(($m['starttime']+90)>time()):?>
|
||||
<div class="abort"><a href="build.php?id=<?= $_GET['id']?>&mode=troops&cancel=1&moveid=<?= $m['moveid']?>"><img src="img/x.gif" class="del"></a></div>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php endforeach;?>
|
||||
|
||||
<?php $settlers = $database->getMovement(5, $village->wid, 0);
|
||||
foreach ($settlers as $s):
|
||||
$session->timer++; $tribe=$session->tribe; $start=($tribe-1)*10+1; $dt=$generator->procMtime($s['endtime']);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td class="role"><a href="karte.php?d=<?= $village->wid?>&c=<?= $generator->getMapCheck($village->wid)?>"><?= $village->vname?></a></td>
|
||||
<td colspan="10"><a href="karte.php?d=<?= $s['to']?>&c=<?= $generator->getMapCheck($s['to'])?>"><?= FOUNDNEWVILLAGE?></a></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr><th> </th><?php for($i=$start;$i<$start+10;$i++):?><td><img src="img/x.gif" class="unit u<?= $i?>"></td><?php endfor;?></tr>
|
||||
<tr><th><?= TROOPS?></th><?php for($i=1;$i<=10;$i++): $v=($i==10?3:0);?><td class="<?= $v==0?'none':''?>"><?= $v?></td><?php endfor;?></tr>
|
||||
</tbody>
|
||||
<tbody class="infos"><tr>
|
||||
<th><?= ARRIVAL?></th><td colspan="10">
|
||||
<div class="in small"><span id="timer<?= $session->timer?>"><?= $generator->getTimeFormat($s['endtime']-time())?></span> h</div>
|
||||
<div class="at small"><?= $dt[0]!='today'?ON.' '.$dt[0].' ':''?><?= AT?> <?= $dt[1]?></div>
|
||||
<?php if(($s['starttime']+90)>time()):?>
|
||||
<div class="abort"><a href="build.php?id=<?= $_GET['id']?>&mode=troops&cancel=1&moveid=<?= $s['moveid']?>"><img src="img/x.gif" class="del"></a></div>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
<?php endforeach;?>
|
||||
+234
-295
@@ -1,307 +1,246 @@
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?>
|
||||
</p>
|
||||
|
||||
<?php include("17_menu.tpl"); ?>
|
||||
|
||||
<script language="JavaScript">
|
||||
<!--
|
||||
var haendler = <?php echo $market->merchantAvail(); ?>;
|
||||
var carry = <?php echo $market->maxcarry; ?>;
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
for ($a = 1; $a <= 4; $a++) {
|
||||
if (!isset($_POST['r'.$a])) {
|
||||
$_POST['r'.$a] = 0;
|
||||
// 17.tpl - MARKETPLACE
|
||||
global $database, $session, $village, $market, $generator, $form, $id;
|
||||
|
||||
$merchantAvail = (int)$market->merchantAvail();
|
||||
$maxcarry = (int)$market->maxcarry;
|
||||
$totalMerchants = (int)$market->merchant;
|
||||
|
||||
// --- POST sanitizat ---
|
||||
$r = [];
|
||||
for ($i = 1; $i <= 4; $i++) {
|
||||
$r[$i] = isset($_POST['r'.$i])? max(0, (int)$_POST['r'.$i]) : 0;
|
||||
}
|
||||
$allres = array_sum($r);
|
||||
$x = isset($_POST['x'])? trim($_POST['x']) : '';
|
||||
$y = isset($_POST['y'])? trim($_POST['y']) : '';
|
||||
$dname = isset($_POST['dname'])? trim($_POST['dname']) : '';
|
||||
$send3 = isset($_POST['send3'])? (int)$_POST['send3'] : 1;
|
||||
$ft = $_POST['ft']?? '';
|
||||
|
||||
// --- target ---
|
||||
$getwref = 0;
|
||||
$checkexist = false;
|
||||
$target = null;
|
||||
|
||||
if ($x!== '' && $y!== '' && is_numeric($x) && is_numeric($y)) {
|
||||
$getwref = (int)$database->getVilWref((int)$x, (int)$y);
|
||||
$checkexist = $database->checkVilExist($getwref);
|
||||
} elseif ($dname!== '') {
|
||||
$getwref = (int)$database->getVillageByName($dname);
|
||||
$checkexist = $database->checkVilExist($getwref);
|
||||
}
|
||||
|
||||
if ($checkexist) {
|
||||
$villageOwner = (int)$database->getVillageField($getwref, 'owner');
|
||||
$userAccess = (int)$database->getUserField($villageOwner, 'access', 0);
|
||||
$userVacation = (int)$database->getUserField($villageOwner, 'vac_mode', 0);
|
||||
$userID = (int)$database->getUserField($villageOwner, 'id', 0);
|
||||
|
||||
$target = [
|
||||
'wref' => $getwref,
|
||||
'name' => $database->getVillageField($getwref, 'name'),
|
||||
'owner' => $villageOwner,
|
||||
'coor' => $database->getCoor($getwref),
|
||||
];
|
||||
$target['time'] = $generator->procDistanceTime($target['coor'], $village->coor, $session->tribe, 0);
|
||||
}
|
||||
|
||||
$maxTotalCarry = $maxcarry * $merchantAvail;
|
||||
$canRepeat = ($send3 === 1) || ($send3 >= 2 && $send3 <= 3 && $session->goldclub);
|
||||
$validTarget = $checkexist && $getwref!== $village->wid;
|
||||
$validAccess = $checkexist && ($userAccess == 2 || $userAccess == MULTIHUNTER || (defined('ADMIN_ALLOW_INCOMING_RAIDS') && ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == ADMIN));
|
||||
|
||||
$showConfirm = ($ft === 'check' && $canRepeat && $validTarget && $allres > 0 && $allres <= $maxTotalCarry && $validAccess && $userVacation == 0);
|
||||
|
||||
// coordonate prefill din GET
|
||||
$coor = ['x' => '', 'y' => ''];
|
||||
if (isset($_GET['z'])) {
|
||||
$coor = $database->getCoor((int)$_GET['z']);
|
||||
}
|
||||
?>
|
||||
<div id="build" class="gid17">
|
||||
<a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo (int)$village->resarray['f'.$id];?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?></p>
|
||||
|
||||
<?php include("17_menu.tpl");?>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
</script>
|
||||
|
||||
<?php if ($showConfirm && $target):?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="ft" value="mk1">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>">
|
||||
<input type="hidden" name="send3" value="<?php echo $send3;?>">
|
||||
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1">
|
||||
<?php for ($i = 1; $i <= 4; $i++):
|
||||
$resNames = [1=>LUMBER,2=>CLAY,3=>IRON,4=>CROP];
|
||||
?>
|
||||
<tr>
|
||||
<td class="ico"><img class="r<?php echo $i;?>" src="img/x.gif" alt="<?php echo $resNames[$i];?>" title="<?php echo $resNames[$i];?>" /></td>
|
||||
<td class="nam"><?php echo $resNames[$i];?></td>
|
||||
<td class="val"><input class="text disabled" type="text" name="r<?php echo $i;?>" id="r<?php echo $i;?>" value="<?php echo $r[$i];?>" readonly="readonly"></td>
|
||||
<td class="max"> / <span class="none"><b><?php echo $maxcarry;?></b></span></td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
</table>
|
||||
<table id="target_validate" class="res_target" cellpadding="1" cellspacing="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo COORDINATES;?>:</th>
|
||||
<td><a href="karte.php?d=<?php echo $target['wref'];?>&c=<?php echo $generator->getMapCheck($target['wref']);?>"><?php echo htmlspecialchars($target['name']);?>(<?php echo (int)$target['coor']['x'];?>|<?php echo (int)$target['coor']['y'];?>)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo PLAYER;?>:</th>
|
||||
<td><a href="spieler.php?uid=<?php echo $target['owner'];?>"><?php echo htmlspecialchars($database->getUserField($target['owner'], 'username', 0));?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo DURATION;?>:</th>
|
||||
<td><?php echo $generator->getTimeFormat($target['time']);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo MERCHANT;?>:</th>
|
||||
<td><?php echo ceil(($allres - 0.1) / $maxcarry);?></td>
|
||||
</tr>
|
||||
<tr><td colspan="2"></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="getwref" value="<?php echo $target['wref'];?>">
|
||||
<div class="clear"></div>
|
||||
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK" <?php if(!$merchantAvail) echo 'disabled';?> /></p>
|
||||
</form>
|
||||
|
||||
<?php else:?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="ft" value="check">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>">
|
||||
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1">
|
||||
<?php for ($i = 1; $i <= 4; $i++):
|
||||
$resNames = [1=>LUMBER,2=>CLAY,3=>IRON,4=>CROP];
|
||||
?>
|
||||
<tr>
|
||||
<td class="ico"><a href="#" onClick="upd_res(<?php echo $i;?>,1); return false;"><img class="r<?php echo $i;?>" src="img/x.gif" alt="<?php echo $resNames[$i];?>" title="<?php echo $resNames[$i];?>" /></a></td>
|
||||
<td class="nam"><?php echo $resNames[$i];?>:</td>
|
||||
<td class="val"><input class="text" type="text" name="r<?php echo $i;?>" id="r<?php echo $i;?>" value="" maxlength="5" onKeyUp="upd_res(<?php echo $i;?>)" tabindex="<?php echo $i;?>"></td>
|
||||
<td class="max"><a href="#" onMouseUp="add_res(<?php echo $i;?>);" onClick="return false;">(<?php echo $maxcarry;?>)</a></td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
</table>
|
||||
|
||||
<table id="target_select" class="res_target" cellpadding="1" cellspacing="1">
|
||||
<tr><td class="mer"><?php echo MERCHANT;?> <?php echo $merchantAvail;?>/<?php echo $totalMerchants;?></td></tr>
|
||||
<tr><td class="vil"><span><?php echo VILLAGES;?>:</span> <input class="text" type="text" name="dname" value="" maxlength="30" tabindex="5"></td></tr>
|
||||
<tr><td class="or"><?php echo OR_;?></td></tr>
|
||||
<tr>
|
||||
<td class="coo">
|
||||
<span>X:</span><input class="text" type="text" name="x" value="<?php echo htmlspecialchars($coor['x']);?>" maxlength="4" tabindex="6">
|
||||
<span>Y:</span><input class="text" type="text" name="y" value="<?php echo htmlspecialchars($coor['y']);?>" maxlength="4" tabindex="7">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="clear"></div>
|
||||
<?php if ($session->goldclub == 1):?>
|
||||
<p><select name="send3"><option value="1" selected>1x</option><option value="2">2x</option><option value="3">3x</option></select> <?php echo GO;?></p>
|
||||
<?php else:?>
|
||||
<input type="hidden" name="send3" value="1">
|
||||
<?php endif;?>
|
||||
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK" <?php if(!$merchantAvail) echo 'disabled';?> /></p>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
// --- erori ---
|
||||
$error = '';
|
||||
if ($ft === 'check') {
|
||||
if ($form->returnErrors() > 0) {
|
||||
$error = '<span class="error"><b>'.$form->getError("error").'</b></span>';
|
||||
} elseif (!$checkexist) {
|
||||
$error = '<span class="error"><b>'.NO_COORDINATES_SELECTED.'</b></span>';
|
||||
} elseif ($getwref == $village->wid) {
|
||||
$error = '<span class="error"><b>'.CANNOT_SEND_RESOURCES.'</b></span>';
|
||||
} elseif (!$canRepeat) {
|
||||
$error = '<span class="error"><b>'.INVALID_MERCHANTS_REPETITION.'</b></span>';
|
||||
} elseif (!$validAccess) {
|
||||
$error = '<span class="error"><b>'.BANNED_CANNOT_SEND_RESOURCES.'.</b></span>';
|
||||
} elseif ($allres == 0) {
|
||||
$error = '<span class="error"><b>'.RESOURCES_NO_SELECTED.'.</b></span>';
|
||||
} elseif ($userVacation == 1) {
|
||||
$error = '<span class="error"><b>Player is on vacation mode. You cannot send resources to him.</b></span>';
|
||||
} elseif ($x === '' && $y === '' && $dname === '') {
|
||||
$error = '<span class="error"><b>'.ENTER_COORDINATES.'.</b></span>';
|
||||
} elseif ($allres > $maxTotalCarry) {
|
||||
$error = '<span class="error"><b>'.TOO_FEW_MERCHANTS.'.</b></span>';
|
||||
}
|
||||
echo $error;
|
||||
}
|
||||
?>
|
||||
<?php endif;?>
|
||||
|
||||
<p><?php echo MERCHANT_CARRY;?> <b><?php echo $maxcarry;?></b> <?php echo UNITS_OF_RESOURCE;?></p>
|
||||
|
||||
<?php
|
||||
// --- comercianți care vin ---
|
||||
if (count($market->recieving) > 0) {
|
||||
echo "<h4>".MERCHANT_COMING.":</h4>";
|
||||
foreach ($market->recieving as $recieve) {
|
||||
$villageowner = (int)$database->getVillageField($recieve['from'], "owner");
|
||||
echo '<table class="traders" cellpadding="1" cellspacing="1">';
|
||||
echo '<thead><tr><td><a href="spieler.php?uid='.$villageowner.'">'.htmlspecialchars($database->getUserField($villageowner,"username",0)).'</a></td>';
|
||||
echo '<td><a href="karte.php?d='.$recieve['from'].'&c='.$generator->getMapCheck($recieve['from']).'">'.TRANSPORT_FROM.' '.htmlspecialchars($database->getVillageField($recieve['from'],"name")).'</a></td></tr></thead>';
|
||||
echo '<tbody><tr><th>'.ARRIVAL_IN.'</th><td>';
|
||||
echo '<div class="in"><span id="timer'.(++$session->timer).'">'.$generator->getTimeFormat($recieve['endtime']-time()).'</span> h</div>';
|
||||
$datetime = $generator->procMtime($recieve['endtime']);
|
||||
echo '<div class="at">'.($datetime[0]!= "today"? ON." ".$datetime[0]." " : "").AT." ".$datetime[1].'</div>';
|
||||
echo '</td></tr></tbody><tr class="res"><th>'.RESOURCES.'</th><td colspan="2"><span class="f10">';
|
||||
echo '<img class="r1" src="img/x.gif" alt="'.LUMBER.'" title="'.LUMBER.'" />'.$recieve['wood'].' | ';
|
||||
echo '<img class="r2" src="img/x.gif" alt="'.CLAY.'" title="'.CLAY.'" />'.$recieve['clay'].' | ';
|
||||
echo '<img class="r3" src="img/x.gif" alt="'.IRON.'" title="'.IRON.'" />'.$recieve['iron'].' | ';
|
||||
echo '<img class="r4" src="img/x.gif" alt="'.CROP.'" title="'.CROP.'" />'.$recieve['crop'];
|
||||
echo '</span></td></tr></table>';
|
||||
}
|
||||
}
|
||||
$allres = (int) $_POST['r1'] + (int) $_POST['r2'] + (int) $_POST['r3'] + (int) $_POST['r4'];
|
||||
if(isset( $_POST['x'] ) && isset( $_POST['y'] ) && $_POST['x'] != "" && $_POST['y'] != "" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
|
||||
$getwref = $database->getVilWref($_POST['x'],$_POST['y']);
|
||||
$checkexist = $database->checkVilExist($getwref);
|
||||
}
|
||||
else if(!empty($_POST['dname'])){
|
||||
$getwref = $database->getVillageByName($_POST['dname']);
|
||||
$checkexist = $database->checkVilExist($getwref);
|
||||
}
|
||||
if(isset($checkexist) && $checkexist){
|
||||
$villageOwner = $database->getVillageField($getwref,'owner');
|
||||
$userAccess = $database->getUserField($villageOwner,'access',0);
|
||||
$userVacation = $database->getUserField($villageOwner,'vac_mode',0);
|
||||
$userID = $database->getUserField($villageOwner,'id',0);
|
||||
}
|
||||
$maxcarry = $market->maxcarry;
|
||||
$maxcarry *= $market->merchantAvail();
|
||||
if(isset($_POST['ft'])=='check' && (($_POST['send3'] > 1 && $_POST['send3'] <= 3 && $session->goldclub) || $_POST['send3'] == 1) && $getwref != $village->wid && $allres!=0 && $allres <= $maxcarry && ($_POST['x']!="" && $_POST['y']!="" or $_POST['dname']!="") && $checkexist && ($userAccess == 2 || $userAccess == MULTIHUNTER || (ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == ADMIN)) && $userVacation == 0){
|
||||
?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="ft" value="mk1">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
||||
<input type="hidden" name="send3" value="<?php echo $_POST['send3']; ?>">
|
||||
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1">
|
||||
<tr>
|
||||
<td class="ico"><img class="r1" src="img/x.gif" alt="Lumber" title="<?php echo LUMBER;?>" /></td>
|
||||
<td class="nam"> <?php echo LUMBER;?></td>
|
||||
<td class="val"><input class="text disabled" type="text" name="r1" id="r1" value="<?php echo $_POST['r1']; ?>" readonly="readonly"></td>
|
||||
<td class="max"> / <span class="none"><B><?php echo $market->maxcarry; ?></B></span> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ico"><img class="r2" src="img/x.gif" alt="Clay" title="<?php echo CLAY;?>" /></td>
|
||||
<td class="nam"> <?php echo CLAY;?></td>
|
||||
<td class="val"><input class="text disabled" type="text" name="r2" id="r2" value="<?php echo $_POST['r2']; ?>" readonly="readonly"></td>
|
||||
<td class="max"> / <span class="none"><b><?php echo$market->maxcarry; ?></b></span> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ico"><img class="r3" src="img/x.gif" alt="Iron" title="<?php echo IRON;?>" /></td>
|
||||
<td class="nam"> <?php echo IRON;?></td>
|
||||
<td class="val"><input class="text disabled" type="text" name="r3" id="r3" value="<?php echo $_POST['r3']; ?>" readonly="readonly">
|
||||
</td>
|
||||
<td class="max"> / <span class="none"><b><?php echo $market->maxcarry; ?></b></span> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ico"><img class="r4" src="img/x.gif" alt="Crop" title="<?php echo CROP;?>" /></td>
|
||||
<td class="nam"> <?php echo CROP;?></td>
|
||||
<td class="val"> <input class="text disabled" type="text" name="r4" id="r4" value="<?php echo $_POST['r4']; ?>" readonly="readonly">
|
||||
</td>
|
||||
<td class="max"> / <span class="none"><B><?php echo $market->maxcarry; ?></B></span></td>
|
||||
</tr></table>
|
||||
<table id="target_validate" class="res_target" cellpadding="1" cellspacing="1">
|
||||
<tbody><tr>
|
||||
<th><?php echo COORDINATES;?>:</th>
|
||||
<?php
|
||||
if($_POST['x'] != "" && $_POST['y'] != "" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
|
||||
$getwref = $database->getVilWref($_POST['x'],$_POST['y']);
|
||||
$getvilname = $database->getVillageField($getwref, "name");
|
||||
$getvilowner = $database->getVillageField($getwref, "owner");
|
||||
$getvilcoor['y'] = $_POST['y'];
|
||||
$getvilcoor['x'] = $_POST['x'];
|
||||
$time = $generator->procDistanceTime($getvilcoor, $village->coor, $session->tribe, 0);
|
||||
}
|
||||
else if(!empty($_POST['dname'])){
|
||||
$getwref = $database->getVillageByName($_POST['dname']);
|
||||
$getvilcoor = $database->getCoor($getwref);
|
||||
$getvilname = $database->getVillageField($getwref, "name");
|
||||
$getvilowner = $database->getVillageField($getwref, "owner");
|
||||
$time = $generator->procDistanceTime($getvilcoor, $village->coor, $session->tribe, 0);
|
||||
}
|
||||
?>
|
||||
<td><a href="karte.php?d=<?php echo $getwref; ?>&c=<?php echo $generator->getMapCheck($getwref); ?>"><?php echo $getvilname; ?>(<?php echo $getvilcoor['x']; ?>|<?php echo $getvilcoor['y']; ?>)<span class="clear"></span></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo PLAYER;?>:</th>
|
||||
<td><a href="spieler.php?uid=<?php echo $getvilowner; ?>"><?php echo $database->getUserField($getvilowner,'username',0); ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo DURATION;?>:</th>
|
||||
<td><?php echo $generator->getTimeFormat($time); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo MERCHANT;?>:</th>
|
||||
<td><?php
|
||||
$resource = array($_POST['r1'],$_POST['r2'],$_POST['r3'],$_POST['r4']);
|
||||
echo ceil((array_sum($resource)-0.1)/$market->maxcarry); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
<input type="hidden" name="getwref" value="<?php echo $getwref; ?>">
|
||||
<div class="clear"></div>
|
||||
<p>
|
||||
<div class="clear"></div><p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK" <?php if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p></form>
|
||||
<?php }else{ ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="ft" value="check">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
||||
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1"><tr>
|
||||
<td class="ico">
|
||||
<a href="#" onClick="upd_res(1,1); return false;"><img class="r1" src="img/x.gif" alt="Lumber" title="<?php echo LUMBER;?>" /></a>
|
||||
</td>
|
||||
<td class="nam">
|
||||
<?php echo LUMBER;?>:
|
||||
</td>
|
||||
<td class="val">
|
||||
<input class="text" type="text" name="r1" id="r1" value="" maxlength="5" onKeyUp="upd_res(1)" tabindex="1">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onMouseUp="add_res(1);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="ico">
|
||||
<a href="#" onClick="upd_res(2,1); return false;"><img class="r2" src="img/x.gif" alt="Clay" title="<?php echo CLAY;?>" /></a>
|
||||
</td>
|
||||
<td class="nam">
|
||||
<?php echo CLAY;?>:
|
||||
</td>
|
||||
<td class="val">
|
||||
<input class="text" type="text" name="r2" id="r2" value="" maxlength="5" onKeyUp="upd_res(2)" tabindex="2">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onMouseUp="add_res(2);" onClick="return false;">(<?php echo$market->maxcarry; ?>)</a>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="ico">
|
||||
<a href="#" onClick="upd_res(3,1); return false;"><img class="r3" src="img/x.gif" alt="Iron" title="<?php echo IRON;?>" /></a>
|
||||
</td>
|
||||
<td class="nam">
|
||||
<?php echo IRON;?>:
|
||||
</td>
|
||||
<td class="val">
|
||||
<input class="text" type="text" name="r3" id="r3" value="" maxlength="5" onKeyUp="upd_res(3)" tabindex="3">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onMouseUp="add_res(3);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="ico">
|
||||
<a href="#" onClick="upd_res(4,1); return false;"><img class="r4" src="img/x.gif" alt="Crop" title="<?php echo CROP;?>" /></a>
|
||||
</td>
|
||||
<td class="nam">
|
||||
<?php echo CROP;?>:
|
||||
</td>
|
||||
<td class="val">
|
||||
<input class="text" type="text" name="r4" id="r4" value="" maxlength="5" onKeyUp="upd_res(4)" tabindex="4">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onMouseUp="add_res(4);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
|
||||
</td>
|
||||
</tr></table>
|
||||
|
||||
<table id="target_select" class="res_target" cellpadding="1" cellspacing="1">
|
||||
<tr>
|
||||
<td class="mer"><?php echo MERCHANT;?> <?php echo $market->merchantAvail(); ?>/<?php echo $market->merchant; ?></td>
|
||||
</tr>
|
||||
<td class="vil">
|
||||
<span><?php echo VILLAGES;?>:</span>
|
||||
<input class="text" type="text" name="dname" value="" maxlength="30" tabindex="5">
|
||||
</td>
|
||||
<tr>
|
||||
<td class="or"><?php echo OR_;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(isset($_GET['z'])){
|
||||
$coor = $database->getCoor($_GET['z']);
|
||||
}
|
||||
else{
|
||||
$coor['x'] = "";
|
||||
$coor['y'] = "";
|
||||
}
|
||||
?>
|
||||
<td class="coo">
|
||||
<span>X:</span><input class="text" type="text" name="x" value="<?php echo $coor['x']; ?>" maxlength="4" tabindex="6">
|
||||
<span>Y:</span><input class="text" type="text" name="y" value="<?php echo $coor['y']; ?>" maxlength="4" tabindex="7">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="clear"></div>
|
||||
<?php if($session->goldclub == 1){?>
|
||||
<p><select name="send3"><option value="1" selected="selected">1x</option><option value="2">2x</option><option value="3">3x</option></select> <?php echo GO;?></p>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<input type="hidden" name="send3" value="1">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK" <?php if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p></form>
|
||||
<?php
|
||||
$error = '';
|
||||
if(isset($_POST['ft'])=='check'){
|
||||
|
||||
if($form->returnErrors() > 0) $error = '<span class="error"><b>'.$form->getError("error").'</b></span>';
|
||||
elseif(!$checkexist){
|
||||
$error = '<span class="error"><b>'.NO_COORDINATES_SELECTED.'</b></span>';
|
||||
}elseif($getwref == $village->wid){
|
||||
$error = '<span class="error"><b>'.CANNOT_SEND_RESOURCES.'</b></span>';
|
||||
}elseif($_POST['send3'] < 1 || $_POST['send3'] > 3 || ($_POST['send3'] > 1 && !$session->goldclub)){
|
||||
$error = '<span class="error"><b>'.INVALID_MERCHANTS_REPETITION.'</b></span>';
|
||||
}elseif($userAccess == '0' or ($userAccess == MULTIHUNTER && $userID == 5) or (!ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == ADMIN)){
|
||||
$error = '<span class="error"><b>'.BANNED_CANNOT_SEND_RESOURCES.'.</b></span>';
|
||||
}elseif($_POST['r1']==0 && $_POST['r2']==0 && $_POST['r3']==0 && $_POST['r4']==0){
|
||||
$error = '<span class="error"><b>'.RESOURCES_NO_SELECTED.'.</b></span>';
|
||||
}elseif($userVacation == '1') {
|
||||
$error = '<span class="error"><b>Player is on vacation mode. You cannot send resources to him.</b></span>';
|
||||
}elseif(!$_POST['x'] && !$_POST['y'] && !$_POST['dname']){
|
||||
$error = '<span class="error"><b>'.ENTER_COORDINATES.'.</b></span>';
|
||||
}elseif($allres > $maxcarry){
|
||||
$error = '<span class="error"><b>'.TOO_FEW_MERCHANTS.'.</b></span>';
|
||||
}
|
||||
echo $error;
|
||||
}
|
||||
?>
|
||||
<p>
|
||||
<?php } ?>
|
||||
<p><?php echo MERCHANT_CARRY;?> <b><?php echo $market->maxcarry; ?></b> <?php echo UNITS_OF_RESOURCE;?> </p>
|
||||
<?php
|
||||
if(count($market->recieving) > 0) {
|
||||
echo "<h4>".MERCHANT_COMING.":</h4>";
|
||||
foreach($market->recieving as $recieve) {
|
||||
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
|
||||
$villageowner = $database->getVillageField($recieve['from'],"owner");
|
||||
echo "<thead><tr><td><a href=\"spieler.php?uid=$villageowner\">".$database->getUserField($villageowner,"username",0)."</a></td>";
|
||||
echo "<td><a href=\"karte.php?d=".$recieve['from']."&c=".$generator->getMapCheck($recieve['from'])."\">".TRANSPORT_FROM." ".$database->getVillageField($recieve['from'],"name")."</a></td>";
|
||||
echo "</tr></thead><tbody><tr><th>".ARRIVAL_IN."</th><td>";
|
||||
echo "<div class=\"in\"><span id=timer".++$session->timer.">".$generator->getTimeFormat($recieve['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($recieve['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "".ON." ".$datetime[0]." ";
|
||||
}
|
||||
echo "".AT." ".$datetime[1]."</div>";
|
||||
echo "</td></tr></tbody> <tr class=\"res\"> <th>".RESOURCES."</th> <td colspan=\"2\"><span class=\"f10\">";
|
||||
echo "<img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".$recieve['wood']." | <img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".$recieve['clay']." | <img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".$recieve['iron']." | <img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$recieve['crop']."</td></tr></tbody>";
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
if(count($market->sending) > 0) {
|
||||
echo "<h4>".OWN_MERCHANTS_ONWAY.":</h4>";
|
||||
foreach($market->sending as $send) {
|
||||
$villageowner = $database->getVillageField($send['to'],"owner");
|
||||
$ownername = $database->getUserField($villageowner,"username",0);
|
||||
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
|
||||
echo "<thead><tr> <td><a href=\"spieler.php?uid=$villageowner\">$ownername</a></td>";
|
||||
echo "<td><a href=\"karte.php?d=".$send['to']."&c=".$generator->getMapCheck($send['to'])."\">".TRANSPORT_TO." ".$database->getVillageField($send['to'],"name")."</a></td>";
|
||||
echo "</tr></thead> <tbody><tr> <th>".ARRIVAL_IN."</th> <td>";
|
||||
echo "<div class=\"in\"><span id=timer".++$session->timer.">".$generator->getTimeFormat($send['endtime']-time())."</span> h</div>";
|
||||
// --- comercianți trimiși ---
|
||||
if (count($market->sending) > 0) {
|
||||
echo "<h4>".OWN_MERCHANTS_ONWAY.":</h4>";
|
||||
foreach ($market->sending as $send) {
|
||||
$villageowner = (int)$database->getVillageField($send['to'],"owner");
|
||||
echo '<table class="traders" cellpadding="1" cellspacing="1">';
|
||||
echo '<thead><tr><td><a href="spieler.php?uid='.$villageowner.'">'.htmlspecialchars($database->getUserField($villageowner,"username",0)).'</a></td>';
|
||||
echo '<td><a href="karte.php?d='.$send['to'].'&c='.$generator->getMapCheck($send['to']).'">'.TRANSPORT_TO.' '.htmlspecialchars($database->getVillageField($send['to'],"name")).'</a></td></tr></thead>';
|
||||
echo '<tbody><tr><th>'.ARRIVAL_IN.'</th><td>';
|
||||
echo '<div class="in"><span id="timer'.(++$session->timer).'">'.$generator->getTimeFormat($send['endtime']-time()).'</span> h</div>';
|
||||
$datetime = $generator->procMtime($send['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "".ON." ".$datetime[0]." ";
|
||||
}
|
||||
echo "".AT." ".$datetime[1]."</div>";
|
||||
echo "</td> </tr> <tr class=\"res\"> <th>".RESOURCES."</th><td>";
|
||||
echo "<img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".$send['wood']." | <img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".$send['clay']." | <img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".$send['iron']." | <img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$send['crop']."</td></tr></tbody>";
|
||||
echo "</table>";
|
||||
echo '<div class="at">'.($datetime[0]!= "today"? ON." ".$datetime[0]." " : "").AT." ".$datetime[1].'</div>';
|
||||
echo '</td></tr><tr class="res"><th>'.RESOURCES.'</th><td>';
|
||||
echo '<img class="r1" src="img/x.gif" alt="'.LUMBER.'" />'.$send['wood'].' | ';
|
||||
echo '<img class="r2" src="img/x.gif" alt="'.CLAY.'" />'.$send['clay'].' | ';
|
||||
echo '<img class="r3" src="img/x.gif" alt="'.IRON.'" />'.$send['iron'].' | ';
|
||||
echo '<img class="r4" src="img/x.gif" alt="'.CROP.'" />'.$send['crop'];
|
||||
echo '</td></tr></tbody></table>';
|
||||
}
|
||||
}
|
||||
if(count($market->return) > 0) {
|
||||
echo "<h4>".MERCHANTS_RETURNING.":</h4>";
|
||||
foreach($market->return as $return) {
|
||||
$villageowner = $database->getVillageField($return['from'],"owner");
|
||||
$ownername = $database->getUserField($villageowner,"username",0);
|
||||
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
|
||||
echo "<thead><tr> <td><a href=\"spieler.php?uid=$villageowner\">$ownername</a></td>";
|
||||
echo "<td><a href=\"karte.php?d=".$return['from']."&c=".$generator->getMapCheck($return['from'])."\">".RETURNFROM." ".$database->getVillageField($return['from'],"name")."</a></td>";
|
||||
echo "</tr></thead> <tbody><tr> <th>".ARRIVAL_IN."</th> <td>";
|
||||
echo "<div class=\"in\"><span id=timer".++$session->timer.">".$generator->getTimeFormat($return['endtime']-time())."</span> h</div>";
|
||||
|
||||
// --- comercianți care se întorc ---
|
||||
if (count($market->return) > 0) {
|
||||
echo "<h4>".MERCHANTS_RETURNING.":</h4>";
|
||||
foreach ($market->return as $return) {
|
||||
$villageowner = (int)$database->getVillageField($return['from'],"owner");
|
||||
echo '<table class="traders" cellpadding="1" cellspacing="1">';
|
||||
echo '<thead><tr><td><a href="spieler.php?uid='.$villageowner.'">'.htmlspecialchars($database->getUserField($villageowner,"username",0)).'</a></td>';
|
||||
echo '<td><a href="karte.php?d='.$return['from'].'&c='.$generator->getMapCheck($return['from']).'">'.RETURNFROM.' '.htmlspecialchars($database->getVillageField($return['from'],"name")).'</a></td></tr></thead>';
|
||||
echo '<tbody><tr><th>'.ARRIVAL_IN.'</th><td>';
|
||||
echo '<div class="in"><span id="timer'.(++$session->timer).'">'.$generator->getTimeFormat($return['endtime']-time()).'</span> h</div>';
|
||||
$datetime = $generator->procMtime($return['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "".ON." ".$datetime[0]." ";
|
||||
}
|
||||
echo "".AT." ".$datetime[1]."</div>";
|
||||
echo "</td> </tr>";
|
||||
echo "</tbody></table>";
|
||||
echo '<div class="at">'.($datetime[0]!= "today"? ON." ".$datetime[0]." " : "").AT." ".$datetime[1].'</div>';
|
||||
echo '</td></tr></tbody></table>';
|
||||
}
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
</div>
|
||||
+149
-142
@@ -1,146 +1,153 @@
|
||||
<?php
|
||||
if(isset($_GET['u'])) {
|
||||
$u = $_GET['u'];
|
||||
}
|
||||
else {
|
||||
$u=0;
|
||||
}
|
||||
?>
|
||||
// 17_1.tpl - MARKETPLACE / OFFERS
|
||||
global $database, $session, $village, $market, $generator, $id;
|
||||
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?>
|
||||
</p>
|
||||
|
||||
<?php include("17_menu.tpl");
|
||||
if($session->plus) {
|
||||
$u = isset($_GET['u']) ? max(0, (int)$_GET['u']) : 0;
|
||||
$s = isset($_GET['s']) ? (int)$_GET['s'] : 0;
|
||||
$b = isset($_GET['b']) ? (int)$_GET['b'] : 0;
|
||||
$v = isset($_GET['v']) ? $_GET['v'] : '';
|
||||
|
||||
$resIcon = [
|
||||
1 => ['class' => 'r1', 'name' => LUMBER],
|
||||
2 => ['class' => 'r2', 'name' => CLAY],
|
||||
3 => ['class' => 'r3', 'name' => IRON],
|
||||
4 => ['class' => 'r4', 'name' => CROP],
|
||||
];
|
||||
?>
|
||||
<table id="search_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td colspan="4"><?php echo I_AN_SEARCHING;?></td>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td <?php if(isset($_GET['s']) && $_GET['s'] == 1) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=1<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r1" src="img/x.gif" alt="Lumber" title="<?php echo LUMBER;?>" /></a></td>
|
||||
<td <?php if(isset($_GET['s']) && $_GET['s'] == 2) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=2<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r2" src="img/x.gif" alt="Clay" title="<?php echo CLAY;?>" /></a></td>
|
||||
<td <?php if(isset($_GET['s']) && $_GET['s'] == 3) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=3<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r3" src="img/x.gif" alt="Iron" title="<?php echo IRON;?>" /></a></td>
|
||||
<td <?php if(isset($_GET['s']) && $_GET['s'] == 4) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=4<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r4" src="img/x.gif" alt="Crop" title="<?php echo CROP;?>" /></a></td></tr></tbody>
|
||||
</table><table id="ratio_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<tbody>
|
||||
<tr><td <?php if(isset($_GET['v'])) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&v=1:1<?php if(isset($_GET['s'])) echo "&s=".$_GET['s']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>">1:1</a></td>
|
||||
</tr><tr><td <?php if(!isset($_GET['v'])) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1<?php if(isset($_GET['s'])) echo "&s=".$_GET['s']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>">1:x</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="bid_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td colspan="4"><?php echo I_AN_OFFERING;?></td>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td <?php if(isset($_GET['b']) && $_GET['b'] == 1) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=1<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r1" src="img/x.gif" alt="Lumber" title="<?php echo LUMBER;?>" /></a></td>
|
||||
<td <?php if(isset($_GET['b']) && $_GET['b'] == 2) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=2<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r2" src="img/x.gif" alt="Clay" title="<?php echo CLAY;?>" /></a></td>
|
||||
<td <?php if(isset($_GET['b']) && $_GET['b'] == 3) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=3<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r3" src="img/x.gif" alt="Iron" title="<?php echo IRON;?>" /></a></td>
|
||||
<td <?php if(isset($_GET['b']) && $_GET['b'] == 4) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=4<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r4" src="img/x.gif" alt="Crop" title="<?php echo CROP;?>" /></a></td></tr></tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="clear"></div><table id="range" cellpadding="1" cellspacing="1">
|
||||
<?php
|
||||
if(isset($_GET['e1']))
|
||||
{
|
||||
echo "<p class=\"error2\">".NOT_ENOUGH_RESOURCES."</p>";
|
||||
}
|
||||
elseif(isset($_GET['e2']))
|
||||
{
|
||||
echo "<p class=\"error2\">".INVALID_OFFER."</p>";
|
||||
}
|
||||
elseif(isset($_GET['e3']))
|
||||
{
|
||||
echo "<p class=\"error2\">".NOT_ENOUGH_MERCHANTS."</p>";
|
||||
}
|
||||
?>
|
||||
<thead><tr>
|
||||
<th colspan="5"><a name="h2"></a><?php echo OFFERS_MARKETPLACE;?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo OFFERED_TO_ME;?></td>
|
||||
<td><?php echo WANTED_TO_ME;?></td>
|
||||
<td><?php echo PLAYER;?></td>
|
||||
<td><?php echo DURATION;?></td>
|
||||
<td><?php echo ACTION;?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(count($market->onsale) > 0) {
|
||||
for($i=0+$u;$i<=40+$u;$i++) {
|
||||
if(isset($market->onsale[$i])) {
|
||||
echo "<tr><td class=\"val\">";
|
||||
$reqMerc = 1;
|
||||
if($market->onsale[$i]['wamt'] > $market->maxcarry) {
|
||||
$reqMerc = round($market->onsale[$i]['wamt']/$market->maxcarry);
|
||||
if($market->onsale[$i]['wamt'] > $market->maxcarry*$reqMerc) {
|
||||
$reqMerc += 1;
|
||||
}
|
||||
}
|
||||
switch($market->onsale[$i]['gtype']) {
|
||||
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"".LUMBER."\" />"; break;
|
||||
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"".CLAY."\" />"; break;
|
||||
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"".IRON."\" />"; break;
|
||||
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"".CROP."\" />"; break;
|
||||
}
|
||||
echo $market->onsale[$i]['gamt'];
|
||||
echo "</td> <td class=\"val\">";
|
||||
switch($market->onsale[$i]['wtype']) {
|
||||
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"".LUMBER."\" />"; break;
|
||||
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"".CLAY."\" />"; break;
|
||||
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"".IRON."\" />"; break;
|
||||
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"".CROP."\" />"; break;
|
||||
}
|
||||
echo $market->onsale[$i]['wamt'];
|
||||
echo "</td><td class=\"pla\" title=\"".$database->getVillageField($market->onsale[$i]['vref'],"name")."\">";
|
||||
echo "<a href=\"karte.php?d=".$market->onsale[$i]['vref']."&c=".$generator->getMapCheck($market->onsale[$i]['vref'])."\">".$database->getUserField($database->getVillageField($market->onsale[$i]['vref'],"owner"),"username",0)."</a></td>";
|
||||
echo "<td class=\"dur\">".$generator->getTimeFormat($market->onsale[$i]['duration'])."</td>";
|
||||
if(($market->onsale[$i]['wtype'] == 1 && $village->awood <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 2 && $village->aclay <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 3 && $village->airon <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 4 && $village->acrop <= $market->onsale[$i]['wamt'])) {
|
||||
echo "<td class=\"act none\">".NOT_ENOUGH_RESOURCES."</td></tr>";
|
||||
}
|
||||
else if($reqMerc > $market->merchantAvail()) {
|
||||
echo "<td class=\"act none\">".NOT_ENOUGH_MERCHANTS."</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "<td class=\"act\"><a href=\"build.php?id=$id&t=1&a=".$session->mchecker."&g=".$market->onsale[$i]['id']."\">Accept offer</a></td>";
|
||||
}else{
|
||||
echo "<td class=\"act\"><a href=\"banned.php\">".ACCEP_OFFER."</a></td>";
|
||||
}
|
||||
echo"</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<tr><td class=\"none\" colspan=\"5\">".NO_AVAILABLE_OFFERS."</td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody><tfoot><tr><td colspan="5">
|
||||
<span class="none">
|
||||
<?php
|
||||
if(!isset($_GET['u']) && count($market->onsale) < 40) {
|
||||
echo "<span class=\"none\"><b>«</b></span><span class=\"none\"><b>»</b></span>";
|
||||
}
|
||||
else if (!isset($_GET['u']) && count($market->onsale) > 40) {
|
||||
echo "<span class=\"none\"><b>«</b></span><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=40\">»</a>";
|
||||
}
|
||||
else if(isset($_GET['u']) && count($market->onsale) > $_GET['u']) {
|
||||
if(count($market->onsale) > ($_GET['u']+40) && $_GET['u']-40 < count($market->onsale) && $_GET['u'] != 0) {
|
||||
echo "<a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']-40)."\">«</a><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']+40)."\">»</a>";
|
||||
}
|
||||
else if(count($market->onsale) > $_GET['u']+40) {
|
||||
echo "<span class=\"none\"><b>«</b></span><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']+40)."\">»</a>";
|
||||
}
|
||||
else {
|
||||
echo "<a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']-40)."\">«</a><span class=\"none\"><b>»</b></span>";
|
||||
<div id="build" class="gid17">
|
||||
<a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo (int)$village->resarray['f'.$id];?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?></p>
|
||||
|
||||
<?php include("17_menu.tpl");?>
|
||||
|
||||
<?php if ($session->plus):?>
|
||||
<table id="search_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<thead><tr><td colspan="4"><?php echo I_AN_SEARCHING;?></td></tr></thead>
|
||||
<tbody><tr>
|
||||
<?php for ($i = 1; $i <= 4; $i++):?>
|
||||
<td <?php if ($s === $i) echo 'class="hl"';?>>
|
||||
<a href="build.php?id=<?php echo (int)$id;?>&t=1&s=<?php echo $i;?><?php if($v) echo '&v='.urlencode($v);?><?php if($b) echo '&b='.$b;?>">
|
||||
<img class="<?php echo $resIcon[$i]['class'];?>" src="img/x.gif" alt="<?php echo $resIcon[$i]['name'];?>" title="<?php echo $resIcon[$i]['name'];?>" />
|
||||
</a>
|
||||
</td>
|
||||
<?php endfor;?>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
|
||||
<table id="ratio_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<tbody>
|
||||
<tr><td <?php if($v) echo 'class="hl"';?>><a href="build.php?id=<?php echo (int)$id;?>&t=1&v=1:1<?php if($s) echo '&s='.$s;?><?php if($b) echo '&b='.$b;?>">1:1</a></td></tr>
|
||||
<tr><td <?php if(!$v) echo 'class="hl"';?>><a href="build.php?id=<?php echo (int)$id;?>&t=1<?php if($s) echo '&s='.$s;?><?php if($b) echo '&b='.$b;?>">1:x</a></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="bid_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<thead><tr><td colspan="4"><?php echo I_AN_OFFERING;?></td></tr></thead>
|
||||
<tbody><tr>
|
||||
<?php for ($i = 1; $i <= 4; $i++):?>
|
||||
<td <?php if ($b === $i) echo 'class="hl"';?>>
|
||||
<a href="build.php?id=<?php echo (int)$id;?>&t=1&b=<?php echo $i;?><?php if($v) echo '&v='.urlencode($v);?><?php if($s) echo '&s='.$s;?>">
|
||||
<img class="<?php echo $resIcon[$i]['class'];?>" src="img/x.gif" alt="<?php echo $resIcon[$i]['name'];?>" title="<?php echo $resIcon[$i]['name'];?>" />
|
||||
</a>
|
||||
</td>
|
||||
<?php endfor;?>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php
|
||||
// erori
|
||||
if (isset($_GET['e1'])) echo '<p class="error2">'.NOT_ENOUGH_RESOURCES.'</p>';
|
||||
elseif (isset($_GET['e2'])) echo '<p class="error2">'.INVALID_OFFER.'</p>';
|
||||
elseif (isset($_GET['e3'])) echo '<p class="error2">'.NOT_ENOUGH_MERCHANTS.'</p>';
|
||||
?>
|
||||
|
||||
<table id="range" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr><th colspan="5"><a name="h2"></a><?php echo OFFERS_MARKETPLACE;?></th></tr>
|
||||
<tr>
|
||||
<td><?php echo OFFERED_TO_ME;?></td>
|
||||
<td><?php echo WANTED_TO_ME;?></td>
|
||||
<td><?php echo PLAYER;?></td>
|
||||
<td><?php echo DURATION;?></td>
|
||||
<td><?php echo ACTION;?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$offers = $market->onsale;
|
||||
$totalOffers = count($offers);
|
||||
|
||||
if ($totalOffers > 0) {
|
||||
$end = min($u + 40, $totalOffers);
|
||||
for ($i = $u; $i < $end; $i++) {
|
||||
if (!isset($offers[$i])) continue;
|
||||
$offer = $offers[$i];
|
||||
|
||||
$reqMerc = max(1, (int)ceil($offer['wamt'] / $market->maxcarry));
|
||||
$vref = (int)$offer['vref'];
|
||||
$owner = (int)$database->getVillageField($vref, "owner");
|
||||
$username = htmlspecialchars($database->getUserField($owner, "username", 0));
|
||||
$villagename = htmlspecialchars($database->getVillageField($vref, "name"));
|
||||
|
||||
$hasRes = true;
|
||||
switch ($offer['wtype']) {
|
||||
case 1: $hasRes = $village->awood > $offer['wamt']; break;
|
||||
case 2: $hasRes = $village->aclay > $offer['wamt']; break;
|
||||
case 3: $hasRes = $village->airon > $offer['wamt']; break;
|
||||
case 4: $hasRes = $village->acrop > $offer['wamt']; break;
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="val">
|
||||
<img src="img/x.gif" class="<?php echo $resIcon[$offer['gtype']]['class'];?>" alt="<?php echo $resIcon[$offer['gtype']]['name'];?>" title="<?php echo $resIcon[$offer['gtype']]['name'];?>" />
|
||||
<?php echo (int)$offer['gamt'];?>
|
||||
</td>
|
||||
<td class="val">
|
||||
<img src="img/x.gif" class="<?php echo $resIcon[$offer['wtype']]['class'];?>" alt="<?php echo $resIcon[$offer['wtype']]['name'];?>" title="<?php echo $resIcon[$offer['wtype']]['name'];?>" />
|
||||
<?php echo (int)$offer['wamt'];?>
|
||||
</td>
|
||||
<td class="pla" title="<?php echo $villagename;?>">
|
||||
<a href="karte.php?d=<?php echo $vref;?>&c=<?php echo $generator->getMapCheck($vref);?>"><?php echo $username;?></a>
|
||||
</td>
|
||||
<td class="dur"><?php echo $generator->getTimeFormat($offer['duration']);?></td>
|
||||
<?php if (!$hasRes):?>
|
||||
<td class="act none"><?php echo NOT_ENOUGH_RESOURCES;?></td>
|
||||
<?php elseif ($reqMerc > $market->merchantAvail()):?>
|
||||
<td class="act none"><?php echo NOT_ENOUGH_MERCHANTS;?></td>
|
||||
<?php elseif ($session->access != BANNED):?>
|
||||
<td class="act"><a href="build.php?id=<?php echo (int)$id;?>&t=1&a=<?php echo $session->mchecker;?>&g=<?php echo (int)$offer['id'];?>">Accept offer</a></td>
|
||||
<?php else:?>
|
||||
<td class="act"><a href="banned.php"><?php echo ACCEP_OFFER;?></a></td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
echo '<tr><td class="none" colspan="5">'.NO_AVAILABLE_OFFERS.'</td></tr>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td></tr>
|
||||
</table></div>
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<?php
|
||||
$prev = $u - 40;
|
||||
$next = $u + 40;
|
||||
|
||||
if ($u == 0) echo '<span class="none"><b>«</b></span>';
|
||||
else echo '<a href="build.php?id='.(int)$id.'&t=1&u='.$prev.'">«</a>';
|
||||
|
||||
if ($next >= $totalOffers) echo '<span class="none"><b>»</b></span>';
|
||||
else echo '<a href="build.php?id='.(int)$id.'&t=1&u='.$next.'">»</a>';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
+112
-123
@@ -1,125 +1,114 @@
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><span class="level"><?php echo MARKETPLACE;?> <?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?></p>
|
||||
|
||||
<?php include("17_menu.tpl"); ?>
|
||||
<form method="POST" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="mk2" />
|
||||
|
||||
<table id="sell" cellpadding="1" cellspacing="1">
|
||||
<tr>
|
||||
<th><?php echo OFFERING;?></th>
|
||||
<td class="val"><input class="text" tabindex="1" name="m1" value="" maxlength="6" /></td>
|
||||
<td class="res">
|
||||
<select name="rid1" tabindex="2" class="dropdown">
|
||||
<option value="1" selected="selected"><?php echo LUMBER;?></option>
|
||||
<option value="2"><?php echo CLAY;?></option>
|
||||
<option value="3"><?php echo IRON;?></option>
|
||||
<option value="4"><?php echo CROP;?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="tra"><input class="check" type="checkbox" tabindex="5" name="d1" value="1" /> <?php echo MAX_TIME_TRANSPORT;?>: <input class="text" tabindex="6" name="d2" value="2" maxlength="2" /> <?php echo HOURS;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo SEARCHING;?></th>
|
||||
<td class="val"><input class="text" tabindex="3" name="m2" value="" maxlength="6" /></td>
|
||||
<td class="res">
|
||||
<select name="rid2" tabindex="4" class="dropdown">
|
||||
<option value="1"><?php echo LUMBER;?></option>
|
||||
<option value="2" selected="selected"><?php echo CLAY;?></option>
|
||||
<option value="3"><?php echo IRON;?></option>
|
||||
<option value="4"><?php echo CROP;?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="al">
|
||||
<?php
|
||||
if($session->userinfo['alliance'] != 0)
|
||||
{
|
||||
echo "<input class=\"check\" type=\"checkbox\" tabindex=\"7\" name=\"ally\" value=\"1\" /> ".OWN_ALLIANCE_ONLY."";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
// 17_2.tpl - MARKETPLACE / SELL
|
||||
global $database, $session, $village, $market, $id;
|
||||
|
||||
<?php
|
||||
if(isset($_GET['e1']))
|
||||
{
|
||||
echo "<p class=\"error2\">".NOT_ENOUGH_RESOURCES."</p>";
|
||||
}
|
||||
elseif(isset($_GET['e2']))
|
||||
{
|
||||
echo "<p class=\"error2\">".INVALID_OFFER."</p>";
|
||||
}
|
||||
elseif(isset($_GET['e3']))
|
||||
{
|
||||
echo "<p class=\"error2\">".NOT_ENOUGH_MERCHANTS."</p>";
|
||||
}
|
||||
|
||||
echo "<br /><p>".MERCHANT.": " .$market->merchantAvail()."/".$market->merchant."</p>";
|
||||
?>
|
||||
<input type="image" tabindex="8" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" <?php //if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p>
|
||||
</form>
|
||||
<?php
|
||||
if(count($market->onmarket) > 0)
|
||||
{
|
||||
echo "<table id=\"sell_overview\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><th colspan=\"7\">".OWN_OFFERS."</th></tr><tr><td> </td><td>".OFFER."</td><td>ratio</td><td>".SEARCH."</td><td>".MERCHANT."</td><td>".ALLIANCE."</td><td>".DURATION."</td></tr></thead><tbody>";
|
||||
foreach($market->onmarket as $offer)
|
||||
{
|
||||
if($session->access != BANNED)
|
||||
{
|
||||
echo "<tr><td class=\"abo\"><a href=\"build.php?id=$id&t=2&a=5&del=".$offer['id']."\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"".DELETE."\" /></a></td>";
|
||||
echo "<td class=\"val\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr><td class=\"abo\"><a href=\"banned.php\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"".DELETE."\" /></a></td>";
|
||||
echo "<td class=\"val\">";
|
||||
}
|
||||
switch($offer['gtype'])
|
||||
{
|
||||
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"".LUMBER."\" />"; break;
|
||||
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"".CLAY."\" />"; break;
|
||||
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"".IRON."\" />"; break;
|
||||
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"".CROP."\" />"; break;
|
||||
}
|
||||
echo $offer['gamt'];
|
||||
$sss = ($offer['wamt']/$offer['gamt']);
|
||||
$ratio = round($sss, 1);
|
||||
if($ratio <= 1){
|
||||
$class = 'red';
|
||||
}elseif($ratio > 1 && $ratio < 2){
|
||||
$class = 'orange';
|
||||
}elseif($ratio >= 2){
|
||||
$class = 'green';
|
||||
}
|
||||
echo "</td><td class=\"ratio\"> ".$ratio." </td> <td class=\"val\">";
|
||||
switch($offer['wtype'])
|
||||
{
|
||||
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"".LUMBER."\" />"; break;
|
||||
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"".CLAY."\" />"; break;
|
||||
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"".IRON."\" />"; break;
|
||||
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"".CROP."\" />"; break;
|
||||
}
|
||||
echo $offer['wamt'];
|
||||
echo "</td><td class=\"tra\">".$offer['merchant']." </td><td class=\"al\">";
|
||||
echo ($offer['alliance'] == 0)? 'No' : 'Yes';
|
||||
echo "</td><td class=\"dur\">";
|
||||
if($offer['maxtime'] != 0)
|
||||
{
|
||||
echo $offer['maxtime']/3600;
|
||||
echo " hrs.";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "".ALL."";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
?>
|
||||
$res = [
|
||||
1 => ['class' => 'r1', 'name' => LUMBER],
|
||||
2 => ['class' => 'r2', 'name' => CLAY],
|
||||
3 => ['class' => 'r3', 'name' => IRON],
|
||||
4 => ['class' => 'r4', 'name' => CROP],
|
||||
];
|
||||
|
||||
$merchantAvail = (int)$market->merchantAvail();
|
||||
$totalMerchants = (int)$market->merchant;
|
||||
?>
|
||||
<div id="build" class="gid17">
|
||||
<a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo (int)$village->resarray['f'.$id];?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?></p>
|
||||
|
||||
<?php include("17_menu.tpl");?>
|
||||
|
||||
<form method="POST" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="mk2" />
|
||||
|
||||
<table id="sell" cellpadding="1" cellspacing="1">
|
||||
<tr>
|
||||
<th><?php echo OFFERING;?></th>
|
||||
<td class="val"><input class="text" tabindex="1" name="m1" value="" maxlength="6" /></td>
|
||||
<td class="res">
|
||||
<select name="rid1" tabindex="2" class="dropdown">
|
||||
<?php foreach ($res as $k => $r):?>
|
||||
<option value="<?php echo $k;?>" <?php if($k==1) echo 'selected';?>><?php echo $r['name'];?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="tra">
|
||||
<input class="check" type="checkbox" tabindex="5" name="d1" value="1" /> <?php echo MAX_TIME_TRANSPORT;?>:
|
||||
<input class="text" tabindex="6" name="d2" value="2" maxlength="2" /> <?php echo HOURS;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo SEARCHING;?></th>
|
||||
<td class="val"><input class="text" tabindex="3" name="m2" value="" maxlength="6" /></td>
|
||||
<td class="res">
|
||||
<select name="rid2" tabindex="4" class="dropdown">
|
||||
<?php foreach ($res as $k => $r):?>
|
||||
<option value="<?php echo $k;?>" <?php if($k==2) echo 'selected';?>><?php echo $r['name'];?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="al">
|
||||
<?php if ((int)$session->userinfo['alliance'] !== 0):?>
|
||||
<input class="check" type="checkbox" tabindex="7" name="ally" value="1" /> <?php echo OWN_ALLIANCE_ONLY;?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if (isset($_GET['e1'])) echo '<p class="error2">'.NOT_ENOUGH_RESOURCES.'</p>';
|
||||
elseif (isset($_GET['e2'])) echo '<p class="error2">'.INVALID_OFFER.'</p>';
|
||||
elseif (isset($_GET['e3'])) echo '<p class="error2">'.NOT_ENOUGH_MERCHANTS.'</p>';
|
||||
?>
|
||||
|
||||
<br /><p><?php echo MERCHANT;?>: <?php echo $merchantAvail;?>/<?php echo $totalMerchants;?></p>
|
||||
<p><input type="image" tabindex="8" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" <?php if(!$merchantAvail) echo 'disabled';?> /></p>
|
||||
</form>
|
||||
|
||||
<?php if (count($market->onmarket) > 0):?>
|
||||
<table id="sell_overview" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr><th colspan="7"><?php echo OWN_OFFERS;?></th></tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><?php echo OFFER;?></td>
|
||||
<td>ratio</td>
|
||||
<td><?php echo SEARCH;?></td>
|
||||
<td><?php echo MERCHANT;?></td>
|
||||
<td><?php echo ALLIANCE;?></td>
|
||||
<td><?php echo DURATION;?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($market->onmarket as $offer):
|
||||
$offerId = (int)$offer['id'];
|
||||
$gtype = (int)$offer['gtype'];
|
||||
$wtype = (int)$offer['wtype'];
|
||||
$ratio = $offer['gamt'] > 0 ? round($offer['wamt'] / $offer['gamt'], 1) : 0;
|
||||
$ratioClass = $ratio <= 1 ? 'red' : ($ratio < 2 ? 'orange' : 'green');
|
||||
$delLink = $session->access != BANNED ? "build.php?id=".(int)$id."&t=2&a=5&del=".$offerId : "banned.php";
|
||||
?>
|
||||
<tr>
|
||||
<td class="abo"><a href="<?php echo $delLink;?>"><img class="del" src="img/x.gif" alt="Delete" title="<?php echo DELETE;?>" /></a></td>
|
||||
<td class="val">
|
||||
<img src="img/x.gif" class="<?php echo $res[$gtype]['class'];?>" alt="<?php echo $res[$gtype]['name'];?>" title="<?php echo $res[$gtype]['name'];?>" />
|
||||
<?php echo (int)$offer['gamt'];?>
|
||||
</td>
|
||||
<td class="ratio <?php echo $ratioClass;?>"><?php echo $ratio;?></td>
|
||||
<td class="val">
|
||||
<img src="img/x.gif" class="<?php echo $res[$wtype]['class'];?>" alt="<?php echo $res[$wtype]['name'];?>" title="<?php echo $res[$wtype]['name'];?>" />
|
||||
<?php echo (int)$offer['wamt'];?>
|
||||
</td>
|
||||
<td class="tra"><?php echo (int)$offer['merchant'];?></td>
|
||||
<td class="al"><?php echo $offer['alliance'] == 0 ? 'No' : 'Yes';?></td>
|
||||
<td class="dur"><?php echo $offer['maxtime'] != 0 ? ((int)$offer['maxtime']/3600).' hrs.' : ALL;?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
+142
-269
@@ -1,271 +1,144 @@
|
||||
<?php if($session->gold > 2){ ?>
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?>
|
||||
</p>
|
||||
|
||||
<?php include("17_menu.tpl");
|
||||
|
||||
|
||||
if(isset($_GET['c'])){
|
||||
?>
|
||||
|
||||
<p><b><?php echo NPC_COMPLETED;?>.</b> <?php echo COSTS;?> 3<img src="img/x.gif" class="gold" alt="Gold" title="<?php echo GOLD;?>" /></p>
|
||||
<a href="javascript: history.go(-2)"><?php echo BACK_BUILDING;?></a>
|
||||
<?php } else { ?>
|
||||
|
||||
<p><?php echo NPC_TRADE_DESC;?></p>
|
||||
|
||||
|
||||
<script language="JavaScript">
|
||||
var overall;
|
||||
function calculateRes() {
|
||||
resObj=document.getElementsByName("m2");
|
||||
overall=0;
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
var tmp="";
|
||||
for (j=0; j<resObj[i].value.length; j++)
|
||||
if ((resObj[i].value.charAt(j)>="0") && (resObj[i].value.charAt(j)<="9")) tmp=tmp+resObj[i].value.charAt(j);
|
||||
resObj[i].value=tmp;
|
||||
if (tmp=="") tmp="0";
|
||||
newRes=Math.round(parseInt(tmp)*summe/100);
|
||||
if (((i<3) && (newRes<=max123)) || ((i==3) && (newRes<=max4)))
|
||||
newHTML=newRes;
|
||||
else
|
||||
newHTML="<span class='corr'>"+newRes+"</span>";
|
||||
document.getElementById("new"+i).innerHTML=newHTML;
|
||||
overall+=parseInt(tmp);
|
||||
}
|
||||
document.getElementById("overall").innerHTML=overall+"%";
|
||||
}
|
||||
function normalize() {
|
||||
calculateRes();
|
||||
resObj=document.getElementsByName("m2");
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
tmp=parseInt(resObj[i].value);
|
||||
tmp=tmp*(100/overall);
|
||||
resObj[i].value=Math.round(tmp);
|
||||
}
|
||||
calculateRes();
|
||||
}
|
||||
|
||||
|
||||
function calculateRest() {
|
||||
resObj=document.getElementsByName("m2[]");
|
||||
overall=0;
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
var tmp="";
|
||||
for (j=0; j<resObj[i].value.length; j++)
|
||||
if ((resObj[i].value.charAt(j)>="0") && (resObj[i].value.charAt(j)<="9")) tmp=tmp+resObj[i].value.charAt(j);
|
||||
if (tmp=="") {
|
||||
tmp="0";
|
||||
newRes=0;
|
||||
resObj[i].value="";
|
||||
} else {
|
||||
newRes=parseInt(tmp);
|
||||
if ((i<3) && (newRes>max123)) newRes=max123;
|
||||
if ((i==3) && (newRes>max4)) newRes=max4;
|
||||
resObj[i].value=newRes;
|
||||
}
|
||||
dif=newRes-parseInt(document.getElementById("org"+i).innerHTML);
|
||||
newHTML=dif;
|
||||
if (dif>0) newHTML="+"+dif;
|
||||
document.getElementById("diff"+i).innerHTML=newHTML;
|
||||
overall+=newRes;
|
||||
}
|
||||
document.getElementById("newsum").innerHTML=overall;
|
||||
rest=parseInt(document.getElementById("org4").innerHTML)-overall;
|
||||
document.getElementById("remain").innerHTML=rest;
|
||||
testSum();
|
||||
}
|
||||
|
||||
function fillup(nr) {
|
||||
resObj=document.getElementsByName("m2[]");
|
||||
if (nr<3) {
|
||||
resObj[nr].value=max123;
|
||||
} else {
|
||||
resObj[nr].value=max4;
|
||||
}
|
||||
calculateRest();
|
||||
}
|
||||
function portionOut() {
|
||||
restRes=parseInt(document.getElementById("remain").innerHTML);
|
||||
rest=restRes;
|
||||
resObj=document.getElementsByName("m2[]");
|
||||
nullCount=0;
|
||||
notNullCount=0;
|
||||
// Z�hlen
|
||||
for (j=0; j<resObj.length; j++) {
|
||||
if ((restRes>0) && (resObj[j].value=="")) nullCount++;
|
||||
if ((restRes<0) && (resObj[j].value!="")) notNullCount++;
|
||||
}
|
||||
// Verteilen
|
||||
nullCount2=0;
|
||||
if (restRes>0) {
|
||||
// In allen Feldern schon Zahlen?
|
||||
if (nullCount==0) {
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
free=max123-parseInt(resObj[i].value);
|
||||
resObj[i].value=(parseInt(resObj[i].value)+Math.round(rest/(4-i)));
|
||||
rest=rest-Math.min(free,Math.round(rest/(4-i)));
|
||||
if ((i<3) && (parseInt(resObj[i].value)<max123)) nullCount2++;
|
||||
}
|
||||
} else {
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
if (resObj[i].value=="") {
|
||||
resObj[i].value=Math.round(rest/nullCount);
|
||||
rest=rest-Math.round(rest/nullCount);
|
||||
nullCount--;
|
||||
}
|
||||
if ((i<3) && (parseInt(resObj[i].value)<max123)) nullCount2++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (j=0; j<resObj.length; j++) {
|
||||
if (parseInt(resObj[j].value)>0) {
|
||||
resObj[j].value=(parseInt(resObj[j].value)+Math.round(rest/notNullCount));
|
||||
rest=rest-Math.round(rest/notNullCount);
|
||||
notNullCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
calculateRest();
|
||||
// Noch irgendein Rest?
|
||||
if (rest>0) {
|
||||
if (max123>max4) {
|
||||
for (j=0; j<3; j++) {
|
||||
if (parseInt(resObj[j].value)<max123) {
|
||||
resObj[j].value=(parseInt(resObj[j].value)+Math.round(rest/nullCount2));
|
||||
rest=rest-Math.round(rest/nullCount2);
|
||||
nullCount2--;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
resObj[3].value=(parseInt(resObj[3].value)+rest);
|
||||
}
|
||||
}
|
||||
calculateRest();
|
||||
}
|
||||
|
||||
function testSum() {
|
||||
if (document.getElementById("remain").innerHTML!=0) {
|
||||
document.getElementById("submitText").innerHTML="<a href='javascript:portionOut();'><?php echo DISTRIBUTE_RESOURCES; ?></a>";
|
||||
document.getElementById("submitText").style.display="block";
|
||||
document.getElementById("submitButton").style.display="none";
|
||||
} else {
|
||||
document.getElementById("submitText").innerHTML="";
|
||||
document.getElementById("submitText").style.display="none";
|
||||
document.getElementById("submitButton").style.display="block";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script language="JavaScript">var summe=<?php echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); ?>;var max123=<?php echo $village->maxstore; ?>;var max4=<?php echo $village->maxcrop; ?>;</script>
|
||||
<form method="post" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="mk3" />
|
||||
<input type="hidden" name="t" value="3" />
|
||||
<?php
|
||||
|
||||
$wwvillage = $database->getResourceLevel($village->wid);
|
||||
if($wwvillage['f99t']!=40){
|
||||
?>
|
||||
<table id="npc" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="5"><?php echo NPC_TRADE;?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(0);"><img class="r1" src="img/x.gif" alt="Lumber" title="<?php echo LUMBER;?>" /></a>
|
||||
<span id="org0"><?php echo floor($village->awood); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(1);"><img class="r2" src="img/x.gif" alt="Clay" title="<?php echo CLAY;?>" /></a>
|
||||
<span id="org1"><?php echo floor($village->aclay); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(2);"><img class="r3" src="img/x.gif" alt="Iron" title="<?php echo IRON;?>" /></a>
|
||||
<span id="org2"><?php echo floor($village->airon); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(3);"><img class="r4" src="img/x.gif" alt="Crop" title="<?php echo CROP;?>" /></a>
|
||||
<span id="org3"><?php echo floor($village->acrop); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="sum"><?php echo SUM;?>: <span id="org4"><?php echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); ?></span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r1'])) { echo "value=\"".$_GET['r1']."\""; } ?>/>
|
||||
<input type="hidden" name="m1[]" value="<?php echo floor($village->awood); ?>" />
|
||||
</td>
|
||||
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r2'])) { echo "value=\"".$_GET['r2']."\""; } ?>/>
|
||||
<input type="hidden" name="m1[]" value="<?php echo floor($village->aclay); ?>" />
|
||||
</td>
|
||||
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r3'])) { echo "value=\"".$_GET['r3']."\""; } ?>/>
|
||||
<input type="hidden" name="m1[]" value="<?php echo floor($village->airon); ?>" />
|
||||
</td>
|
||||
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r4'])) { echo "value=\"".$_GET['r4']."\""; } ?>/>
|
||||
<input type="hidden" name="m1[]" value="<?php echo floor($village->acrop); ?>" />
|
||||
</td>
|
||||
|
||||
<td class="sum"><?php echo SUM;?>: <span id="newsum"><?php if(isset($_GET['r1']) && isset($_GET['r2']) && isset($_GET['r3']) && isset($_GET['r4'])) { echo $_GET['r1']+$_GET['r2']+$_GET['r3']+$_GET['r4']; } else { echo 0; } ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td class="rem">
|
||||
<span id="diff0"><?php echo 0-floor($village->awood); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="rem">
|
||||
<span id="diff1"><?php echo 0-floor($village->aclay); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="rem">
|
||||
<span id="diff2"><?php echo 0-floor($village->airon); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="rem">
|
||||
<span id="diff3"><?php echo 0-floor($village->acrop); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="sum"><?php echo REST;?>: <span id="remain">
|
||||
<?php if(isset($_GET['r1']) && isset($_GET['r2']) && isset($_GET['r3']) && isset($_GET['r4'])) {
|
||||
echo floor($village->awood+$village->acrop+$village->airon+$village->aclay)-($_GET['r1']+$_GET['r2']+$_GET['r3']+$_GET['r4']);
|
||||
} else { echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); } ?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p id="submitButton">
|
||||
<?php if($session->userinfo['gold'] >= 3) { ?><a href="javascript:document.snd.submit();"><?php echo TRADE_RESOURCES;?>)</a> <span class="none">(<?php echo COSTS;?>: <img src="img/x.gif" class="gold_g" alt="Gold" title="<?php echo GOLD;?>" /><b>3</b>)</span><?php } else { echo"<span class='none'>".TRADE_RESOURCES.")</span> (".COSTS.": <img src='img/x.gif' class='gold' alt='Gold' title='".GOLD."' /><b>3</b>)"; }?> </p>
|
||||
<p id="submitText"></p>
|
||||
</form>
|
||||
<script>
|
||||
testSum();
|
||||
</script>
|
||||
|
||||
<?php }else{ ?>
|
||||
</br></br>
|
||||
<?php echo "".YOU_CAN_NAT_NPC_WW."";
|
||||
}} ?>
|
||||
</div>
|
||||
<?php
|
||||
}else{
|
||||
header("Location: build.php?id=".$_GET['id']."");
|
||||
exit;
|
||||
// 17_3.tpl - MARKETPLACE / NPC Trade
|
||||
global $database, $session, $village, $id;
|
||||
|
||||
if ($session->gold <= 2) {
|
||||
header("Location: build.php?id=".(int)$_GET['id']);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$totalRes = floor($village->awood + $village->aclay + $village->airon + $village->acrop);
|
||||
$maxstore = (int)$village->maxstore;
|
||||
$maxcrop = (int)$village->maxcrop;
|
||||
|
||||
// valori prefill din GET
|
||||
$r = [];
|
||||
for ($i = 1; $i <= 4; $i++) {
|
||||
$r[$i] = isset($_GET['r'.$i])? max(0, (int)$_GET['r'.$i]) : '';
|
||||
}
|
||||
$newsum = ($r[1]!=='' && $r[2]!=='' && $r[3]!=='' && $r[4]!=='')? array_sum($r) : 0;
|
||||
$remain = $totalRes - $newsum;
|
||||
|
||||
$wwvillage = $database->getResourceLevel($village->wid);
|
||||
$isWW = ($wwvillage['f99t'] == 40);
|
||||
$completed = isset($_GET['c']);
|
||||
?>
|
||||
<div id="build" class="gid17">
|
||||
<a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?></p>
|
||||
|
||||
<?php include("17_menu.tpl");?>
|
||||
|
||||
<?php if ($completed):?>
|
||||
<p><b><?php echo NPC_COMPLETED;?>.</b> <?php echo COSTS;?> 3<img src="img/x.gif" class="gold" alt="Gold" title="<?php echo GOLD;?>" /></p>
|
||||
<a href="javascript: history.go(-2)"><?php echo BACK_BUILDING;?></a>
|
||||
|
||||
<?php else:?>
|
||||
<p><?php echo NPC_TRADE_DESC;?></p>
|
||||
|
||||
<script language="JavaScript">
|
||||
var overall;
|
||||
function calculateRes() {
|
||||
resObj=document.getElementsByName("m2");
|
||||
overall=0;
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
var tmp="";
|
||||
for (j=0; j<resObj[i].value.length; j++)
|
||||
if ((resObj[i].value.charAt(j)>="0") && (resObj[i].value.charAt(j)<="9")) tmp=tmp+resObj[i].value.charAt(j);
|
||||
resObj[i].value=tmp;
|
||||
if (tmp=="") tmp="0";
|
||||
newRes=Math.round(parseInt(tmp)*summe/100);
|
||||
if (((i<3) && (newRes<=max123)) || ((i==3) && (newRes<=max4)))
|
||||
newHTML=newRes;
|
||||
else
|
||||
newHTML="<span class='corr'>"+newRes+"</span>";
|
||||
document.getElementById("new"+i).innerHTML=newHTML;
|
||||
overall+=parseInt(tmp);
|
||||
}
|
||||
document.getElementById("overall").innerHTML=overall+"%";
|
||||
}
|
||||
function normalize() { calculateRes(); resObj=document.getElementsByName("m2"); for (i=0; i<resObj.length; i++) { tmp=parseInt(resObj[i].value); tmp=tmp*(100/overall); resObj[i].value=Math.round(tmp); } calculateRes(); }
|
||||
function calculateRest() {
|
||||
resObj=document.getElementsByName("m2[]"); overall=0;
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
var tmp=""; for (j=0; j<resObj[i].value.length; j++) if ((resObj[i].value.charAt(j)>="0") && (resObj[i].value.charAt(j)<="9")) tmp=tmp+resObj[i].value.charAt(j);
|
||||
if (tmp=="") { tmp="0"; newRes=0; resObj[i].value=""; } else { newRes=parseInt(tmp); if ((i<3) && (newRes>max123)) newRes=max123; if ((i==3) && (newRes>max4)) newRes=max4; resObj[i].value=newRes; }
|
||||
dif=newRes-parseInt(document.getElementById("org"+i).innerHTML); newHTML=dif; if (dif>0) newHTML="+"+dif; document.getElementById("diff"+i).innerHTML=newHTML; overall+=newRes;
|
||||
}
|
||||
document.getElementById("newsum").innerHTML=overall; rest=parseInt(document.getElementById("org4").innerHTML)-overall; document.getElementById("remain").innerHTML=rest; testSum();
|
||||
}
|
||||
function fillup(nr) { resObj=document.getElementsByName("m2[]"); if (nr<3) { resObj[nr].value=max123; } else { resObj[nr].value=max4; } calculateRest(); }
|
||||
function portionOut() { /*... cod original neschimbat... */ restRes=parseInt(document.getElementById("remain").innerHTML); rest=restRes; resObj=document.getElementsByName("m2[]"); nullCount=0; notNullCount=0; for (j=0; j<resObj.length; j++) { if ((restRes>0) && (resObj[j].value=="")) nullCount++; if ((restRes<0) && (resObj[j].value!="")) notNullCount++; } nullCount2=0; if (restRes>0) { if (nullCount==0) { for (i=0; i<resObj.length; i++) { free=max123-parseInt(resObj[i].value); resObj[i].value=(parseInt(resObj[i].value)+Math.round(rest/(4-i))); rest=rest-Math.min(free,Math.round(rest/(4-i))); if ((i<3) && (parseInt(resObj[i].value)<max123)) nullCount2++; } } else { for (i=0; i<resObj.length; i++) { if (resObj[i].value=="") { resObj[i].value=Math.round(rest/nullCount); rest=rest-Math.round(rest/nullCount); nullCount--; } if ((i<3) && (parseInt(resObj[i].value)<max123)) nullCount2++; } } } else { for (j=0; j<resObj.length; j++) { if (parseInt(resObj[j].value)>0) { resObj[j].value=(parseInt(resObj[j].value)+Math.round(rest/notNullCount)); rest=rest-Math.round(rest/notNullCount); notNullCount--; } } } calculateRest(); if (rest>0) { if (max123>max4) { for (j=0; j<3; j++) { if (parseInt(resObj[j].value)<max123) { resObj[j].value=(parseInt(resObj[j].value)+Math.round(rest/nullCount2)); rest=rest-Math.round(rest/nullCount2); nullCount2--; } } } else { resObj[3].value=(parseInt(resObj[3].value)+rest); } } calculateRest(); }
|
||||
function testSum() { if (document.getElementById("remain").innerHTML!=0) { document.getElementById("submitText").innerHTML="<a href='javascript:portionOut();'><?php echo DISTRIBUTE_RESOURCES;?></a>"; document.getElementById("submitText").style.display="block"; document.getElementById("submitButton").style.display="none"; } else { document.getElementById("submitText").innerHTML=""; document.getElementById("submitText").style.display="none"; document.getElementById("submitButton").style.display="block"; } }
|
||||
</script>
|
||||
<script language="JavaScript">var summe=<?php echo $totalRes;?>;var max123=<?php echo $maxstore;?>;var max4=<?php echo $maxcrop;?>;</script>
|
||||
|
||||
<?php if (!$isWW):?>
|
||||
<form method="post" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="mk3" />
|
||||
<input type="hidden" name="t" value="3" />
|
||||
|
||||
<table id="npc" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr><th colspan="5"><?php echo NPC_TRADE;?></th></tr>
|
||||
<tr>
|
||||
<?php $resData = [
|
||||
['wood', $village->awood, 'r1', LUMBER],
|
||||
['clay', $village->aclay, 'r2', CLAY],
|
||||
['iron', $village->airon, 'r3', IRON],
|
||||
['crop', $village->acrop, 'r4', CROP],
|
||||
];
|
||||
foreach ($resData as $idx => $rd):?>
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(<?php echo $idx;?>);"><img class="<?php echo $rd[2];?>" src="img/x.gif" alt="<?php echo $rd[3];?>" title="<?php echo $rd[3];?>" /></a>
|
||||
<span id="org<?php echo $idx;?>"><?php echo floor($rd[1]);?></span>
|
||||
</td>
|
||||
<?php endforeach;?>
|
||||
<td class="sum"><?php echo SUM;?>: <span id="org4"><?php echo $totalRes;?></span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php for ($i = 0; $i < 4; $i++):
|
||||
$val = $r[$i+1]!== ''? $r[$i+1] : '';
|
||||
$orig = floor($resData[$i][1]);
|
||||
?>
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" value="<?php echo $val;?>" />
|
||||
<input type="hidden" name="m1[]" value="<?php echo $orig;?>" />
|
||||
</td>
|
||||
<?php endfor;?>
|
||||
<td class="sum"><?php echo SUM;?>: <span id="newsum"><?php echo $newsum;?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php for ($i = 0; $i < 4; $i++):?>
|
||||
<td class="rem"><span id="diff<?php echo $i;?>"><?php echo 0 - floor($resData[$i][1]);?></span></td>
|
||||
<?php endfor;?>
|
||||
<td class="sum"><?php echo REST;?>: <span id="remain"><?php echo $remain;?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p id="submitButton">
|
||||
<?php if ($session->userinfo['gold'] >= 3):?>
|
||||
<a href="javascript:document.snd.submit();"><?php echo TRADE_RESOURCES;?></a>
|
||||
<span class="none">(<?php echo COSTS;?>: <img src="img/x.gif" class="gold_g" alt="Gold" title="<?php echo GOLD;?>" /><b>3</b>)</span>
|
||||
<?php else:?>
|
||||
<span class="none"><?php echo TRADE_RESOURCES;?></span> (<?php echo COSTS;?>: <img src='img/x.gif' class='gold' alt='Gold' title='<?php echo GOLD;?>' /><b>3</b>)
|
||||
<?php endif;?>
|
||||
</p>
|
||||
<p id="submitText"></p>
|
||||
</form>
|
||||
<script>testSum();</script>
|
||||
|
||||
<?php else:?>
|
||||
<br /><br /><?php echo YOU_CAN_NAT_NPC_WW;?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php endif;?>
|
||||
</div>
|
||||
+84
-76
@@ -1,79 +1,87 @@
|
||||
<?php if($session->goldclub == 1 && count($database->getProfileVillages($session->uid)) > 1) { ?>
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?>
|
||||
</p>
|
||||
|
||||
<?php include("17_menu.tpl");
|
||||
if(isset($_POST['action'])){
|
||||
$routeaccess = 1;
|
||||
}
|
||||
if(isset($_GET['create']) && $session->gold > 1){
|
||||
$routeaccess = 1;
|
||||
include("17_create.tpl");
|
||||
}else if(isset($_POST['action']) && $_POST['action'] == 'editRoute' && isset($_POST['routeid']) && !empty($_POST['routeid']) && $database->getTradeRouteUid($_POST['routeid']) == $session->uid){
|
||||
include("17_edit.tpl");
|
||||
}else{
|
||||
?>
|
||||
<?php
|
||||
// 17_4.tpl - MARKETPLACE / COMERCIAL ROUTE
|
||||
global $database, $session, $village, $generator, $id;
|
||||
|
||||
<p><?php echo TRADE_ROUTES_DESC;?> <img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="<?php echo GOLD;?>"><b>2</b>.</p>
|
||||
<form method="post" action ="build.php?gid=17&t=4">
|
||||
<table id="npc" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><?php echo DESCRIPTION;?></th>
|
||||
<th><?php echo START;?></th>
|
||||
<th><?php echo MERCHANT;?></th>
|
||||
<th><?php echo TIME_LEFT;?></th>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
$routes = $database->getTradeRoute($village->wid);
|
||||
if(empty($routes)) {
|
||||
echo "<td colspan=\"5\" class=\"none\">".NO_TRADE_ROUTES.".</td></tr>";
|
||||
}else{
|
||||
foreach($routes as $route){
|
||||
?>
|
||||
<tr>
|
||||
<th><label><input class="radio" type="radio" name="routeid" value="<?php echo $route['id']; ?>" <?php if($routeid == $route['id']) { echo "".CHECKED.""; } ?>></label></th>
|
||||
<th>
|
||||
<?php
|
||||
echo "".TRADE_ROUTE_TO." <a href=karte.php?d=".$route['wid']."&c=".$generator->getMapCheck($route['wid']).">".$database->getVillageField($route['wid'],"name")."</a>";
|
||||
?>
|
||||
</th>
|
||||
<th><?php if($route['start'] > 9){ echo $route['start'];}else{ echo "0".$route['start'];} echo ":00"; ?></th>
|
||||
<th><?php echo $route['deliveries']."x".$route['merchant']; ?></th>
|
||||
<th><?php echo ceil(($route['timeleft']-time())/86400); echo " ".DAYS.""; ?></th>
|
||||
</tr>
|
||||
<?php }} ?>
|
||||
</tbody><tfoot><tr>
|
||||
<th>
|
||||
</th>
|
||||
<th colspan="4">
|
||||
<?php
|
||||
if ( isset( $routeid ) ) {
|
||||
$routeid = $routeid == 0? $routeid=0:$routeid;
|
||||
} else {
|
||||
$routeid = 0;
|
||||
}
|
||||
?>
|
||||
<button type="submit" name="action" value="extendRoute" id="btn_id" class="trav_buttons"><b><?php echo EXTEND;?>*</b></button>
|
||||
| <button type="submit" name="action" value="editRoute" id="btn_id" class="trav_buttons"><b><?php echo EDIT;?></b></button>
|
||||
| <button type="submit" name="action" value="delRoute" id="btn_id" class="trav_buttons"><b><?php echo DELETE;?></b></button>
|
||||
</th></tr></tfoot></table>
|
||||
</form>
|
||||
* <?php echo EXTEND_TRADE_ROUTES;?> <img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="<?php echo GOLD;?>"><b>2</b>
|
||||
<br>
|
||||
<div class="options">
|
||||
<a class="arrow" href="build.php?gid=17&t=4&create">» <?php echo CREATE_TRADE_ROUTES;?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}}else{
|
||||
header("Location: build.php?id=".$_GET['id']."");
|
||||
exit;
|
||||
if (!($session->goldclub == 1 && count($database->getProfileVillages($session->uid)) > 1)) {
|
||||
header("Location: build.php?id=".(int)$_GET['id']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$action = $_POST['action'] ?? '';
|
||||
$routeid = isset($_POST['routeid']) ? (int)$_POST['routeid'] : 0;
|
||||
$create = isset($_GET['create']) && $session->gold > 1;
|
||||
$edit = ($action === 'editRoute' && $routeid > 0 && $database->getTradeRouteUid($routeid) == $session->uid);
|
||||
?>
|
||||
<div id="build" class="gid17">
|
||||
<a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="<?php echo MARKETPLACE;?>" />
|
||||
</a>
|
||||
<h1><?php echo MARKETPLACE;?> <span class="level"><?php echo LEVEL;?> <?php echo (int)$village->resarray['f'.$id];?></span></h1>
|
||||
<p class="build_desc"><?php echo MARKETPLACE_DESC;?></p>
|
||||
|
||||
<?php include("17_menu.tpl");?>
|
||||
|
||||
<?php if ($create):?>
|
||||
<?php include("17_create.tpl");?>
|
||||
|
||||
<?php elseif ($edit):?>
|
||||
<?php include("17_edit.tpl");?>
|
||||
|
||||
<?php else:?>
|
||||
<p><?php echo TRADE_ROUTES_DESC;?> <img src="../../<?php echo GP_LOCATE;?>img/a/gold.gif" alt="Gold" title="<?php echo GOLD;?>"><b>2</b>.</p>
|
||||
|
||||
<form method="post" action="build.php?gid=17&t=4">
|
||||
<table id="npc" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><?php echo DESCRIPTION;?></th>
|
||||
<th><?php echo START;?></th>
|
||||
<th><?php echo MERCHANT;?></th>
|
||||
<th><?php echo TIME_LEFT;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$routes = $database->getTradeRoute($village->wid);
|
||||
if (empty($routes)):
|
||||
?>
|
||||
<tr><td colspan="5" class="none"><?php echo NO_TRADE_ROUTES;?>.</td></tr>
|
||||
<?php else:
|
||||
foreach ($routes as $route):
|
||||
$rid = (int)$route['id'];
|
||||
$wid = (int)$route['wid'];
|
||||
$vname = htmlspecialchars($database->getVillageField($wid, "name"));
|
||||
$start = str_pad((int)$route['start'], 2, '0', STR_PAD_LEFT).":00";
|
||||
$deliveries = (int)$route['deliveries']."x".(int)$route['merchant'];
|
||||
$daysLeft = max(0, ceil(($route['timeleft'] - time()) / 86400));
|
||||
?>
|
||||
<tr>
|
||||
<th><label><input class="radio" type="radio" name="routeid" value="<?php echo $rid;?>" <?php if($routeid === $rid) echo 'checked';?>></label></th>
|
||||
<th><?php echo TRADE_ROUTE_TO;?> <a href="karte.php?d=<?php echo $wid;?>&c=<?php echo $generator->getMapCheck($wid);?>"><?php echo $vname;?></a></th>
|
||||
<th><?php echo $start;?></th>
|
||||
<th><?php echo $deliveries;?></th>
|
||||
<th><?php echo $daysLeft.' '.DAYS;?></th>
|
||||
</tr>
|
||||
<?php endforeach; endif;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th colspan="4">
|
||||
<button type="submit" name="action" value="extendRoute" class="trav_buttons"><b><?php echo EXTEND;?>*</b></button>
|
||||
| <button type="submit" name="action" value="editRoute" class="trav_buttons"><b><?php echo EDIT;?></b></button>
|
||||
| <button type="submit" name="action" value="delRoute" class="trav_buttons"><b><?php echo DELETE;?></b></button>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
* <?php echo EXTEND_TRADE_ROUTES;?> <img src="../../<?php echo GP_LOCATE;?>img/a/gold.gif" alt="Gold" title="<?php echo GOLD;?>"><b>2</b>
|
||||
<br>
|
||||
<div class="options">
|
||||
<a class="arrow" href="build.php?gid=17&t=4&create">» <?php echo CREATE_TRADE_ROUTES;?></a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
@@ -1,78 +1,77 @@
|
||||
<form action="build.php" method="post">
|
||||
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
|
||||
<input type="hidden" name="action" value="addRoute">
|
||||
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo CREATE_TRADE_ROUTE;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo TARGET_VILLAGE;?>: </th>
|
||||
<td>
|
||||
|
||||
<select id="tvillage" name="tvillage">
|
||||
<?php
|
||||
if($session->villages[0] == $village->wid){
|
||||
$firstvillage = 2;
|
||||
}else{
|
||||
$firstvillage = 1;
|
||||
}
|
||||
for($i=1;$i<=count($session->villages);$i++) {
|
||||
if($i == $firstvillage){
|
||||
$select = 'selected="selected"';
|
||||
}else{
|
||||
$select = '';
|
||||
}
|
||||
if($session->villages[$i-1] != $village->wid){
|
||||
$coor = $database->getCoor($session->villages[$i-1]);
|
||||
echo "<option value=\"".$session->villages[$i-1]."\" ".$select.">".$database->getVillageField($session->villages[$i-1],'name')." (".$coor['x']."|".$coor['y'].")</option>";
|
||||
}
|
||||
}
|
||||
?> </select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo RESOURCES;?>: </th>
|
||||
<td>
|
||||
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="<?php echo LUMBER;?>"> <input class="text" type="text" name="r1" id="r1" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="<?php echo CLAY;?>"> <input class="text" type="text" name="r2" id="r2" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="<?php echo IRON;?>"> <input class="text" type="text" name="r3" id="r3" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="<?php echo CROP;?>"> <input class="text" type="text" name="r4" id="r4" value="" maxlength="5" tabindex="1" style="width:50px;">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo START_TIME_TRADE;?>: </th>
|
||||
<td>
|
||||
<select name="start"><option value="0" selected="selected">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo DELIVERIES;?>: </th>
|
||||
<td>
|
||||
<select name="deliveries"><option value="1" selected="selected">1</option><option value="2">2</option><option value="3">3</option></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo COSTS;?>: </th>
|
||||
<td>
|
||||
<img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="<?php echo GOLD;?>"> <b>2</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo DURATION;?>: </th>
|
||||
<td>
|
||||
<b>7</b> <?php echo DAYS;?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
// 17_create.tpl - MARKETPLACE / CREATE ROUTE
|
||||
global $database, $session, $village;
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
|
||||
</form>
|
||||
</div>
|
||||
$villages = $session->villages?? [];
|
||||
$firstSelect = ($villages[0]?? 0) == $village->wid? 1 : 0;
|
||||
?>
|
||||
<form action="build.php" method="post">
|
||||
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
|
||||
<input type="hidden" name="action" value="addRoute">
|
||||
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
|
||||
<thead>
|
||||
<tr><th colspan="2"><?php echo CREATE_TRADE_ROUTE;?></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo TARGET_VILLAGE;?>:</th>
|
||||
<td>
|
||||
<select id="tvillage" name="tvillage">
|
||||
<?php
|
||||
$idx = 0;
|
||||
foreach ($villages as $vid) {
|
||||
$vid = (int)$vid;
|
||||
if ($vid === (int)$village->wid) continue;
|
||||
$coor = $database->getCoor($vid);
|
||||
$name = htmlspecialchars($database->getVillageField($vid, 'name'));
|
||||
$selected = ($idx === $firstSelect)? 'selected' : '';
|
||||
echo '<option value="'.$vid.'" '.$selected.'>'.$name.' ('.(int)$coor['x'].'|'.(int)$coor['y'].')</option>';
|
||||
$idx++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo RESOURCES;?>:</th>
|
||||
<td>
|
||||
<?php $icons = [1=>'1',2=>'2',3=>'3',4=>'4']; $names = [1=>LUMBER,2=>CLAY,3=>IRON,4=>CROP];
|
||||
foreach ($icons as $i => $img):?>
|
||||
<img src="../../<?php echo GP_LOCATE;?>img/r/<?php echo $img;?>.gif" alt="<?php echo $names[$i];?>" title="<?php echo $names[$i];?>">
|
||||
<input class="text" type="text" name="r<?php echo $i;?>" id="r<?php echo $i;?>" value="" maxlength="5" tabindex="1" style="width:50px;">
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo START_TIME_TRADE;?>:</th>
|
||||
<td>
|
||||
<select name="start">
|
||||
<?php for ($h = 0; $h < 24; $h++):?>
|
||||
<option value="<?php echo $h;?>" <?php if($h===0) echo 'selected';?>><?php echo str_pad($h,2,'0',STR_PAD_LEFT);?></option>
|
||||
<?php endfor;?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo DELIVERIES;?>:</th>
|
||||
<td>
|
||||
<select name="deliveries">
|
||||
<?php for ($d = 1; $d <= 3; $d++):?>
|
||||
<option value="<?php echo $d;?>" <?php if($d===1) echo 'selected';?>><?php echo $d;?></option>
|
||||
<?php endfor;?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo COSTS;?>:</th>
|
||||
<td><img src="../../<?php echo GP_LOCATE;?>img/a/gold.gif" alt="Gold" title="<?php echo GOLD;?>"> <b>2</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo DURATION;?>:</th>
|
||||
<td><b>7</b> <?php echo DAYS;?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
|
||||
</form>
|
||||
+62
-39
@@ -1,40 +1,63 @@
|
||||
<?php $edited_route = $database->getTradeRoute2($_POST['routeid']); ?>
|
||||
<form action="build.php" method="post">
|
||||
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
|
||||
<input type="hidden" name="action" value="editRoute2">
|
||||
<input type="hidden" name="routeid" value="<?php echo $_POST['routeid']; ?>">
|
||||
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo EDIT_TRADE_ROUTES;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo RESOURCES;?>: </th>
|
||||
<td>
|
||||
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="<?php echo LUMBER;?>"> <input class="text" type="text" name="r1" id="r1" value="<?php echo $edited_route['wood']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="<?php echo CLAY;?>"> <input class="text" type="text" name="r2" id="r2" value="<?php echo $edited_route['clay']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="<?php echo IRON;?>"> <input class="text" type="text" name="r3" id="r3" value="<?php echo $edited_route['iron']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="<?php echo CROP;?>"> <input class="text" type="text" name="r4" id="r4" value="<?php echo $edited_route['crop']; ?>" maxlength="5" tabindex="1" style="width:50px;">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo START_TIME_TRADE;?>: </th>
|
||||
<td>
|
||||
<select name="start"><?php for($i=0;$i<=23;$i++){?><option value="<?php echo $i; ?>" <?php if($i == $edited_route['start']){echo "selected";} ?>><?php if($i > 9){echo $i;}else{echo "0".$i;}?></option><?php } ?></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo DELIVERIES;?>: </th>
|
||||
<td>
|
||||
<select name="deliveries"><?php for($i=1;$i<=3;$i++){?><option value="<?php echo $i; ?>" <?php if($i == $edited_route['deliveries']){echo "selected";} ?>><?php echo $i; ?></option><?php } ?></select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<?php
|
||||
// 17_edit.tpl - MARKETPLACE / EDIT ROUTES
|
||||
global $database;
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
|
||||
</form>
|
||||
</div>
|
||||
$routeid = isset($_POST['routeid'])? (int)$_POST['routeid'] : 0;
|
||||
$edited_route = $database->getTradeRoute2($routeid);
|
||||
|
||||
$wood = (int)($edited_route['wood']??0);
|
||||
$clay = (int)($edited_route['clay']??0);
|
||||
$iron = (int)($edited_route['iron']??0);
|
||||
$crop = (int)($edited_route['crop']??0);
|
||||
$start = (int)($edited_route['start']??0);
|
||||
$deliveries = (int)($edited_route['deliveries']??1);
|
||||
?>
|
||||
<form action="build.php" method="post">
|
||||
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
|
||||
<input type="hidden" name="action" value="editRoute2">
|
||||
<input type="hidden" name="routeid" value="<?php echo $routeid;?>">
|
||||
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
|
||||
<thead>
|
||||
<tr><th colspan="2"><?php echo EDIT_TRADE_ROUTES;?></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo RESOURCES;?>:</th>
|
||||
<td>
|
||||
<?php $res = [
|
||||
['r1', $wood, '1', LUMBER],
|
||||
['r2', $clay, '2', CLAY],
|
||||
['r3', $iron, '3', IRON],
|
||||
['r4', $crop, '4', CROP],
|
||||
];
|
||||
foreach ($res as $r):?>
|
||||
<img src="../../<?php echo GP_LOCATE;?>img/r/<?php echo $r[2];?>.gif" alt="<?php echo $r[3];?>" title="<?php echo $r[3];?>">
|
||||
<input class="text" type="text" name="<?php echo $r[0];?>" id="<?php echo $r[0];?>" value="<?php echo $r[1];?>" maxlength="5" tabindex="1" style="width:50px;">
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo START_TIME_TRADE;?>:</th>
|
||||
<td>
|
||||
<select name="start">
|
||||
<?php for ($i = 0; $i <= 23; $i++):?>
|
||||
<option value="<?php echo $i;?>" <?php if($i === $start) echo 'selected';?>><?php echo str_pad($i,2,'0',STR_PAD_LEFT);?></option>
|
||||
<?php endfor;?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo DELIVERIES;?>:</th>
|
||||
<td>
|
||||
<select name="deliveries">
|
||||
<?php for ($i = 1; $i <= 3; $i++):?>
|
||||
<option value="<?php echo $i;?>" <?php if($i === $deliveries) echo 'selected';?>><?php echo $i;?></option>
|
||||
<?php endfor;?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
|
||||
</form>
|
||||
+19
-17
@@ -1,17 +1,19 @@
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>"<?php if(!isset($_GET['t'])) { echo "class=\"selected\""; } ?>"><?php echo SEND_RESOURCES;?></a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=1" <?php if(isset($_GET['t']) && $_GET['t'] == 1) { echo "class=\"selected\""; } ?>><?php echo BUY;?></a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=2" <?php if(isset($_GET['t']) && $_GET['t'] == 2) { echo "class=\"selected\""; } ?>><?php echo OFFER;?></a>
|
||||
<?php if($session->userinfo['gold'] > 2) {
|
||||
?>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=3" <?php if(isset($_GET['t']) && $_GET['t'] == 3) { echo "class=\"selected\""; } ?>><?php echo NPC_TRADING;?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php if($session->goldclub == 1 && count($database->getProfileVillages($session->uid)) > 1) {
|
||||
?>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=4" <?php if(isset($_GET['t']) && $_GET['t'] == 4) { echo "class=\"selected\""; } ?>><?php echo TRADE_ROUTES;?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
// 17_menu.tpl - MENU MARKETPLACE
|
||||
global $database, $session, $id;
|
||||
|
||||
$t = isset($_GET['t'])? (int)$_GET['t'] : 0;
|
||||
$hasGold = (int)$session->userinfo['gold'] > 2;
|
||||
$hasRoutes = $session->goldclub == 1 && count($database->getProfileVillages($session->uid)) > 1;
|
||||
?>
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo (int)$id;?>" <?php if($t===0) echo 'class="selected"';?>><?php echo SEND_RESOURCES;?></a>
|
||||
| <a href="build.php?id=<?php echo (int)$id;?>&t=1" <?php if($t===1) echo 'class="selected"';?>><?php echo BUY;?></a>
|
||||
| <a href="build.php?id=<?php echo (int)$id;?>&t=2" <?php if($t===2) echo 'class="selected"';?>><?php echo OFFER;?></a>
|
||||
<?php if ($hasGold):?>
|
||||
| <a href="build.php?id=<?php echo (int)$id;?>&t=3" <?php if($t===3) echo 'class="selected"';?>><?php echo NPC_TRADING;?></a>
|
||||
<?php endif;?>
|
||||
<?php if ($hasRoutes):?>
|
||||
| <a href="build.php?id=<?php echo (int)$id;?>&t=4" <?php if($t===4) echo 'class="selected"';?>><?php echo TRADE_ROUTES;?></a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
+61
-63
@@ -1,66 +1,64 @@
|
||||
<div id="build" class="gid18"><a href="#" onClick="return Popup(18,4);" class="build_logo">
|
||||
<img class="building g18" src="img/x.gif" alt="Embassy" title="<?php echo EMBASSY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo EMBASSY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo EMBASSY_DESC; ?></p>
|
||||
|
||||
<?php
|
||||
if($village->resarray['f'.$id] >= 3 && $session->alliance == 0) {
|
||||
include("18_create.tpl");
|
||||
}
|
||||
if($session->alliance != 0) {
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" id=\"ally_info\">
|
||||
<thead><tr>
|
||||
<th colspan=\"2\">".ALLIANCE."</th>
|
||||
</tr></thead>
|
||||
// 18.tpl - EMBESSY
|
||||
global $village, $session, $id, $alliance, $database, $form;
|
||||
|
||||
<tbody><tr>
|
||||
<th>".TAG."</th>
|
||||
<td>".$alliance->allianceArray['tag']."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>".NAME."</th>
|
||||
<td>".$alliance->allianceArray['name']."</td>
|
||||
<span class=\"error\">".$form->getError("ally3")."</span>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class=\"empty\" colspan=\"2\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=\"2\"><a href=\"allianz.php\"> » ".TO_THE_ALLIANCE."</a></td>
|
||||
</tr></tbody>
|
||||
</table>";
|
||||
}
|
||||
else if($village->resarray['f'.$id] >= 1) {
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="join">
|
||||
<form method="post" action="build.php">
|
||||
<input type="hidden" name="a" value="2">
|
||||
|
||||
<thead><tr>
|
||||
<th colspan="3"><?php echo JOIN_ALLIANCE; ?></th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<?php
|
||||
if($alliance->gotInvite) {
|
||||
foreach($alliance->inviteArray as $invite) {
|
||||
echo "<td class=\"abo\"><a href=\"build.php?id=".$id."&a=2&d=".$invite['id']."\"><img class=\"del\" src=\"img/x.gif\" alt=\"refuse\" title=\"".REFUSE."\" /></a></td>
|
||||
<td class=\"nam\"><a href=\"allianz.php?aid=".$invite['alliance']."\"> ".$database->getAllianceName($invite['alliance'])."</a></td>
|
||||
<td class=\"acc\"><a href=\"build.php?id=".$id."&a=3&d=".$invite['id']."\"> ".ACCEPT."</a></td>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<td colspan=\"3\" class=\"none\">".NO_INVITATIONS."</td>";
|
||||
}
|
||||
?>
|
||||
</tr></tbody></table>
|
||||
<p class="error"><?php echo $form->getError("ally4"); ?></p>
|
||||
<?php
|
||||
if($alliance->gotInvite) {
|
||||
echo "<p class=\"error2\" style=\"color: #DD0000\">".$form->getError("ally_accept")."</p>";
|
||||
}
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$inAlliance = (int)$session->alliance !== 0;
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid18">
|
||||
<a href="#" onClick="return Popup(18,4);" class="build_logo">
|
||||
<img class="building g18" src="img/x.gif" alt="Embassy" title="<?php echo EMBASSY;?>" />
|
||||
</a>
|
||||
<h1><?php echo EMBASSY;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo EMBASSY_DESC;?></p>
|
||||
|
||||
<?php if ($level >= 3 && !$inAlliance) include("18_create.tpl");?>
|
||||
|
||||
<?php if ($inAlliance):?>
|
||||
<table cellpadding="1" cellspacing="1" id="ally_info">
|
||||
<thead><tr><th colspan="2"><?php echo ALLIANCE;?></th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo TAG;?></th>
|
||||
<td><?php echo htmlspecialchars($alliance->allianceArray['tag']);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo NAME;?></th>
|
||||
<td>
|
||||
<?php echo htmlspecialchars($alliance->allianceArray['name']);?>
|
||||
<span class="error"><?php echo $form->getError("ally3");?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="empty" colspan="2"></td></tr>
|
||||
<tr><td colspan="2"><a href="allianz.php"> » <?php echo TO_THE_ALLIANCE;?></a></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php elseif ($level >= 1):?>
|
||||
<table cellpadding="1" cellspacing="1" id="join">
|
||||
<thead><tr><th colspan="3"><?php echo JOIN_ALLIANCE;?></th></tr></thead>
|
||||
<tbody>
|
||||
<?php if ($alliance->gotInvite && !empty($alliance->inviteArray)):
|
||||
foreach ($alliance->inviteArray as $invite):
|
||||
$invId = (int)$invite['id'];
|
||||
$allyId = (int)$invite['alliance'];
|
||||
$allyName = htmlspecialchars($database->getAllianceName($allyId));
|
||||
?>
|
||||
<tr>
|
||||
<td class="abo"><a href="build.php?id=<?php echo (int)$id;?>&a=2&d=<?php echo $invId;?>"><img class="del" src="img/x.gif" alt="refuse" title="<?php echo REFUSE;?>" /></a></td>
|
||||
<td class="nam"><a href="allianz.php?aid=<?php echo $allyId;?>"> <?php echo $allyName;?></a></td>
|
||||
<td class="acc"><a href="build.php?id=<?php echo (int)$id;?>&a=3&d=<?php echo $invId;?>"> <?php echo ACCEPT;?></a></td>
|
||||
</tr>
|
||||
<?php endforeach; else:?>
|
||||
<tr><td colspan="3" class="none"><?php echo NO_INVITATIONS;?></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="error"><?php echo $form->getError("ally4");?></p>
|
||||
<?php if ($alliance->gotInvite):?>
|
||||
<p class="error2" style="color: #DD0000"><?php echo $form->getError("ally_accept");?></p>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
@@ -1,55 +1,40 @@
|
||||
<?php if($session->access!=BANNED){ ?>
|
||||
<?php
|
||||
// 18_create.tpl - EMBESSY / CREATE
|
||||
global $form, $session;
|
||||
|
||||
$isBanned = $session->access == BANNED;
|
||||
$disabled = $isBanned ? 'disabled' : '';
|
||||
$tagValue = htmlspecialchars($form->getValue("ally1"));
|
||||
$nameValue = htmlspecialchars($form->getValue("ally2"));
|
||||
$maxTag = $isBanned ? 8 : 15;
|
||||
$maxName = $isBanned ? 25 : 50;
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="found">
|
||||
<form method="post" action="build.php">
|
||||
<input type="hidden" name="ft" value="ali1">
|
||||
<thead><tr>
|
||||
<th colspan="2"><?php echo FOUND_ALLIANCE; ?></th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<th><?php echo TAG; ?></th>
|
||||
<td class="tag">
|
||||
<input class="text" name="ally1" value="<?php echo $form->getValue("ally1"); ?>" maxlength="15">
|
||||
<span class="error"><?php echo $form->getError("ally1"); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo NAME; ?></th>
|
||||
<td class="nam">
|
||||
<input class="text" name="ally2" value="<?php echo $form->getValue("ally2"); ?>" maxlength="50">
|
||||
<span class="error"><?php echo $form->getError("ally2"); ?></span>
|
||||
</td>
|
||||
<form method="post" action="build.php">
|
||||
<input type="hidden" name="ft" value="ali1">
|
||||
<thead><tr><th colspan="2"><?php echo FOUND_ALLIANCE;?></th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo TAG;?></th>
|
||||
<td class="tag">
|
||||
<input class="text" name="ally1" value="<?php echo $tagValue;?>" maxlength="<?php echo $maxTag;?>" <?php echo $disabled;?>>
|
||||
<span class="error"><?php echo $form->getError("ally1");?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo NAME;?></th>
|
||||
<td class="nam">
|
||||
<input class="text" name="ally2" value="<?php echo $nameValue;?>" maxlength="<?php echo $maxName;?>" <?php echo $disabled;?>>
|
||||
<span class="error"><?php echo $form->getError("ally2");?></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</tr></tbody>
|
||||
</table>
|
||||
|
||||
<p><button value="ok" name="s1" id="btn_ok" class="trav_buttons" alt="OK" /> Ok </button></form></p><table cellpadding="1" cellspacing="1" id="join">
|
||||
|
||||
<?php }else{ ?>
|
||||
<table cellpadding="1" cellspacing="1" id="found">
|
||||
<form method="post" action="build.php">
|
||||
<input type="hidden" name="ft" value="ali1">
|
||||
<thead><tr>
|
||||
<th colspan="2"><?php echo FOUND_ALLIANCE; ?></th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<th><?php echo TAG; ?></th>
|
||||
<td class="tag">
|
||||
<input class="text" name="ally1" disabled="disabled" value="<?php echo $form->getValue("ally1"); ?>" maxlength="8">
|
||||
<span class="error"><?php echo $form->getError("ally1"); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo NAME; ?></th>
|
||||
<td class="nam">
|
||||
<input class="text" name="ally2" disabled="disabled" value="<?php echo $form->getValue("ally2"); ?>" maxlength="25">
|
||||
<span class="error"><?php echo $form->getError("ally2"); ?></span>
|
||||
</td>
|
||||
|
||||
</tr></tbody>
|
||||
</table>
|
||||
<?php
|
||||
echo "".NO_CREATE_ALLIANCE."";
|
||||
?></br><?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if (!$isBanned):?>
|
||||
<p><button type="submit" name="s1" id="btn_ok" class="trav_buttons">Ok</button></p>
|
||||
</form>
|
||||
<?php else:?>
|
||||
</form>
|
||||
<p><?php echo NO_CREATE_ALLIANCE;?></p>
|
||||
<?php endif;?>
|
||||
+80
-57
@@ -1,59 +1,82 @@
|
||||
<div id="build" class="gid19"><a href="#" onClick="return Popup(19,4);" class="build_logo">
|
||||
<img class="building g19" src="img/x.gif" alt="Barracks" title="<?php echo BARRACKS; ?>" />
|
||||
</a>
|
||||
<h1><?php echo BARRACKS; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo BARRACKS_DESC; ?> </p>
|
||||
<?php
|
||||
// 19.tpl - BARRAKS
|
||||
global $village, $building, $technology, $generator, $session, $id;
|
||||
|
||||
<?php if ($building->getTypeLevel(19) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo NAME; ?></td>
|
||||
<td><?php echo QUANTITY; ?></td>
|
||||
<td><?php echo MAX; ?></td>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
include("19_train.tpl");
|
||||
?></table>
|
||||
<p><button id="btn_train" class="trav_buttons" value="ok" name="s1" alt="train" onclick="this.disabled=true;this.form.submit();"/> Train </button></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>".TRAINING_COMMENCE_BARRACKS."</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(1);
|
||||
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 }
|
||||
include("upgrade.tpl");
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$canTrain = $building->getTypeLevel(19) > 0;
|
||||
$trainlist = $technology->getTrainingList(1);
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid19">
|
||||
<a href="#" onClick="return Popup(19,4);" class="build_logo">
|
||||
<img class="building g19" src="img/x.gif" alt="Barracks" title="<?php echo BARRACKS;?>" />
|
||||
</a>
|
||||
<h1><?php echo BARRACKS;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo BARRACKS_DESC;?></p>
|
||||
|
||||
<?php if ($canTrain):?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo NAME;?></td>
|
||||
<td><?php echo QUANTITY;?></td>
|
||||
<td><?php echo MAX;?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php include("19_train.tpl");?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><button type="submit" id="btn_train" class="trav_buttons" name="s1" onclick="this.disabled=true;this.form.submit();">Train</button></p>
|
||||
</form>
|
||||
<?php else:?>
|
||||
<b><?php echo TRAINING_COMMENCE_BARRACKS;?></b><br />
|
||||
<?php endif;?>
|
||||
|
||||
<?php if (count($trainlist) > 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 $TrainCount = 0; foreach ($trainlist as $train):
|
||||
$TrainCount++;
|
||||
$unit = (int)$train['unit'];
|
||||
$amt = (int)$train['amt'];
|
||||
$name = htmlspecialchars($train['name']);
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo $name;?>" title="<?php echo $name;?>" />
|
||||
<?php echo $amt.' '.$name;?>
|
||||
</td>
|
||||
<td class="dur">
|
||||
<?php if ($TrainCount === 1):
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2'] - time());
|
||||
$timerId = ++$session->timer;
|
||||
?>
|
||||
<span id="timer<?php echo $timerId;?>"><?php echo $generator->getTimeFormat($train['timestamp'] - time());?></span>
|
||||
<?php else:?>
|
||||
<?php echo $generator->getTimeFormat($train['eachtime'] * $amt);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class="fin">
|
||||
<?php
|
||||
$time = $generator->procMTime($train['timestamp']);
|
||||
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;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
@@ -1,50 +1,52 @@
|
||||
<?php
|
||||
if($session->tribe != 4){
|
||||
for ($i=($session->tribe-1)*10+1;$i<=($session->tribe-1)*10+4;$i++) {
|
||||
if ($i <> 4 && $i <> 23 && $i <> 24 && ($technology->getTech($i) || $i%10 == 1)) {
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(".AVAILABLE.": ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"".LUMBER."\" />".(${'u'.$i}['wood'])."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".(${'u'.$i}['clay'])."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".(${'u'.$i}['iron'])."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".(${'u'.$i}['crop'])."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo $generator->getTimeFormat($dur);
|
||||
// 19_train.tpl - UNIT LIST BARRAKS
|
||||
global $session, $technology, $village, $database, $generator, $building, $bid19, $id;
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||
$tribe = (int)$session->tribe;
|
||||
$units = ($tribe !== 4) ? range(($tribe-1)*10+1, ($tribe-1)*10+4) : range(31, 40);
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"10\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,false)."; return false;\">(".$technology->maxUnit($i,false).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for ($i=31;$i<=40;$i++) {
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(".AVAILABLE.": ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"".LUMBER."\" />".(${'u'.$i}['wood'])."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".(${'u'.$i}['clay'])."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".(${'u'.$i}['iron'])."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".(${'u'.$i}['crop'])."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo $generator->getTimeFormat($dur);
|
||||
foreach ($units as $i) {
|
||||
// skip unități invalide
|
||||
if ($tribe !== 4 && ($i == 4 || $i == 23 || $i == 24)) continue;
|
||||
if (!($technology->getTech($i) || $i % 10 == 1)) continue;
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"10\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,false)."; return false;\">(".$technology->maxUnit($i,false).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
$unitData = ${'u'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$maxTrain = $technology->maxUnit($i, false);
|
||||
$maxPlus = $technology->maxUnitPlus($i);
|
||||
$available = (int)($village->unitarray['u'.$i] ?? 0);
|
||||
|
||||
$dur = $database->getArtifactsValueInfluence(
|
||||
$session->uid,
|
||||
$village->wid,
|
||||
5,
|
||||
round($unitData['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED)
|
||||
);
|
||||
$timeFormatted = $generator->getTimeFormat($dur);
|
||||
|
||||
$total_required = (int)($unitData['wood'] + $unitData['clay'] + $unitData['iron'] + $unitData['crop']);
|
||||
$showNpc = $session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>" />
|
||||
<a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a>
|
||||
<span class="info">(<?php echo AVAILABLE;?>: <?php echo $available;?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Wood" title="<?php echo LUMBER;?>" /><?php echo (int)$unitData['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" alt="Clay" title="<?php echo CLAY;?>" /><?php echo (int)$unitData['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" alt="Iron" title="<?php echo IRON;?>" /><?php echo (int)$unitData['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="<?php echo CROP;?>" /><?php echo (int)$unitData['crop'];?>|
|
||||
<img class="r5" src="img/x.gif" alt="Crop consumption" title="<?php echo CROP_COM;?>" /><?php echo (int)$unitData['pop'];?>|
|
||||
<img class="clock" src="img/x.gif" alt="Duration" title="<?php echo DURATION;?>" /><?php echo $timeFormatted;?>
|
||||
<?php if ($showNpc):?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$unitData['wood']*$maxPlus;?>&r2=<?php echo (int)$unitData['clay']*$maxPlus;?>&r3=<?php echo (int)$unitData['iron']*$maxPlus;?>&r4=<?php echo (int)$unitData['crop']*$maxPlus;?>" title="NPC trade"><img class="npc" src="img/x.gif" alt="NPC trade" title="NPC trade" /></a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t<?php echo $i;?>" value="0" maxlength="10"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t<?php echo $i;?>.value=<?php echo $maxTrain;?>; return false;">(<?php echo $maxTrain;?>)</a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
+43
-50
@@ -1,55 +1,48 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
|
||||
// CLAYPIT
|
||||
|
||||
include 'next.tpl';
|
||||
|
||||
// — pregătire date —
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentProd = $bid2[$currentLevel]['prod'] * SPEED;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = ($village->capital == 1) ? 20 : 10;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextProd = $bid2[$nextLevel]['prod'] * SPEED;
|
||||
?>
|
||||
<div id="build" class="gid2"><a href="#" onClick="return Popup(2,4);" class="build_logo">
|
||||
<img class="building g2" src="img/x.gif" alt="<?php echo CLAYPIT; ?>" title="<?php echo CLAYPIT; ?>" />
|
||||
</a>
|
||||
<h1><?php echo CLAYPIT; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo CLAYPIT_DESC; ?></p>
|
||||
<div id="build" class="gid2">
|
||||
<a href="#" onclick="return Popup(2,4);" class="build_logo">
|
||||
<img class="building g2" src="img/x.gif" alt="<?= CLAYPIT ?>" title="<?= CLAYPIT ?>">
|
||||
</a>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CUR_PROD; ?>:</th>
|
||||
<td><b><?php echo $bid2[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
|
||||
if($village->capital == 1) {
|
||||
if($next<=20){
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid2[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo 20; ?>:</th>
|
||||
<td><b><?php echo $bid2[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}}else{
|
||||
if($next<=10){
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid2[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
|
||||
<td><b><?php echo $bid2[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}}}
|
||||
?>
|
||||
</table>
|
||||
<h1>
|
||||
<?= CLAYPIT ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?></p></div>
|
||||
<p class="build_desc"><?= CLAYPIT_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CUR_PROD ?>:</th>
|
||||
<td><b><?= $currentProd ?></b> <?= PER_HR ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= NEXT_PROD ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextProd ?></b> <?= PER_HR ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+80
-71
@@ -1,72 +1,81 @@
|
||||
<div id="build" class="gid20"><a href="#" onClick="return Popup(20,4);" class="build_logo">
|
||||
<img class="building g20" src="img/x.gif" alt="Stable" title="<?php echo STABLE; ?>" /> </a>
|
||||
|
||||
<h1><?php echo STABLE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo STABLE_DESC; ?><br /></p>
|
||||
|
||||
<?php if ($building->getTypeLevel(20) > 0) { ?>
|
||||
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo NAME; ?></td>
|
||||
<td><?php echo QUANTITY; ?></td>
|
||||
<td><?php echo MAX; ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($session->tribe != 4){
|
||||
include("20_train.tpl");
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>".TRAINING_COMMENCE_STABLE."</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(2);
|
||||
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 "</span></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
|
||||
include("upgrade.tpl");
|
||||
?> </p></div>
|
||||
// 20.tpl - STABLE
|
||||
global $village, $building, $technology, $generator, $session, $id;
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$canTrain = $building->getTypeLevel(20) > 0;
|
||||
$trainlist = $technology->getTrainingList(2);
|
||||
?>
|
||||
<div id="build" class="gid20">
|
||||
<a href="#" onClick="return Popup(20,4);" class="build_logo">
|
||||
<img class="building g20" src="img/x.gif" alt="Stable" title="<?php echo STABLE;?>" />
|
||||
</a>
|
||||
<h1><?php echo STABLE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo STABLE_DESC;?><br /></p>
|
||||
|
||||
<?php if ($canTrain):?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo NAME;?></td>
|
||||
<td><?php echo QUANTITY;?></td>
|
||||
<td><?php echo MAX;?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php if ($session->tribe!= 4) include("20_train.tpl");?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></p>
|
||||
</form>
|
||||
<?php else:?>
|
||||
<b><?php echo TRAINING_COMMENCE_STABLE;?></b><br />
|
||||
<?php endif;?>
|
||||
|
||||
<?php if (count($trainlist) > 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 $TrainCount = 0; foreach ($trainlist as $train):
|
||||
$TrainCount++;
|
||||
$unit = (int)$train['unit'];
|
||||
$amt = (int)$train['amt'];
|
||||
$name = htmlspecialchars($train['name']);
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo $name;?>" title="<?php echo $name;?>" />
|
||||
<?php echo $amt.' '.$name;?>
|
||||
</td>
|
||||
<td class="dur">
|
||||
<?php if ($TrainCount === 1):
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2'] - time());
|
||||
?>
|
||||
<span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($train['timestamp'] - time());?></span>
|
||||
<?php else:?>
|
||||
<?php echo $generator->getTimeFormat($train['eachtime'] * $amt);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class="fin">
|
||||
<?php
|
||||
$time = $generator->procMTime($train['timestamp']);
|
||||
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;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
@@ -1,41 +1,57 @@
|
||||
<?php
|
||||
// 20_train.tpl - STABLE UNIT TRAIN
|
||||
global $session, $technology, $village, $database, $generator, $building, $bid20, $bid41, $id;
|
||||
|
||||
$tribe = (int)$session->tribe;
|
||||
$start = ($tribe - 1) * 10 + 4 - ($tribe == 3 ? 1 : 0) + ($tribe == 2 ? 1 : 0);
|
||||
$end = $tribe * 10 - 4;
|
||||
$success = 0;
|
||||
$start = ($session->tribe - 1) * 10 + 4 - (($session->tribe == 3) ? 1 : 0) + (($session->tribe == 2) ? 1 : 0);
|
||||
$end = $session->tribe * 10 - 4;
|
||||
$horseTrough = $building->getTypeLevel(41);
|
||||
|
||||
for($i = $start; $i <= $end; $i++) {
|
||||
if($technology->getTech($i)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(".AVAILABLE.": ".$village->unitarray['u'.$i].")</span></div>";
|
||||
if(${'u'.$i}['drinking'] <= $building->getTypeLevel(41)) {
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"".LUMBER."\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />".(${'u'.$i}['pop']-1)."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
}else{
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"".LUMBER."\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />".(${'u'.$i}['pop'])."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
}
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / SPEED));
|
||||
echo $generator->getTimeFormat($dur);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||
for ($i = $start; $i <= $end; $i++) {
|
||||
if (!$technology->getTech($i)) continue;
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div></td>
|
||||
<td class=\"val\">
|
||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
|
||||
</td>
|
||||
$unitData = ${'u'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$maxTrain = $technology->maxUnit($i);
|
||||
$maxPlus = $technology->maxUnitPlus($i);
|
||||
$available = (int)($village->unitarray['u'.$i] ?? 0);
|
||||
|
||||
<td class=\"max\">
|
||||
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
|
||||
</td>
|
||||
</tr>";
|
||||
$success += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td colspan=\"3\"><div class=\"none\" align=\"center\">".AVAILABLE_ACADEMY."</div></td></tr>";
|
||||
}
|
||||
$pop = (int)$unitData['pop'] - ($unitData['drinking'] <= $horseTrough ? 1 : 0);
|
||||
|
||||
$baseTime = $unitData['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100);
|
||||
if ($horseTrough >= 1) $baseTime *= (1 / $bid41[$horseTrough]['attri']);
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round($baseTime / SPEED));
|
||||
$timeFormatted = $generator->getTimeFormat($dur);
|
||||
|
||||
$total_required = (int)($unitData['wood'] + $unitData['clay'] + $unitData['iron'] + $unitData['crop']);
|
||||
$showNpc = $session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required;
|
||||
$success++;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>" />
|
||||
<a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a>
|
||||
<span class="info">(<?php echo AVAILABLE;?>: <?php echo $available;?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Wood" title="<?php echo LUMBER;?>" /><?php echo (int)$unitData['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" alt="Clay" title="<?php echo CLAY;?>" /><?php echo (int)$unitData['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" alt="Iron" title="<?php echo IRON;?>" /><?php echo (int)$unitData['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="<?php echo CROP;?>" /><?php echo (int)$unitData['crop'];?>|
|
||||
<img class="r5" src="img/x.gif" alt="Crop consumption" title="<?php echo CROP_COM;?>" /><?php echo $pop;?>|
|
||||
<img class="clock" src="img/x.gif" alt="Duration" title="<?php echo DURATION;?>" /><?php echo $timeFormatted;?>
|
||||
<?php if ($showNpc):?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$unitData['wood']*$maxPlus;?>&r2=<?php echo (int)$unitData['clay']*$maxPlus;?>&r3=<?php echo (int)$unitData['iron']*$maxPlus;?>&r4=<?php echo (int)$unitData['crop']*$maxPlus;?>" title="NPC trade"><img class="npc" src="img/x.gif" alt="NPC trade" /></a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t<?php echo $i;?>" value="0" maxlength="10"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t<?php echo $i;?>.value=<?php echo $maxTrain;?>; return false;">(<?php echo $maxTrain;?>)</a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($success === 0):?>
|
||||
<tr><td colspan="3"><div class="none" align="center"><?php echo AVAILABLE_ACADEMY;?></div></td></tr>
|
||||
<?php endif;?>
|
||||
+100
-110
@@ -1,114 +1,104 @@
|
||||
<div id="build" class="gid21"><a href="#" onClick="return Popup(21,4, 'gid');" class="build_logo">
|
||||
<img class="building g21" src="img/x.gif" alt="Workshop" title="<?php echo WORKSHOP; ?>" /> </a>
|
||||
|
||||
<h1><?php echo WORKSHOP; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo WORKSHOP_DESC; ?></p>
|
||||
<?php if ($building->getTypeLevel(21) > 0) { ?>
|
||||
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo NAME; ?></td>
|
||||
<td><?php echo QUANTITY; ?></td>
|
||||
<td><?php echo MAX; ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$success = 0;
|
||||
$start = ($session->tribe == 1)? 7 : (($session->tribe == 2)? 17 : 27);
|
||||
if ($session->tribe == 1){
|
||||
$start = 7;
|
||||
}else if ($session->tribe == 2){
|
||||
$start = 17;
|
||||
}else if ($session->tribe == 3){
|
||||
$start = 27;
|
||||
}else if ($session->tribe == 5){
|
||||
$start = 47;
|
||||
}
|
||||
if($session->tribe != 4){
|
||||
for($i=$start;$i<=($start+1);$i++) {
|
||||
if($technology->getTech($i)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(".AVAILABLE.": ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"".LUMBER."\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid21[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo $generator->getTimeFormat($dur);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div></td>
|
||||
<td class=\"val\">
|
||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
|
||||
</td>
|
||||
|
||||
<td class=\"max\">
|
||||
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
|
||||
</td>
|
||||
</tr>";
|
||||
$success += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td class=\"none\" colspan=\"3\">".AVAILABLE_ACADEMY."</td></tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>".TRAINING_COMMENCE_WORKSHOP."</b><br>\n";
|
||||
}
|
||||
// 21.tpl - WORKSHOP
|
||||
global $village, $building, $technology, $generator, $session, $database, $id, $bid21;
|
||||
|
||||
$trainlist = $technology->getTrainingList(3);
|
||||
if(count($trainlist) > 0) {
|
||||
//$timer = 2*count($trainlist);
|
||||
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 }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$canTrain = $building->getTypeLevel(21) > 0;
|
||||
$trainlist = $technology->getTrainingList(3);
|
||||
?>
|
||||
<div id="build" class="gid21">
|
||||
<a href="#" onClick="return Popup(21,4, 'gid');" class="build_logo">
|
||||
<img class="building g21" src="img/x.gif" alt="Workshop" title="<?php echo WORKSHOP;?>" />
|
||||
</a>
|
||||
<h1><?php echo WORKSHOP;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo WORKSHOP_DESC;?></p>
|
||||
|
||||
<?php if ($canTrain):?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo NAME;?></td>
|
||||
<td><?php echo QUANTITY;?></td>
|
||||
<td><?php echo MAX;?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$success = 0;
|
||||
$tribe = (int)$session->tribe;
|
||||
if ($tribe!== 4) {
|
||||
$starts = [1=>7, 2=>17, 3=>27, 5=>47];
|
||||
$start = $starts[$tribe]?? 7;
|
||||
for ($i = $start; $i <= $start+1; $i++) {
|
||||
if (!$technology->getTech($i)) continue;
|
||||
$unitData = ${'u'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$maxTrain = $technology->maxUnit($i);
|
||||
$maxPlus = $technology->maxUnitPlus($i);
|
||||
$available = (int)($village->unitarray['u'.$i]?? 0);
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round($unitData['time'] * ($bid21[$level]['attri']/100) / SPEED));
|
||||
$timeFormatted = $generator->getTimeFormat($dur);
|
||||
$total_required = (int)($unitData['wood']+$unitData['clay']+$unitData['iron']+$unitData['crop']);
|
||||
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
|
||||
$success++;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>" />
|
||||
<a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a>
|
||||
<span class="info">(<?php echo AVAILABLE;?>: <?php echo $available;?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$unitData['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$unitData['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$unitData['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$unitData['crop'];?>|
|
||||
<img class="r5" src="img/x.gif" title="<?php echo CROP_COM;?>"/><?php echo (int)$unitData['pop'];?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $timeFormatted;?>
|
||||
<?php if ($showNpc):?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$unitData['wood']*$maxPlus;?>&r2=<?php echo (int)$unitData['clay']*$maxPlus;?>&r3=<?php echo (int)$unitData['iron']*$maxPlus;?>&r4=<?php echo (int)$unitData['crop']*$maxPlus;?>" title="NPC trade"><img class="npc" src="img/x.gif" alt="NPC trade"/></a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t<?php echo $i;?>" value="0" maxlength="10"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t<?php echo $i;?>.value=<?php echo $maxTrain;?>; return false;">(<?php echo $maxTrain;?>)</a></td>
|
||||
</tr>
|
||||
<?php } } if ($success===0):?>
|
||||
<tr><td class="none" colspan="3"><?php echo AVAILABLE_ACADEMY;?></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></p>
|
||||
</form>
|
||||
<?php else:?>
|
||||
<b><?php echo TRAINING_COMMENCE_WORKSHOP;?></b><br />
|
||||
<?php endif;?>
|
||||
|
||||
<?php if (count($trainlist) > 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 $TrainCount=0; foreach($trainlist as $train):
|
||||
$TrainCount++; $unit=(int)$train['unit']; $amt=(int)$train['amt']; $name=htmlspecialchars($train['name']);
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo $name;?>" title="<?php echo $name;?>"/> <?php echo $amt.' '.$name;?></td>
|
||||
<td class="dur">
|
||||
<?php if($TrainCount===1): $NextFinished=$generator->getTimeFormat($train['timestamp2']-time());?>
|
||||
<span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($train['timestamp']-time());?></span>
|
||||
<?php else: echo $generator->getTimeFormat($train['eachtime']*$amt); endif;?>
|
||||
</td>
|
||||
<td class="fin"><?php $time=$generator->procMTime($train['timestamp']); 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;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+20
-14
@@ -1,17 +1,23 @@
|
||||
<div id="build" class="gid22"><a href="#" onClick="return Popup(22,4);" class="build_logo">
|
||||
|
||||
<img class="building g22" src="img/x.gif" alt="Academy" title="<?php echo ACADEMY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo ACADEMY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo ACADEMY_DESC; ?></p>
|
||||
<?php
|
||||
if ($building->getTypeLevel(22) > 0) {
|
||||
include("22_".$session->tribe.".tpl");
|
||||
} else {
|
||||
echo "<p><b>".RESEARCH_COMMENCE_ACADEMY."</b><br>\n";
|
||||
}
|
||||
// 22.tpl - ACADEMY
|
||||
global $village, $building, $session, $id;
|
||||
|
||||
include("upgrade.tpl");
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$hasAcademy = $building->getTypeLevel(22) > 0;
|
||||
$tribe = (int)$session->tribe;
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div id="build" class="gid22">
|
||||
<a href="#" onClick="return Popup(22,4);" class="build_logo">
|
||||
<img class="building g22" src="img/x.gif" alt="Academy" title="<?php echo ACADEMY;?>" />
|
||||
</a>
|
||||
<h1><?php echo ACADEMY;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo ACADEMY_DESC;?></p>
|
||||
|
||||
<?php if ($hasAcademy):?>
|
||||
<?php include("22_".$tribe.".tpl");?>
|
||||
<?php else:?>
|
||||
<p><b><?php echo RESEARCH_COMMENCE_ACADEMY;?></b><br /></p>
|
||||
<?php endif;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+97
-151
@@ -1,154 +1,100 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo ACADEMY; ?></td>
|
||||
<td><?php echo ACTION; ?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=2;$i<=9;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$i}['crop']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span></div></td>";
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">".EXPAND_WAREHOUSE."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span></div></td>";
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">".EXPAND_GRANARY."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(22,${'r'.$i});
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">".CROP_NEGATIVE."</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">".TOO_FEW_RESOURCES."</div></td></tr>";
|
||||
}
|
||||
else if (count($acares) > 0) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
".RESEARCH_IN_PROGRESS."</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">".RESEARCH."</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">".RESEARCH."</a></td></tr>";
|
||||
}
|
||||
$success += 1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABLE."</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">".SHOW_MORE."</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">".PREREQUISITES."</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(2) && !$technology->getTech(2)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u2\" title=\"".U2."\" alt=\"Praetorian\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(2, 1);\" href=\"#\">Praetorian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 1);\">".ACADEMY."</a>
|
||||
<span title=\"+2\"> ".LEVEL." 1</span><br /><a href=\"#\" onclick=\"return Popup(13, 4);\">".ARMOURY." </a><span title=\"+1\"> ".LEVEL." 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(3) && !$technology->getTech(3)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u3\" title=\"".U3."\" alt=\"Imperian\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(3, 1);\" href=\"#\">Imperian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a>
|
||||
<span title=\"+2\"> ".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">".BLACKSMITH." </a><span title=\"+1\"> ".LEVEL." 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(4) && !$technology->getTech(4)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u4\" title=\"".U4."\" alt=\"Equites Legati\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(4, 1);\" href=\"#\">Equites Legati</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a><span title=\"+2\"> ".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">".STABLE."</a><span title=\"+1\"> ".LEVEL." 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(5) && !$technology->getTech(5)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u5\" title=\"".U5."\" alt=\"Equites Imperatoris\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(5, 1);\" href=\"#\">Equites Imperatoris</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a><span title=\"+2\"> ".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">".STABLE."</a><span title=\"+5\"> ".LEVEL." 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(6) && !$technology->getTech(6)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u6\" title=\"".U6."\" alt=\"Equites Caesaris\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(6, 1);\" href=\"#\">Equites Caesaris</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a><span title=\"+12\"> ".LEVEL." 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
".STABLE."</a><span title=\"+10\"> ".LEVEL." 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(7) && !$technology->getTech(7)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u7\" title=\"".U7."\" alt=\"Battering Ram\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(7, 1);\" href=\"#\">Battering Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a>
|
||||
<span title=\"+7\"> ".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP."</a><span title=\"+1\"> ".LEVEL." 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(8) && !$technology->getTech(8)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u8\" title=\"".U8."\" alt=\"Fire Catapult\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(8, 1);\" href=\"#\">Fire Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP."</a>
|
||||
<span title=\"+10\"> ".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a><span title=\"+12\"> ".LEVEL." 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(9) && !$technology->getTech(9)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u9\" title=\"".U9."\" alt=\"Senator\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(9, 1);\" href=\"#\">Senator</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(16, 4);\">".RALLYPOINT."</a><span title=\"+9\"> ".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
".ACADEMY."</a><span title=\"+17\"> ".LEVEL." 20</span></td></tr>";
|
||||
}
|
||||
echo "<script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
// 22_1.tpl - ACADEMY - ROMAN UNITS
|
||||
global $technology, $generator, $village, $session, $building, $bid22, $id;
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"".SHOW_MORE."\"
|
||||
: \"".HIDE_MORE."\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
//$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
$acares = $technology->grabAcademyRes();
|
||||
$success = $fail = 0;
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php for ($i = 2; $i <= 9; $i++):
|
||||
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
|
||||
$success++;
|
||||
$res = ${'r'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
|
||||
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
|
||||
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
|
||||
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="NPC trade"><img class="npc" src="img/x.gif"/></a><?php endif;?>
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
|
||||
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
|
||||
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
|
||||
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
|
||||
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&a=".$i."&c=".$session->mchecker."\">".RESEARCH."</a>";
|
||||
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor; if ($success===0):?>
|
||||
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php if ($fail>0):?>
|
||||
<p class="switch"><a id="researchFutureLink" href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
|
||||
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
|
||||
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php if (!$technology->meetRRequirement(2) &&!$technology->getTech(2)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u2" src="img/x.gif" alt="Praetorian"/><a onclick="return Popup(2,1);" href="#">Praetorian</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,1);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(13,4);"><?php echo ARMOURY;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(3) &&!$technology->getTech(3)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u3" src="img/x.gif" alt="Imperian"/><a onclick="return Popup(3,1);" href="#">Imperian</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(4) &&!$technology->getTech(4)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u4" src="img/x.gif" alt="Equites Legati"/><a onclick="return Popup(4,1);" href="#">Equites Legati</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(5) &&!$technology->getTech(5)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u5" src="img/x.gif" alt="Equites Imperatoris"/><a onclick="return Popup(5,1);" href="#">Equites Imperatoris</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(6) &&!$technology->getTech(6)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u6" src="img/x.gif" alt="Equites Caesaris"/><a onclick="return Popup(6,1);" href="#">Equites Caesaris</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(7) &&!$technology->getTech(7)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u7" src="img/x.gif" alt="Battering Ram"/><a onclick="return Popup(7,1);" href="#">Battering Ram</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(8) &&!$technology->getTech(8)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u8" src="img/x.gif" alt="Fire Catapult"/><a onclick="return Popup(8,1);" href="#">Fire Catapult</a></div></td><td class="cond"><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(9) &&!$technology->getTech(9)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u9" src="img/x.gif" alt="Senator"/><a onclick="return Popup(9,1);" href="#">Senator</a></div></td><td class="cond"><a href="#" onclick="return Popup(16,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 20</span></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if (count($acares)>0):?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
|
||||
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> hrs</span></td></tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
+94
-147
@@ -1,150 +1,97 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo ACADEMY; ?></td>
|
||||
<td><?php echo ACTION; ?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
// 22_2.tpl - ACADEMY TEUTON UNITS
|
||||
global $technology, $generator, $village, $session, $building, $bid22, $id;
|
||||
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=12;$i<=19;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$i}['crop']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".EXPAND_WAREHOUSE."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".EXPAND_GRANARY."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(22,${'r'.$i});
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">".CROP_NEGATIVE."</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">".TOO_FEW_RESOURCES."</div></td></tr>";
|
||||
}
|
||||
else if ( count($acares) > 0 ) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
".RESEARCH_IN_PROGRESS."</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">".RESEARCH."</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">".RESEARCH."</a></td></tr>";
|
||||
}
|
||||
$success += 1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABLE."</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">".SHOW_MORE."</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">".PREREQUISITES."</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(13) && !$technology->getTech(13)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u13\" title=\"".U13."\" alt=\"Axeman\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(13, 1);\" href=\"#\">Axeman</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a>
|
||||
<span title=\"+2\">".LEVEL." 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">".BLACKSMITH." </a><span title=\"+1\">".LEVEL." 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(14) && !$technology->getTech(14)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u14\" title=\"".U14."\" alt=\"Scout\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(14, 1);\" href=\"#\">Scout</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 1</span><br /><a href=\"#\" onclick=\"return Popup(15, 4);\">".MAINBUILDING."</a>
|
||||
<span title=\"+3\">".LEVEL." 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(15) && !$technology->getTech(15)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u15\" title=\"".U15."\" alt=\"Paladin\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(15, 1);\" href=\"#\">Paladin</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">".STABLE." </a>
|
||||
<span title=\"+5\">".LEVEL." 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(16) && !$technology->getTech(16)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u16\" title=\"".U16."\" alt=\"Teutonic Knight\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(16, 1);\" href=\"#\">Teutonic Knight</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
".STABLE." </a><span title=\"+3\">".LEVEL." 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(17) && !$technology->getTech(17)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u17\" title=\"".U17."\" alt=\"Ram\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(17, 1);\" href=\"#\">Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a>
|
||||
<span title=\"+7\">".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP." </a><span title=\"+1\">".LEVEL." 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(18) && !$technology->getTech(18)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u18\" title=\"".U18."\" alt=\"Catapult\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(18, 1);\" href=\"#\">Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP."</a>
|
||||
<span title=\"+10\">".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+12\">".LEVEL." 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(19) && !$technology->getTech(19)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u19\" title=\"".U19."\" alt=\"Chief\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(19, 1);\" href=\"#\">Chief</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(16, 4);\">".RALLYPOINT." </a><span title=\"+4\">".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
Academy </a><span title=\"+17\">".LEVEL." 20</span></td></tr>";
|
||||
}
|
||||
echo " <script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"".SHOW_MORE."\"
|
||||
: \"".HIDE_MORE."\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
//$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
$success = $fail = 0;
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php for ($i = 12; $i <= 19; $i++):
|
||||
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
|
||||
$success++;
|
||||
$res = ${'r'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
|
||||
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
|
||||
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
|
||||
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="NPC trade"><img class="npc" src="img/x.gif"/></a><?php endif;?>
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
|
||||
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
|
||||
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
|
||||
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
|
||||
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&a=".$i."&c=".$session->mchecker."\">".RESEARCH."</a>";
|
||||
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor; if ($success===0):?>
|
||||
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php if ($fail>0):?>
|
||||
<p class="switch"><a id="researchFutureLink" href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
|
||||
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
|
||||
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php if (!$technology->meetRRequirement(13) &&!$technology->getTech(13)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u13" src="img/x.gif" alt="Axeman"/><a onclick="return Popup(13,1);" href="#">Axeman</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 3</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(14) &&!$technology->getTech(14)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u14" src="img/x.gif" alt="Scout"/><a onclick="return Popup(14,1);" href="#">Scout</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(15,4);"><?php echo MAINBUILDING;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(15) &&!$technology->getTech(15)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u15" src="img/x.gif" alt="Paladin"/><a onclick="return Popup(15,1);" href="#">Paladin</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(16) &&!$technology->getTech(16)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u16" src="img/x.gif" alt="Teutonic Knight"/><a onclick="return Popup(16,1);" href="#">Teutonic Knight</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(17) &&!$technology->getTech(17)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u17" src="img/x.gif" alt="Ram"/><a onclick="return Popup(17,1);" href="#">Ram</a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(18) &&!$technology->getTech(18)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u18" src="img/x.gif" alt="Catapult"/><a onclick="return Popup(18,1);" href="#">Catapult</a></div></td><td class="cond"><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(19) &&!$technology->getTech(19)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u19" src="img/x.gif" alt="Chief"/><a onclick="return Popup(19,1);" href="#">Chief</a></div></td><td class="cond"><a href="#" onclick="return Popup(16,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(22,4);">Academy</a> <span><?php echo LEVEL;?> 20</span></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if (count($acares)>0):?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
|
||||
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> hrs</span></td></tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
+97
-150
@@ -1,153 +1,100 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo ACADEMY; ?></td>
|
||||
<td><?php echo ACTION; ?></td>
|
||||
<?php
|
||||
// 22_3.tpl - ACADEMY GAULS UNITS
|
||||
global $technology, $generator, $village, $session, $building, $bid22, $id;
|
||||
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=22;$i<=29;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$i}['crop']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".EXPAND_WAREHOUSE."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".EXPAND_GRANARY."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(22,${'r'.$i});
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">".CROP_NEGATIVE."</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">".TOO_FEW_RESOURCES."</div></td></tr>";
|
||||
}
|
||||
else if ( count($acares) > 0 ) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
".RESEARCH_IN_PROGRESS."</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">".RESEARCH."</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">".RESEARCH."</a></td></tr>";
|
||||
}
|
||||
$success +=1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABLE."</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody></table>
|
||||
<?php if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">".SHOW_MORE."</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">".PREREQUISITES."</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(22) && !$technology->getTech(22)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u22\" title=\"".U22."\" alt=\"".U22."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(22, 1);\" href=\"#\">".U22."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a>
|
||||
<span title=\"+2\"> ".LEVEL." 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">".BLACKSMITH." </a><span title=\"+1\"> ".LEVEL." 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(23) && !$technology->getTech(23)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u23\" title=\"".U23."\" alt=\"Pathfinder\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(23, 1);\" href=\"#\">".U23."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a>
|
||||
<span title=\"+2\"> ".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">".STABLE." </a><span title=\"+1\"> ".LEVEL." 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(24) && !$technology->getTech(24)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u24\" title=\"".U24."\" alt=\"Theutates Thunder\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(24, 1);\" href=\"#\">".U24."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a><span title=\"+2\"> ".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">".STABLE."</a>
|
||||
<span title=\"+3\"> ".LEVEL." 3</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(25) && !$technology->getTech(25)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u25\" title=\"".U25."\" alt=\"Druidrider\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(25, 1);\" href=\"#\">".U25."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a><span title=\"+2\"> ".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">".STABLE."</a>
|
||||
<span title=\"+5\"> ".LEVEL." 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(26) && !$technology->getTech(26)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u26\" title=\"".U26."\" alt=\"Haeduan\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(26, 1);\" href=\"#\">".U26."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a><span title=\"+12\"> ".LEVEL." 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
".STABLE."</a><span title=\"+10\"> ".LEVEL." 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(27) && !$technology->getTech(27)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u27\" title=\"".U27."\" alt=\"Ram\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(27, 1);\" href=\"#\">".U27."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a>
|
||||
<span title=\"+7\"> ".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP."</a><span title=\"+1\"> ".LEVEL." 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(28) && !$technology->getTech(28)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u28\" title=\"".U28."\" alt=\"Trebuchet\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(28, 1);\" href=\"#\">".U28."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP."</a>
|
||||
<span title=\"+10\"> ".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY."</a><span title=\"+12\"> ".LEVEL." 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(29) && !$technology->getTech(29)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u29\" title=\"".U29."\" alt=\"Chieftain\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(29, 1);\" href=\"#\">".U29."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(14, 4);\">".RALLYPOINT."</a><span title=\"+9\"> ".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
".ACADEMY."</a><span title=\"+17\"> ".LEVEL." 20</span></td></tr>";
|
||||
}
|
||||
echo " <script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"".SHOW_MORE."\"
|
||||
: \"".HIDE_MORE."\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
$success = $fail = 0;
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php for ($i = 22; $i <= 29; $i++):
|
||||
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
|
||||
$success++;
|
||||
$res = ${'r'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
|
||||
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
|
||||
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
|
||||
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="NPC trade"><img class="npc" src="img/x.gif"/></a><?php endif;?>
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
|
||||
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
|
||||
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
|
||||
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
|
||||
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&a=".$i."&c=".$session->mchecker."\">".RESEARCH."</a>";
|
||||
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor; if ($success===0):?>
|
||||
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php if ($fail>0):?>
|
||||
<p class="switch"><a href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
|
||||
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
|
||||
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php if (!$technology->meetRRequirement(22) &&!$technology->getTech(22)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u22" src="img/x.gif" alt="<?php echo U22;?>"/><a onclick="return Popup(22,1);" href="#"><?php echo U22;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 3</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(23) &&!$technology->getTech(23)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u23" src="img/x.gif" alt="<?php echo U23;?>"/><a onclick="return Popup(23,1);" href="#"><?php echo U23;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(24) &&!$technology->getTech(24)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u24" src="img/x.gif" alt="<?php echo U24;?>"/><a onclick="return Popup(24,1);" href="#"><?php echo U24;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 3</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(25) &&!$technology->getTech(25)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u25" src="img/x.gif" alt="<?php echo U25;?>"/><a onclick="return Popup(25,1);" href="#"><?php echo U25;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(26) &&!$technology->getTech(26)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u26" src="img/x.gif" alt="<?php echo U26;?>"/><a onclick="return Popup(26,1);" href="#"><?php echo U26;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(27) &&!$technology->getTech(27)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u27" src="img/x.gif" alt="<?php echo U27;?>"/><a onclick="return Popup(27,1);" href="#"><?php echo U27;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(28) &&!$technology->getTech(28)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u28" src="img/x.gif" alt="<?php echo U28;?>"/><a onclick="return Popup(28,1);" href="#"><?php echo U28;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(29) &&!$technology->getTech(29)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u29" src="img/x.gif" alt="<?php echo U29;?>"/><a onclick="return Popup(29,1);" href="#"><?php echo U29;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(14,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 20</span></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if (count($acares)>0):?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
|
||||
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> hrs</span></td></tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
+94
-144
@@ -1,147 +1,97 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo ACADEMY; ?></td>
|
||||
<td><?php echo ACTION; ?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
// 22_4.tpl - NATARS ACADEMY RESEARCH
|
||||
global $technology, $generator, $village, $session, $building, $bid22, $id;
|
||||
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=32;$i<=39;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$i}['crop']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".EXPAND_WAREHOUSE."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".EXPAND_GRANARY."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
$time = $technology->calculateAvaliable($i);
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".TOO_FEW_RESOURCES."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if ( count($acares) > 0 ) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
".RESEARCH_IN_PROGRESS."</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">".RESEARCH."</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">".RESEARCH."</a></td></tr>";
|
||||
}
|
||||
$success += 1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABLE."</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">".SHOW_MORE."</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">".PREREQUISITES."</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(33) && !$technology->getTech(33)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u33\" title=\"".U33."\" alt=\"".U33."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(33, 1);\" href=\"#\">".U33."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a>
|
||||
<span title=\"+2\">".LEVEL." 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">".BLACKSMITH." </a><span title=\"+1\">".LEVEL." 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(34) && !$technology->getTech(34)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u34\" title=\"".U34."\" alt=\"".U34."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(34, 1);\" href=\"#\">".U34."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 1</span><br /><a href=\"#\" onclick=\"return Popup(15, 4);\">".MAINBUILDING."</a>
|
||||
<span title=\"+3\">".LEVEL." 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(35) && !$technology->getTech(35)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u35\" title=\"".U35."\" alt=\"".U35."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(35, 1);\" href=\"#\">".U35."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">".STABLE." </a>
|
||||
<span title=\"+5\">".LEVEL." 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(36) && !$technology->getTech(36)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u36\" title=\"".U36."\" alt=\"".U36."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(36, 1);\" href=\"#\">".U36."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
".STABLE." </a><span title=\"+3\">".LEVEL." 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(17) && !$technology->getTech(17)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u37\" title=\"".U37."\" alt=\"".U37."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(37, 1);\" href=\"#\">".U37."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a>
|
||||
<span title=\"+7\">".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP." </a><span title=\"+1\">".LEVEL." 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(38) && !$technology->getTech(38)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u38\" title=\"".U38."\" alt=\"".U38."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(38, 1);\" href=\"#\">".U38."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP."</a>
|
||||
<span title=\"+10\">".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+12\">".LEVEL." 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(39) && !$technology->getTech(39)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u39\" title=\"".U39."\" alt=\"".U39."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(39, 1);\" href=\"#\">".U39."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(16, 4);\">".RALLYPOINT." </a><span title=\"+4\">".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
".ACADEMY." </a><span title=\"+17\">".LEVEL." 20</span></td></tr>";
|
||||
}
|
||||
echo " <script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"".SHOW_MORE."\"
|
||||
: \"".HIDE_MORE."\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
//$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
$success = $fail = 0;
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php for ($i = 32; $i <= 39; $i++):
|
||||
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
|
||||
$success++;
|
||||
$res = ${'r'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
|
||||
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
|
||||
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
|
||||
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="NPC trade"><img class="npc" src="img/x.gif"/></a><?php endif;?>
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
|
||||
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
|
||||
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
|
||||
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
|
||||
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&a=".$i."&c=".$session->mchecker."\">".RESEARCH."</a>";
|
||||
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor; if ($success===0):?>
|
||||
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php if ($fail>0):?>
|
||||
<p class="switch"><a href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
|
||||
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
|
||||
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php if (!$technology->meetRRequirement(33) &&!$technology->getTech(33)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u33" src="img/x.gif" alt="<?php echo U33;?>"/><a onclick="return Popup(33,1);" href="#"><?php echo U33;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 3</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(34) &&!$technology->getTech(34)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u34" src="img/x.gif" alt="<?php echo U34;?>"/><a onclick="return Popup(34,1);" href="#"><?php echo U34;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(15,4);"><?php echo MAINBUILDING;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(35) &&!$technology->getTech(35)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u35" src="img/x.gif" alt="<?php echo U35;?>"/><a onclick="return Popup(35,1);" href="#"><?php echo U35;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(36) &&!$technology->getTech(36)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u36" src="img/x.gif" alt="<?php echo U36;?>"/><a onclick="return Popup(36,1);" href="#"><?php echo U36;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(37) &&!$technology->getTech(37)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u37" src="img/x.gif" alt="<?php echo U37;?>"/><a onclick="return Popup(37,1);" href="#"><?php echo U37;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(38) &&!$technology->getTech(38)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u38" src="img/x.gif" alt="<?php echo U38;?>"/><a onclick="return Popup(38,1);" href="#"><?php echo U38;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(39) &&!$technology->getTech(39)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u39" src="img/x.gif" alt="<?php echo U39;?>"/><a onclick="return Popup(39,1);" href="#"><?php echo U39;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(16,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 20</span></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if (count($acares)>0):?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
|
||||
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> hrs</span></td></tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
+94
-140
@@ -1,143 +1,97 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo ACADEMY; ?></td>
|
||||
<td><?php echo ACTION; ?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
// 22_5.tpl - ACADEMY RESEARCH TRIBE 5
|
||||
global $technology, $generator, $village, $session, $building, $bid22, $id;
|
||||
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=42;$i<=49;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$i}['crop']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".EXPAND_WAREHOUSE."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".EXPAND_GRANARY."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
$time = $technology->calculateAvaliable($i);
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">".TOO_FEW_RESOURCES."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if ( count($acares) > 0 ) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
".RESEARCH_IN_PROGRESS."</td></tr>";
|
||||
}
|
||||
else {
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">".RESEARCH."</a></td></tr>";
|
||||
}
|
||||
$success += 1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABLE."</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">".SHOW_MORE."</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">".PREREQUISITES."</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(43) && !$technology->getTech(43)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u43\" title=\"".U43."\" alt=\"".U43."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(43, 1);\" href=\"#\">".U43."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a>
|
||||
<span title=\"+2\">".LEVEL." 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">".BLACKSMITH." </a><span title=\"+1\">".LEVEL." 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(44) && !$technology->getTech(44)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u44\" title=\"".U44."\" alt=\"".U44."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(34, 1);\" href=\"#\">".U44."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(44, 5);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 1</span><br /><a href=\"#\" onclick=\"return Popup(15, 4);\">".MAINBUILDING."</a>
|
||||
<span title=\"+3\">".LEVEL." 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(45) && !$technology->getTech(45)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u45\" title=\"".U45."\" alt=\"".U45."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(45, 1);\" href=\"#\">".U45."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(45, 4);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">".STABLE." </a>
|
||||
<span title=\"+5\">".LEVEL." 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(46) && !$technology->getTech(46)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u46\" title=\"".U46."\" alt=\"".U46."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(46, 1);\" href=\"#\">".U46."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+2\">".LEVEL." 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
".STABLE." </a><span title=\"+3\">".LEVEL." 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(47) && !$technology->getTech(47)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u47\" title=\"".U47."\" alt=\"".U47."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(47, 1);\" href=\"#\">".U47."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a>
|
||||
<span title=\"+7\">".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP." </a><span title=\"+1\">".LEVEL." 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(48) && !$technology->getTech(48)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u48\" title=\"".U48."\" alt=\"".U48."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(48, 1);\" href=\"#\">".U48."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">".WORKSHOP."</a>
|
||||
<span title=\"+10\">".LEVEL." 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">".ACADEMY." </a><span title=\"+12\">".LEVEL." 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(49) && !$technology->getTech(49)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u49\" title=\"".U49."\" alt=\"".U49."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(49, 1);\" href=\"#\">".U49."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(16, 4);\">".RALLYPOINT." </a><span title=\"+4\">".LEVEL." 5</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
".ACADEMY." </a><span title=\"+17\">".LEVEL." 20</span></td></tr>";
|
||||
}
|
||||
echo " <script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"".SHOW_MORE."\"
|
||||
: \"".HIDE_MORE."\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
//$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
$success = $fail = 0;
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php for ($i = 42; $i <= 49; $i++):
|
||||
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
|
||||
$success++;
|
||||
$res = ${'r'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
|
||||
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
|
||||
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
|
||||
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="NPC trade"><img class="npc" src="img/x.gif"/></a><?php endif;?>
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
|
||||
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
|
||||
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
|
||||
<?php
|
||||
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
|
||||
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
|
||||
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
|
||||
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
|
||||
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&a=".$i."&c=".$session->mchecker."\">".RESEARCH."</a>";
|
||||
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor; if ($success===0):?>
|
||||
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php if ($fail>0):?>
|
||||
<p class="switch"><a href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
|
||||
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
|
||||
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php if (!$technology->meetRRequirement(43) &&!$technology->getTech(43)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u43" src="img/x.gif" alt="<?php echo U43;?>"/><a onclick="return Popup(43,1);" href="#"><?php echo U43;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 3</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(44) &&!$technology->getTech(44)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u44" src="img/x.gif" alt="<?php echo U44;?>"/><a onclick="return Popup(44,1);" href="#"><?php echo U44;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(15,4);"><?php echo MAINBUILDING;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(45) &&!$technology->getTech(45)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u45" src="img/x.gif" alt="<?php echo U45;?>"/><a onclick="return Popup(45,1);" href="#"><?php echo U45;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(46) &&!$technology->getTech(46)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u46" src="img/x.gif" alt="<?php echo U46;?>"/><a onclick="return Popup(46,1);" href="#"><?php echo U46;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(47) &&!$technology->getTech(47)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u47" src="img/x.gif" alt="<?php echo U47;?>"/><a onclick="return Popup(47,1);" href="#"><?php echo U47;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(48) &&!$technology->getTech(48)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u48" src="img/x.gif" alt="<?php echo U48;?>"/><a onclick="return Popup(48,1);" href="#"><?php echo U48;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span></td></tr>
|
||||
<?php endif;?>
|
||||
<?php if (!$technology->meetRRequirement(49) &&!$technology->getTech(49)):?>
|
||||
<tr><td class="desc"><div class="tit"><img class="unit u49" src="img/x.gif" alt="<?php echo U49;?>"/><a onclick="return Popup(49,1);" href="#"><?php echo U49;?></a></div></td><td class="cond"><a href="#" onclick="return Popup(16,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 20</span></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if (count($acares)>0):?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
|
||||
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> hrs</span></td></tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
+29
-21
@@ -1,27 +1,35 @@
|
||||
<?php
|
||||
// 23.tpl - Cranny
|
||||
global $session, $village, $database, $bid23, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
|
||||
$multiplier = (($session->tribe == 3) ? 2 : 1) * CRANNY_CAPACITY;
|
||||
$actualLevel = $village->resarray['f'.$id];
|
||||
$actualLevel = (int)$village->resarray['f'.$id];
|
||||
$level = min($actualLevel + 1 + $loopsame + $doublebuild + $master, 10);
|
||||
|
||||
$currentHidden = $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $bid23[$actualLevel]['attri'] * $multiplier);
|
||||
$nextHidden = $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $bid23[$level]['attri'] * $multiplier);
|
||||
?>
|
||||
<div id="build" class="gid23"><a href="#" onClick="return Popup(23,4);" class="build_logo">
|
||||
<img class="building g23" src="img/x.gif" alt="Cranny" title="<?php echo CRANNY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo CRANNY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo CRANNY_DESC; ?></p>
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_HIDDEN_UNITS; ?></th>
|
||||
<td><b><?php echo $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $bid23[$village->resarray['f'.$id]]['attri'] * $multiplier); ?></b> <?php echo UNITS; ?></td>
|
||||
</tr>
|
||||
<?php if($actualLevel < 10){?>
|
||||
<tr>
|
||||
<th><?php echo HIDDEN_UNITS_LEVEL; ?> <?php echo $level; ?>:</th>
|
||||
<td><b><?php echo $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $bid23[$level]['attri'] * $multiplier); ?></b> <?php echo UNITS; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
<div id="build" class="gid23">
|
||||
<a href="#" onClick="return Popup(23,4);" class="build_logo">
|
||||
<img class="building g23" src="img/x.gif" alt="Cranny" title="<?php echo CRANNY;?>" />
|
||||
</a>
|
||||
<h1><?php echo CRANNY;?> <span class="level"><?php echo LEVEL;?> <?php echo $actualLevel;?></span></h1>
|
||||
<p class="build_desc"><?php echo CRANNY_DESC;?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_HIDDEN_UNITS;?></th>
|
||||
<td><b><?php echo $currentHidden;?></b> <?php echo UNITS;?></td>
|
||||
</tr>
|
||||
<?php if ($actualLevel < 10):?>
|
||||
<tr>
|
||||
<th><?php echo HIDDEN_UNITS_LEVEL;?> <?php echo $level;?>:</th>
|
||||
<td><b><?php echo $nextHidden;?></b> <?php echo UNITS;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+19
-16
@@ -1,18 +1,21 @@
|
||||
<div id="build" class="gid24"><a href="#" onClick="return Popup(24,4);" class="build_logo">
|
||||
<img class="building g24" src="img/x.gif" alt="Town Hall" title="<?php echo TOWNHALL; ?>" />
|
||||
</a>
|
||||
<h1><?php echo TOWNHALL; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo TOWNHALL_DESC; ?>
|
||||
</p>
|
||||
<?php
|
||||
if ($building->getTypeLevel(24) > 0) {
|
||||
include("Templates/Build/24_1.tpl");
|
||||
include("Templates/Build/24_2.tpl");
|
||||
} else {
|
||||
echo "<p><b>".CELEBRATIONS_COMMENCE_TOWNHALL."</b><br>\n";
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
|
||||
// 24.tpl - Town Hall
|
||||
global $village, $building, $id;
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid24">
|
||||
<a href="#" onClick="return Popup(24,4);" class="build_logo">
|
||||
<img class="building g24" src="img/x.gif" alt="Town Hall" title="<?php echo TOWNHALL;?>" />
|
||||
</a>
|
||||
<h1><?php echo TOWNHALL;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo TOWNHALL_DESC;?></p>
|
||||
|
||||
<?php if ($building->getTypeLevel(24) > 0):?>
|
||||
<?php include("Templates/Build/24_1.tpl"); ?>
|
||||
<?php include("Templates/Build/24_2.tpl"); ?>
|
||||
<?php else:?>
|
||||
<p><b><?php echo CELEBRATIONS_COMMENCE_TOWNHALL;?></b></p>
|
||||
<?php endif;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+65
-79
@@ -1,82 +1,68 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo CELEBRATIONS; ?></td>
|
||||
<td><?php echo ACTION; ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
// 24_1.tpl - TOWNHALL CELEBRATIONS
|
||||
global $village, $database, $generator, $building, $session, $cel, $gc, $bid24, $id, $technology;
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
$level = $village->resarray['f'.$id];
|
||||
$inuse = $database->getVillageField($village->wid, 'celebration');
|
||||
$time = Time();
|
||||
$i = 1;
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\">".$cel[$i]['name']." (".$cel[$i]['attri']." ".CULTURE_POINTS.")</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".$cel[$i]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".$cel[$i]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".$cel[$i]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$cel[$i]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
|
||||
echo $generator->getTimeFormat(round($cel[$i]['time'] * ($bid24[$building->getTypeLevel(24)]['attri'] / 100)/SPEED));
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($cel[$i]['wood'] + $cel[$i]['clay'] + $cel[$i]['iron'] + $cel[$i]['crop']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".$cel[$i]['wood']."&r2=".$cel[$i]['clay']."&r3=".$cel[$i]['iron']."&r4=".$cel[$i]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if($inuse > $time){
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">".CELEBRATIONS_IN_PROGRESS."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if($cel[$i]['wood'] > $village->awood || $cel[$i]['clay'] > $village->aclay || $cel[$i]['iron'] > $village->airon || $cel[$i]['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(24,$cel[$i]);
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">".CROP_NEGATIVE."</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">".TOO_FEW_RESOURCES."</div></td></tr>";
|
||||
}
|
||||
else {
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">";
|
||||
echo "<a class=\"research\" href=\"celebration.php?type=$i&id=$id\">".HOLD."</a></td></tr>";
|
||||
}
|
||||
|
||||
if($level >= 10){
|
||||
$level = $village->resarray['f'.$id];
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
".GREAT_CELEBRATIONS." (2000 ".CULTURE_POINTS.")
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />29700|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />33250|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />32000|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />6700|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
|
||||
echo $generator->getTimeFormat(round($gc[$level]/SPEED));
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(29700 + 33250 + 32000 + 6700);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=29700&r2=33250&r3=32000&r4=6700\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if($inuse > $time){
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">".CELEBRATIONS_IN_PROGRESS."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(29700 > $village->awood || 33250 > $village->aclay || 32000 > $village->airon || 6700 > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(24,$cel[2]);
|
||||
echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">".CROP_NEGATIVE."</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">".TOO_FEW_RESOURCES."</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else {
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"celebration.php?type=2&id=$id\">".HOLD."</a></td></tr>";
|
||||
}
|
||||
}
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$inuse = (int)$database->getVillageField($village->wid, 'celebration');
|
||||
$now = time();
|
||||
$inProgress = $inuse > $now;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo CELEBRATIONS;?></td><td><?php echo ACTION;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$i = 1;
|
||||
$c = $cel[$i];
|
||||
$time = $generator->getTimeFormat(round($c['time'] * ($bid24[$building->getTypeLevel(24)]['attri']/100) / SPEED));
|
||||
$total = $c['wood']+$c['clay']+$c['iron']+$c['crop'];
|
||||
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total;
|
||||
$canAfford = $c['wood']<=$village->awood && $c['clay']<=$village->aclay && $c['iron']<=$village->airon && $c['crop']<=$village->acrop;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><?php echo $c['name'];?> (<?php echo $c['attri'];?> <?php echo CULTURE_POINTS;?>)</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$c['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$c['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$c['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$c['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
|
||||
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo $c['wood'];?>&r2=<?php echo $c['clay'];?>&r3=<?php echo $c['iron'];?>&r4=<?php echo $c['crop'];?>" title="NPC trade"><img class="npc" src="img/x.gif"/></a><?php endif;?>
|
||||
<?php if (!$canAfford &&!$inProgress): if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(24,$c); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; } else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>"; endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="act">
|
||||
<?php if ($inProgress):?><div class="none"><?php echo CELEBRATIONS_IN_PROGRESS;?></div>
|
||||
<?php elseif (!$canAfford):?><div class="none"><?php echo TOO_FEW_RESOURCES;?></div>
|
||||
<?php else:?><a class="research" href="celebration.php?type=<?php echo $i;?>&id=<?php echo $id;?>"><?php echo HOLD;?></a><?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ($level >= 10):
|
||||
$gcTime = $generator->getTimeFormat(round($gc[$level]/SPEED));
|
||||
$gcTotal = 29700+33250+32000+6700;
|
||||
$showNpc2 = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $gcTotal;
|
||||
$canAfford2 = 29700<=$village->awood && 33250<=$village->aclay && 32000<=$village->airon && 6700<=$village->acrop;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><?php echo GREAT_CELEBRATIONS;?> (2000 <?php echo CULTURE_POINTS;?>)</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/>29700|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/>33250|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/>32000|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/>6700|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $gcTime;?>
|
||||
<?php if ($showNpc2):?>|<a href="build.php?gid=17&t=3&r1=29700&r2=33250&r3=32000&r4=6700" title="NPC trade"><img class="npc" src="img/x.gif"/></a><?php endif;?>
|
||||
<?php if (!$canAfford2 &&!$inProgress): if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(24,$cel[2]); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; } else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>"; endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="act">
|
||||
<?php if ($inProgress):?><div class="none"><?php echo CELEBRATIONS_IN_PROGRESS;?></div>
|
||||
<?php elseif (!$canAfford2):?><div class="none"><?php echo TOO_FEW_RESOURCES;?></div>
|
||||
<?php else:?><a class="research" href="celebration.php?type=2&id=<?php echo $id;?>"><?php echo HOLD;?></a><?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
+16
-14
@@ -1,14 +1,16 @@
|
||||
<?php
|
||||
$timeleft = $database->getVillageField($village->wid, 'celebration');
|
||||
if($timeleft > time()){
|
||||
echo '</br>';
|
||||
echo '<table cellpadding="0" cellspacing="0" id="building_contract">';
|
||||
echo '<tr><td>';
|
||||
echo 'celebration still needs:';
|
||||
echo "</td><td><span id=\"timer".++$session->timer."\">";
|
||||
echo $generator->getTimeFormat($timeleft - time());
|
||||
echo "</span> hrs.</td>";
|
||||
echo "<td>done at ".date('H:i', $timeleft)."</td></tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
// 24_2.tpl - TOWNHALL TIMER
|
||||
global $database, $village, $generator, $session;
|
||||
|
||||
$timeleft = (int)$database->getVillageField($village->wid, 'celebration');
|
||||
if ($timeleft > time()):
|
||||
?>
|
||||
<br>
|
||||
<table cellpadding="0" cellspacing="0" id="building_contract">
|
||||
<tr>
|
||||
<td>celebration still needs:</td>
|
||||
<td><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($timeleft - time());?></span> hrs.</td>
|
||||
<td>done at <?php echo date('H:i', $timeleft);?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
+26
-23
@@ -1,26 +1,29 @@
|
||||
<div id="build" class="gid25"><h1><?php echo RESIDENCE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g25"
|
||||
src="img/x.gif" alt="Residence"
|
||||
title="<?php echo RESIDENCE; ?>" /> </a>
|
||||
<?php echo RESIDENCE_DESC; ?></p>
|
||||
|
||||
<?php
|
||||
if ($village->capital == 1) {
|
||||
echo "<p class=\"act\">".CAPITAL."</p>";
|
||||
}
|
||||
// 25.tpl - Residence
|
||||
global $village, $id;
|
||||
|
||||
include("25_menu.tpl");
|
||||
|
||||
if($village->resarray['f'.$id] >= 10){
|
||||
include ("25_train.tpl");
|
||||
}
|
||||
else{
|
||||
echo '<div class="c">'.RESIDENCE_TRAIN_DESC.'</div>';
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
</div>
|
||||
<div id="build" class="gid25">
|
||||
<h1><?php echo RESIDENCE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');" class="build_logo">
|
||||
<img class="building g25" src="img/x.gif" alt="Residence" title="<?php echo RESIDENCE;?>" />
|
||||
</a>
|
||||
<?php echo RESIDENCE_DESC;?>
|
||||
</p>
|
||||
|
||||
<?php if ($village->capital == 1):?>
|
||||
<p class="act"><?php echo CAPITAL;?></p>
|
||||
<?php endif;?>
|
||||
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
|
||||
<?php if ($level >= 10):?>
|
||||
<?php include("25_train.tpl");?>
|
||||
<?php else:?>
|
||||
<div class="c"><?php echo RESIDENCE_TRAIN_DESC;?></div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+35
-25
@@ -1,28 +1,38 @@
|
||||
<div id="build" class="gid25"><h1><?php echo RESIDENCE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g25"
|
||||
src="img/x.gif" alt="Residence"
|
||||
title="<?php echo RESIDENCE; ?>" /> </a>
|
||||
<?php echo RESIDENCE_DESC; ?></p>
|
||||
<?php
|
||||
// 25_2.tpl - RESIDENCE CULTURE POINTS
|
||||
global $village, $database, $session, $id;
|
||||
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$isNatar = (int)$database->getVillageField($village->wid, 'natar') == 1;
|
||||
$villageCp = $isNatar ? 0 : (int)$database->getVillageField($village->wid, 'cp');
|
||||
$accountCp = (int)$database->getVSumField($session->uid, 'cp');
|
||||
$totalVillages = count($database->getProfileVillages($session->uid));
|
||||
|
||||
<p><?php echo RESIDENCE_CULTURE_DESC; ?></p>
|
||||
$mode = CP;
|
||||
$nextCpNeeded = ${'cp'.$mode}[$totalVillages + 1];
|
||||
?>
|
||||
<div id="build" class="gid25">
|
||||
<h1><?php echo RESIDENCE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');" class="build_logo">
|
||||
<img class="building g25" src="img/x.gif" alt="Residence" title="<?php echo RESIDENCE;?>" />
|
||||
</a>
|
||||
<?php echo RESIDENCE_DESC;?>
|
||||
</p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo PRODUCTION_POINTS; ?></th>
|
||||
<?php if($database->getVillageField($village->wid, 'natar') == 0){ ?>
|
||||
<td><b><?php echo $database->getVillageField($village->wid, 'cp'); ?></b> <?php echo POINTS_DAY; ?></td>
|
||||
<?php }else{ ?>
|
||||
<td><b>0</b> <?php echo POINTS_DAY; ?></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo PRODUCTION_ALL_POINTS; ?></th>
|
||||
<td><b><?php echo $database->getVSumField($session->uid, 'cp'); ?></b> <?php echo POINTS_DAY; ?></td>
|
||||
</tr>
|
||||
</table><p><?php echo VILLAGES_PRODUCED; ?> <b><?php echo $session->cp; ?></b> <?php echo POINTS_NEED; ?> <b><?php $mode = CP; $total = count($database->getProfileVillages($session->uid)); echo ${'cp'.$mode}[$total+1]; ?></b> <?php echo POINTS; ?>.</p>
|
||||
</div>
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
|
||||
<p><?php echo RESIDENCE_CULTURE_DESC;?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo PRODUCTION_POINTS;?></th>
|
||||
<td><b><?php echo $villageCp;?></b> <?php echo POINTS_DAY;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo PRODUCTION_ALL_POINTS;?></th>
|
||||
<td><b><?php echo $accountCp;?></b> <?php echo POINTS_DAY;?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><?php echo VILLAGES_PRODUCED;?> <b><?php echo $session->cp;?></b> <?php echo POINTS_NEED;?> <b><?php echo $nextCpNeeded;?></b> <?php echo POINTS;?>.</p>
|
||||
</div>
|
||||
+17
-10
@@ -1,13 +1,20 @@
|
||||
<div id="build" class="gid25"><h1><?php echo RESIDENCE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g25"
|
||||
src="img/x.gif" alt="Residence"
|
||||
title="<?php echo RESIDENCE; ?>" /> </a>
|
||||
<?php echo RESIDENCE_DESC; ?></p>
|
||||
<?php
|
||||
// 25_3.tpl - Residence loyalty
|
||||
global $village, $database, $id;
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$loyalty = floor((float)$database->getVillageField($village->wid, 'loyalty'));
|
||||
?>
|
||||
<div id="build" class="gid25">
|
||||
<h1><?php echo RESIDENCE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');" class="build_logo">
|
||||
<img class="building g25" src="img/x.gif" alt="Residence" title="<?php echo RESIDENCE;?>" />
|
||||
</a>
|
||||
<?php echo RESIDENCE_DESC;?>
|
||||
</p>
|
||||
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
|
||||
<?php echo RESIDENCE_LOYALTY_DESC; ?> <b><?php echo floor($database->getVillageField($village->wid,'loyalty')); ?></b> <?php echo PERCENT; ?>.</div>
|
||||
<p><?php echo RESIDENCE_LOYALTY_DESC;?> <b><?php echo $loyalty;?></b> <?php echo PERCENT;?>.</p>
|
||||
</div>
|
||||
+53
-51
@@ -1,54 +1,56 @@
|
||||
<div id="build" class="gid25"><h1><?php echo RESIDENCE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g25"
|
||||
src="img/x.gif" alt="Residence"
|
||||
title="<?php echo RESIDENCE; ?>" /> </a>
|
||||
<?php echo RESIDENCE_DESC; ?></p>
|
||||
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="expansion">
|
||||
<thead><tr>
|
||||
<th colspan="6"><a name="h2"></a><?php echo CONQUERED_BY_VILLAGE; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo VILLAGE; ?></td>
|
||||
<td><?php echo PLAYER; ?></td>
|
||||
<td><?php echo INHABITANTS; ?></td>
|
||||
<td><?php echo COORDINATES; ?></td>
|
||||
<td><?php echo DATE; ?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$slot1 = $database->getVillageField($village->wid, 'exp1');
|
||||
$slot2 = $database->getVillageField($village->wid, 'exp2');
|
||||
$slot3 = $database->getVillageField($village->wid, 'exp3');
|
||||
// 25_4.tpl - RESIDENCE EXPANSION
|
||||
global $village, $database, $generator, $id;
|
||||
|
||||
if($slot1 != 0 || $slot2 != 0 || $slot3 != 0){
|
||||
for($i=1; $i <= 3; $i++){
|
||||
if (${'slot'.$i}<>0) {
|
||||
$coor = $database->getCoor(${'slot'.$i});
|
||||
$vname = $database->getVillageField(${'slot'.$i},'name');
|
||||
$owner = $database->getVillageField(${'slot'.$i},'owner');
|
||||
$pop = $database->getVillageField(${'slot'.$i},'pop');
|
||||
$vcreated = $database->getVillageField(${'slot'.$i},'created');
|
||||
$ownername = $database->getUserField($owner,'username',0);
|
||||
echo '
|
||||
<tr>
|
||||
<td class="ra">'.$i.'.</td>
|
||||
<td class="vil"><a href="karte.php?d='.${'slot'.$i}.'&c='.$generator->getMapCheck(${'slot'.$i}).'">'.$vname.'</a></td>
|
||||
<td class="pla"><a href="spieler.php?uid='.$owner.'">'.$ownername.'</a></td>
|
||||
<td class="ha">'.$pop.'</td>
|
||||
<td class="aligned_coords"><div class="cox">('.$coor['x'].'</div><div class="pi">|</div><div class="coy">'.$coor['y'].')</div></td>
|
||||
<td class="dat">'.date('d.m.Y',$vcreated).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo '<tr><td colspan="6" class="none">'.NONE_CONQUERED_BY_VILLAGE.'</td></tr>';
|
||||
}
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$slots = [
|
||||
(int)$database->getVillageField($village->wid, 'exp1'),
|
||||
(int)$database->getVillageField($village->wid, 'exp2'),
|
||||
(int)$database->getVillageField($village->wid, 'exp3'),
|
||||
];
|
||||
?>
|
||||
</tbody></table></div>
|
||||
<div id="build" class="gid25">
|
||||
<h1><?php echo RESIDENCE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');" class="build_logo">
|
||||
<img class="building g25" src="img/x.gif" alt="Residence" title="<?php echo RESIDENCE;?>" />
|
||||
</a>
|
||||
<?php echo RESIDENCE_DESC;?>
|
||||
</p>
|
||||
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="expansion">
|
||||
<thead>
|
||||
<tr><th colspan="6"><a name="h2"></a><?php echo CONQUERED_BY_VILLAGE;?></th></tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo VILLAGE;?></td>
|
||||
<td><?php echo PLAYER;?></td>
|
||||
<td><?php echo INHABITANTS;?></td>
|
||||
<td><?php echo COORDINATES;?></td>
|
||||
<td><?php echo DATE;?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $hasSlots = false; foreach ($slots as $idx => $slotId): if ($slotId == 0) continue; $hasSlots = true;
|
||||
$coor = $database->getCoor($slotId);
|
||||
$vname = $database->getVillageField($slotId, 'name');
|
||||
$owner = $database->getVillageField($slotId, 'owner');
|
||||
$pop = $database->getVillageField($slotId, 'pop');
|
||||
$vcreated = $database->getVillageField($slotId, 'created');
|
||||
$ownername = $database->getUserField($owner, 'username', 0);
|
||||
?>
|
||||
<tr>
|
||||
<td class="ra"><?php echo $idx+1;?>.</td>
|
||||
<td class="vil"><a href="karte.php?d=<?php echo $slotId;?>&c=<?php echo $generator->getMapCheck($slotId);?>"><?php echo htmlspecialchars($vname);?></a></td>
|
||||
<td class="pla"><a href="spieler.php?uid=<?php echo $owner;?>"><?php echo htmlspecialchars($ownername);?></a></td>
|
||||
<td class="ha"><?php echo (int)$pop;?></td>
|
||||
<td class="aligned_coords"><div class="cox">(<?php echo $coor['x'];?></div><div class="pi">|</div><div class="coy"><?php echo $coor['y'];?>)</div></td>
|
||||
<td class="dat"><?php echo date('d.m.Y', $vcreated);?></td>
|
||||
</tr>
|
||||
<?php endforeach; if (!$hasSlots):?>
|
||||
<tr><td colspan="6" class="none"><?php echo NONE_CONQUERED_BY_VILLAGE;?></td></tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1,68 +1,55 @@
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Naam</td>
|
||||
<td>Aantal</td>
|
||||
<td>max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$i = 20;
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time']/SPEED));
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
//$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$i}['crop']);
|
||||
// 25_create.tpl - RESIDENCE TRAIN UNITS
|
||||
global $id, $technology, $village, $generator;
|
||||
|
||||
//if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
//echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
//}
|
||||
echo "
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a></td></tr></tbody>
|
||||
";
|
||||
?>
|
||||
$i = 20; // Settler (sau 19 pentru Chief la Palace)
|
||||
$unit = ${'u'.$i};
|
||||
$available = (int)$village->unitarray['u'.$i];
|
||||
$maxTrain = $technology->maxUnit($i);
|
||||
$trainlist = $technology->getTrainingList(20);
|
||||
?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td>Naam</td><td>Aantal</td><td>max</td></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo $technology->getUnitName($i);?>" />
|
||||
<a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo $technology->getUnitName($i);?></a>
|
||||
<span class="info">(Available: <?php echo $available;?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="Lumber"/><?php echo (int)$unit['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" title="Clay"/><?php echo (int)$unit['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" title="Iron"/><?php echo (int)$unit['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" title="Crop"/><?php echo (int)$unit['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" title="duration"/><?php echo $generator->getTimeFormat(round($unit['time']/SPEED));?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t<?php echo $i;?>" value="0" maxlength="4"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t<?php echo $i;?>.value=<?php echo $maxTrain;?>; return false;">(<?php echo $maxTrain;?>)</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></p>
|
||||
|
||||
<?php
|
||||
$trainlist = $technology->getTrainingList(20);
|
||||
if(count($trainlist) > 0) {
|
||||
$timer = 2*count($trainlist);
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
foreach($trainlist as $train) {
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />".$train['amt']." ".$train['name']."</td><td class=\"dur\"><span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span></td><td class=\"fin\">";
|
||||
$timer -= 1;
|
||||
$time = $generator->procMTime($train['commence']+(1*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at";
|
||||
}
|
||||
echo $time[1]."</span><span> o'clock</td>
|
||||
</tr><tr class=\"next\"><td colspan=\"3\">The next unit will be finished in <span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+$train['eachtime'])-time())."</span></td></tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
<?php if (count($trainlist) > 0): $timer = 2*count($trainlist);?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead><tr><td>Training</td><td>Duration</td><td>Finished</td></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($trainlist as $train):?>
|
||||
<tr>
|
||||
<td class="desc"><img class="unit u<?php echo $train['unit'];?>" src="img/x.gif" alt="<?php echo $train['name'];?>"/><?php echo $train['amt'];?> <?php echo $train['name'];?></td>
|
||||
<td class="dur"><span id="timer<?php echo $timer;?>"><?php echo $generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time());?></span></td>
|
||||
<td class="fin"><?php $time = $generator->procMTime($train['commence']+$train['amt']); if($time[0]!="today") echo "on ".$time[0]." at "; echo $time[1];?> o'clock</td>
|
||||
</tr>
|
||||
<tr class="next"><td colspan="3">The next unit will be finished in <span id="timer<?php echo --$timer;?>"><?php echo $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());?></span></td></tr>
|
||||
<?php $timer--; endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
@@ -1,7 +1,12 @@
|
||||
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>" <?php if(!isset($_GET['s']))echo "class=\"selected\""; ?>><?php echo TRAIN; ?></a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=2" <?php if(isset($_GET['s']) && $_GET['s'] == 2) echo "class=\"selected\""; ?>><?php echo CULTURE_POINTS; ?></a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=3" <?php if(isset($_GET['s']) && $_GET['s'] == 3) echo "class=\"selected\""; ?>><?php echo LOYALTY; ?></a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=4" <?php if(isset($_GET['s']) && $_GET['s'] == 4) echo "class=\"selected\""; ?>><?php echo EXPANSION; ?></a>
|
||||
<?php
|
||||
// 25_menu.tpl - RESIDENCE MENU
|
||||
global $id;
|
||||
$s = $_GET['s'] ?? null;
|
||||
?>
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo (int)$id;?>" <?php if(!$s) echo 'class="selected"';?>><?php echo TRAIN;?></a>
|
||||
| <a href="build.php?id=<?php echo (int)$id;?>&s=2" <?php if($s==2) echo 'class="selected"';?>><?php echo CULTURE_POINTS;?></a>
|
||||
| <a href="build.php?id=<?php echo (int)$id;?>&s=3" <?php if($s==3) echo 'class="selected"';?>><?php echo LOYALTY;?></a>
|
||||
| <a href="build.php?id=<?php echo (int)$id;?>&s=4" <?php if($s==4) echo 'class="selected"';?>><?php echo EXPANSION;?></a>
|
||||
</div>
|
||||
@@ -1,34 +1,32 @@
|
||||
<?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
|
||||
// 25_progress.tpl - RESIDENCE TRAINING UNITS PROGRESS
|
||||
global $technology, $generator, $session;
|
||||
|
||||
$trainlist = $technology->getTrainingList(4);
|
||||
if (count($trainlist) > 0):
|
||||
$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++;?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<img class="unit u<?php echo $train['unit'];?>" src="img/x.gif" alt="<?php echo $train['name'];?>" title="<?php echo $train['name'];?>" />
|
||||
<?php echo $train['amt'];?> <?php echo $train['name'];?>
|
||||
</td>
|
||||
<td class="dur">
|
||||
<?php if ($TrainCount == 1): $NextFinished = $generator->getTimeFormat($train['timestamp2']-time());?>
|
||||
<span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($train['timestamp']-time());?></span>
|
||||
<?php else:?>
|
||||
<?php echo $generator->getTimeFormat($train['eachtime']*$train['amt']);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class="fin"><?php $time = $generator->procMTime($train['timestamp']); 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;?>
|
||||
@@ -1,13 +1,6 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename 25_train.tpl ##
|
||||
## Made by: Dzoki ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
// 25_train.tpl - RESIDENCE TRAINING UNITS PROGRESS
|
||||
|
||||
$slots = $database->getAvailableExpansionTraining();
|
||||
|
||||
|
||||
+41
-31
@@ -1,38 +1,58 @@
|
||||
<?php
|
||||
// PALACE - gid 26 - refactorizat
|
||||
if(time() - (!empty($_SESSION['time_p']) ? $_SESSION['time_p'] : 0) > 5){
|
||||
$_SESSION['time_p'] = '';
|
||||
$_SESSION['error_p'] = '';
|
||||
}
|
||||
|
||||
if($_POST and $_GET['action'] == 'change_capital' && !$village->capital){
|
||||
$pass = mysqli_escape_string($database->dblink, $_POST['pass']);
|
||||
// --- LOGICA SCHIMBARE CAPITALA ---
|
||||
if($_POST && $_GET['action'] == 'change_capital' && !$village->capital){
|
||||
$pass = $_POST['pass'];
|
||||
$query = mysqli_query($database->dblink, 'SELECT password FROM `'.TB_PREFIX.'users` WHERE `id` = '.(int)$session->uid);
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
// 1. Verifică parola
|
||||
if(password_verify($pass, $data['password'])){
|
||||
$query1 = mysqli_query($database->dblink, 'SELECT wref FROM `'.TB_PREFIX.'vdata` WHERE `owner` = '.(int)$session->uid.' AND `capital` = 1');
|
||||
$data1 = mysqli_fetch_assoc($query1);
|
||||
$query2 = mysqli_query($database->dblink, 'SELECT * FROM `'.TB_PREFIX.'fdata` WHERE `vref` = '.(int)$data1['wref']);
|
||||
$data2 = mysqli_fetch_assoc($query2);
|
||||
if($data2['vref'] != $village->wid){
|
||||
$oldWid = (int)$data1['wref'];
|
||||
$newWid = (int)$village->wid;
|
||||
|
||||
if($oldWid != $newWid){
|
||||
// ia datele ambelor sate
|
||||
$query2 = mysqli_query($database->dblink, 'SELECT * FROM `'.TB_PREFIX.'fdata` WHERE `vref` = '.$oldWid);
|
||||
$data2 = mysqli_fetch_assoc($query2);
|
||||
$query3 = mysqli_query($database->dblink, 'SELECT * FROM `'.TB_PREFIX.'fdata` WHERE `vref` = '.$newWid);
|
||||
$data3 = mysqli_fetch_assoc($query3);
|
||||
|
||||
// 1. taie resursele vechii capitale la nivel 10
|
||||
for($i = 1; $i <= 18; ++$i){
|
||||
if($data2['f'.$i] > 10){
|
||||
$query2 = mysqli_query($database->dblink, 'UPDATE `'.TB_PREFIX.'fdata` SET `f'.$i.'` = 10 WHERE `vref` = '.(int)$data2['vref']);
|
||||
mysqli_query($database->dblink, 'UPDATE `'.TB_PREFIX.'fdata` SET `f'.$i.'` = 10 WHERE `vref` = '.$oldWid);
|
||||
}
|
||||
}
|
||||
// 2. șterge Zidarul din vechea capitală
|
||||
for($i = 19; $i <= 40; ++$i){
|
||||
if($data2['f'.$i.'t'] == 34){
|
||||
$query3 = mysqli_query($database->dblink, 'UPDATE `'.TB_PREFIX.'fdata` SET `f'.$i.'t` = 0, `f'.$i.'` = 0 WHERE `vref` = '.(int)$data2['vref']);
|
||||
mysqli_query($database->dblink, 'UPDATE `'.TB_PREFIX.'fdata` SET `f'.$i.'t` = 0, `f'.$i.'` = 0 WHERE `vref` = '.$oldWid);
|
||||
}
|
||||
}
|
||||
// 3. FIX: șterge clădirile specifice capitalei din NOUA capitală
|
||||
$capitalOnly = [29,30,38,39,42];
|
||||
for($i = 19; $i <= 40; ++$i){
|
||||
if(in_array((int)$data3['f'.$i.'t'], $capitalOnly)){
|
||||
mysqli_query($database->dblink, 'UPDATE `'.TB_PREFIX.'fdata` SET `f'.$i.'t` = 0, `f'.$i.'` = 0 WHERE `vref` = '.$newWid);
|
||||
}
|
||||
}
|
||||
|
||||
for($i = 19; $i <= 40; ++$i){
|
||||
if($data2['f'.$i.'t'] == 29 || $data2['f'.$i.'t'] == 30 || $data2['f'.$i.'t'] == 38 || $data2['f'.$i.'t'] == 39 || $data2['f'.$i.'t'] == 42){
|
||||
$query3 = mysqli_query($database->dblink, 'UPDATE `'.TB_PREFIX.'fdata` SET `f'.$i.'t` = 0, `f'.$i.'` = 0 WHERE `vref` = '.(int)$village->wid);
|
||||
}
|
||||
}
|
||||
|
||||
$database->changeCapital((int)$data1['wref'], 0);
|
||||
$database->changeCapital($village->wid);
|
||||
$database->changeCapital($oldWid, 0);
|
||||
$database->changeCapital($newWid);
|
||||
|
||||
// 4. FIX BUG-UL TĂU: recount populație instant
|
||||
if(!isset($automation)){
|
||||
include_once("GameEngine/Automation.php");
|
||||
}
|
||||
$automation->recountPop($oldWid, false);
|
||||
$automation->recountPop($newWid, false);
|
||||
|
||||
header("location: build.php?gid=26");
|
||||
exit;
|
||||
}
|
||||
@@ -40,37 +60,29 @@ if($_POST and $_GET['action'] == 'change_capital' && !$village->capital){
|
||||
$error = '<br /><font color="red">'.LOGIN_PW_ERROR.'</font><br />';
|
||||
$_SESSION['error_p'] = $error;
|
||||
$_SESSION['time_p'] = time();
|
||||
echo '<script language="javascript">location.href="build.php?id='.$building->getTypeField(26).'&confirm=yes";</script>';
|
||||
echo '<script>location.href="build.php?id='.$building->getTypeField(26).'&confirm=yes";</script>';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="build" class="gid26"><h1><?php echo PALACE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g26"
|
||||
src="img/x.gif" alt="Palace"
|
||||
title="<?php echo PALACE; ?>" /> </a>
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');" class="build_logo"> <img class="building g26" src="img/x.gif" alt="Palace" title="<?php echo PALACE; ?>" /> </a>
|
||||
<?php echo PALACE_DESC; ?></p>
|
||||
|
||||
<?php
|
||||
if ($building->getTypeLevel(26) > 0) {
|
||||
|
||||
include("26_menu.tpl");
|
||||
|
||||
if($village->resarray['f'.$id] >= 10) include ("26_train.tpl");
|
||||
else echo '<div class="c">'.PALACE_TRAIN_DESC.'</div>';
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if($village->capital == 1) {
|
||||
?>
|
||||
<p class="none"><?php echo CAPITAL; ?></p>
|
||||
<?php
|
||||
} else {
|
||||
if(empty($_GET['confirm'])) {
|
||||
print '<p><a href="?id='.$building->getTypeField(26).'&confirm=yes">» '.CHANGE_CAPITAL.'</a></p>';
|
||||
print '<p><a href="?id='.$building->getTypeField(26).'&confirm=yes">» '.CHANGE_CAPITAL.'</a></p>';
|
||||
} else {
|
||||
print '<p>Are you sure, that you want to change your capital?<br /><b>You can\'t undo this!</b><br />For security you must enter your password to confirm:<br />
|
||||
<form method="post" action="build.php?id='.$building->getTypeField(26).'&action=change_capital">
|
||||
@@ -81,9 +93,7 @@ if($village->capital == 1) {
|
||||
</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else echo "<b><?php echo PALACE_CONSTRUCTION; ?></b>";
|
||||
|
||||
} else echo "<b>".PALACE_CONSTRUCTION."</b>";
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</div>
|
||||
+49
-25
@@ -1,27 +1,51 @@
|
||||
<div id="build" class="gid26"><h1><?php echo PALACE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g26"
|
||||
src="img/x.gif" alt="Palace"
|
||||
title="Palace" /> </a>
|
||||
<?php echo PALACE_DESC; ?></p>
|
||||
<?php
|
||||
// 26_2.tpl - PALACE / POINT CULTURE
|
||||
global $database, $session, $village;
|
||||
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$isNatar = (int)$database->getVillageField($village->wid, 'natar') === 1;
|
||||
|
||||
<p><?php echo RESIDENCE_CULTURE_DESC; ?></p>
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo PRODUCTION_POINTS; ?></th>
|
||||
<?php if($database->getVillageField($village->wid, 'natar') == 0){ ?>
|
||||
<td><b><?php echo $database->getVillageField($village->wid, 'cp'); ?></b> <?php echo POINTS_DAY; ?></td>
|
||||
<?php }else{ ?>
|
||||
<td><b>0</b> <?php echo POINTS_DAY; ?></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo PRODUCTION_ALL_POINTS; ?></th>
|
||||
<td><b><?php echo $database->getVSumField($session->uid, 'cp'); ?></b> <?php echo POINTS_DAY; ?></td>
|
||||
</tr>
|
||||
</table><p><?php echo VILLAGES_PRODUCED; ?> <b><?php echo $session->cp; ?></b> <?php echo POINTS_NEED; ?> <b><?php $mode = CP; $total = count($database->getProfileVillages($session->uid)); echo ${'cp'.$mode}[$total+1]; ?></b> <?php echo POINTS; ?>.</p>
|
||||
</div>
|
||||
// ia datele o singură dată
|
||||
$cpVillage = $isNatar ? 0 : (int)$database->getVillageField($village->wid, 'cp');
|
||||
$cpTotal = (int)$database->getVSumField($session->uid, 'cp');
|
||||
$villages = $database->getProfileVillages($session->uid);
|
||||
$totalVillages = count($villages);
|
||||
|
||||
// calcul pentru următorul sat - fără variable variables
|
||||
$cpMode = CP; // 0 = normal, 1 = speed
|
||||
$cpArrayName = 'cp' . $cpMode;
|
||||
$cpArray = $GLOBALS[$cpArrayName] ?? [];
|
||||
$nextCpNeed = $cpArray[$totalVillages + 1] ?? 0;
|
||||
$currentCp = (int)$session->cp;
|
||||
?>
|
||||
<div id="build" class="gid26">
|
||||
<h1><?php echo PALACE; ?> <span class="level"><?php echo LEVEL.' '.$level; ?></span></h1>
|
||||
|
||||
<p class="build_desc">
|
||||
<a href="#" onclick="return Popup(26,4,'gid');" class="build_logo">
|
||||
<img class="building g26" src="img/x.gif" alt="<?php echo PALACE; ?>" title="<?php echo PALACE; ?>" />
|
||||
</a>
|
||||
<?php echo PALACE_DESC; ?>
|
||||
</p>
|
||||
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
|
||||
<p><?php echo RESIDENCE_CULTURE_DESC; ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo PRODUCTION_POINTS; ?></th>
|
||||
<td><b><?php echo $cpVillage; ?></b> <?php echo POINTS_DAY; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo PRODUCTION_ALL_POINTS; ?></th>
|
||||
<td><b><?php echo $cpTotal; ?></b> <?php echo POINTS_DAY; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<?php echo VILLAGES_PRODUCED; ?> <b><?php echo $currentCp; ?></b>
|
||||
<?php echo POINTS_NEED; ?> <b><?php echo $nextCpNeed; ?></b>
|
||||
<?php echo POINTS; ?>.
|
||||
</p>
|
||||
</div>
|
||||
+22
-10
@@ -1,13 +1,25 @@
|
||||
<div id="build" class="gid26"><h1><?php echo PALACE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g26"
|
||||
src="img/x.gif" alt="Palace"
|
||||
title="<?php echo PALACE; ?>" /> </a>
|
||||
<?php echo PALACE_DESC; ?></p>
|
||||
<?php
|
||||
// 26_3.tpl - PALACE / LOIALITY
|
||||
global $database, $village;
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$loyalty = floor((float)$database->getVillageField($village->wid, 'loyalty'));
|
||||
$loyalty = max(0, min(100, $loyalty)); // siguranță: între 0-100%
|
||||
?>
|
||||
<div id="build" class="gid26">
|
||||
<h1><?php echo PALACE; ?> <span class="level"><?php echo LEVEL.' '.$level; ?></span></h1>
|
||||
|
||||
<p class="build_desc">
|
||||
<a href="#" onclick="return Popup(26,4,'gid');" class="build_logo">
|
||||
<img class="building g26" src="img/x.gif" alt="<?php echo PALACE; ?>" title="<?php echo PALACE; ?>" />
|
||||
</a>
|
||||
<?php echo PALACE_DESC; ?>
|
||||
</p>
|
||||
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
|
||||
<?php echo RESIDENCE_LOYALTY_DESC; ?> <b><?php echo floor($database->getVillageField($village->wid,'loyalty')); ?></b> <?php echo PERCENT; ?>.</div>
|
||||
<p class="loyalty">
|
||||
<?php echo RESIDENCE_LOYALTY_DESC; ?>
|
||||
<b><?php echo $loyalty; ?></b> <?php echo PERCENT; ?>.
|
||||
</p>
|
||||
</div>
|
||||
+77
-52
@@ -1,55 +1,80 @@
|
||||
<div id="build" class="gid26"><h1><?php echo PALACE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g26"
|
||||
src="img/x.gif" alt="Palace"
|
||||
title="<?php echo PALACE; ?>" /> </a>
|
||||
|
||||
<?php echo PALACE_DESC; ?>
|
||||
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="expansion">
|
||||
<thead><tr>
|
||||
<th colspan="6"><a name="h2"></a><?php echo CONQUERED_BY_VILLAGE; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo VILLAGE; ?></td>
|
||||
<td><?php echo PLAYER; ?></td>
|
||||
<td><?php echo INHABITANTS; ?></td>
|
||||
<td><?php echo COORDINATES; ?></td>
|
||||
<td><?php echo DATE; ?></td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$slot1 = $database->getVillageField($village->wid, 'exp1');
|
||||
$slot2 = $database->getVillageField($village->wid, 'exp2');
|
||||
$slot3 = $database->getVillageField($village->wid, 'exp3');
|
||||
// 26_4.tpl - PALACE / CONQUERED VILLAGES
|
||||
global $database, $village, $generator;
|
||||
|
||||
if($slot1 != 0 || $slot2 != 0 || $slot3 != 0){
|
||||
for($i=1; $i <= 3; $i++){
|
||||
if (${'slot'.$i}<>0) {
|
||||
$coor = $database->getCoor(${'slot'.$i});
|
||||
$vname = $database->getVillageField(${'slot'.$i},'name');
|
||||
$owner = $database->getVillageField(${'slot'.$i},'owner');
|
||||
$pop = $database->getVillageField(${'slot'.$i},'pop');
|
||||
$vcreated = $database->getVillageField(${'slot'.$i},'created');
|
||||
$ownername = $database->getUserField($owner,'username',0);
|
||||
echo '
|
||||
<tr>
|
||||
<td class="ra">'.$i.'.</td>
|
||||
<td class="vil"><a href="karte.php?d='.${'slot'.$i}.'&c='.$generator->getMapCheck(${'slot'.$i}).'">'.$vname.'</a></td>
|
||||
<td class="pla"><a href="spieler.php?uid='.$owner.'">'.$ownername.'</a></td>
|
||||
<td class="ha">'.$pop.'</td>
|
||||
<td class="aligned_coords"><div class="cox">('.$coor['x'].'</div><div class="pi">|</div><div class="coy">'.$coor['y'].')</div></td>
|
||||
<td class="dat">'.date('d.m.Y',$vcreated).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo '<tr><td colspan="6" class="none">'.NONE_CONQUERED_BY_VILLAGE.'</td></tr>';
|
||||
}
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
|
||||
// ia toate 3 sloturile o singură dată
|
||||
$slots = [
|
||||
(int)$database->getVillageField($village->wid, 'exp1'),
|
||||
(int)$database->getVillageField($village->wid, 'exp2'),
|
||||
(int)$database->getVillageField($village->wid, 'exp3'),
|
||||
];
|
||||
$slots = array_filter($slots); // elimină 0
|
||||
?>
|
||||
</tbody></table></div>
|
||||
<div id="build" class="gid26">
|
||||
<h1><?php echo PALACE; ?> <span class="level"><?php echo LEVEL.' '.$level; ?></span></h1>
|
||||
|
||||
<p class="build_desc">
|
||||
<a href="#" onclick="return Popup(26,4,'gid');" class="build_logo">
|
||||
<img class="building g26" src="img/x.gif" alt="<?php echo PALACE; ?>" title="<?php echo PALACE; ?>" />
|
||||
</a>
|
||||
<?php echo PALACE_DESC; ?>
|
||||
</p>
|
||||
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="expansion">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="6"><a name="h2"></a><?php echo CONQUERED_BY_VILLAGE; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo VILLAGE; ?></td>
|
||||
<td><?php echo PLAYER; ?></td>
|
||||
<td><?php echo INHABITANTS; ?></td>
|
||||
<td><?php echo COORDINATES; ?></td>
|
||||
<td><?php echo DATE; ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (!empty($slots)):
|
||||
$i = 1;
|
||||
foreach ($slots as $wid):
|
||||
// un singur set de date per sat
|
||||
$coor = $database->getCoor($wid);
|
||||
$villageData = $database->getVillage($wid); // conține name, owner, pop, created
|
||||
$ownerName = $database->getUserField($villageData['owner'], 'username', 0);
|
||||
$mapCheck = $generator->getMapCheck($wid);
|
||||
?>
|
||||
<tr>
|
||||
<td class="ra"><?php echo $i; ?>.</td>
|
||||
<td class="vil">
|
||||
<a href="karte.php?d=<?php echo $wid; ?>&c=<?php echo $mapCheck; ?>">
|
||||
<?php echo htmlspecialchars($villageData['name']); ?>
|
||||
</a>
|
||||
</td>
|
||||
<td class="pla">
|
||||
<a href="spieler.php?uid=<?php echo (int)$villageData['owner']; ?>">
|
||||
<?php echo htmlspecialchars($ownerName); ?>
|
||||
</a>
|
||||
</td>
|
||||
<td class="ha"><?php echo (int)$villageData['pop']; ?></td>
|
||||
<td class="aligned_coords">
|
||||
<div class="cox">(<?php echo (int)$coor['x']; ?></div>
|
||||
<div class="pi">|</div>
|
||||
<div class="coy"><?php echo (int)$coor['y']; ?>)</div>
|
||||
</td>
|
||||
<td class="dat"><?php echo date('d.m.Y', (int)$villageData['created']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$i++;
|
||||
endforeach;
|
||||
else: ?>
|
||||
<tr>
|
||||
<td colspan="6" class="none"><?php echo NONE_CONQUERED_BY_VILLAGE; ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1,68 +1,97 @@
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Naam</td>
|
||||
<td>Aantal</td>
|
||||
<td>max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$i = 20;
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time']/SPEED));
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
//$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$i}['crop']);
|
||||
// 26_create.tpl - PALACE / TRAIN SETTLERS
|
||||
global $village, $technology, $generator, $id;
|
||||
|
||||
//if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
//echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
//}
|
||||
echo "
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a></td></tr></tbody>
|
||||
";
|
||||
?>
|
||||
$unitId = 20; // colonist
|
||||
$unitName = $technology->getUnitName($unitId);
|
||||
$costs = $GLOBALS['u'.$unitId]; // $u20 din config
|
||||
$maxTrain = $technology->maxUnit($unitId);
|
||||
$available = (int)($village->unitarray['u'.$unitId]?? 0);
|
||||
$trainTime = $generator->getTimeFormat(round($costs['time'] / SPEED));
|
||||
$trainList = $technology->getTrainingList($unitId);
|
||||
?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Naam</td>
|
||||
<td>Aantal</td>
|
||||
<td>max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $unitId;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($unitName);?>" title="<?php echo htmlspecialchars($unitName);?>" />
|
||||
<a href="#" onclick="return Popup(<?php echo $unitId;?>,1);"><?php echo htmlspecialchars($unitName);?></a>
|
||||
<span class="info">(Available: <?php echo $available;?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $costs['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $costs['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $costs['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $costs['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $trainTime;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val">
|
||||
<input type="text" class="text" name="t<?php echo $unitId;?>" value="0" maxlength="4">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onclick="document.snd.t<?php echo $unitId;?>.value=<?php echo $maxTrain;?>; return false;">(<?php echo $maxTrain;?>)</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
$trainlist = $technology->getTrainingList(20);
|
||||
if(count($trainlist) > 0) {
|
||||
$timer = 2*count($trainlist);
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
foreach($trainlist as $train) {
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />".$train['amt']." ".$train['name']."</td><td class=\"dur\"><span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span></td><td class=\"fin\">";
|
||||
$timer -= 1;
|
||||
$time = $generator->procMTime($train['commence']+(1*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at";
|
||||
}
|
||||
echo $time[1]."</span><span> o'clock</td>
|
||||
</tr><tr class=\"next\"><td colspan=\"3\">The next unit will be finished in <span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+$train['eachtime'])-time())."</span></td></tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<?php if (!empty($trainList)):
|
||||
$timer = count($trainList) * 2;
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="under_progress">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($trainList as $train):
|
||||
$totalFinish = $train['commence'] + ($train['eachtime'] * $train['amt']);
|
||||
$nextFinish = $train['commence'] + $train['eachtime'];
|
||||
$remainingTotal = max(0, $totalFinish - time());
|
||||
$remainingNext = max(0, $nextFinish - time());
|
||||
$time = $generator->procMTime($totalFinish);
|
||||
?>
|
||||
<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">
|
||||
<span id="timer<?php echo $timer;?>"><?php echo $generator->getTimeFormat($remainingTotal);?></span>
|
||||
</td>
|
||||
<td class="fin">
|
||||
<?php if ($time[0]!= "today") echo "on ".$time[0]." at "; echo $time[1];?> o'clock
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="next">
|
||||
<td colspan="3">
|
||||
The next unit will be finished in <span id="timer<?php echo $timer-1;?>"><?php echo $generator->getTimeFormat($remainingNext);?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$timer -= 2;
|
||||
endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
@@ -1,7 +1,25 @@
|
||||
<?php
|
||||
// 26_menu.tpl - PALACE / MENU
|
||||
global $id;
|
||||
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>" <?php if(!isset($_GET['s'])) { echo "class=\"selected\""; } ?>><?php echo TRAIN; ?></a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=2" <?php if(isset($_GET['s']) && $_GET['s'] == 2) { echo "class=\"selected\""; } ?>><?php echo CULTURE_POINTS; ?></a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=3" <?php if(isset($_GET['s']) && $_GET['s'] == 3) { echo "class=\"selected\""; } ?>><?php echo LOYALTY; ?></a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=4" <?php if(isset($_GET['s']) && $_GET['s'] == 4) { echo "class=\"selected\""; } ?>><?php echo EXPANSION; ?></a>
|
||||
$current = $_GET['s'] ?? '';
|
||||
$menu = [
|
||||
'' => TRAIN,
|
||||
'2' => CULTURE_POINTS,
|
||||
'3' => LOYALTY,
|
||||
'4' => EXPANSION,
|
||||
];
|
||||
?>
|
||||
<div id="textmenu">
|
||||
<?php
|
||||
$first = true;
|
||||
foreach ($menu as $s => $label):
|
||||
if (!$first) echo ' | ';
|
||||
$first = false;
|
||||
|
||||
$url = 'build.php?id='.(int)$id.($s !== '' ? '&s='.$s : '');
|
||||
$selected = ($current === (string)$s) ? ' class="selected"' : '';
|
||||
?>
|
||||
<a href="<?php echo $url;?>"<?php echo $selected;?>><?php echo $label;?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -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;?>
|
||||
@@ -1,64 +1,86 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename 26_train.tpl ##
|
||||
## Made by: Dzoki ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
// 26_train.tpl - PALACE / Antrenare coloniști și șefi
|
||||
global $database, $session, $village, $technology, $generator, $building, $bid26, $id;
|
||||
|
||||
$slots = $database->getAvailableExpansionTraining();
|
||||
|
||||
if ($slots['settlers'] + $slots['chiefs'] > 0) { ?>
|
||||
$slots = $database->getAvailableExpansionTraining();
|
||||
$totalSlots = ($slots['settlers'] ?? 0) + ($slots['chiefs'] ?? 0);
|
||||
|
||||
if ($totalSlots > 0): ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo NAME; ?></td>
|
||||
<td><?php echo QUANTITY; ?></td>
|
||||
<td><?php echo MAX; ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i = ($session->tribe - 1) * 10 + 9; $i <= $session->tribe * 10; $i++) {
|
||||
if ($slots['settlers'] > 0 && $i % 10 == 0 || $slots['chiefs'] > 0 && $i % 10 == 9 && $session->tribe != 4) {
|
||||
$maxunit = MIN($technology->maxUnit($i), ($i % 10 == 0 ? $slots['settlers'] : $slots['chiefs']));
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(".AVAILABLE.": ".$village->unitarray['u'.$i].")</span></div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo $generator->getTimeFormat($dur);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'u'.$i}['wood']."&r2=".${'u'.$i}['clay']."&r3=".${'u'.$i}['iron']."&r4=".${'u'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$maxunit."; return false;\">(".$maxunit.")</a></td></tr></tbody>";
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo NAME;?></td>
|
||||
<td><?php echo QUANTITY;?></td>
|
||||
<td><?php echo MAX;?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$start = ($session->tribe - 1) * 10 + 9;
|
||||
$end = $session->tribe * 10;
|
||||
|
||||
for ($i = $start; $i <= $end; $i++):
|
||||
$isSettler = ($i % 10 === 0);
|
||||
$isChief = ($i % 10 === 9 && $session->tribe != 4);
|
||||
|
||||
if (($isSettler && $slots['settlers'] > 0) || ($isChief && $slots['chiefs'] > 0)):
|
||||
$unitName = $technology->getUnitName($i);
|
||||
$costs = $GLOBALS['u'.$i];
|
||||
$maxByTech = $technology->maxUnit($i);
|
||||
$slotLimit = $isSettler ? $slots['settlers'] : $slots['chiefs'];
|
||||
$maxUnit = min($maxByTech, $slotLimit);
|
||||
$available = (int)($village->unitarray['u'.$i] ?? 0);
|
||||
|
||||
// timp cu bonus palat și artefacte
|
||||
$baseTime = $costs['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 100) / SPEED;
|
||||
$duration = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round($baseTime));
|
||||
|
||||
$totalRequired = $costs['wood'] + $costs['clay'] + $costs['iron'] + $costs['crop'];
|
||||
$canNpc = $session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $totalRequired;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($unitName);?>" title="<?php echo htmlspecialchars($unitName);?>" />
|
||||
<a href="#" onclick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($unitName);?></a>
|
||||
<span class="info">(<?php echo AVAILABLE;?>: <?php echo $available;?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="<?php echo LUMBER;?>" title="<?php echo LUMBER;?>" /><?php echo $costs['wood'];?>|
|
||||
<img class="r2" src="img/x.gif" alt="<?php echo CLAY;?>" title="<?php echo CLAY;?>" /><?php echo $costs['clay'];?>|
|
||||
<img class="r3" src="img/x.gif" alt="<?php echo IRON;?>" title="<?php echo IRON;?>" /><?php echo $costs['iron'];?>|
|
||||
<img class="r4" src="img/x.gif" alt="<?php echo CROP;?>" title="<?php echo CROP;?>" /><?php echo $costs['crop'];?>|
|
||||
<img class="clock" src="img/x.gif" alt="<?php echo DURATION;?>" title="<?php echo DURATION;?>" /><?php echo $generator->getTimeFormat($duration);?>
|
||||
<?php if ($canNpc):?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?php echo $costs['wood'];?>&r2=<?php echo $costs['clay'];?>&r3=<?php echo $costs['iron'];?>&r4=<?php echo $costs['crop'];?>" title="NPC trade">
|
||||
<img class="npc" src="img/x.gif" alt="NPC trade" title="NPC trade" />
|
||||
</a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val">
|
||||
<input type="text" class="text" name="t<?php echo $i;?>" value="0" maxlength="4">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onclick="document.snd.t<?php echo $i;?>.value=<?php echo $maxUnit;?>; return false;">(<?php echo $maxUnit;?>)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endif;
|
||||
endfor; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else echo '<div class="c">'.PALACE_TRAIN_DESC.'</div>';
|
||||
|
||||
include ("26_progress.tpl");
|
||||
?>
|
||||
<?php else: ?>
|
||||
<div class="c"><?php echo PALACE_TRAIN_DESC;?></div>
|
||||
<?php endif;
|
||||
|
||||
include("26_progress.tpl");
|
||||
?>
|
||||
+29
-32
@@ -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>
|
||||
+49
-57
@@ -1,59 +1,51 @@
|
||||
<div id="build" class="gid29"><a href="#" onClick="return Popup(29,4);" class="build_logo">
|
||||
<img class="building g29" src="img/x.gif" alt="Great Barracks" title="<?php echo GREATBARRACKS; ?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATBARRACKS; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATBARRACKS_DESC; ?></p>
|
||||
<?php
|
||||
// 29.tpl - GREATBARRACKS
|
||||
global $village, $building, $technology, $generator, $session, $id;
|
||||
|
||||
<?php if ($building->getTypeLevel(29) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo NAME; ?></td>
|
||||
<td><?php echo QUANTITY; ?></td>
|
||||
<td><?php echo MAX; ?></td>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
include("29_train.tpl");
|
||||
?></table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>".TRAINING_COMMENCE_GREATBARRACKS."</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(5);
|
||||
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 }
|
||||
include("upgrade.tpl");
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid29">
|
||||
<a href="#" onClick="return Popup(29,4);" class="build_logo">
|
||||
<img class="building g29" src="img/x.gif" alt="Great Barracks" title="<?php echo GREATBARRACKS;?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATBARRACKS;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATBARRACKS_DESC;?></p>
|
||||
|
||||
<?php if ($building->getTypeLevel(29) > 0):?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo NAME;?></td><td><?php echo QUANTITY;?></td><td><?php echo MAX;?></td></tr></thead>
|
||||
<tbody><?php include("29_train.tpl");?></tbody>
|
||||
</table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></p>
|
||||
</form>
|
||||
<?php else:?>
|
||||
<b><?php echo TRAINING_COMMENCE_GREATBARRACKS;?></b><br />
|
||||
<?php endif;?>
|
||||
|
||||
<?php $trainlist = $technology->getTrainingList(5); if (count($trainlist) > 0): $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++;?>
|
||||
<tr>
|
||||
<td class="desc"><img class="unit u<?php echo $train['unit'];?>" src="img/x.gif" alt="<?php echo $train['name'];?>" title="<?php echo $train['name'];?>" /><?php echo $train['amt'];?> <?php echo $train['name'];?></td>
|
||||
<td class="dur">
|
||||
<?php if ($TrainCount == 1): $NextFinished = $generator->getTimeFormat($train['timestamp2']-time());?>
|
||||
<span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($train['timestamp']-time());?></span>
|
||||
<?php else:?>
|
||||
<?php echo $generator->getTimeFormat($train['eachtime']*$train['amt']);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class="fin"><?php $time = $generator->procMTime($train['timestamp']); 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;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
@@ -1,27 +1,48 @@
|
||||
<?php
|
||||
for ($i=($session->tribe-1)*10+1;$i<=($session->tribe-1)*10+4;$i++) {
|
||||
if ($i <> 4 && $i <> 23 && $i <> 24 && ($technology->getTech($i) || $i%10 == 1)) {
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(".AVAILABLE.": ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"".LUMBER."\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid29[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo $generator->getTimeFormat($dur);
|
||||
// 29_train.tpl - GREATBARRACKS TRAIN
|
||||
global $session, $technology, $village, $database, $building, $bid29, $generator, $id;
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||
$start = ($session->tribe - 1) * 10 + 1;
|
||||
$end = ($session->tribe - 1) * 10 + 4;
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"10\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,true)."; return false;\">(".$technology->maxUnit($i,true).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
for ($i = $start; $i <= $end; $i++):
|
||||
if ($i == 4 || $i == 23 || $i == 24) continue;
|
||||
if (!($technology->getTech($i) || $i % 10 == 1)) continue;
|
||||
|
||||
$unit = ${'u'.$i};
|
||||
$costWood = (int)$unit['wood'] * 3;
|
||||
$costClay = (int)$unit['clay'] * 3;
|
||||
$costIron = (int)$unit['iron'] * 3;
|
||||
$costCrop = (int)$unit['crop'] * 3;
|
||||
$pop = (int)$unit['pop'];
|
||||
$available = (int)$village->unitarray['u'.$i];
|
||||
$max = $technology->maxUnit($i, true);
|
||||
$maxPlus = $technology->maxUnitPlus($i);
|
||||
$time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round($unit['time'] * ($bid29[$level]['attri'] / 100) / SPEED));
|
||||
$totalRequired = (int)($unit['wood'] + $unit['clay'] + $unit['iron'] + $unit['crop']);
|
||||
$showNpc = $session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $totalRequired;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo $technology->getUnitName($i);?>" title="<?php echo $technology->getUnitName($i);?>" />
|
||||
<a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo $technology->getUnitName($i);?></a>
|
||||
<span class="info">(<?php echo AVAILABLE;?>: <?php echo $available;?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo $costWood;?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo $costClay;?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo $costIron;?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo $costCrop;?>|
|
||||
<img class="r5" src="img/x.gif" title="<?php echo CROP_COM;?>"/><?php echo $pop;?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $generator->getTimeFormat($time);?>
|
||||
<?php if ($showNpc):?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?php echo $costWood/3*$maxPlus;?>&r2=<?php echo $costClay/3*$maxPlus;?>&r3=<?php echo $costIron/3*$maxPlus;?>&r4=<?php echo $costCrop/3*$maxPlus;?>" title="NPC trade"><img class="npc" src="img/x.gif" alt="NPC trade" /></a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t<?php echo $i;?>" value="0" maxlength="10"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t<?php echo $i;?>.value=<?php echo $max;?>; return false;">(<?php echo $max;?>)</a></td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
+42
-50
@@ -1,56 +1,48 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
|
||||
// IRONMINE
|
||||
|
||||
include 'next.tpl';
|
||||
|
||||
// — pregătire date —
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentProd = $bid3[$currentLevel]['prod'] * SPEED;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = ($village->capital == 1) ? 20 : 10;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextProd = $bid3[$nextLevel]['prod'] * SPEED;
|
||||
?>
|
||||
<div id="build" class="gid3"><a href="#" onClick="return Popup(3,4);" class="build_logo">
|
||||
<img class="building g3" src="img/x.gif" alt="<?php echo IRONMINE; ?>" title="<?php echo IRONMINE; ?>" />
|
||||
</a>
|
||||
<h1><?php echo IRONMINE; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo IRONMINE_DESC; ?></p>
|
||||
<div id="build" class="gid3">
|
||||
<a href="#" onclick="return Popup(3,4);" class="build_logo">
|
||||
<img class="building g3" src="img/x.gif" alt="<?= IRONMINE ?>" title="<?= IRONMINE ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= IRONMINE ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= IRONMINE_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CUR_PROD; ?></th>
|
||||
<td><b><?php echo $bid3[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> per hour</td>
|
||||
</tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
|
||||
if($village->capital == 1) {
|
||||
if($next<=20){
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid3[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo 20; ?>:</th>
|
||||
<td><b><?php echo $bid3[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}}else{
|
||||
if($next<=10){
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid3[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
|
||||
<td><b><?php echo $bid3[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}}}
|
||||
?>
|
||||
</table>
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CUR_PROD ?>:</th>
|
||||
<td><b><?= $currentProd ?></b> <?= PER_HR ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?></p></div>
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= NEXT_PROD ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextProd ?></b> <?= PER_HR ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+49
-57
@@ -1,59 +1,51 @@
|
||||
<div id="build" class="gid30"><a href="#" onClick="return Popup(30,4);" class="build_logo">
|
||||
<img class="building g30" src="img/x.gif" alt="Great Stables" title="<?php echo GREATSTABLE; ?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATSTABLE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATSTABLE_DESC; ?><br /></p>
|
||||
<?php
|
||||
// 30.tpl - GREATSTABLE
|
||||
global $village, $building, $technology, $generator, $session, $id;
|
||||
|
||||
<?php if ($building->getTypeLevel(30) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo NAME; ?></td>
|
||||
<td><?php echo QUANTITY; ?></td>
|
||||
<td><?php echo MAX; ?></td>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
include("30_train.tpl");
|
||||
?></table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>".TRAINING_COMMENCE_GREATSTABLE."</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(6);
|
||||
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 }
|
||||
include("upgrade.tpl");
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid30">
|
||||
<a href="#" onClick="return Popup(30,4);" class="build_logo">
|
||||
<img class="building g30" src="img/x.gif" alt="Great Stables" title="<?php echo GREATSTABLE;?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATSTABLE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATSTABLE_DESC;?><br /></p>
|
||||
|
||||
<?php if ($building->getTypeLevel(30) > 0):?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo NAME;?></td><td><?php echo QUANTITY;?></td><td><?php echo MAX;?></td></tr></thead>
|
||||
<tbody><?php include("30_train.tpl");?></tbody>
|
||||
</table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></p>
|
||||
</form>
|
||||
<?php else:?>
|
||||
<b><?php echo TRAINING_COMMENCE_GREATSTABLE;?></b><br />
|
||||
<?php endif;?>
|
||||
|
||||
<?php $trainlist = $technology->getTrainingList(6); if (count($trainlist) > 0): $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++;?>
|
||||
<tr>
|
||||
<td class="desc"><img class="unit u<?php echo $train['unit'];?>" src="img/x.gif" alt="<?php echo $train['name'];?>" title="<?php echo $train['name'];?>" /><?php echo $train['amt'];?> <?php echo $train['name'];?></td>
|
||||
<td class="dur">
|
||||
<?php if ($TrainCount == 1): $NextFinished = $generator->getTimeFormat($train['timestamp2']-time());?>
|
||||
<span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($train['timestamp']-time());?></span>
|
||||
<?php else:?>
|
||||
<?php echo $generator->getTimeFormat($train['eachtime']*$train['amt']);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class="fin"><?php $time = $generator->procMTime($train['timestamp']); 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;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
@@ -1,31 +1,57 @@
|
||||
<?php
|
||||
// 30_train.tpl - GREATSTABLE TRAIN
|
||||
global $session, $technology, $village, $database, $building, $bid30, $bid41, $generator, $id;
|
||||
|
||||
$start = ($session->tribe - 1) * 10 + 3;
|
||||
$end = ($session->tribe - 1) * 10 + 6;
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$horseDrinking = $building->getTypeLevel(41);
|
||||
$success = 0;
|
||||
for ($i=($session->tribe-1)*10+3;$i<=($session->tribe-1)*10+6;$i++) {
|
||||
if ($i <> 3 && $i <> 13 && $i <> 14 && $technology->getTech($i)) {
|
||||
$success ++;
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(".AVAILABLE.": ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"".LUMBER."\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />".(${'u'.$i}['pop']-($building->getTypeLevel(41)>=1?1:0))."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid30[$village->resarray['f'.$id]]['attri'] * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / 100) / SPEED));
|
||||
echo $generator->getTimeFormat($dur);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||
for ($i = $start; $i <= $end; $i++):
|
||||
if ($i == 3 || $i == 13 || $i == 14) continue;
|
||||
if (!$technology->getTech($i)) continue;
|
||||
$success++;
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"10\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,true)."; return false;\">(".$technology->maxUnit($i,true).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td colspan=\"3\"><div class=\"none\" align=\"center\">".AVAILABLE_ACADEMY."</div></td></tr>";
|
||||
}
|
||||
$unit = ${'u'.$i};
|
||||
$costWood = (int)$unit['wood'] * 3;
|
||||
$costClay = (int)$unit['clay'] * 3;
|
||||
$costIron = (int)$unit['iron'] * 3;
|
||||
$costCrop = (int)$unit['crop'] * 3;
|
||||
$pop = (int)$unit['pop'] - ($horseDrinking >= 1 ? 1 : 0);
|
||||
$available = (int)$village->unitarray['u'.$i];
|
||||
$max = $technology->maxUnit($i, true);
|
||||
$maxPlus = $technology->maxUnitPlus($i);
|
||||
|
||||
$speedMod = $bid30[$level]['attri'] / 100;
|
||||
if ($horseDrinking >= 1) $speedMod *= (1 / $bid41[$horseDrinking]['attri']);
|
||||
$time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round($unit['time'] * $speedMod / SPEED));
|
||||
|
||||
$totalRequired = (int)($unit['wood'] + $unit['clay'] + $unit['iron'] + $unit['crop']);
|
||||
$showNpc = $session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $totalRequired;
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo $technology->getUnitName($i);?>" title="<?php echo $technology->getUnitName($i);?>" />
|
||||
<a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo $technology->getUnitName($i);?></a>
|
||||
<span class="info">(<?php echo AVAILABLE;?>: <?php echo $available;?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo $costWood;?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo $costClay;?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo $costIron;?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo $costCrop;?>|
|
||||
<img class="r5" src="img/x.gif" title="<?php echo CROP_COM;?>"/><?php echo $pop;?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $generator->getTimeFormat($time);?>
|
||||
<?php if ($showNpc):?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?php echo $unit['wood']*$maxPlus;?>&r2=<?php echo $unit['clay']*$maxPlus;?>&r3=<?php echo $unit['iron']*$maxPlus;?>&r4=<?php echo $unit['crop']*$maxPlus;?>" title="NPC trade"><img class="npc" src="img/x.gif" alt="NPC trade" /></a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t<?php echo $i;?>" value="0" maxlength="10"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t<?php echo $i;?>.value=<?php echo $max;?>; return false;">(<?php echo $max;?>)</a></td>
|
||||
</tr>
|
||||
<?php endfor; if ($success == 0):?>
|
||||
<tr><td colspan="3"><div class="none" align="center"><?php echo AVAILABLE_ACADEMY;?></div></td></tr>
|
||||
<?php endif;?>
|
||||
+24
-28
@@ -1,35 +1,31 @@
|
||||
<?php
|
||||
// 31.tpl - CITYWALL
|
||||
global $village, $building, $bid31, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$current = $level > 0 ? (int)$bid31[$level]['attri'] : 0;
|
||||
?>
|
||||
<div id="build" class="gid31">
|
||||
<h1><?php echo CITYWALL; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo CITYWALL_DESC; ?></p>
|
||||
<h1><?php echo CITYWALL;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo CITYWALL_DESC;?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_NOW; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid31[$village->resarray['f'.$id]]['attri'] : 0; ?></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){
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_NOW;?></th>
|
||||
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
|
||||
$next = $level + 1 + $loopsame + $doublebuild + $master;
|
||||
$next = $next > 20 ? 20 : $next;
|
||||
?>
|
||||
<th><?php echo DEFENCE_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_LEVEL;?> <?php echo $next;?>:</th>
|
||||
<td><b><?php echo (int)$bid31[$next]['attri'];?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
<td><b><?php echo $bid31[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo DEFENCE_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid31[20]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+24
-28
@@ -1,35 +1,31 @@
|
||||
<?php
|
||||
// 32.tpl - EARTHWALL
|
||||
global $village, $building, $bid32, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$current = $level > 0 ? (int)$bid32[$level]['attri'] : 0;
|
||||
?>
|
||||
<div id="build" class="gid32">
|
||||
<h1><?php echo EARTHWALL; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo EARTHWALL_DESC; ?></p>
|
||||
<h1><?php echo EARTHWALL;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo EARTHWALL_DESC;?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_NOW; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid32[$village->resarray['f'.$id]]['attri'] : 0; ?></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){
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_NOW;?></th>
|
||||
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
|
||||
$next = $level + 1 + $loopsame + $doublebuild + $master;
|
||||
$next = $next > 20 ? 20 : $next;
|
||||
?>
|
||||
<th><?php echo DEFENCE_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_LEVEL;?> <?php echo $next;?>:</th>
|
||||
<td><b><?php echo (int)$bid32[$next]['attri'];?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
<td><b><?php echo $bid32[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo DEFENCE_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid32[20]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+24
-28
@@ -1,35 +1,31 @@
|
||||
<?php
|
||||
// 33.tpl - PALISADE
|
||||
global $village, $building, $bid33, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$current = $level > 0 ? (int)$bid33[$level]['attri'] : 0;
|
||||
?>
|
||||
<div id="build" class="gid33">
|
||||
<h1><?php echo PALISADE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo PALISADE_DESC; ?></p>
|
||||
<h1><?php echo PALISADE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo PALISADE_DESC;?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_NOW; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid33[$village->resarray['f'.$id]]['attri'] : 0; ?></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){
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_NOW;?></th>
|
||||
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
|
||||
$next = $level + 1 + $loopsame + $doublebuild + $master;
|
||||
$next = $next > 20 ? 20 : $next;
|
||||
?>
|
||||
<th><?php echo DEFENCE_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<tr>
|
||||
<th><?php echo DEFENCE_LEVEL;?> <?php echo $next;?>:</th>
|
||||
<td><b><?php echo (int)$bid33[$next]['attri'];?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
<td><b><?php echo $bid33[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo DEFENCE_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid33[20]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
// 34.tpl STONEMASON
|
||||
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid34"><a href="#" onClick="return Popup(34,4);" class="build_logo">
|
||||
|
||||
+33
-33
@@ -1,37 +1,37 @@
|
||||
<?php
|
||||
// 35.tpl
|
||||
|
||||
// 35.tpl - BREWERY
|
||||
|
||||
global $village, $building, $bid35, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid35"><a href="#" onClick="return Popup(35,4);" class="build_logo">
|
||||
<img class="building g35" src="img/x.gif" alt="Brewery" title="<?php echo BREWERY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo BREWERY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo BREWERY_DESC; ?></p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_BONUS; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid35[$village->resarray['f'.$id]]['attri'] : 0; ?></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 <= 10){
|
||||
?>
|
||||
<th><?php echo BONUS_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid35[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo BONUS_LEVEL; ?> 10:</th>
|
||||
<td><b><?php echo $bid35[10]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$current = $level > 0 ? (int)$bid35[$level]['attri'] : 0;
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid35">
|
||||
<a href="#" onClick="return Popup(35,4);" class="build_logo">
|
||||
<img class="building g35" src="img/x.gif" alt="Brewery" title="<?php echo BREWERY;?>" />
|
||||
</a>
|
||||
<h1><?php echo BREWERY;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo BREWERY_DESC;?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_BONUS;?></th>
|
||||
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
|
||||
$next = $level + 1 + $loopsame + $doublebuild + $master;
|
||||
$next = $next > 10 ? 10 : $next;
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo BONUS_LEVEL;?> <?php echo $next;?>:</th>
|
||||
<td><b><?php echo (int)$bid35[$next]['attri'];?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+101
-126
@@ -1,135 +1,110 @@
|
||||
<?php
|
||||
// 36.tpl - TRAPS
|
||||
global $village, $building, $technology, $generator, $database, $session, $bid19, $bid36, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$currentCap = $level > 0? (int)$bid36[$level]['attri'] * TRAPPER_CAPACITY : 0;
|
||||
?>
|
||||
<div id="build" class="gid36"><h1><?php echo TRAPPER; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(36,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g36"
|
||||
src="img/x.gif" alt="Trapper"
|
||||
title="<?php echo TRAPPER; ?>" /> </a>
|
||||
<?php echo TRAPPER_DESC; ?> </p>
|
||||
<div id="build" class="gid36">
|
||||
<h1><?php echo TRAPPER;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(36,4,'gid');" class="build_logo">
|
||||
<img class="building g36" src="img/x.gif" alt="Trapper" title="<?php echo TRAPPER;?>" />
|
||||
</a>
|
||||
<?php echo TRAPPER_DESC;?>
|
||||
</p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_TRAPS; ?></th>
|
||||
<td><b><?php echo $bid36[$village->resarray['f'.$id]]['attri'] * TRAPPER_CAPACITY; ?></b> <?php echo TRAPS; ?></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 TRAPS_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid36[$next]['attri'] * TRAPPER_CAPACITY; ?></b> <?php echo TRAPS; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo TRAPS_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid36[20]['attri'] * TRAPPER_CAPACITY; ?></b> <?php echo TRAPS; ?></td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_TRAPS;?></th>
|
||||
<td><b><?php echo $currentCap;?></b> <?php echo TRAPS;?></td>
|
||||
</tr>
|
||||
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
|
||||
$next = $level + 1 + $loopsame + $doublebuild + $master;
|
||||
$next = $next > 20? 20 : $next;
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo TRAPS_LEVEL;?> <?php echo $next;?>:</th>
|
||||
<td><b><?php echo (int)$bid36[$next]['attri'] * TRAPPER_CAPACITY;?></b> <?php echo TRAPS;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<p><?php echo CURRENT_HAVE; ?> <b><?php echo $village->unitarray['u99']; ?></b> <?php echo TRAPS; ?>, <b><?php echo $village->unitarray['u99o']; ?></b> <?php echo WHICH_OCCUPIED; ?></p>
|
||||
<?php if ($building->getTypeLevel(36) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<p><?php echo CURRENT_HAVE;?> <b><?php echo (int)$village->unitarray['u99'];?></b> <?php echo TRAPS;?>, <b><?php echo (int)$village->unitarray['u99o'];?></b> <?php echo WHICH_OCCUPIED;?></p>
|
||||
|
||||
<tr>
|
||||
<td><?php echo NAME; ?></td>
|
||||
<td><?php echo QUANTITY; ?></td>
|
||||
<td><?php echo MAX; ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($building->getTypeLevel(36) > 0):
|
||||
$trainlist = $technology->getTrainingList(8);
|
||||
$train_amt = 0;
|
||||
foreach ($trainlist as $t) $train_amt += (int)$t['amt'];
|
||||
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><img class="unit u99" src="img/x.gif"
|
||||
alt="Trap"
|
||||
title="Trap" /> <a href="#"
|
||||
onClick="return Popup(36,4,'gid');"><?php echo TRAP; ?></a> <span class="info">(<?php echo AVAILABLE; ?>: <?php echo $village->unitarray['u99']; ?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<span><img class="r1" src="img/x.gif"
|
||||
alt="Lumber" title="<?php echo LUMBER; ?>" />20|</span><span><img class="r2" src="img/x.gif"
|
||||
alt="Clay" title="<?php echo CLAY; ?>" />30|</span><span><img class="r3" src="img/x.gif"
|
||||
alt="Iron" title="<?php echo IRON; ?>" />10|</span><span><img class="r4" src="img/x.gif"
|
||||
alt="Crop" title="<?php echo CROP; ?>" />20|</span><span><img class="r5" src="img/x.gif" alt="Crop consumption"
|
||||
title="<?php echo CROP_COM; ?>" />0|<img class="clock" src="img/x.gif"
|
||||
alt="Duration" title="<?php echo DURATION; ?>" />
|
||||
<?php echo $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(($bid19[$village->resarray['f'.$id]]['attri'] / 100) * ${'u99'}['time'] / SPEED))); ?>
|
||||
</span>
|
||||
$max = $technology->maxUnit(99, false);
|
||||
$max1 = 0;
|
||||
for ($i = 19; $i < 41; $i++) {
|
||||
if ((int)$village->resarray['f'.$i.'t'] == 36) {
|
||||
$max1 += (int)$bid36[(int)$village->resarray['f'.$i]]['attri'] * TRAPPER_CAPACITY;
|
||||
}
|
||||
}
|
||||
$max = min($max, $max1 - ((int)$village->unitarray['u99'] + $train_amt));
|
||||
if ($max < 0) $max = 0;
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<?php
|
||||
$trainlist = $technology->getTrainingList(8);
|
||||
foreach($trainlist as $train) $train_amt += $train['amt'];
|
||||
|
||||
$max = $technology->maxUnit(99, false);
|
||||
$max1 = 0;
|
||||
for($i = 19; $i < 41; $i++){
|
||||
if($village->resarray['f'.$i.'t'] == 36){
|
||||
$max1 += $bid36[$village->resarray['f'.$i]]['attri'] * TRAPPER_CAPACITY;
|
||||
}
|
||||
}
|
||||
$time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(($bid19[$level]['attri'] / 100) * ${'u99'}['time'] / SPEED));
|
||||
?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo NAME;?></td><td><?php echo QUANTITY;?></td><td><?php echo MAX;?></td></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u99" src="img/x.gif" alt="Trap" title="Trap" />
|
||||
<a href="#" onClick="return Popup(36,4,'gid');"><?php echo TRAP;?></a>
|
||||
<span class="info">(<?php echo AVAILABLE;?>: <?php echo (int)$village->unitarray['u99'];?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/>20|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/>30|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/>10|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/>20|
|
||||
<img class="r5" src="img/x.gif" title="<?php echo CROP_COM;?>"/>0|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $generator->getTimeFormat($time);?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t99" value="0" maxlength="4"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t99.value=<?php echo $max;?>; return false;">(<?php echo $max;?>)</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" onclick="this.disabled=true;this.form.submit();"/></p>
|
||||
</form>
|
||||
<?php else:?>
|
||||
<b><?php echo TRAINING_COMMENCE_TRAPPER;?></b><br />
|
||||
<?php endif;?>
|
||||
|
||||
if (!isset($train_amt)) $train_amt = 0;
|
||||
|
||||
if($max > $max1 - ($village->unitarray['u99'] + $train_amt)){
|
||||
$max = $max1 - ($village->unitarray['u99'] + $train_amt);
|
||||
}
|
||||
|
||||
if($max < 0) $max = 0;
|
||||
?>
|
||||
<td class="val"><input type="text" class="text" name="t99" value="0" maxlength="4"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t99.value=<?php echo $max; ?>">(<?php echo $max; ?>)</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" onclick="this.disabled=true;this.form.submit();"/></p></form>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>".TRAINING_COMMENCE_TRAPPER."</b><br>\n";
|
||||
}
|
||||
if(!empty($trainlist)) {
|
||||
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=\"".U99."\" title=\"".U99."\" />";
|
||||
echo $train['amt']." ".U99."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp'] - time()) - ($train['amt'] - 1) * $train['eachtime']);
|
||||
echo "<span id=timer1>".$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="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
<?php 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++;?>
|
||||
<tr>
|
||||
<td class="desc"><img class="unit u<?php echo $train['unit'];?>" src="img/x.gif" alt="<?php echo U99;?>" title="<?php echo U99;?>" /><?php echo $train['amt'];?> <?php echo U99;?></td>
|
||||
<td class="dur">
|
||||
<?php if ($TrainCount == 1): $NextFinished = $generator->getTimeFormat(($train['timestamp'] - time()) - ($train['amt'] - 1) * $train['eachtime']);?>
|
||||
<span id="timer1"><?php echo $generator->getTimeFormat($train['timestamp'] - time());?></span>
|
||||
<?php else:?>
|
||||
<?php echo $generator->getTimeFormat($train['eachtime'] * $train['amt']);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class="fin"><?php $time = $generator->procMTime($train['timestamp']); 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="timer2"><?php echo $NextFinished;?></span></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+29
-33
@@ -1,38 +1,34 @@
|
||||
<?php
|
||||
// 38.tpl - GREATWAREHOUSE
|
||||
global $village, $building, $bid38, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$current = $level > 0 ? (int)$bid38[$level]['attri'] * STORAGE_MULTIPLIER : 0;
|
||||
?>
|
||||
<div id="build" class="gid38"><a href="#" onClick="return Popup(38,4);" class="build_logo">
|
||||
<img class="building g38" src="img/x.gif" alt="Great Warehouse" title="<?php echo GREATWAREHOUSE; ?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATWAREHOUSE; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATWAREHOUSE_DESC; ?></p>
|
||||
<div id="build" class="gid38">
|
||||
<a href="#" onClick="return Popup(38,4);" class="build_logo">
|
||||
<img class="building g38" src="img/x.gif" alt="Great Warehouse" title="<?php echo GREATWAREHOUSE;?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATWAREHOUSE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATWAREHOUSE_DESC;?></p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CAPACITY; ?></th>
|
||||
<td><b><?php echo $bid38[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo RESOURCE_UNITS; ?></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){
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CAPACITY;?></th>
|
||||
<td><b><?php echo $current;?></b> <?php echo RESOURCE_UNITS;?></td>
|
||||
</tr>
|
||||
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
|
||||
$next = $level + 1 + $loopsame + $doublebuild + $master;
|
||||
$next = $next > 20 ? 20 : $next;
|
||||
?>
|
||||
<th><?php echo CAPACITY_LEVEL; ?> <?php echo $next ?>:</th>
|
||||
<td><b><?php echo $bid38[$next]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo RESOURCE_UNITS; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo CAPACITY_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid38[20]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo RESOURCE_UNITS; ?></td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
<tr>
|
||||
<th><?php echo CAPACITY_LEVEL;?> <?php echo $next;?>:</th>
|
||||
<td><b><?php echo (int)$bid38[$next]['attri'] * STORAGE_MULTIPLIER;?></b> <?php echo RESOURCE_UNITS;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+29
-34
@@ -1,39 +1,34 @@
|
||||
<?php
|
||||
// 39.tpl - GREATGRANARY
|
||||
global $village, $building, $bid39, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$current = $level > 0 ? (int)$bid39[$level]['attri'] * STORAGE_MULTIPLIER : 0;
|
||||
?>
|
||||
<div id="build" class="gid39"><a href="#" onClick="return Popup(39,4);" class="build_logo">
|
||||
<img class="building g39" src="img/x.gif" alt="Great Granary" title="<?php echo GREATGRANARY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATGRANARY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATGRANARY_DESC; ?></p>
|
||||
<div id="build" class="gid39">
|
||||
<a href="#" onClick="return Popup(39,4);" class="build_logo">
|
||||
<img class="building g39" src="img/x.gif" alt="Great Granary" title="<?php echo GREATGRANARY;?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATGRANARY;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATGRANARY_DESC;?></p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CAPACITY; ?></th>
|
||||
<td><b><?php echo $bid39[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo CROP_UNITS; ?></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){
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CAPACITY;?></th>
|
||||
<td><b><?php echo $current;?></b> <?php echo CROP_UNITS;?></td>
|
||||
</tr>
|
||||
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
|
||||
$next = $level + 1 + $loopsame + $doublebuild + $master;
|
||||
$next = $next > 20 ? 20 : $next;
|
||||
?>
|
||||
<th><?php echo CAPACITY_LEVEL; ?> <?php echo $next ?>:</th>
|
||||
<td><b><?php echo $bid39[$next]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo CROP_UNITS; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo CAPACITY_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid39[20]['attri']*STORAGE_MULTIPLIER; ?></b> <?php echo CROP_UNITS; ?></td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
<tr>
|
||||
<th><?php echo CAPACITY_LEVEL;?> <?php echo $next;?>:</th>
|
||||
<td><b><?php echo (int)$bid39[$next]['attri'] * STORAGE_MULTIPLIER;?></b> <?php echo CROP_UNITS;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+44
-52
@@ -1,56 +1,48 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
|
||||
// CROPLAND
|
||||
|
||||
include 'next.tpl';
|
||||
|
||||
// — pregătire date —
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentProd = $bid4[$currentLevel]['prod'] * SPEED;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = ($village->capital == 1) ? 20 : 10;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextProd = $bid4[$nextLevel]['prod'] * SPEED;
|
||||
?>
|
||||
<div id="build" class="gid4"><a href="#" onClick="return Popup(4,4);" class="build_logo">
|
||||
<img class="building g4" src="img/x.gif" alt="<?php echo CROPLAND; ?>" title="<?php echo CROPLAND; ?>" />
|
||||
</a>
|
||||
<h1><?php echo CROPLAND; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id];?></span></h1>
|
||||
<p class="build_desc"><?php echo CROPLAND_DESC; ?></p>
|
||||
<div id="build" class="gid4">
|
||||
<a href="#" onclick="return Popup(4,4);" class="build_logo">
|
||||
<img class="building g4" src="img/x.gif" alt="<?= CROPLAND ?>" title="<?= CROPLAND ?>">
|
||||
</a>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CUR_PROD; ?></th>
|
||||
<td><b><?php echo $bid4[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
|
||||
if($village->capital == 1) {
|
||||
if($next<=20){
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid4[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo 20; ?>:</th>
|
||||
<td><b><?php echo $bid4[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}}else{
|
||||
if($next<=10){
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid4[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
|
||||
<td><b><?php echo $bid4[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<h1>
|
||||
<?= CROPLAND ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?></p></div>
|
||||
<p class="build_desc"><?= CROPLAND_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CUR_PROD ?>:</th>
|
||||
<td><b><?= $currentProd ?></b> <?= PER_HR ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= NEXT_PROD ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextProd ?></b> <?= PER_HR ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+34
-31
@@ -1,32 +1,35 @@
|
||||
<div id="build" class="gid41"><a href="#" onClick="return Popup(41,4);" class="build_logo">
|
||||
<img class="building g41" src="img/x.gif" alt="Horse Drinking Trough" title="<?php echo HORSEDRINKING; ?>" />
|
||||
</a>
|
||||
<h1><?php echo HORSEDRINKING; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo HORSEDRINKING_DESC; ?></p>
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_BONUS; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid41[$village->resarray['f'.$id]]['attri'] * 100 - 100 : 0; ?></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 BONUS_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid41[$next]['attri'] * 100 - 100; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo BONUS_LEVEL; ?> 20:</th>
|
||||
<td><b><?php echo $bid41[20]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
<?php
|
||||
// 41.tpl - HORSEDRINKING
|
||||
global $village, $building, $bid41, $id, $loopsame, $doublebuild, $master;
|
||||
|
||||
include("next.tpl");
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
$current = $level > 0 ? (int)($bid41[$level]['attri'] * 100 - 100) : 0;
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid41">
|
||||
<a href="#" onClick="return Popup(41,4);" class="build_logo">
|
||||
<img class="building g41" src="img/x.gif" alt="Horse Drinking Trough" title="<?php echo HORSEDRINKING;?>" />
|
||||
</a>
|
||||
<h1><?php echo HORSEDRINKING;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo HORSEDRINKING_DESC;?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_BONUS;?></th>
|
||||
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
|
||||
$next = $level + 1 + $loopsame + $doublebuild + $master;
|
||||
$next = $next > 20 ? 20 : $next;
|
||||
$nextBonus = (int)($bid41[$next]['attri'] * 100 - 100);
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo BONUS_LEVEL;?> <?php echo $next;?>:</th>
|
||||
<td><b><?php echo $nextBonus;?></b> <?php echo PERCENT;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
+56
-57
@@ -1,59 +1,58 @@
|
||||
<div id="build" class="gid42"><a href="#" onClick="return Popup(42,4);" class="build_logo">
|
||||
<img class="building g42" src="img/x.gif" alt="Great Workshop" title="<?php echo GREATWORKSHOP; ?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATWORKSHOP; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATWORKSHOP_DESC; ?></p>
|
||||
<?php
|
||||
// 42.tpl - GREATWORKSHOP
|
||||
global $village, $building, $technology, $generator, $session, $id;
|
||||
|
||||
<?php if ($building->getTypeLevel(42) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td><?php echo NAME; ?></td>
|
||||
<td><?php echo QUANTITY; ?></td>
|
||||
<td><?php echo MAX; ?></td>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
include("42_train.tpl");
|
||||
?></table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>".TRAINING_COMMENCE_GREATWORKSHOP."</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(7);
|
||||
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 }
|
||||
include("upgrade.tpl");
|
||||
include("next.tpl");
|
||||
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid42">
|
||||
<a href="#" onClick="return Popup(42,4);" class="build_logo">
|
||||
<img class="building g42" src="img/x.gif" alt="Great Workshop" title="<?php echo GREATWORKSHOP;?>" />
|
||||
</a>
|
||||
<h1><?php echo GREATWORKSHOP;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo GREATWORKSHOP_DESC;?></p>
|
||||
|
||||
<?php if ($building->getTypeLevel(42) > 0):?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr><td><?php echo NAME;?></td><td><?php echo QUANTITY;?></td><td><?php echo MAX;?></td></tr></thead>
|
||||
<tbody>
|
||||
<?php include("42_train.tpl");?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></p>
|
||||
</form>
|
||||
<?php else:?>
|
||||
<b><?php echo TRAINING_COMMENCE_GREATWORKSHOP;?></b><br />
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
$trainlist = $technology->getTrainingList(7);
|
||||
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++;?>
|
||||
<tr>
|
||||
<td class="desc"><img class="unit u<?php echo $train['unit'];?>" src="img/x.gif" alt="<?php echo $train['name'];?>" title="<?php echo $train['name'];?>" /><?php echo $train['amt'];?> <?php echo $train['name'];?></td>
|
||||
<td class="dur">
|
||||
<?php if ($TrainCount == 1): $NextFinished = $generator->getTimeFormat($train['timestamp2'] - time());?>
|
||||
<span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($train['timestamp'] - time());?></span>
|
||||
<?php else:?>
|
||||
<?php echo $generator->getTimeFormat($train['eachtime'] * $train['amt']);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class="fin"><?php $time = $generator->procMTime($train['timestamp']); 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;?>
|
||||
|
||||
<?php include("upgrade.tpl");?>
|
||||
</div>
|
||||
@@ -1,31 +1,61 @@
|
||||
<?php
|
||||
// 42_train.tpl -
|
||||
global $session, $technology, $village, $generator, $database, $building, $bid42, $id;
|
||||
|
||||
$success = 0;
|
||||
for ($i=($session->tribe-1)*10+7;$i<=($session->tribe-1)*10+8;$i++) {
|
||||
if ($technology->getTech($i)) {
|
||||
$success++;
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(".AVAILABLE.": ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"".LUMBER."\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$dur = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo $generator->getTimeFormat($dur);
|
||||
$start = ($session->tribe - 1) * 10 + 7;
|
||||
$end = $start + 1; // ram + catapult
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||
for ($i = $start; $i <= $end; $i++) {
|
||||
if (!$technology->getTech($i)) continue;
|
||||
$success++;
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,true)."; return false;\">(".$technology->maxUnit($i,true).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td colspan=\"3\"><div class=\"none\" align=\"center\">".AVAILABLE_ACADEMY."</div></td></tr>";
|
||||
$unit = ${'u'.$i};
|
||||
$name = $technology->getUnitName($i);
|
||||
$wood = $unit['wood'] * 3;
|
||||
$clay = $unit['clay'] * 3;
|
||||
$iron = $unit['iron'] * 3;
|
||||
$crop = $unit['crop'] * 3;
|
||||
$pop = $unit['pop'];
|
||||
|
||||
$dur = $database->getArtifactsValueInfluence(
|
||||
$session->uid, $village->wid, 5,
|
||||
round($unit['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 100) / SPEED)
|
||||
);
|
||||
$max = $technology->maxUnit($i, true);
|
||||
?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo $name;?>" title="<?php echo $name;?>" />
|
||||
<a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo $name;?></a>
|
||||
<span class="info">(<?php echo AVAILABLE;?>: <?php echo (int)$village->unitarray['u'.$i];?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo $wood;?>|
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo $clay;?>|
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo $iron;?>|
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo $crop;?>|
|
||||
<img class="r5" src="img/x.gif" title="<?php echo CROP_COM;?>"/><?php echo $pop;?>|
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $generator->getTimeFormat($dur);?>
|
||||
<?php
|
||||
$total_required = $unit['wood'] + $unit['clay'] + $unit['iron'] + $unit['crop'];
|
||||
if ($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required):
|
||||
$r1 = $unit['wood'] * $technology->maxUnitPlus($i);
|
||||
$r2 = $unit['clay'] * $technology->maxUnitPlus($i);
|
||||
$r3 = $unit['iron'] * $technology->maxUnitPlus($i);
|
||||
$r4 = $unit['crop'] * $technology->maxUnitPlus($i);
|
||||
?>
|
||||
|<a href="build.php?gid=17&t=3&r1=<?php echo $r1;?>&r2=<?php echo $r2;?>&r3=<?php echo $r3;?>&r4=<?php echo $r4;?>" title="NPC trade"><img class="npc" src="img/x.gif" alt="NPC trade" /></a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t<?php echo $i;?>" value="0" maxlength="4"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t<?php echo $i;?>.value=<?php echo $max;?>; return false;">(<?php echo $max;?>)</a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
if ($success == 0): ?>
|
||||
<tr><td colspan="3"><div class="none" align="center"><?php echo AVAILABLE_ACADEMY;?></div></td></tr>
|
||||
<?php endif; ?>
|
||||
+43
-33
@@ -1,37 +1,47 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid5"><a href="#" onClick="return Popup(5,4);" class="build_logo">
|
||||
<img class="building g5" src="img/x.gif" alt="Sawmill" title="<?php echo SAWMILL; ?>" />
|
||||
</a>
|
||||
<h1><?php echo SAWMILL; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo SAWMILL_DESC; ?></p>
|
||||
|
||||
// SAWMILL
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_WOOD_BONUS; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid5[$village->resarray['f'.$id]]['attri'] : 0; ?></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<=5){
|
||||
?>
|
||||
<th><?php echo WOOD_BONUS_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid5[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo WOOD_BONUS_LEVEL; ?> 5:</th>
|
||||
<td><b><?php echo $bid5[5]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentBonus = $currentLevel > 0 ? $bid5[$currentLevel]['attri'] : 0;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 5; // sawmill e max 5
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextBonus = $bid5[$nextLevel]['attri'];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid5">
|
||||
<a href="#" onclick="return Popup(5,4);" class="build_logo">
|
||||
<img class="building g5" src="img/x.gif" alt="<?= SAWMILL ?>" title="<?= SAWMILL ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= SAWMILL ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= SAWMILL_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_WOOD_BONUS ?>:</th>
|
||||
<td><b><?= $currentBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= WOOD_BONUS_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+43
-33
@@ -1,37 +1,47 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid6"><a href="#" onClick="return Popup(6,4);" class="build_logo">
|
||||
<img class="building g6" src="img/x.gif" alt="Brickyard" title="<?php echo BRICKYARD; ?>" />
|
||||
</a>
|
||||
<h1><?php echo BRICKYARD; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo BRICKYARD_DESC; ?></p>
|
||||
|
||||
// BRICKYARD
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CLAY_BONUS; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid6[$village->resarray['f'.$id]]['attri'] : 0; ?></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 <= 5){
|
||||
?>
|
||||
<th><?php echo CLAY_BONUS_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid6[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo CLAY_BONUS_LEVEL; ?> 5:</th>
|
||||
<td><b><?php echo $bid6[5]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentBonus = $currentLevel > 0 ? $bid6[$currentLevel]['attri'] : 0;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 5;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextBonus = $bid6[$nextLevel]['attri'];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid6">
|
||||
<a href="#" onclick="return Popup(6,4);" class="build_logo">
|
||||
<img class="building g6" src="img/x.gif" alt="<?= BRICKYARD ?>" title="<?= BRICKYARD ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= BRICKYARD ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= BRICKYARD_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_CLAY_BONUS ?>:</th>
|
||||
<td><b><?= $currentBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= CLAY_BONUS_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+43
-33
@@ -1,37 +1,47 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid7"><a href="#" onClick="return Popup(7,4);" class="build_logo">
|
||||
<img class="building g7" src="img/x.gif" alt="Iron Foundry" title="<?php echo IRONFOUNDRY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo IRONFOUNDRY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo IRONFOUNDRY_DESC; ?></p>
|
||||
|
||||
// IRONFOUNDRY
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_IRON_BONUS; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid7[$village->resarray['f'.$id]]['attri'] : 0; ?></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<=5){
|
||||
?>
|
||||
<th><?php echo IRON_BONUS_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid7[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo IRON_BONUS_LEVEL; ?> 5:</th>
|
||||
<td><b><?php echo $bid7[5]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentBonus = $currentLevel > 0 ? $bid7[$currentLevel]['attri'] : 0;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 5;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextBonus = $bid7[$nextLevel]['attri'];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid7">
|
||||
<a href="#" onclick="return Popup(7,4);" class="build_logo">
|
||||
<img class="building g7" src="img/x.gif" alt="<?= IRONFOUNDRY ?>" title="<?= IRONFOUNDRY ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= IRONFOUNDRY ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= IRONFOUNDRY_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_IRON_BONUS ?>:</th>
|
||||
<td><b><?= $currentBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= IRON_BONUS_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+43
-33
@@ -1,37 +1,47 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid8"><a href="#" onClick="return Popup(8,4);" class="build_logo">
|
||||
<img class="building g8" src="img/x.gif" alt="Grain Mill" title="<?php echo GRAINMILL; ?>" />
|
||||
</a>
|
||||
<h1><?php echo GRAINMILL; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo GRAINMILL_DESC; ?></p>
|
||||
|
||||
// GRAINMILL
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CROP_BONUS; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid8[$village->resarray['f'.$id]]['attri'] : 0; ?></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 <= 5){
|
||||
?>
|
||||
<th><?php echo CROP_BONUS_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid8[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo CROP_BONUS_LEVEL; ?> 5:</th>
|
||||
<td><b><?php echo $bid8[5]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentBonus = $currentLevel > 0 ? $bid8[$currentLevel]['attri'] : 0;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 5;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextBonus = $bid8[$nextLevel]['attri'];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid8">
|
||||
<a href="#" onclick="return Popup(8,4);" class="build_logo">
|
||||
<img class="building g8" src="img/x.gif" alt="<?= GRAINMILL ?>" title="<?= GRAINMILL ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= GRAINMILL ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= GRAINMILL_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_CROP_BONUS ?>:</th>
|
||||
<td><b><?= $currentBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= CROP_BONUS_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
+43
-33
@@ -1,37 +1,47 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
?>
|
||||
<div id="build" class="gid9"><a href="#" onClick="return Popup(9,4);" class="build_logo">
|
||||
<img class="building g9" src="img/x.gif" alt="Bakery" title="<?php echo BAKERY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo BAKERY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo BAKERY_DESC; ?></p>
|
||||
|
||||
// BAKERY
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_CROP_BONUS; ?></th>
|
||||
<td><b><?php echo $village->resarray['f'.$id] > 0 ? $bid9[$village->resarray['f'.$id]]['attri'] : 0; ?></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 <= 5){
|
||||
?>
|
||||
<th><?php echo CROP_BONUS_LEVEL; ?> <?php echo $next; ?>:</th>
|
||||
<td><b><?php echo $bid9[$next]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<th><?php echo CROP_BONUS_LEVEL; ?> 5:</th>
|
||||
<td><b><?php echo $bid9[5]['attri']; ?></b> <?php echo PERCENT; ?></td>
|
||||
<?php
|
||||
}}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
include 'next.tpl';
|
||||
|
||||
$field = 'f' . $id;
|
||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||
|
||||
$currentBonus = $currentLevel > 0 ? $bid9[$currentLevel]['attri'] : 0;
|
||||
|
||||
$isMax = $building->isMax($buildingType, $id);
|
||||
$maxLevel = 5;
|
||||
|
||||
$nextLevelRaw = $currentLevel + 1 + $loopsame + $doublebuild + $master;
|
||||
$nextLevel = min($nextLevelRaw, $maxLevel);
|
||||
$nextBonus = $bid9[$nextLevel]['attri'];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid9">
|
||||
<a href="#" onclick="return Popup(9,4);" class="build_logo">
|
||||
<img class="building g9" src="img/x.gif" alt="<?= BAKERY ?>" title="<?= BAKERY ?>">
|
||||
</a>
|
||||
|
||||
<h1>
|
||||
<?= BAKERY ?>
|
||||
<span class="level"><?= LEVEL ?> <?= $currentLevel ?></span>
|
||||
</h1>
|
||||
|
||||
<p class="build_desc"><?= BAKERY_DESC ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?= CURRENT_CROP_BONUS ?>:</th>
|
||||
<td><b><?= $currentBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!$isMax): ?>
|
||||
<tr>
|
||||
<th><?= CROP_BONUS_LEVEL ?> <?= $nextLevel ?>:</th>
|
||||
<td><b><?= $nextBonus ?></b> <?= PERCENT ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<?php include 'upgrade.tpl'; ?>
|
||||
</div>
|
||||
@@ -1,89 +1,84 @@
|
||||
<?php
|
||||
$bid = $_GET['bid'];
|
||||
unset($_GET['bid']);
|
||||
$bindicator = $building->canBuild($id,$bid);
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* availupgrade.tpl - fix redeclare + PHP 8.2 safe
|
||||
* NU mai declară funcții, folosește variabilă
|
||||
*/
|
||||
$bid = (int)($_GET['bid']?? 0);
|
||||
$id = (int)$id;
|
||||
|
||||
$bindicator = (int)$building->canBuild($id, $bid);
|
||||
$uprequire = $building->resourceRequired($id, $bid);
|
||||
|
||||
// --- pregătim o singură dată HTML-ul pentru Master Builder ---
|
||||
$masterBuilderHtml = '';
|
||||
if ($session->goldclub == 1) {
|
||||
$canUse = ($session->gold >= 1 && $village->master == 0);
|
||||
$checker = htmlspecialchars((string)$session->checker, ENT_QUOTES, 'UTF-8');
|
||||
$url = "dorf2.php?master={$bid}&id={$id}&c={$checker}";
|
||||
$label = htmlspecialchars(CONSTRUCTING_MASTER_BUILDER, ENT_QUOTES, 'UTF-8');
|
||||
$goldIcon = htmlspecialchars(GP_LOCATE. 'img/a/gold_g.gif', ENT_QUOTES, 'UTF-8');
|
||||
$cost = '<span class="gold-cost">(costs: <img src="'.$goldIcon.'" alt="Gold" title="Gold"/>1)</span>';
|
||||
|
||||
$masterBuilderHtml = $canUse
|
||||
? '<br><a class="build" href="'.htmlspecialchars($url, ENT_QUOTES, 'UTF-8').'">'.$label.'</a> '.$cost
|
||||
: '<br><span class="none">'.$label.'</span> '.$cost;
|
||||
}
|
||||
|
||||
$totalRequired = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
|
||||
$canNpc = ($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $totalRequired);
|
||||
?>
|
||||
<td class="res">
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $uprequire['wood']; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $uprequire['clay']; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $uprequire['iron']; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $uprequire['crop']; ?> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
} ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="link">
|
||||
<?php
|
||||
if($bindicator == 2) {
|
||||
echo "<span class=\"none\">" . WORKERS_ALREADY_WORK_WAITING . "</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&c=$session->checker\">" . CONSTRUCTING_MASTER_BUILDER . "</a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicator == 3) {
|
||||
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&c=$session->checker\">" . CONSTRUCTING_MASTER_BUILDER . "</a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicator == 4) {
|
||||
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
|
||||
}
|
||||
else if($bindicator == 5) {
|
||||
echo "<span class=\"none\">Upgrade Warehouse.</span>";
|
||||
}
|
||||
else if($bindicator == 6) {
|
||||
echo "<span class=\"none\">Upgrade Granary.</span>";
|
||||
}
|
||||
else if($bindicator == 7) {
|
||||
$neededtime = $building->calculateAvaliable($id,$bid);
|
||||
echo "<span class=\"none\">" .ENOUGH_RESOURCES . " " .$neededtime[0]." at ".$neededtime[1]."</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&c=$session->checker\">" . CONSTRUCTING_MASTER_BUILDER . "</a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicator == 8) {
|
||||
if($session->access!=BANNED){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=".$session->checker."\">". CONSTRUCT_BUILD."</a>";
|
||||
}else{
|
||||
echo "<a class=\"build\" href=\"banned.php\">". CONSTRUCT_BUILD."</a>";
|
||||
}
|
||||
}
|
||||
else if($bindicator == 9) {
|
||||
if($session->access!=BANNED){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=".$session->checker."\">Construct building. (waiting loop)</a>";
|
||||
}else{
|
||||
echo "<a class=\"build\" href=\"banned.php?a=$bid&id=$id&c=".$session->checker."\">Construct building. (waiting loop)</a>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?= (int)$uprequire['wood']?> |
|
||||
<img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?= (int)$uprequire['clay']?> |
|
||||
<img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?= (int)$uprequire['iron']?> |
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?= (int)$uprequire['crop']?> |
|
||||
<img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?= (int)$uprequire['pop']?> |
|
||||
<img class="clock" src="img/x.gif" alt="duration" title="duration" /><?= htmlspecialchars($generator->getTimeFormat($uprequire['time']), ENT_QUOTES, 'UTF-8')?>
|
||||
<?php if ($canNpc):?>
|
||||
| <a href="build.php?gid=17&t=3&r1=<?= (int)$uprequire['wood']?>&r2=<?= (int)$uprequire['clay']?>&r3=<?= (int)$uprequire['iron']?>&r4=<?= (int)$uprequire['crop']?>" title="NPC trade">
|
||||
<img class="npc" src="img/x.gif" alt="NPC trade" title="NPC trade" />
|
||||
</a>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="link">
|
||||
<?php
|
||||
switch ($bindicator) {
|
||||
case 2:
|
||||
echo '<span class="none">'.htmlspecialchars(WORKERS_ALREADY_WORK_WAITING, ENT_QUOTES, 'UTF-8').'</span>';
|
||||
echo $masterBuilderHtml;
|
||||
break;
|
||||
case 3:
|
||||
echo '<span class="none">The workers are already at work. (waiting loop)</span>';
|
||||
echo $masterBuilderHtml;
|
||||
break;
|
||||
case 4:
|
||||
echo '<span class="none">Not enough food. Expand cropland.</span>';
|
||||
break;
|
||||
case 5:
|
||||
echo '<span class="none">Upgrade Warehouse.</span>';
|
||||
break;
|
||||
case 6:
|
||||
echo '<span class="none">Upgrade Granary.</span>';
|
||||
break;
|
||||
case 7:
|
||||
$needed = $building->calculateAvaliable($id, $bid);
|
||||
echo '<span class="none">'.htmlspecialchars(ENOUGH_RESOURCES, ENT_QUOTES, 'UTF-8').' '.htmlspecialchars((string)$needed[0], ENT_QUOTES, 'UTF-8').' at '.htmlspecialchars((string)$needed[1], ENT_QUOTES, 'UTF-8').'</span>';
|
||||
echo $masterBuilderHtml;
|
||||
break;
|
||||
case 8:
|
||||
$url = ($session->access!= BANNED)
|
||||
? "dorf2.php?a={$bid}&id={$id}&c={$session->checker}"
|
||||
: "banned.php";
|
||||
echo '<a class="build" href="'.htmlspecialchars($url, ENT_QUOTES, 'UTF-8').'">'.htmlspecialchars(CONSTRUCT_BUILD, ENT_QUOTES, 'UTF-8').'</a>';
|
||||
break;
|
||||
case 9:
|
||||
$url = ($session->access!= BANNED)
|
||||
? "dorf2.php?a={$bid}&id={$id}&c={$session->checker}"
|
||||
: "banned.php?a={$bid}&id={$id}&c={$session->checker}";
|
||||
echo '<a class="build" href="'.htmlspecialchars($url, ENT_QUOTES, 'UTF-8').'">Construct building. (waiting loop)</a>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
|
||||
$master = count($database->getMasterJobsByField($village->wid,$id));
|
||||
// next.tpl - calculează offset-ul pentru nivelul următor
|
||||
global $building, $database, $village, $id;
|
||||
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id)) ? 1 : 0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id)) ? 1 : 0;
|
||||
$master = count($database->getMasterJobsByField($village->wid, $id));
|
||||
?>
|
||||
+80
-139
@@ -1,146 +1,87 @@
|
||||
<?php
|
||||
// upgrade.tpl
|
||||
global $village, $building, $database, $generator, $session, $technology, $id;
|
||||
|
||||
$bid = $village->resarray['f'.$id.'t'];
|
||||
$bid = (int)$village->resarray['f'.$id.'t'];
|
||||
$bindicate = $building->canBuild($id, $bid);
|
||||
if($bindicate == 1) {
|
||||
echo "<p><span class=\"none\">".MAX_LEVEL."</span></p>";
|
||||
} else if($bindicate == 10) {
|
||||
echo "<p><span class=\"none\">".BUILDING_MAX_LEVEL_UNDER."</span></p>";
|
||||
} else if($bindicate == 11) {
|
||||
echo "<p><span class=\"none\">".BUILDING_BEING_DEMOLISHED."</span></p>";
|
||||
} else {
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id)) ? 1 : 0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id)) ? 1 : 0;
|
||||
$master = count($database->getMasterJobsByField($village->wid,$id));
|
||||
|
||||
// master and loopsame would have duplicated level display,
|
||||
// so we need to decrease loopsame if master is the only job left
|
||||
if ($master == 1 && $loopsame == 1) $loopsame = 0;
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1 + $loopsame + $doublebuild + $master);
|
||||
?>
|
||||
<?php
|
||||
$total_required = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
|
||||
?>
|
||||
<p id="contract"><b><?php echo COSTS_UPGRADING_LEVEL;?> <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:<br />
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "| <a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
} ?><br />
|
||||
<?php
|
||||
if($bindicate == 2) {
|
||||
echo "<span class=\"none\">".WORKERS_ALREADY_WORK."</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&c=$session->checker\">".CONSTRUCTING_MASTER_BUILDER." </a>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">".CONSTRUCTING_MASTER_BUILDER."</span>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&c=$session->checker\">".CONSTRUCTING_MASTER_BUILDER." </a>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">".CONSTRUCTING_MASTER_BUILDER."</span>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicate == 3) {
|
||||
echo "<span class=\"none\">".WORKERS_ALREADY_WORK_WAITING."</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&c=$session->checker\">".CONSTRUCTING_MASTER_BUILDER." </a>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">".CONSTRUCTING_MASTER_BUILDER."</span>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&c=$session->checker\">".CONSTRUCTING_MASTER_BUILDER." </a>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">".CONSTRUCTING_MASTER_BUILDER."</span>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicate == 4) {
|
||||
echo "<span class=\"none\">".ENOUGH_FOOD_EXPAND_CROPLAND."</span>";
|
||||
}
|
||||
else if($bindicate == 5) {
|
||||
echo "<span class=\"none\">".UPGRADE_WAREHOUSE.".</span>";
|
||||
}
|
||||
else if($bindicate == 6) {
|
||||
echo "<span class=\"none\">".UPGRADE_GRANARY.".</span>";
|
||||
}
|
||||
else if($bindicate == 7) {
|
||||
if($village->allcrop - $village->pop - $technology->getUpkeep($village->unitall, 0) > 0){
|
||||
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
|
||||
echo "<span class=\"none\">".ENOUGH_RESOURCES." ".$neededtime[0]." at ".$neededtime[1]."</span>";
|
||||
}else{
|
||||
echo "<span class=\"none\">".YOUR_CROP_NEGATIVE."</span>";
|
||||
}
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&c=$session->checker\">".CONSTRUCTING_MASTER_BUILDER." </a>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">".CONSTRUCTING_MASTER_BUILDER."</span>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&c=$session->checker\">".CONSTRUCTING_MASTER_BUILDER." </a>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">".CONSTRUCTING_MASTER_BUILDER."</span>";
|
||||
echo '<font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicate == 8) {
|
||||
if($session->access==BANNED){
|
||||
echo "<a class=\"build\" href=\"banned.php\">".UPGRADE_LEVEL." ";
|
||||
}
|
||||
else if($id <= 18) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">".UPGRADE_LEVEL." ";
|
||||
}
|
||||
else {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">".UPGRADE_LEVEL." ";
|
||||
}
|
||||
echo $village->resarray['f'.$id]+1;
|
||||
echo ".</a>";
|
||||
}
|
||||
else if($bindicate == 9) {
|
||||
if($session->access==BANNED){
|
||||
echo "<a class=\"build\" href=\"banned.php\">".UPGRADE_LEVEL." ";
|
||||
}
|
||||
else if($id <= 18) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">".UPGRADE_LEVEL." ";
|
||||
}
|
||||
else {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">".UPGRADE_LEVEL." ";
|
||||
}
|
||||
echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1);
|
||||
echo ".</a> <span class=\"none\">".WAITING."</span> ";
|
||||
}
|
||||
if ($bindicate == 1) {
|
||||
echo '<p><span class="none">'.MAX_LEVEL.'</span></p>';
|
||||
return;
|
||||
}
|
||||
if ($bindicate == 10) {
|
||||
echo '<p><span class="none">'.BUILDING_MAX_LEVEL_UNDER.'</span></p>';
|
||||
return;
|
||||
}
|
||||
if ($bindicate == 11) {
|
||||
echo '<p><span class="none">'.BUILDING_BEING_DEMOLISHED.'</span></p>';
|
||||
return;
|
||||
}
|
||||
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))? 1 : 0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))? 1 : 0;
|
||||
$master = count($database->getMasterJobsByField($village->wid, $id));
|
||||
if ($master == 1 && $loopsame == 1) $loopsame = 0;
|
||||
|
||||
$nextLevel = (int)$village->resarray['f'.$id] + 1 + $loopsame + $doublebuild + $master;
|
||||
$uprequire = $building->resourceRequired($id, $bid, 1 + $loopsame + $doublebuild + $master);
|
||||
$total_required = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
|
||||
?>
|
||||
<p id="contract">
|
||||
<b><?php echo COSTS_UPGRADING_LEVEL;?> <?php echo $nextLevel;?>:</b><br />
|
||||
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><span class="little_res"><?php echo $uprequire['wood'];?></span> |
|
||||
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><span class="little_res"><?php echo $uprequire['clay'];?></span> |
|
||||
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><span class="little_res"><?php echo $uprequire['iron'];?></span> |
|
||||
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><span class="little_res"><?php echo $uprequire['crop'];?></span> |
|
||||
<img class="r5" src="img/x.gif" title="<?php echo CROP_COM;?>"/><?php echo $uprequire['pop'];?> |
|
||||
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $generator->getTimeFormat($uprequire['time']);?>
|
||||
<?php if ($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required):?>
|
||||
| <a href="build.php?gid=17&t=3&r1=<?php echo $uprequire['wood'];?>&r2=<?php echo $uprequire['clay'];?>&r3=<?php echo $uprequire['iron'];?>&r4=<?php echo $uprequire['crop'];?>" title="NPC trade"><img class="npc" src="img/x.gif" alt="NPC trade"/></a>
|
||||
<?php endif;?>
|
||||
<br />
|
||||
<?php
|
||||
switch ($bindicate) {
|
||||
case 2:
|
||||
echo '<span class="none">'.WORKERS_ALREADY_WORK.'</span>';
|
||||
break;
|
||||
case 3:
|
||||
echo '<span class="none">'.WORKERS_ALREADY_WORK_WAITING.'</span>';
|
||||
break;
|
||||
case 4:
|
||||
echo '<span class="none">'.ENOUGH_FOOD_EXPAND_CROPLAND.'</span>';
|
||||
break;
|
||||
case 5:
|
||||
echo '<span class="none">'.UPGRADE_WAREHOUSE.'.</span>';
|
||||
break;
|
||||
case 6:
|
||||
echo '<span class="none">'.UPGRADE_GRANARY.'.</span>';
|
||||
break;
|
||||
case 7:
|
||||
if ($village->allcrop - $village->pop - $technology->getUpkeep($village->unitall, 0) > 0) {
|
||||
$neededtime = $building->calculateAvaliable($id, $bid, 1 + $loopsame + $doublebuild + $master);
|
||||
echo '<span class="none">'.ENOUGH_RESOURCES.' '.$neededtime[0].' at '.$neededtime[1].'</span>';
|
||||
} else {
|
||||
echo '<span class="none">'.YOUR_CROP_NEGATIVE.'</span>';
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
$href = $session->access == BANNED? 'banned.php' : (($id <= 18)? "dorf1.php?a=$id&c=$session->checker" : "dorf2.php?a=$id&c=$session->checker");
|
||||
$lvl = $bindicate == 8? $village->resarray['f'.$id] + 1 : $village->resarray['f'.$id] + ($loopsame > 0? 2 : 1);
|
||||
echo '<a class="build" href="'.$href.'">'.UPGRADE_LEVEL.' '.$lvl.'.</a>';
|
||||
if ($bindicate == 9) echo ' <span class="none">'.WAITING.'</span>';
|
||||
break;
|
||||
}
|
||||
|
||||
if (in_array($bindicate, [2,3,7]) && $session->goldclub == 1) {
|
||||
echo '<br/>';
|
||||
$masterHref = ($id <= 18? 'dorf1.php' : 'dorf2.php'). "?master=$bid&id=$id&c=$session->checker";
|
||||
if ($session->gold >= 1 && $village->master == 0) {
|
||||
echo '<a class="build" href="'.$masterHref.'">'.CONSTRUCTING_MASTER_BUILDER.'</a>';
|
||||
} else {
|
||||
echo '<span class="none">'.CONSTRUCTING_MASTER_BUILDER.'</span>';
|
||||
}
|
||||
echo ' <font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
+33
-41
@@ -1,46 +1,38 @@
|
||||
<?php
|
||||
// ww.tpl - World Wonder
|
||||
global $building, $village, $database, $id, $session;
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename ww.tpl ##
|
||||
## Developed by: Dixie ##
|
||||
## Edited by: Dzoki ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
|
||||
?>
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id)) ? 1 : 0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id)) ? 1 : 0;
|
||||
|
||||
<div id="build" class="gid40"><a href="#" onClick="return Popup(40,4);" class="build_logo">
|
||||
<img class="building g40" src="img/x.gif" alt="World Wonder" title="<?php echo WORLD_WONDER;?>" />
|
||||
</a>
|
||||
<h1><?php echo WONDER;?> <br /><span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id];?></span></h1>
|
||||
<p class="build_desc"><?php echo WONDER_DESC;?></p>
|
||||
<form action="GameEngine/Game/WorldWonderName.php" method="POST">
|
||||
<?php
|
||||
$vref = $_SESSION['wid'];
|
||||
$vref = (int)$_SESSION['wid'];
|
||||
$wwname = $database->getWWName($vref);
|
||||
|
||||
if($village->resarray['f'.$id] < 0){
|
||||
echo ''.WORLD_WONDER_CHANGE_NAME.'.
|
||||
<center><br />'.WORLD_WONDER_NAME.': <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><button value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="trav_buttons" alt="OK" /> Ok </button></p>';
|
||||
} else if($village->resarray['f'.$id] > 0 and $village->resarray['f'.$id] < 11) {
|
||||
echo '<center><br />'.WORLD_WONDER_NAME.': <input class="text" name="wwname" id="wwname" value="'.$wwname.'" maxlength="20"></center><p class="btn"><button value="" tabindex="9" name="s1" id="btn_ok" class="trav_buttons" alt="OK" /> Ok </button></p>';
|
||||
} else if ($village->resarray['f'.$id] > 10){
|
||||
echo ''.WORLD_WONDER_NOTCHANGE_NAME.'.
|
||||
<center><br />'.WORLD_WONDER_NAME.': <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><button value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="trav_buttons" alt="OK" /> Ok </button></p>';
|
||||
}?>
|
||||
</form>
|
||||
<?php
|
||||
if(isset($_GET['n'])) {
|
||||
echo '<div style="text-align: center"><font color="Red"><b>'.WORLD_WONDER_NAME_CHANGED.'.</b></font></div><br />';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
include("wwupgrade.tpl");
|
||||
$level = (int)$village->resarray['f'.$id];
|
||||
?>
|
||||
</p></div>
|
||||
<div id="build" class="gid40">
|
||||
<a href="#" onClick="return Popup(40,4);" class="build_logo">
|
||||
<img class="building g40" src="img/x.gif" alt="World Wonder" title="<?php echo WORLD_WONDER;?>" />
|
||||
</a>
|
||||
<h1><?php echo WONDER;?><br /><span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
|
||||
<p class="build_desc"><?php echo WONDER_DESC;?></p>
|
||||
|
||||
<form action="GameEngine/Game/WorldWonderName.php" method="POST">
|
||||
<?php
|
||||
$disabled = ($level < 1 || $level > 10) ? 'disabled="disabled"' : '';
|
||||
$msg = $level < 0 ? WORLD_WONDER_CHANGE_NAME.'.' : ($level > 10 ? WORLD_WONDER_NOTCHANGE_NAME.'.' : '');
|
||||
if ($msg) echo $msg;
|
||||
?>
|
||||
<center><br /><?php echo WORLD_WONDER_NAME;?>:
|
||||
<input class="text" name="wwname" id="wwname" <?php echo $disabled;?> value="<?php echo htmlspecialchars($wwname);?>" maxlength="20">
|
||||
</center>
|
||||
<p class="btn">
|
||||
<button type="submit" tabindex="9" name="s1" id="btn_ok" class="trav_buttons" <?php echo $disabled;?> alt="OK">Ok</button>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<?php if (isset($_GET['n'])):?>
|
||||
<div style="text-align: center"><font color="Red"><b><?php echo WORLD_WONDER_NAME_CHANGED;?>.</b></font></div><br />
|
||||
<?php endif;?>
|
||||
|
||||
<?php include("wwupgrade.tpl");?>
|
||||
</div>
|
||||
+72
-145
@@ -1,154 +1,81 @@
|
||||
<?php
|
||||
$bid = $village->resarray[ 'f' . $id . 't' ];
|
||||
$bindicate = $building->canBuild( $id, $bid );
|
||||
$wwlevel = $village->resarray['f99'];
|
||||
if ( $wwlevel >= 50 ) {
|
||||
$needed_plan = 1;
|
||||
} else {
|
||||
$needed_plan = 0;
|
||||
// wwupgrade.tpl
|
||||
global $village, $building, $database, $generator, $session, $id;
|
||||
|
||||
$bid = (int)$village->resarray['f'.$id.'t'];
|
||||
$bindicate = $building->canBuild($id, $bid);
|
||||
$wwlevel = (int)$village->resarray['f99'];
|
||||
$needed_plan = $wwlevel >= 50? 1 : 0;
|
||||
|
||||
if (!$building->allowWwUpgrade()) {
|
||||
echo $needed_plan == 0
|
||||
? '<p><span class="none">'.NEED_WWCONSTRUCTION_PLAN.'.</span></p>'
|
||||
: '<p><span class="none">'.NEED_MORE_WWCONSTRUCTION_PLAN.'.</span></p>';
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $building->allowWwUpgrade() ) {
|
||||
if ( $bindicate == 1 ) {
|
||||
echo "<p><span class=\"none\">" . MAX_LEVEL . "</span></p>";
|
||||
} else if ( $bindicate == 10 ) {
|
||||
echo "<p><span class=\"none\">" . BUILDING_MAX_LEVEL_UNDER . "</span></p>";
|
||||
} else if ( $bindicate == 11 ) {
|
||||
echo "<p><span class=\"none\">" . BUILDING_BEING_DEMOLISHED . "</span></p>";
|
||||
} else {
|
||||
$loopsame = ( $building->isCurrent( $id ) || $building->isLoop( $id ) ) ? 1 : 0;
|
||||
$doublebuild = ( $building->isCurrent( $id ) && $building->isLoop( $id ) ) ? 1 : 0;
|
||||
$master = count( $database->getMasterJobsByField( $village->wid, $id ) );
|
||||
$uprequire = $building->resourceRequired( $id, $village->resarray[ 'f' . $id . 't' ], 1 + $loopsame + $doublebuild + $master );
|
||||
if ($bindicate == 1) {
|
||||
echo '<p><span class="none">'.MAX_LEVEL.'</span></p>'; return;
|
||||
}
|
||||
if ($bindicate == 10) {
|
||||
echo '<p><span class="none">'.BUILDING_MAX_LEVEL_UNDER.'</span></p>'; return;
|
||||
}
|
||||
if ($bindicate == 11) {
|
||||
echo '<p><span class="none">'.BUILDING_BEING_DEMOLISHED.'</span></p>'; return;
|
||||
}
|
||||
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))? 1 : 0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))? 1 : 0;
|
||||
$master = count($database->getMasterJobsByField($village->wid, $id));
|
||||
$nextLevel = (int)$village->resarray['f'.$id] + 1 + $loopsame + $doublebuild + $master;
|
||||
$uprequire = $building->resourceRequired($id, $bid, 1 + $loopsame + $doublebuild + $master);
|
||||
$total_required = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
|
||||
?>
|
||||
<p id="contract">
|
||||
<b><?php echo COSTS_UPGRADING_LEVEL; ?> <?php echo $village->resarray[ 'f' . $id ] + 1 + $loopsame + $doublebuild + $master; ?>
|
||||
:<br/>
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber"/><span
|
||||
class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay"
|
||||
title="Clay"/><span
|
||||
class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron"
|
||||
title="Iron"/><span
|
||||
class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop"
|
||||
title="Crop"/><span
|
||||
class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif"
|
||||
alt="Crop consumption"
|
||||
title="Crop consumption"/><?php echo $uprequire['pop']; ?>
|
||||
| <img class="clock" src="img/x.gif" alt="duration"
|
||||
title="duration"/><?php echo $generator->getTimeFormat( $uprequire['time'] );
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
|
||||
if ( $session->userinfo['gold'] >= 3 && $building->getTypeLevel( 17 ) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=" . $uprequire['wood'] . "&r2=" . $uprequire['clay'] . "&r3=" . $uprequire['iron'] . "&r4=" . $uprequire['crop'] . "\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
} ?><br/>
|
||||
<?php
|
||||
if ( $bindicate == 2 ) {
|
||||
echo "<span class=\"none\">" . WORKERS_ALREADY_WORK . "</span>";
|
||||
if ( $session->goldclub == 1 ) {
|
||||
?> </br>
|
||||
<?php
|
||||
if ( $id <= 18 ) {
|
||||
if ( $session->gold >= 1 && $village->master == 0 ) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id\">" . CONSTRUCTING_MASTER_BUILDER . " </a>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
} else {
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
}
|
||||
} else {
|
||||
if ( $session->gold >= 1 && $village->master == 0 ) {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id\">" . CONSTRUCTING_MASTER_BUILDER . " </a>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
} else {
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ( $bindicate == 3 ) {
|
||||
echo "<span class=\"none\">" . WORKERS_ALREADY_WORK_WAITING . "</span>";
|
||||
if ( $session->goldclub == 1 ) {
|
||||
?> </br>
|
||||
<?php
|
||||
if ( $id <= 18 ) {
|
||||
if ( $session->gold >= 1 && $village->master == 0 ) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id\">" . CONSTRUCTING_MASTER_BUILDER . " </a>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
} else {
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
}
|
||||
} else {
|
||||
if ( $session->gold >= 1 && $village->master == 0 ) {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id\">" . CONSTRUCTING_MASTER_BUILDER . " </a>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
} else {
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ( $bindicate == 4 ) {
|
||||
echo "<span class=\"none\">" . ENOUGH_FOOD_EXPAND_CROPLAND . "</span>";
|
||||
} else if ( $bindicate == 5 ) {
|
||||
echo "<span class=\"none\">" . UPGRADE_WAREHOUSE . ".</span>";
|
||||
} else if ( $bindicate == 6 ) {
|
||||
echo "<span class=\"none\">" . UPGRADE_GRANARY . ".</span>";
|
||||
} else if ( $bindicate == 7 ) {
|
||||
if ( $village->allcrop > 0 ) {
|
||||
$neededtime = $building->calculateAvaliable( $id, $village->resarray[ 'f' . $id . 't' ], 1 + $loopsame + $doublebuild + $master );
|
||||
echo "<span class=\"none\">" . ENOUGH_RESOURCES . " " . $neededtime[0] . " at " . $neededtime[1] . "</span>";
|
||||
} else {
|
||||
echo "<span class=\"none\">" . YOUR_CROP_NEGATIVE . "</span>";
|
||||
}
|
||||
if ( $session->goldclub == 1 ) {
|
||||
?> </br>
|
||||
<?php
|
||||
if ( $id <= 18 ) {
|
||||
if ( $session->gold >= 1 && $village->master == 0 ) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id\">" . CONSTRUCTING_MASTER_BUILDER . " </a>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
} else {
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
}
|
||||
} else {
|
||||
if ( $session->gold >= 1 && $village->master == 0 ) {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id\">" . CONSTRUCTING_MASTER_BUILDER . " </a>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
} else {
|
||||
echo "<span class=\"none\">" . CONSTRUCTING_MASTER_BUILDER . "</span>";
|
||||
echo '<font color="#B3B3B3">(' . COSTS . ': <img src="' . GP_LOCATE . 'img/a/gold_g.gif" alt="Gold" title="' . GOLD . '"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ( $bindicate == 8 ) {
|
||||
if ( $session->access == BANNED ) {
|
||||
echo "<a class=\"build\" href=\"banned.php\">" . UPGRADE_LEVEL . " ";
|
||||
} else if ( $id <= 18 ) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">" . UPGRADE_LEVEL . " ";
|
||||
<b><?php echo COSTS_UPGRADING_LEVEL;?> <?php echo $nextLevel;?>:</b><br />
|
||||
<img class="r1" src="img/x.gif" title="Lumber"/><span class="little_res"><?php echo $uprequire['wood'];?></span> |
|
||||
<img class="r2" src="img/x.gif" title="Clay"/><span class="little_res"><?php echo $uprequire['clay'];?></span> |
|
||||
<img class="r3" src="img/x.gif" title="Iron"/><span class="little_res"><?php echo $uprequire['iron'];?></span> |
|
||||
<img class="r4" src="img/x.gif" title="Crop"/><span class="little_res"><?php echo $uprequire['crop'];?></span> |
|
||||
<img class="r5" src="img/x.gif" title="Crop consumption"/><?php echo $uprequire['pop'];?> |
|
||||
<img class="clock" src="img/x.gif" title="duration"/><?php echo $generator->getTimeFormat($uprequire['time']);?>
|
||||
<?php if ($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required):?>
|
||||
| <a href="build.php?gid=17&t=3&r1=<?php echo $uprequire['wood'];?>&r2=<?php echo $uprequire['clay'];?>&r3=<?php echo $uprequire['iron'];?>&r4=<?php echo $uprequire['crop'];?>" title="NPC trade"><img class="npc" src="img/x.gif" alt="NPC trade"/></a>
|
||||
<?php endif;?>
|
||||
<br />
|
||||
<?php
|
||||
switch ($bindicate) {
|
||||
case 2: echo '<span class="none">'.WORKERS_ALREADY_WORK.'</span>'; break;
|
||||
case 3: echo '<span class="none">'.WORKERS_ALREADY_WORK_WAITING.'</span>'; break;
|
||||
case 4: echo '<span class="none">'.ENOUGH_FOOD_EXPAND_CROPLAND.'</span>'; break;
|
||||
case 5: echo '<span class="none">'.UPGRADE_WAREHOUSE.'.</span>'; break;
|
||||
case 6: echo '<span class="none">'.UPGRADE_GRANARY.'.</span>'; break;
|
||||
case 7:
|
||||
if ($village->allcrop > 0) {
|
||||
$neededtime = $building->calculateAvaliable($id, $bid, 1 + $loopsame + $doublebuild + $master);
|
||||
echo '<span class="none">'.ENOUGH_RESOURCES.' '.$neededtime[0].' at '.$neededtime[1].'</span>';
|
||||
} else {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">" . UPGRADE_LEVEL . " ";
|
||||
echo '<span class="none">'.YOUR_CROP_NEGATIVE.'</span>';
|
||||
}
|
||||
echo $village->resarray[ 'f' . $id ] + 1;
|
||||
echo ".</a>";
|
||||
} else if ( $bindicate == 9 ) {
|
||||
if ( $session->access == BANNED ) {
|
||||
echo "<a class=\"build\" href=\"banned.php\">" . UPGRADE_LEVEL . " ";
|
||||
} else if ( $id <= 18 ) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">" . UPGRADE_LEVEL . " ";
|
||||
} else {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">" . UPGRADE_LEVEL . " ";
|
||||
}
|
||||
echo $village->resarray[ 'f' . $id ] + ( $loopsame > 0 ? 2 : 1 );
|
||||
echo ".</a> <span class=\"none\">" . WAITING . "</span> ";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
$href = $session->access == BANNED? 'banned.php' : (($id <= 18)? "dorf1.php?a=$id&c=$session->checker" : "dorf2.php?a=$id&c=$session->checker");
|
||||
$lvl = $bindicate == 8? $village->resarray['f'.$id] + 1 : $village->resarray['f'.$id] + ($loopsame > 0? 2 : 1);
|
||||
echo '<a class="build" href="'.$href.'">'.UPGRADE_LEVEL.' '.$lvl.'.</a>';
|
||||
if ($bindicate == 9) echo ' <span class="none">'.WAITING.'</span>';
|
||||
break;
|
||||
}
|
||||
|
||||
if (in_array($bindicate, [2,3,7]) && $session->goldclub == 1) {
|
||||
echo '<br/>';
|
||||
$masterHref = ($id <= 18? 'dorf1.php' : 'dorf2.php'). "?master=$bid&id=$id&c=$session->checker";
|
||||
if ($session->gold >= 1 && $village->master == 0) {
|
||||
echo '<a class="build" href="'.$masterHref.'">'.CONSTRUCTING_MASTER_BUILDER.'</a>';
|
||||
} else {
|
||||
if ( $needed_plan == 0 ) {
|
||||
echo "<span class=\"none\">" . NEED_WWCONSTRUCTION_PLAN . ".</span>";
|
||||
} else {
|
||||
echo "<span class=\"none\">" . NEED_MORE_WWCONSTRUCTION_PLAN . ".</span>";
|
||||
}
|
||||
echo '<span class="none">'.CONSTRUCTING_MASTER_BUILDER.'</span>';
|
||||
}
|
||||
?>
|
||||
echo ' <font color="#B3B3B3">('.COSTS.': <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="'.GOLD.'"/>1)</font>';
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
Reference in New Issue
Block a user