o.moresis
2 years ago
6 changed files with 21 additions and 53 deletions
@ -1,44 +0,0 @@ |
|||||||
<?php |
|
||||||
/** |
|
||||||
* Requests external data from other APIs such as Poseidon or WfdAPI |
|
||||||
* |
|
||||||
*/ |
|
||||||
session_start(); |
|
||||||
$user_groups = implode(",", $_SESSION['usergroups']); |
|
||||||
if ($user_groups < 4) { |
|
||||||
header('HTTP/1.0 401 Unauthorized'); |
|
||||||
exit(); |
|
||||||
} |
|
||||||
/* require_once(__DIR__ . '/data_request.php'); */ |
|
||||||
require_once(__DIR__ . '/../wfd_api.php'); |
|
||||||
//require_once(__DIR__ . '/../lib/common.php'); |
|
||||||
// Process all of the get values |
|
||||||
// TODO: Clean below variables |
|
||||||
/* $bodyId = $_GET['bodyId']; */ |
|
||||||
/* $entity_type = $_GET['entityGroup']; */ |
|
||||||
/* $entity_id = $_GET['entityId']; */ |
|
||||||
/* $criterias = $_GET['critId']; */ |
|
||||||
/* $dateFrom = $_GET['dateFrom']; */ |
|
||||||
/* $dateTo = $_GET['dateTo']; */ |
|
||||||
/* $user_id = $_SESSION['userid']; */ |
|
||||||
/* $user_groups = implode(",", $_SESSION['usergroups']); */ |
|
||||||
/* $files_list = array(); */ |
|
||||||
/* $downloadable = array(); */ |
|
||||||
$p = new WfdAPI(); |
|
||||||
$p->getToken(); |
|
||||||
$stations = $p->getStations(); |
|
||||||
$samples = $p->getStationSamples(); |
|
||||||
$sampleIds = []; |
|
||||||
foreach ($samples as $sample) { |
|
||||||
$sampleIds[] = $sample->id; |
|
||||||
} |
|
||||||
|
|
||||||
$data = $p->getData($sampleIds); |
|
||||||
/* print_r($data); */ |
|
||||||
/* $json = json_encode($stations); */ |
|
||||||
echo json_encode($data); |
|
||||||
/* echo convertToGeoJSON($json, 'ctStationDecimalLongitude', 'ctStationDecimalLatitude'); */ |
|
||||||
/* $request = new DataRequest($_GET, $user_id); */ |
|
||||||
/* echo $request->insert_to_db(); */ |
|
||||||
/* */ |
|
||||||
?> |
|
Loading…
Reference in new issue