General fixes

+You can now read all reports in the multihunter panel, it's still a
work in progress
This commit is contained in:
iopietro
2018-06-01 18:34:24 +02:00
parent 459354d39e
commit 5b7a13ef5d
4 changed files with 119 additions and 117 deletions
+98 -77
View File
@@ -1,96 +1,117 @@
<?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");
$noticeClass =
["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">
<table cellpadding="1" cellspacing="1" id="overview"
class="row_table_data">
<thead>
<tr>
<th colspan="2">Subject:</th>
<th class="sent">
<a href="berichte.php?s=0&amp;o=1">Sent</a></th>
</tr>
</thead><tfoot>
<tr><th><?php
$MyGold = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
$golds = mysqli_fetch_array($MyGold);
$date2=strtotime("NOW");
if ($golds['plus'] <= $date2) { ?>
<table cellpadding="1" cellspacing="1" id="overview"
class="row_table_data">
<thead>
<tr>
<th colspan="2">Subject:</th>
<th class="sent"><a href="berichte.php?s=0&amp;o=1">Sent</a></th>
</tr>
</thead>
<tfoot>
<tr>
<th><?php
$MyGold = mysqli_query($GLOBALS["link"], "SELECT * FROM " . TB_PREFIX . "users WHERE `id`='" . $session->uid . "'") or die(mysqli_error($database->dblink));
$golds = mysqli_fetch_array($MyGold);
$date2 = strtotime("NOW");
if ($golds['plus'] <= $date2) {
?>
<?php } else { ?>
<input class="check" type="checkbox" id="s10" name="s10" onclick="Allmsg(this.form);" />
<input class="check" type="checkbox" id="s10" name="s10"
onclick="Allmsg(this.form);" />
<?php } ?></th>
<th class="buttons"><button name="del" id="btn_delete" class="trav_buttons" value="delete" alt="delete" /> Delete </button>
<?php if($session->plus) {
if(isset($_GET['t']) && $_GET['t'] == 5) {
echo "<button name=\"start\" value=\"back\" alt=\"back\" id=\"btn_back\" class=\"trav_buttons\" /> Back </button>";
}
else {
echo "<button name=\"archive\" value=\"Archive\" alt=\"Archive\" id=\"btn_archiv\" class=\"trav_buttons\" /> Archive </button>";
}
}?>
<th class="buttons">
<?php
if ($session->plus) {
if (isset($_GET['t']) && $_GET['t'] == 5) {
echo "<button name=\"start\" value=\"back\" alt=\"back\" id=\"btn_back\" class=\"trav_buttons\" /> Back </button>";
} else {
echo "<button name=\"archive\" value=\"Archive\" alt=\"Archive\" id=\"btn_archiv\" class=\"trav_buttons\" /> Archive </button>";
}
}
?>
</th>
<th class=navi>
<th class=navi>
<?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&".(!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&".(!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&".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else {
echo "<a href=\"?p=report&".(!empty($_GET['t']) ? 't='.$_GET['t'].'&amp;' : '')."s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
}
}
?>
if (! isset($_GET['s']) && count($rep1) < 10) {
echo "&laquo;&raquo;";
} else if (! isset($_GET['s']) && count($rep1) > 10) {
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&" . (! 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&" . (! empty($_GET['t']) ? 't=' . $_GET['t'] . '&amp;' : '') . "s=" . ($_GET['s'] + 10) . "&o=0\">&raquo;</a>";
} else {
echo "<a href=\"?p=report&" . (! empty($_GET['t']) ? 't=' . $_GET['t'] . '&amp;' : '') . "s=" . ($_GET['s'] - 10) . "&o=0\">&laquo;</a>&raquo;";
}
}
?>
</th>
</tr>
</tfoot>
<tbody>
</tr>
</tfoot>
<tbody>
<?php
if(isset($_GET['s'])) {
if (isset($_GET['s'])) {
$s = $_GET['s'];
}
else {
} else {
$s = 0;
}
}
$name = 1;
$count = 0;
for($i=(1+$s);$i<=(10+$s);$i++) {
if(count($rep1) >= $i) {
echo "<tr><td class=\"sel\"><input class=\"check\" type=\"checkbox\" name=\"n".$name."\" value=\"".$rep1[$i-1]['id']."\" /></td>
$name = 1;
$count = 0;
for ($i = (1 + $s); $i <= (10 + $s); $i ++) {
if (count($rep1) >= $i) {
echo "<tr><td class=\"sel\"><input class=\"check\" type=\"checkbox\" name=\"n" . $name . "\" value=\"" . $rep1[$i - 1]['id'] . "\" /></td>
<td class=\"sub\">";
$type = $rep1[$i-1]['ntype'];
if($type==15 or $type==16 or $type==17){
//$type = $type-11;
echo "<img src=\"img/x.gif\" class=\"iReport iReport$type\" alt=\"".$noticeClass[$type]."\" title=\"".$noticeClass[$type]."\" />";
}else if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"".$noticeClass[$type]."\" title=\"".$noticeClass[$type]."\" />";
}else{
echo "<img src=\"img/x.gif\" class=\"iReport iReport$type\" alt=\"".$noticeClass[$type]."\" title=\"".$noticeClass[$type]."\" />";
}
echo "<div><a href=\"admin.php?p=message&bid=".$rep1[$i-1]['id']."\">".$rep1[$i-1]['topic']."</a> ";
if($rep1[$i-1]['viewed'] == 0) {
echo "(new)";
}
$date = $generator->procMtime($rep1[$i-1]['time']);
echo "</div></td><td class=\"dat\">".$date[0]." ".$date[1]."</td></tr>";
$type = $rep1[$i - 1]['ntype'];
if ($type >= 15 || $type <= 17) {
// $type = $type-11;
echo "<img src=\"img/x.gif\" class=\"iReport iReport$type\" alt=\"" . $noticeClass[$type] . "\" title=\"" . $noticeClass[$type] . "\" />";
} else if ($type >= 18 || $type <= 22) {
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"" . $noticeClass[$type] . "\" title=\"" . $noticeClass[$type] . "\" />";
} else {
echo "<img src=\"img/x.gif\" class=\"iReport iReport$type\" alt=\"" . $noticeClass[$type] . "\" title=\"" . $noticeClass[$type] . "\" />";
}
$name++;
echo "<div><a href=\"admin.php?p=report&bid=" . $rep1[$i - 1]['id'] . "\">" . $rep1[$i - 1]['topic'] . "</a> ";
if ($rep1[$i - 1]['viewed'] == 0) {
echo "(new)";
}
$date = $generator->procMtime($rep1[$i - 1]['time']);
echo "</div></td><td class=\"dat\">" . $date[0] . " " . $date[1] . "</td></tr>";
}
if(count($rep1) == 0) {
echo "<td colspan=\"3\" class=\"none\">There are no reports available.</td></tr>";
$name ++;
}
if (count($rep1) == 0) {
echo "<td colspan=\"3\" class=\"none\">There are no reports available.</td></tr>";
}
?>
</tbody>
</table>
</table>
+11 -10
View File
@@ -18,15 +18,15 @@ else
$result = mysqli_query($GLOBALS["link"], $sql);
$rep1 = $database->mysqli_fetch_all($result);
}
if($rep1)
{
//$att = $database->getUserArray($rep1['uid'],1);
?>
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css">
<link href="../<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
<link href="../<?php echo GP_LOCATE; ?>travian.css?e21d2" rel="stylesheet" type="text/css">
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?e21d2" rel="stylesheet" type="text/css">
<h1>Under Construction</h1>
<h1>Reports</h1>
<div id="content" class="reports" style="padding: 0;">
<?php
include("Notice/all.tpl");
@@ -34,22 +34,23 @@ if($rep1)
</div>
<?php
}
if($rep)
{ ?>
elseif($rep)
{
?>
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css">
<link href="../<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
<link href="../<?php echo GP_LOCATE; ?>travian.css?e21d2" rel="stylesheet" type="text/css">
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?e21d2" rel="stylesheet" type="text/css">
<br />
<span class="b">reporte de</span>: <?php echo $database->getUserField($rep[0]['uid'],'username',0);?><br />
<span class="b">Report of</span>: <?php echo $database->getUserField($rep['uid'],'username',0);?><br />
<div id="content" class="reports">
<h1>Reporte</h1>
<h1>Report</h1>
<?php
$type = $rep[0]['ntype'];
include ("Notice/" . $type . ".tpl");
$message = New Message();
$type = $rep['ntype'];
$message->readingNotice['data'] = $rep['data'];
include ("../Templates/Notice/" . $message->getReportType($type) . ".tpl");
}
else echo "Report ID ".$_GET['bid']." doesn't exist!";
?>
+9 -29
View File
@@ -527,46 +527,26 @@ if (!empty($_GET['p'])) {
<?php
if($funct->CheckLogin())
{
if($_POST or $_GET)
if($_POST || $_GET)
{
if($_GET['p'] and $_GET['p']!="search")
{
$filename = 'Templates/'.$_GET['p'].'.tpl';
if(file_exists($filename))
{
include($filename);
}
else
{
include('Templates/404.tpl');
}
}
else
{
include('Templates/search.tpl');
if(file_exists($filename)) include($filename);
else include('Templates/404.tpl');
}
else include('Templates/search.tpl');
if(isset($_POST['p']) && isset($_POST['s']) && $_POST['p'] and $_POST['s'])
{
$filename = 'Templates/results_'.$_POST['p'].'.tpl';
if(file_exists($filename))
{
include($filename);
}
else
{
include('Templates/404.tpl');
}
if(file_exists($filename)) include($filename);
else include('Templates/404.tpl');
}
}
else
{
include('Templates/home.tpl');
}
}
else
{
include('Templates/login.tpl');
else include('Templates/home.tpl');
}
else include('Templates/login.tpl');
?>
</div>
</div>