more fixes

This commit is contained in:
unknown
2012-06-17 20:34:01 +03:00
parent 1232c8c87e
commit 6c7db3420d
23 changed files with 206 additions and 105 deletions
+52
View File
@@ -20,5 +20,57 @@ if(!$session->goldclub) {
<div id="raidList">
<?php include "Templates/goldClub/farmlist.tpl"; ?>
</div>
<br />
<table cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="4">evasion settings</th>
</tr>
<tr>
<td></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 = ''; }
?>
<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><?php echo $database->getUnitsNumber($wref); ?></td>
<td><?php echo count($reinf); ?></td>
</tr>
<?php
}
$user = $database->getUserArray($session->uid, 1);
?>
</tbody>
</table>
<form action="build.php?id=39&t=99" method="POST">
<br />
<tr>
Send troops away a maximun of <input class="text" type="text" name="maxevasion" value="<?php echo $user['maxevasion']; ?>" maxlength="3" style="width:50px;"> times
<span class="none">(costs: <img src="<?php echo GP_LOCATE; ?>img/a/gold_g.gif" alt="Gold" title="Gold"/><b>2</b> per evasion)</span>
</tr>
<tr>
<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>
</tr>
</form>
</div>
<?php } ?>
-71
View File
@@ -136,7 +136,6 @@ if ($units[$y]['sort_type']==3){
$to = $database->getMInfo($units[$y]['vref']);
if($units[$y]['from'] != 0){
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
@@ -205,76 +204,6 @@ if($units[$y]['from'] != 0){
</tbody>
</table>
<?php
}else{
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a>?</a></td>
<td colspan="<?php if($units[$y]['t11'] != 0) {echo"11";}else{echo"10";}?>"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo "Returning to ".$to['name']; ?></a></td>
</tr>
</thead>
<tbody class="units">
<?php
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</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>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>
<?php
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
if($units[$y]['attack_type']!=2 and $units[$y]['attack_type']!=1 and $totalres != ""){?>
<tr><th>Bounty</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
$totalcarry = $units[$y]['t1']*${'u'.$start.''}['cap']+$units[$y]['t2']*${'u'.($start+1).''}['cap']+$units[$y]['t3']*${'u'.($start+2).''}['cap']+$units[$y]['t4']*${'u'.($start+3).''}['cap']+$units[$y]['t5']*${'u'.($start+4).''}['cap']+$units[$y]['t6']*${'u'.($start+5).''}['cap']+$units[$y]['t7']*${'u'.($start+6).''}['cap']+$units[$y]['t8']*${'u'.($start+7).''}['cap']+$units[$y]['t9']*${'u'.($start+8).''}['cap']+$units[$y]['t10']*${'u'.($start+9).''}['cap'];
echo "<div class=\"in small\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$res['wood']."<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$res['clay']."<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$res['iron']."<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$res['crop']."</div>";
echo "<div class=\"in small\"><img class=\"car\" src=\"gpack/travian_default/img/a/car.gif\" alt=\"carry\" title=\"carry\"/>".$totalres."/".$totalcarry."</div>";
?>
</tr>
<?php } ?>
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
echo "<div class=\"in small\"><span id=timer".$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>
</table>
<?php
}
}
}
+1 -1
View File
@@ -40,7 +40,7 @@
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['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
+1 -1
View File
@@ -50,7 +50,7 @@
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['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
+1 -1
View File
@@ -104,7 +104,7 @@
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['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
+1 -1
View File
@@ -16,7 +16,7 @@
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['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
+1 -1
View File
@@ -16,7 +16,7 @@
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['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
+1 -1
View File
@@ -39,7 +39,7 @@
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['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
+1 -1
View File
@@ -39,7 +39,7 @@
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['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
+1 -1
View File
@@ -39,7 +39,7 @@
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['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
+1 -1
View File
@@ -76,7 +76,7 @@ $cps = $session->cp;
if($cps >= $need_cps) {
?>
<input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" alt="OK" src="img/x.gif" />
<input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" alt="OK" src="img/x.gif" onclick="this.disabled=true;this.form.submit();"/>
<?php
} else {
print "$cps/$need_cps culture points";
+1 -1
View File
@@ -52,7 +52,7 @@ $coor['y'] = "";
</tr>
</tbody></table>
<input value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" type="image">
<input value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" type="image" onclick="this.disabled=true;this.form.submit();">
</form>
<p class="error"><?php echo $form->getError("error"); ?></p>
</div>
+1 -2
View File
@@ -18,7 +18,7 @@ $oasistype = $type['oasistype'];
$vdata = $database->getVillage($Wref);
$villageOwner = $database->getVillageField($Wref,'owner');
$userAccess = $database->getUserField($villageOwner,'access',0);
}elseif($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){{
}elseif($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
$Wref = $database->getVilWref($_POST['x'], $_POST['y']);
$WrefX = $_POST['x'];
$WrefY = $_POST['y'];
@@ -72,7 +72,6 @@ $troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+"
header("Location: build.php?id=39&t=99");
}
}
}
if($FLData['owner'] == $session->uid){
?>
+17 -1
View File
@@ -9,7 +9,7 @@
## ##
#################################################################################
$aantal=(count($database->getMovement(4,$village->wid,1))+count($database->getMovement(4,$village->wid,0))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0)));
$aantal=(count($database->getMovement(4,$village->wid,1))+count($database->getMovement(4,$village->wid,0))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0))+count($database->getMovement(7,$village->wid,1)));
if($aantal > 0){
echo '<table id="movements" cellpadding="1" cellspacing="1"><thead><tr><th colspan="3">'.TROOP_MOVEMENTS.'</th></tr></thead><tbody>';
}
@@ -32,6 +32,22 @@ if($aantal > 0){
$timer += 1;
}
/* Units coming back from evasion */
$aantal = count($database->getMovement(7,$village->wid,1));
$aantal2 = $database->getMovement(7,$village->wid,1);
if($aantal > 0){
foreach($aantal2 as $receive) {
$action = 'def1';
$aclass = 'd1';
$title = ''.ARRIVING_REINF_TROOPS.'';
$short = ''.ARRIVING_REINF_TROOPS_SHORT.'';
$NextArrival[] = $receive['endtime'];
}
echo '<tr><td class="typ"><a href="build.php?id=39"><img src="img/x.gif" class="'.$action.'" alt="'.$title.'" title="'.$title.'" /></a><span class="'.$aclass.'">&raquo;</span></td>
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
$timer += 1;
}
/* attack/raid on you! */
$aantal = count($database->getMovement(3,$village->wid,1));
$aantal2 = $database->getMovement(3,$village->wid,1);