fix: logging works, tech log link added to Admin

This commit is contained in:
Martin Ambrus
2017-11-07 10:34:50 +01:00
parent 6a332f292b
commit 8a7f12268c
15 changed files with 100 additions and 23 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
$id = $_GET['did'];
if(isset($id))
{
?>
<br /><br />
<table id="profile">
<thead>
<tr>
<th colspan="3" class="on"><a href="#"><?php echo $village['name']; ?></a>'s Research Log</th>
</tr>
<tr>
<td style="width: 12%">#</td>
<td>Event</td>
<td>Date</td>
</tr>
</thead>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."tech_log WHERE wid = ".(int) $_GET['did']."";
$result = mysqli_query($GLOBALS["link"], $sql);
$j = 0;
while($row = mysqli_fetch_assoc($result))
{
echo '
<tr>
<td>'.++$j.'</td>
<td>'.$row['log'].'</td>
<td style="white-space: nowrap">'.$row['date'].'</td>
</tr>';
}
?>
</thead>
</table><?php
}
else
{
include("404.tpl");
}
?>
+1 -1
View File
@@ -54,7 +54,7 @@ if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!");
if($_SESSION['access'] == ADMIN)
{
if($tribe==5) { echo '<span class="none">Upgrades Troops</span>';}
else { echo '<a href="admin.php?p=addABTroops&did='.$_GET['did'].'">Upgrades Troops</a>';}
else { echo '<a href="admin.php?p=addABTroops&did='.$_GET['did'].'">Upgrades Troops</a><a href="admin.php?p=techlog&did='.$_GET['did'].'" style="float: right">Research Log</a>';}
}
if(isset($_GET['ab'])){
echo '<div align="right"><font color="Red"><b>AB Tech Troops upgrades</font></b></div>';
+5 -3
View File
@@ -10,20 +10,22 @@ if(isset($id))
<th colspan="3" class="on"><a href="#"><?php echo $village['name']; ?></a>'s Build Log</th>
</tr>
<tr>
<td class="on">#</td>
<td style="width: 12%">#</td>
<td>Event</td>
<td>Date</td>
</tr>
</thead>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."build_log WHERE wid = ".(int) $_GET['did']."";
$result = mysqli_query($GLOBALS["link"], $sql);
$j = 0;
while($row = mysqli_fetch_assoc($result))
{
$j++;
echo '
<tr>
<td class="on">'.$j.'</td>
<td>'.++$j.'</td>
<td>'.$row['log'].'</td>
<td style="white-space: nowrap">'.$row['date'].'</td>
</tr>';
}
?>
+10
View File
@@ -351,6 +351,16 @@ if (!empty($_GET['p'])) {
$subpage = 'Build Log (no village)';
}
break;
case 'techlog':
if (!empty($_GET['did'])) {
$village = $database->getVillage($_GET['did']);
$user = $database->getUserArray($village['owner'],1);
$subpage = 'Research Log ('.$village['name'].' &raquo; '.$user['username'].')';
} else {
$subpage = 'Research Log (no village)';
}
break;
}
}