forked from Flame1994/CosmicTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetSignatures.php
56 lines (55 loc) · 2.46 KB
/
getSignatures.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
// ============================================================================
// Updates and displays the signatures when jumping to a new region
// ============================================================================
include "php/routes.php";
session_start();
if (isset($_SESSION['CharacterRegionName'])) {
echo '
<h4 id="sig-region">Signatures scanned in <span class="text-primary">'.$_SESSION['CharacterRegionName'].'</span></h4>
<form action="" autocomplete="on" style="margin-bottom: 50px;">
<input id="search" name="search" type="text" placeholder="What are you looking for?"><input id="search_submit" value="Rechercher" type="submit"><i class="fa fa-search search-bar" aria-hidden="true" style="font-size: 30px;"></i>
</form>
<div class="col-xs-12 signature-list all-signature-list">
<table>
<tr>
<th>System</th>
<th>ID</th>
<th>Type</th>
<th>Signature Name</th>
<th>Explorer</th>
<th>Time</th>
<th></th>
</tr>';
$conn = connect();
$prepared = $conn->prepare("SELECT * FROM signatures WHERE region_name = ? AND (corp_id = ? OR alliance_id = ?) ORDER BY report_time DESC");
$prepared->bind_param('sss', $_SESSION['CharacterRegionName'], $_SESSION["CharacterCorpID"], $_SESSION['CharacterAllianceID']);
$prepared->execute();
$result = get_result($prepared);
while ($row = array_shift($result)) {
$system = $row['system'];
$sigID = $row['sig_id'];
$sigType = $row['sig_type'];
$sigName = $row['sig_name'];
$reported = $row['reported'];
$reportedID = $row['reported_id'];
$reportTime = $row['report_time'];
echo '
<tr>
<td>'.$system.'</td>
<td>'.$sigID.'</td>
<td>'.$sigType.'</td>
<td>'.$sigName.'</td>
<td><a href="https://zkillboard.com/character/'.$reportedID.'/">'.$reported.'</a></td>
<td>'.$reportTime.'</td>
<td></td>
</tr>
';
}
$conn->close();
echo '</table>
</div> ';
} else {
echo "NONE";
}
?>