forked from Flame1994/CosmicTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetIntel.php
68 lines (61 loc) · 2.09 KB
/
getIntel.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
65
66
67
68
<?php
// ============================================================================
// Loads intel from the system
// ============================================================================
include "php/routes.php";
session_start();
if (isset($_GET['system'])) {
$system_id = $_GET['system'];
$url4 = file_get_contents("https://esi.tech.ccp.is/latest/universe/system_kills/?datasource=tranquility");
$content4 = json_decode($url4, true);
$foundKills = false;
foreach($content4 as $systemKills) {
if ($systemKills['system_id'] == $system_id) {
$foundKills = true;
$kills = (int)$systemKills['ship_kills'];
$npc_kills = (int)$systemKills['npc_kills'];
$pod_kills = $systemKills['pod_kills'];
$ship_kills = $kills - $npc_kills;
}
}
if ($foundKills == false) {
$kills = 0;
$npc_kills = 0;
$pod_kills = 0;
$ship_kills = 0;
}
$foundJumps = false;
$url5 = file_get_contents("https://esi.tech.ccp.is/latest/universe/system_jumps/?datasource=tranquility");
$content5 = json_decode($url5, true);
foreach($content5 as $systemJumps) {
if ($systemJumps['system_id'] == $system_id) {
$foundJumps = true;
$jumps = $systemJumps['ship_jumps'];
}
}
if ($foundJumps == false) {
$jumps = 0;
}
echo '
<h5>Intel (1h)</h5>
<table>
<tr>
<td>'.$jumps.'</td>
<td>Jumps</td>
</tr>
<tr>
<td>'.$ship_kills.'</td>
<td>Ship Kills</td>
</tr>
<tr>
<td>'.$pod_kills.'</td>
<td>Pod Kills</td>
</tr>
<tr>
<td>'.$npc_kills.'</td>
<td>Rat Kills</td>
</tr>
</table>
';
}
?>