very big update

This commit is contained in:
unknown
2012-04-19 17:41:33 +03:00
parent e74c7a9518
commit f597c070d5
55 changed files with 1789 additions and 694 deletions
+18 -4
View File
@@ -41,9 +41,10 @@ if($units_incoming >= 1){
<?php
if(count($village->enforcetome) > 0) {
foreach($village->enforcetome 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['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a></td>
<td colspan=\"10\">";
<td colspan=\"$colspan\">";
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);
@@ -53,6 +54,9 @@ if($units_incoming >= 1){
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) {
@@ -63,8 +67,11 @@ if($units_incoming >= 1){
}
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=\"10\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>Send back</a></div></td></tr>";
<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 hour</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>Send back</a></div></td></tr>";
echo "</tbody></table>";
}
@@ -72,9 +79,10 @@ if($units_incoming >= 1){
if(count($village->enforcetoyou) > 0) {
echo "<h4>Troops in other village</h4>";
foreach($village->enforcetoyou 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['vref'],"name")."</a></td>
<td colspan=\"10\">";
<td colspan=\"$colspan\">";
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);
@@ -84,6 +92,9 @@ if($units_incoming >= 1){
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) {
@@ -94,8 +105,11 @@ if($units_incoming >= 1){
}
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=\"10\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>Send back</a></div></td></tr>";
<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 hour</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>Send back</a></div></td></tr>";
echo "</tbody></table>";
}
+8 -6
View File
@@ -27,8 +27,7 @@ if ($units[$y]['sort_type']==3){
}
echo "</tr><tr><th>Troops</th>";
for($i=$start;$i<=($end);$i++) {
$tribe1 = $tribe-1;
$totalunits = $units[$y]['t'.$tribe1*10+1]+$units[$y]['t'.$tribe1*10+2]+$units[$y]['t'.$tribe1*10+3]+$units[$y]['t'.$tribe1*10+4]+$units[$y]['t'.$tribe1*10+5]+$units[$y]['t'.$tribe1*10+6]+$units[$y]['t'.$tribe1*10+7]+$units[$y]['t'.$tribe1*10+8]+$units[$y]['t'.$tribe1*10+9]+$units[$y]['t'.$tribe1*10+10];
$totalunits = $units[$y]['t1']+$units[$y]['2']+$units[$y]['3']+$units[$y]['4']+$units[$y]['5']+$units[$y]['6']+$units[$y]['7']+$units[$y]['8']+$units[$y]['9']+$units[$y]['10']+$units[$y]['t11'];
if($totalunits > $building->getTypeLevel(16)){
echo "<td class=\"none\">?</td>";
}else{
@@ -96,14 +95,18 @@ $to = $database->getMInfo($units[$y]['vref']);
<tr><th>Troops</th>
<?php
for($i=1;$i<($units[$y]['t11'] != 0?12:11);$i++) {
if($units[$y]['attack_type']!=2){
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">?</td>";
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
}
echo $units[$y]['t'.$i]."</td>";
}
}
}else{
echo "<td class=\"none\">?</td>";
}
}
?>
</tr></tbody>
<tbody class="infos">
@@ -130,5 +133,4 @@ $to = $database->getMInfo($units[$y]['vref']);
}
//}
?>
+60
View File
@@ -0,0 +1,60 @@
<?php
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u11\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Pikemanm\" />
<a href=\"#\" onClick=\"return Popup(11,1);\"> Clubswinger</a> <span class=\"info\">(Available: ".$village->unitarray['u41'].")</span>
</div>
<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />95|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />75|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />40|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />40|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />1|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
echo $generator->getTimeFormat(round($u11['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
echo "</div>
</td>
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t11\" value=\"0\" maxlength=\"4\"></td>
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t11.value=".$technology->maxUnit(11)."; return false;\">(".$technology->maxUnit(11).")</a></td></tr></tbody>
";
if($technology->getTech(12)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u12\" src=\"img/x.gif\" alt=\"Spearman\" title=\"Spearman\" />
<a href=\"#\" onClick=\"return Popup(12,1);\"> Spearman</a> <span class=\"info\">(Available: ".$village->unitarray['u12'].")</span>
</div>
<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />145|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />70|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />85|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />40|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />1|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
echo $generator->getTimeFormat(round($u12['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
echo "</div>
</td>
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t12\" value=\"0\" maxlength=\"4\"></td>
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t12.value=".$technology->maxUnit(12)."; return false;\">(".$technology->maxUnit(12).")</a></td></tr></tbody>
";
}
if($technology->getTech(13)){
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u13\" src=\"img/x.gif\" alt=\"Axeman\" title=\"Axeman\" />
<a href=\"#\" onClick=\"return Popup(13,1);\"> Axeman</a> <span class=\"info\">(Available: ".$village->unitarray['u13'].")</span>
</div>
<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />130|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />120|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />170|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />70|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />1|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
echo $generator->getTimeFormat(round($u13['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
echo "</div>
</td>
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t13\" value=\"0\" maxlength=\"4\"></td>
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t13.value=".$technology->maxUnit(13)."; return false;\">(".$technology->maxUnit(13).")</a></td></tr></tbody>
";
}
if($technology->getTech(14)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u14\" src=\"img/x.gif\" alt=\"Scout\" title=\"Scout\" />
<a href=\"#\" onClick=\"return Popup(14,1);\"> Scout</a> <span class=\"info\">(Available: ".$village->unitarray['u14'].")</span>
</div>
<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />160|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />100|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />50|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />50|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />1|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
echo $generator->getTimeFormat(round($u14['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
echo "</div>
</td>
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t14\" value=\"0\" maxlength=\"4\"></td>
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t14.value=".$technology->maxUnit(14)."; return false;\">(".$technology->maxUnit(14).")</a></td></tr></tbody>
";
}
?>
+25
View File
@@ -0,0 +1,25 @@
<?php
$success = 0;
for($i=45;$i<=46;$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\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
echo "<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'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 consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"$i\">
</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\">No units avaliable. Research at academy</td></tr>";
}
?>
+143
View File
@@ -0,0 +1,143 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Academy</td>
<td>Action</td>
</tr></thead>
<tbody>
<?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($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
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 warehouse</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>warehouse</div>
</td></tr>";
}
else if(${'r'.$i}['crop'] > $village->maxcrop) {
echo "<br><span class=\"none\">Expand granary</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>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<br>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&amp;a=$i&amp;c=".$session->mchecker."\">Research</a></td></tr>";
}
$success += 1;
}
else {
$fail += 1;
}
}
if($success == 0) {
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</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=\"".U33."\" 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);\">Main Building</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=\"".U43."\" 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);\">Rally Point </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>";
$timer = 1;
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$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>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+65 -3
View File
@@ -122,8 +122,39 @@ if($academy == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 4
include("avaliable/academy.tpl");
}
//fix palace
if($palace == 0 && $embassy >= 1 && $mainbuilding >= 5 && $$UnderConstruction <> -1 && $id != 39 && $id != 40 && $residence == 0) {
include("avaliable/palace.tpl");
if($palace == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0) {
//Fix Castle
//id user
$user = $session->uid;
//connect to DB
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
//loop search village user
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysql_fetch_array($query)){
//loop structure village
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1);
//search Castle in array structure village
$test = in_array(26,$strutture);
if ($test){
break;
}
}
//if Castle no ready include palace.tpl
if (!$test){
include("avaliable/palace.tpl");
}
//end Fix
}
if($blacksmith == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) {
include("avaliable/blacksmith.tpl");
@@ -213,7 +244,38 @@ if($academy == 0 && ($mainbuilding <= 2 || $barrack <= 2)) {
include("soon/academy.tpl");
}
if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4) {
include("soon/palace.tpl");
//Fix Castle
//id user
$user = $session->uid;
//connect to DB
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
//loop search village user
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysql_fetch_array($query)){
//loop structure village
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1);
//search Castle in array structure village
$test = in_array(26,$strutture);
if ($test){
break;
}
}
//if Castle no ready include palace.tpl
if (!$test){
include("soon/palace.tpl");
}
//end Fix
}
if($blacksmith == 0 && ($academy <= 2 || $mainbuilding <= 2)) {
include("soon/blacksmith.tpl");
+156
View File
@@ -0,0 +1,156 @@
<?php
$to = $database->getVillage($enforce['from']);
$fromcoor = $database->getCoor($enforce['from']);
$tocoor = $database->getCoor($enforce['vref']);
$fromCor = array('x'=>$tocoor['x'], 'y'=>$tocoor['y']);
$toCor = array('x'=>$fromcoor['x'], 'y'=>$fromcoor['y']);
?>
<h1>Send units back</h1>
<form method="POST" name="snd" action="a2b.php">
<table id="short_info" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<th>Destination:</th>
<td><a href="karte.php?d=<?php echo $generator->getBaseID($fromcoor['x'],$fromcoor['y']); ?>&amp;c=<?php echo $generator->getMapCheck($generator->getBaseID($fromcoor['x'],$fromcoor['y'])); ?>"><?php echo $to['name']; ?> (<?php echo $fromcoor['x']; ?>|<?php echo $fromcoor['y']; ?>)</a></td>
</tr>
<tr>
<th>Owner:</th>
<td><a href="spieler.php?uid=<?php echo $to['owner']; ?>"><?php echo $database->getUserField($to['owner'],'username',0); ?></a></td>
</tr>
</tbody>
</table>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td colspan="10">Send units back to <?php echo $to['name']; ?></td>
</tr>
</thead>
</table>
<table id="troops" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="line-first column-first large"><img class="unit u41" src="img/x.gif" title="Pikeman" alt="Pikeman"> <input class="text" <?php if ($enforce['u41']<=0) {echo ' disabled="disabled"';}?> name="t1" value="<?php echo $enforce['u41']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u41'].")</span></td>";
?>
<td class="line-first large"><img class="unit u44" src="img/x.gif" title="Bird of Prey" alt="Bird of Prey"> <input class="text" <?php if ($enforce['u44']<=0) {echo ' disabled="disabled"';}?> name="t4" value="<?php echo $enforce['u44']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u44'].")</span></td>";
?>
<td class="line-first regular"><img class="unit u47" src="img/x.gif" title="War Elephant" alt="War Elephant"> <input class="text" <?php if ($enforce['u47']<=0) {echo ' disabled="disabled"';}?> name="t7" value="<?php echo $enforce['u47']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u47'].")</span></td>";
?>
<td class="line-first column-last small"><img class="unit u49" src="img/x.gif" title="Natarian Emperor" alt="Natarian Emperor"> <input class="text" <?php if ($enforce['u49']<=0) {echo ' disabled="disabled"';}?> name="t9" value="<?php echo $enforce['u49']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u49'].")</span></td>";
?>
</tr>
<tr>
<td class="column-first large"><img class="unit u42" src="img/x.gif" title="Thorned Warrior" alt="Thorned Warrior"> <input class="text" <?php if ($enforce['u42']<=0) {echo ' disabled="disabled"';}?> name="t2" value="<?php echo $enforce['u42']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u42'].")</span></td>";
?>
<td class="large"><img class="unit u45" src="img/x.gif" title="Axerider" alt="Axerider"> <input class="text" <?php if ($enforce['u45']<=0) {echo ' disabled="disabled"';}?> name="t5" value="<?php echo $enforce['u45']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u45'].")</span></td>";
?>
<td class="regular"><img class="unit u48" src="img/x.gif" title="Balista" alt="Balista"> <input class="text" <?php if ($enforce['u48']<=0) {echo ' disabled="disabled"';}?> name="t8" value="<?php echo $enforce['u48']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u48'].")</span></td>";
?>
<td class="column-last small"><img class="unit u40" src="img/x.gif" title="Settler" alt="Settler"> <input class="text" <?php if ($enforce['u50']<=0) {echo ' disabled="disabled"';}?> name="t10" value="<?php echo $enforce['u50']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u50'].")</span></td>";
?>
</tr>
<tr>
<td class="line-last column-first large"><img class="unit u43" src="img/x.gif" title="Guardsman" alt="Guardsman"> <input class="text" <?php if ($enforce['u3']<=0) {echo ' disabled="disabled"';}?> name="t3" value="<?php echo $enforce['u3']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u3'].")</span></td>";
?>
<td class="line-last large"><img class="unit u46" src="img/x.gif" title="Natarian Knight" alt="Natarian Knight"> <input class="text" <?php if ($enforce['u6']<=0) {echo ' disabled="disabled"';}?> name="t6" value="<?php echo $enforce['u6']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u6'].")</span></td>";
?>
<td class="line-last regular"></td>
<td class="line-last column-last"></td> </tr>
</tbody></table>
<table class="troop_details" cellpadding="1" cellspacing="1">
<tbody class="infos">
<tr>
<th>Arrived:</th>
<?php
$att_tribe = $session->tribe;
$start = ($att_tribe-1)*10+1;
$end = ($att_tribe*10);
$speeds = array();
//find slowest unit.
for($i=$start;$i<=$end;$i++)
{
if (isset($enforce['u'.$i]))
{
if($enforce['u'.$i]!='' && $enforce['u'.$i]>0)
{
//$speeds[] = $unitspeeds[$i-2];
$speeds[] = ${'u'.$i}['speed'];
}
}
}
$time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1);
?>
<td colspan="10">
<div class="in">in <?php echo $generator->getTimeFormat($time); ?></div>
<div class="at">at <span id="tp2"> <?php echo date("H:i:s",time()+$time)?></span><span> hours</span></div>
</td>
</tr>
</tbody>
</table>
<input name="ckey" value="<?php echo $ckey; ?>" type="hidden">
<input name="id" value="39" type="hidden">
<input name="a" value="533374" type="hidden">
<input name="c" value="8" type="hidden">
<p class="btn"><input value="ok" name="s1" id="btn_ok" class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.disabled==false) {document.getElementsByTagName('form')[0].submit();} this.disabled=true;" onLoad="this.disabled=false;"></p>
</form>
</div>
+19 -19
View File
@@ -1,66 +1,66 @@
<?php
$bindicate = $building->canBuild($id,$village->resarray['f'.$id.'t']);
if($bindicate == 1) {
echo "<p><span class=\"none\">".$lang['upgrade'][0]."</span></p>";
echo "<p><span class=\"none\">Building already at max level</span></p>";
} else if($bindicate == 10) {
echo "<p><span class=\"none\">".$lang['upgrade'][1]."</span></p>";
echo "<p><span class=\"none\">Building max level under construction</span></p>";
} else if($bindicate == 11) {
echo "<p><span class=\"none\">".$lang['upgrade'][2]."</span></p>";
echo "<p><span class=\"none\">Building presently being demolished</span></p>";
} else {
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],($loopsame > 0 ? 2:1)+$doublebuild);
?>
<p id="contract"><?php echo $lang['upgrade'][3]; echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1)+$doublebuild; ?>:<br />
<img class="r1" src="img/x.gif" alt="<?php echo LUMBER; ?>" title="<?php echo LUMBER; ?>" />&nbsp;<span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="<?php echo CLAY; ?>" title="<?php echo CLAY; ?>" />&nbsp;<span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="<?php echo IRON; ?>" title="<?php echo IRON; ?>" />&nbsp;<span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="<?php echo CROP; ?>" title="<?php echo CROP; ?>" />&nbsp;<span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="<?php echo CROP_COM; ?>" title="<?php echo CROP_COM; ?>" />&nbsp;<?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="<?php echo DURATION ?>" title="<?php echo DURATION ?>" /><?php echo $generator->getTimeFormat($uprequire['time']);
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1)+$doublebuild; ?>:<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) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"".$lang['npc'][0]."\"><img class=\"npc\" src=\"img/x.gif\" alt=\"".$lang['npc'][0]."\" title=\"".$lang['npc'][0]."\" /></a>";
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\">".$lang['upgrade'][4]."</span>";
echo "<span class=\"none\">The workers are already at work.</span>";
}
else if($bindicate == 3) {
echo "<span class=\"none\">".$lang['upgrade'][4]."&nbsp;".WAITING_LOOP."</span>";
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
}
else if($bindicate == 4) {
echo "<span class=\"none\">".$lang['upgrade'][5]."</span>";
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
}
else if($bindicate == 5) {
echo "<span class=\"none\">".$lang['upgrade'][6]."</span>";
echo "<span class=\"none\">Upgrade Warehouse.</span>";
}
else if($bindicate == 6) {
echo "<span class=\"none\">".$lang['upgrade'][7]."</span>";
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],($loopsame > 0 ? 2:1));
echo "<span class=\"none\">".$lang['upgrade'][8].$neededtime[0].$lang['upgrade'][9].$neededtime[1]."</span>";
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
}
else if($bindicate == 8) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">".$lang['upgrade'][10];
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">".$lang['upgrade'][10];
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">".$lang['upgrade'][10];
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f'.$id]+1;
echo ".</a>";
}
else if($bindicate == 9) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">".$lang['upgrade'][10];
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">".$lang['upgrade'][10];
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">".$lang['upgrade'][10];
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1);
echo ".</a> <span class=\"none\">".WAITING_LOOP."</span> ";
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
}
}