-
Notifications
You must be signed in to change notification settings - Fork 1
/
getSystemInfo.php
64 lines (58 loc) · 2.54 KB
/
getSystemInfo.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
57
58
59
60
61
62
63
64
<?php
// ============================================================================
// Loads system info on hover (on the map)
// ============================================================================
include "php/routes.php";
session_start();
$conn = connect();
if (isset($_GET['system'])) {
$prepared = $conn->prepare("SELECT COUNT(*) AS sigCount FROM signatures WHERE system_id = ? AND sig_type = ? AND alliance_id = ?");
$var = "Relic Site";
$prepared->bind_param('sss', $_GET['system'], $var, $_SESSION['CharacterAllianceID']);
$prepared->execute();
$result = get_result($prepared);
while ($row = array_shift($result)) {
$relicSites = $row['sigCount'];
}
$prepared = $conn->prepare("SELECT COUNT(*) AS sigCount FROM signatures WHERE system_id = ? AND sig_type = ? AND alliance_id = ?");
$var = "Data Site";
$prepared->bind_param('sss', $_GET['system'], $var, $_SESSION['CharacterAllianceID']);
$prepared->execute();
$result = get_result($prepared);
while ($row = array_shift($result)) {
$dataSites = $row['sigCount'];
}
$prepared = $conn->prepare("SELECT COUNT(*) AS sigCount FROM signatures WHERE system_id = ? AND sig_type = ? AND alliance_id = ?");
$var = "Combat Site";
$prepared->bind_param('sss', $_GET['system'], $var, $_SESSION['CharacterAllianceID']);
$prepared->execute();
$result = get_result($prepared);
while ($row = array_shift($result)) {
$combatSites = $row['sigCount'];
}
$prepared = $conn->prepare("SELECT COUNT(*) AS sigCount FROM signatures WHERE system_id = ? AND sig_type = ? AND alliance_id = ?");
$var = "Gas Site";
$prepared->bind_param('sss', $_GET['system'], $var, $_SESSION['CharacterAllianceID']);
$prepared->execute();
$result = get_result($prepared);
while ($row = array_shift($result)) {
$gasSites = $row['sigCount'];
}
$prepared = $conn->prepare("SELECT COUNT(*) AS sigCount FROM signatures WHERE system_id = ? AND sig_type = ? AND alliance_id = ?");
$var = "Wormhole";
$prepared->bind_param('sss', $_GET['system'], $var, $_SESSION['CharacterAllianceID']);
$prepared->execute();
$result = get_result($prepared);
while ($row = array_shift($result)) {
$wormhole = $row['sigCount'];
}
// echo $count;
echo '
<h6>'.$relicSites.' Relic Site(s)</h6>
<h6>'.$dataSites.' Data Site(s)</h6>
<h6>'.$combatSites.' Combat Site(s)</h6>
<h6>'.$gasSites.' Gas Site(s)</h6>
<h6>'.$wormhole.' Wormhole(s)</h6>
';
}
?>