//print_r($json);
foreach (json_decode($json, true)["hydra:member"] as $day){
$id = explode("/",$day["ticketing"]["@id"]);
//Get scanned
$uri = 'https://ticketing.mapado.net/v1/scans?user=me&fields=&itemsPerPage=0&page=1&after='.date("Y-m-d", strtotime($day["startDate"])).'T00:00:00.000Z&before='.date("Y-m-d", strtotime($day["startDate"])).'T23:59:00.000Z&status=valid';
$ch = curl_init($uri);
curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array('Authorization: Bearer '.$apikey),
CURLOPT_RETURNTRANSFER =>true,
CURLOPT_VERBOSE => 1
));
$json = curl_exec($ch);
//echo prettyPrint($json);
curl_close($ch);
// echo response output
$array = json_decode($json, true);
$nb_scan = $array["hydra:totalItems"];
if($id[3]==$id_park){
echo '
'.strftime("%a %e %b %Y", strtotime($day["startDate"])).'
Preventes : '.$day["issuedTickets"].'
Scannés : '.$nb_scan.' ('.$day["validScanNb"].')
';
if(!$fastcheck){
foreach ($day["ticketPriceList"] as $ticketPrice){
if (strcmp($ticketPrice["name"], "visite guidée coulisses et ateliers de 15h") == 0) {
echo "Visites 15h : ".$ticketPrice["issuedTickets"]."
";
}
if (strcmp($ticketPrice["name"], "visite guidée coulisses et ateliers de 16h30") == 0) {
echo "Visites 16h30 : ".$ticketPrice["issuedTickets"]."
";
}
}}
echo'';
}
}
?>