fix finish all

This commit is contained in:
Shadowss
2013-11-01 09:36:34 +02:00
parent 790c726ca4
commit 3a7b7e2b0b
+8 -7
View File
@@ -1,9 +1,9 @@
<?php <?php
$ty=(isset($_GET['ty']))? $_GET['ty']:"";
if($_REQUEST["cancel"] == "1") { if($_REQUEST["cancel"] == "1") {
if($session->access != BANNED){ if($session->access != BANNED){
$database->delDemolition($village->wid); $database->delDemolition($village->wid);
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0"); header("Location: build.php?gid=15&ty=$ty&cancel=0&demolish=0");
}else{ }else{
header("Location: banned.php"); header("Location: banned.php");
} }
@@ -15,7 +15,7 @@ if($session->access != BANNED){
$type = $_REQUEST['type']; $type = $_REQUEST['type'];
$database->addDemolition($village->wid,$type); $database->addDemolition($village->wid,$type);
$session->changeChecker(); $session->changeChecker();
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0"); header("Location: build.php?gid=15&ty=$type&cancel=0&demolish=0");
} }
}else{ }else{
header("Location: banned.php"); header("Location: banned.php");
@@ -29,14 +29,14 @@ if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
if (!empty($DemolitionProgress)) { if (!empty($DemolitionProgress)) {
$Demolition = $DemolitionProgress[0]; $Demolition = $DemolitionProgress[0];
echo "<b>"; echo "<b>";
echo "<a href='build.php?id=26&cancel=1'><img src='img/x.gif' class='del' title='cancel' alt='cancel'></a> "; 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>"; echo "Demolition of ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": <span id=timer1>".$generator->getTimeFormat($Demolition['timetofinish']-time())."</span>";
if($session->gold >= 2) { if($session->gold >= 2) {
if($session->access!=BANNED){ if($session->access!=BANNED){
?> <a href="?buildingFinish=1" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a> ?> <a href="?id=15&buildingFinish=1&ty=<?php echo $ty;?>" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php <?php
}else{ }else{
?> <a href="banned.php" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a> ?> <a href="banned.php" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php <?php
} }
} }
@@ -46,8 +46,9 @@ if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
<form action=\"build.php?gid=15&amp;demolish=1&amp;cancel=0&amp;c=".$session->mchecker."\" method=\"POST\" style=\"display:inline\"> <form action=\"build.php?gid=15&amp;demolish=1&amp;cancel=0&amp;c=".$session->mchecker."\" method=\"POST\" style=\"display:inline\">
<select name=\"type\" class=\"dropdown\">"; <select name=\"type\" class=\"dropdown\">";
for ($i=19; $i<=41; $i++) { for ($i=19; $i<=41; $i++) {
$select=($i==$ty)? " SELECTED":"";
if ($VillageResourceLevels['f'.$i] >= 1 && !$building->isCurrent($i) && !$building->isLoop($i)) { if ($VillageResourceLevels['f'.$i] >= 1 && !$building->isCurrent($i) && !$building->isLoop($i)) {
echo "<option value=".$i.">".$i.". ".$building->procResType($VillageResourceLevels['f'.$i.'t'])." (lvl ".$VillageResourceLevels['f'.$i].")</option>"; echo "<option value=".$i.$select.">".$i.". ".$building->procResType($VillageResourceLevels['f'.$i.'t'])." (lvl ".$VillageResourceLevels['f'.$i].")</option>";
} }
} }
echo "</select><input id=\"btn_demolish\" name=\"demolish\" class=\"dynamic_img\" value=\"Demolish\" type=\"image\" src=\"img/x.gif\" alt=\"Demolish\" title=\"Demolish\" /></form>"; echo "</select><input id=\"btn_demolish\" name=\"demolish\" class=\"dynamic_img\" value=\"Demolish\" type=\"image\" src=\"img/x.gif\" alt=\"Demolish\" title=\"Demolish\" /></form>";