forked from Flame1994/CosmicTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetCombatSites.php
35 lines (27 loc) · 1.04 KB
/
getCombatSites.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
<?php
// ============================================================================
// Loads all combat sites scanned in the region
// ============================================================================
include "php/routes.php";
session_start();
if (isset($_SESSION['CharacterRegionName'])) {
$region = $_SESSION['CharacterRegionName'];
$conn = connect();
$prepared = $conn->prepare("SELECT * FROM signatures WHERE region_name = ? AND sig_type = ?");
$site = "Combat Site";
$prepared->bind_param('ss', $region, $site);
$prepared->execute();
$result = get_result($prepared);
$return_arr = array();
if ($prepared->num_rows == 0) {
echo "NONE";
} else {
while ($row = array_shift($result)) {
$row_array['system'] = $row['system'];
array_push($return_arr,$row_array);
}
$conn->close();
echo json_encode($return_arr);
}
}
?>