Add parameters back

This commit is contained in:
Vojtěch Sajdl 2018-04-14 12:50:10 +02:00
parent 4b7d8be838
commit 3c75159e2a
No known key found for this signature in database
GPG Key ID: 082BC82518E5F32E

View File

@ -8,12 +8,11 @@ else{
require_once("../config.php"); require_once("../config.php");
require_once("../classes/constellation.php"); require_once("../classes/constellation.php");
if (isset($_GET['future']) && $_GET['future'] == true) $limit = (isset($_GET['limit'])?$_GET['limit']:5);
{ $offset = (isset($_GET['offset'])?$_GET['offset']:0);
$result = $constellation->get_incidents(true); $timestamp = (isset($_GET['timestamp']))?$_GET['timestamp']:time();
}else{
$result = $constellation->get_incidents(); $result = $constellation->get_incidents((isset($_GET['future'])?$_GET['future']:false), $offset, $limit, $timestamp);
}
echo json_encode($result); echo json_encode($result);
} }