<?php

error_reporting(E_ALL);

$session;
if($_GET['request'] === '0')
{
  $session = curl_init('https://poseidonsystem.gr/map/pg_connect_platform.php?id=' . $_GET["id"] . '&dateStart=1970-01-01&dateEnd=2050-01-01&alldateStart=1970-01-01&alldateEnd=2050-01-01');
}

if($_GET['request'] === '1')
{
  $session = curl_init('https://poseidonsystem.gr/map/page_platform_info_get_ts_chartdata.php?good=1&id=' . $_GET["id"] . '&param=' . $_GET["param"] . '&chosenDtEnd=' . $_GET["chosenDtEnd"] . '&chosenDtStart=' . $_GET["chosenDtStart"]);
}

curl_setopt($session, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($session);

header("Content-Type: application/json");

echo $response;

curl_close($session);