| 
									
										
										
										
											2018-04-13 21:31:03 +02:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if (!file_exists("../config.php")) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   header("Location: ../"); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | else{ | 
					
						
							| 
									
										
										
										
											2018-04-13 22:38:10 +02:00
										 |  |  | 	require_once("../config.php"); | 
					
						
							|  |  |  | 	require_once("../classes/constellation.php"); | 
					
						
							| 
									
										
										
										
											2018-04-13 21:31:03 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-14 12:50:10 +02:00
										 |  |  |   $limit = (isset($_GET['limit'])?$_GET['limit']:5); | 
					
						
							|  |  |  |   $offset = (isset($_GET['offset'])?$_GET['offset']:0); | 
					
						
							|  |  |  |   $timestamp = (isset($_GET['timestamp']))?$_GET['timestamp']:time(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	$result = $constellation->get_incidents((isset($_GET['future'])?$_GET['future']:false), $offset, $limit, $timestamp); | 
					
						
							| 
									
										
										
										
											2018-06-07 21:42:06 +02:00
										 |  |  | 	header('Cache-Control: no-cache'); | 
					
						
							|  |  |  | 	header('Content-type: application/json'); | 
					
						
							| 
									
										
										
										
											2018-04-13 22:38:10 +02:00
										 |  |  | 	echo json_encode($result); | 
					
						
							| 
									
										
										
										
											2018-04-13 21:31:03 +02:00
										 |  |  | } |