fix: pagination returns to ALL from Attacks page in battle reports

Closes #343
This commit is contained in:
Martin Ambrus
2017-11-22 12:34:38 +01:00
parent 0134b0abe9
commit 98ddbe235f
4 changed files with 34 additions and 36 deletions
+12 -13
View File
@@ -1,4 +1,4 @@
<?php
<?php
$noticeClass = array("Scout Report","Won as attacker without losses","Won as attacker with losses","Lost as attacker with losses","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Lost as defender without losses","Reinforcement arrived","","Wood Delivered","Clay Delivered","Iron Delivered","Crop Delivered","","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Won scouting as attacker","Lost scouting as attacker","Won scouting as defender","Lost scouting as defender","Scout Report");
?>
<form method="post" action="berichte.php" name="msg">
@@ -20,32 +20,32 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
<input class="check" type="checkbox" id="s10" name="s10" onclick="Allmsg(this.form);" />
<?php } ?></th>
<th class="buttons"><input name="del" type="image" id="btn_delete" class="dynamic_img" src="img/x.gif" value="delete" alt="delete" />
<?php if($session->plus) {
<?php if($session->plus) {
if(isset($_GET['t']) && $_GET['t'] == 5) {
echo "<input name=\"start\" type=\"image\" value=\"back\" alt=\"back\" id=\"btn_back\" class=\"dynamic_img\" src=\"img/x.gif\" />";
}
else {
echo "<input name=\"archive\" type=\"image\" value=\"Archive\" alt=\"Archive\" id=\"btn_archiv\" class=\"dynamic_img\" src=\"img/x.gif\" />";
echo "<input name=\"archive\" type=\"image\" value=\"Archive\" alt=\"Archive\" id=\"btn_archiv\" class=\"dynamic_img\" src=\"img/x.gif\" />";
}
}?>
</th>
<th class=navi>
<?php
<?php
if(!isset($_GET['s']) && count($rep1) < 10) {
echo "&laquo;&raquo;";
}
else if (!isset($_GET['s']) && count($rep1) > 10) {
echo "&laquo;<a href=\"?p=report&s=10&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?p=report&".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=10&o=0\">&raquo;</a>";
}
else if(isset($_GET['s']) && count($rep1) > $_GET['s']) {
if(count($rep1) > ($_GET['s']+10) && $_GET['s']-10 < count($rep1) && $_GET['s'] != 0) {
echo "<a href=\"?p=report&s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?p=report&s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "<a href=\"?p=report&".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?p=report&".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else if(count($rep1) > $_GET['s']+10) {
echo "&laquo;<a href=\"?p=report&s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?p=report&".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else {
echo "<a href=\"?p=report&s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
echo "<a href=\"?p=report&".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
}
}
?>
@@ -53,7 +53,7 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
</tr>
</tfoot>
<tbody>
<?php
<?php
if(isset($_GET['s'])) {
$s = $_GET['s'];
@@ -61,7 +61,7 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
else {
$s = 0;
}
$name = 1;
$count = 0;
for($i=(1+$s);$i<=(10+$s);$i++) {
@@ -88,10 +88,9 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
}
if(count($rep1) == 0) {
echo "<td colspan=\"3\" class=\"none\">There are no reports available.</td></tr>";
}
}
?>
</tbody>
</table>
+7 -7
View File
@@ -1,6 +1,6 @@
<div id="content" class="messages">
<h1>Messages</h1>
<?php
<?php
include("menu.tpl");
?>
<form method="post" action="nachrichten.php" name="msg" ><input type="hidden" name="ft" value="m5" /><table cellpadding="1" cellspacing="1" id="overview">
@@ -14,26 +14,26 @@ include("menu.tpl");
</th>
<th colspan="2" class="buttons">
<input name="delmsg" value="delete" type="image" id="btn_delete" class="dynamic_img" src="img/x.gif" alt="delete" /> <input name="start" type="image" value="Back" alt="Back" id="btn_back" class="dynamic_img" src="img/x.gif" /></th>
<th class="navi"><?php
<th class="navi"><?php
if(!isset($_GET['s']) && count($message->archived1) < 10) {
echo "&laquo;&raquo;";
}
else if (!isset($_GET['s']) && count($message->archived1) > 10) {
echo "&laquo;<a href=\"?s=10&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=10&o=0\">&raquo;</a>";
}
else if(isset($_GET['s']) && count($message->archived1) > $_GET['s']) {
if(count($message->archived1) > ($_GET['s']+10) && $_GET['s']-10 < count($message->archived1) && $_GET['s'] != 0) {
echo "<a href=\"?s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else if(count($message->archived1) > $_GET['s']+10) {
echo "&laquo;<a href=\"?s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else {
echo "<a href=\"?s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
echo "<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
}
}
?></th></tr></tfoot><tbody>
<?php
<?php
if(isset($_GET['s'])) {
$s = $_GET['s'];
}
+4 -4
View File
@@ -28,17 +28,17 @@
echo "&laquo;&raquo;";
}
else if (!isset($_GET['s']) && count($message->inbox1) > 10) {
echo "&laquo;<a href=\"?s=10&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=10&o=0\">&raquo;</a>";
}
else if(isset($_GET['s']) && count($message->inbox1) > $_GET['s']) {
if(count($message->inbox1) > ($_GET['s']+10) && $_GET['s']-10 < count($message->inbox1) && $_GET['s'] != 0) {
echo "<a href=\"?s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else if(count($message->inbox1) > $_GET['s']+10) {
echo "&laquo;<a href=\"?s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else {
echo "<a href=\"?s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
echo "<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
}
}
?></th></tr></tfoot><tbody>
+11 -12
View File
@@ -1,4 +1,4 @@
<?php
<?php
$noticeClass = array("Scout Report","Won as attacker without losses","Won as attacker with losses","Lost as attacker with losses","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Lost as defender without losses","Reinforcement arrived","","Wood Delivered","Clay Delivered","Iron Delivered","Crop Delivered","","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Won scouting as attacker","Lost scouting as attacker","Won scouting as defender","Lost scouting as defender","Scout Report");
?>
<form method="post" action="berichte.php" name="msg">
@@ -20,17 +20,17 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
<input class="check" type="checkbox" id="s10" name="s10" onclick="Allmsg(this.form);" />
<?php } ?></th>
<th class="buttons"><input name="del" type="image" id="btn_delete" class="dynamic_img" src="img/x.gif" value="delete" alt="delete" />
<?php if($session->plus) {
<?php if($session->plus) {
if(isset($_GET['t']) && $_GET['t'] == 5) {
echo "<input name=\"start\" type=\"image\" value=\"back\" alt=\"back\" id=\"btn_back\" class=\"dynamic_img\" src=\"img/x.gif\" />";
}
else {
echo "<input name=\"archive\" type=\"image\" value=\"Archive\" alt=\"Archive\" id=\"btn_archiv\" class=\"dynamic_img\" src=\"img/x.gif\" />";
echo "<input name=\"archive\" type=\"image\" value=\"Archive\" alt=\"Archive\" id=\"btn_archiv\" class=\"dynamic_img\" src=\"img/x.gif\" />";
}
}?>
</th>
<th class=navi>
<?php
<?php
if(!isset($_GET['s']) && count($message->noticearray) < 10) {
echo "&laquo;&raquo;";
}
@@ -39,13 +39,13 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
}
else if(isset($_GET['s']) && count($message->noticearray) > $_GET['s']) {
if(count($message->noticearray) > ($_GET['s']+10) && $_GET['s']-10 < count($message->noticearray) && $_GET['s'] != 0) {
echo "<a href=\"?s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else if(count($message->noticearray) > $_GET['s']+10) {
echo "&laquo;<a href=\"?s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else {
echo "<a href=\"?s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
echo "<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
}
}
?>
@@ -53,7 +53,7 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
</tr>
</tfoot>
<tbody>
<?php
<?php
if(isset($_GET['s'])) {
$s = $_GET['s'];
@@ -61,7 +61,7 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
else {
$s = 0;
}
$name = 1;
$count = 0;
for($i=(1+$s);$i<=(10+$s);$i++) {
@@ -88,10 +88,9 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
}
if(count($message->noticearray) == 0) {
echo "<td colspan=\"3\" class=\"none\">There are no reports available.</td></tr>";
}
}
?>
</tbody>
</table>