-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* @param string $key | ||
* @param DateTime $MASTER_DATE | ||
* @return void | ||
*/ | ||
function default_fir_render(string $key, DateTime $MASTER_DATE): void | ||
{ | ||
$weeklyBookings = Datahub::get_weekly_data($key); | ||
|
||
$min_stations = Datahub::get_stations_data($key, true); | ||
$main_stations = Datahub::get_stations_data($key, false); | ||
|
||
|
||
$booked_stations = DataManager::get_matched_station_array_bookings(clone $MASTER_DATE, 7, $main_stations); | ||
|
||
$img = ImageRenderer::render($min_stations, $main_stations, $booked_stations, $MASTER_DATE, $weeklyBookings); | ||
|
||
header('Content-type: image/png'); | ||
imagepng($img); | ||
imagedestroy($img); | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,15 @@ | ||
<?php | ||
require_once ("../../conf.php"); | ||
require_once("../../conf.php"); | ||
require_once(_BASE_PATH_ . "datamanager.class.php"); | ||
require_once(_BASE_PATH_ . "datahub.class.php"); | ||
require_once(_BASE_PATH_ . "imagerenderer.class.php"); | ||
require_once(_BASE_PATH_ . "helpers.php"); | ||
|
||
$MASTER_DATE = new DateTime(); | ||
if (isset($_GET['nextWeek'])) { | ||
$MASTER_DATE->add(new DateInterval('P7D')); | ||
} | ||
|
||
$key = 'edgg'; | ||
|
||
$stationsFile = fopen(_DATA_PATH_ . "edgg_allstations.csv", "r") or die("Unable to open allstations file!"); | ||
$minStationsFile = fopen(_DATA_PATH_ . "edgg_minstations.csv", "r") or die("Unable to open minstations file!"); | ||
$allStationsString = fgets($stationsFile); | ||
$minStationsString = fgets($minStationsFile); | ||
|
||
|
||
$bookingsString = file_get_contents(_DATA_PATH_ . "edgg_weekly.json") or die("Unable to open weekly file!"); | ||
$weeklyBookings = json_decode($bookingsString); | ||
|
||
$min_stations = explode(',',$minStationsString); | ||
$main_stations = explode(',',$allStationsString); | ||
|
||
$booked_stations = DataManager::get_matched_station_array_bookings(clone $MASTER_DATE,7 , $main_stations); | ||
|
||
$img = ImageRenderer::render($min_stations, $main_stations, $booked_stations, $MASTER_DATE, $weeklyBookings); | ||
|
||
header('Content-type: image/png'); | ||
imagepng($img); | ||
imagedestroy($img); | ||
default_fir_render($key, $MASTER_DATE); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,14 @@ | ||
<?php | ||
require_once ("../../conf.php"); | ||
require_once("../../conf.php"); | ||
require_once(_BASE_PATH_ . "datamanager.class.php"); | ||
require_once(_BASE_PATH_ . "datahub.class.php"); | ||
require_once(_BASE_PATH_ . "imagerenderer.class.php"); | ||
|
||
$MASTER_DATE = new DateTime(); | ||
if (isset($_GET['nextWeek'])) { | ||
$MASTER_DATE->add(new DateInterval('P7D')); | ||
} | ||
|
||
$key = 'edww'; | ||
|
||
$stationsFile = fopen(_DATA_PATH_ . "edww_allstations.csv", "r") or die("Unable to open allstations file!"); | ||
$minStationsFile = fopen(_DATA_PATH_ . "edww_minstations.csv", "r") or die("Unable to open minstations file!"); | ||
$allStationsString = fgets($stationsFile); | ||
$minStationsString = fgets($minStationsFile); | ||
|
||
|
||
$bookingsString = file_get_contents(_DATA_PATH_ . "edww_weekly.json") or die("Unable to open weekly file!"); | ||
$weeklyBookings = json_decode($bookingsString); | ||
|
||
|
||
$min_stations = explode(',',$minStationsString); | ||
$main_stations = explode(',',$allStationsString); | ||
|
||
$booked_stations = DataManager::get_matched_station_array_bookings(clone $MASTER_DATE,7 , $main_stations); | ||
|
||
$img = ImageRenderer::render($min_stations, $main_stations, $booked_stations, $MASTER_DATE, $weeklyBookings); | ||
|
||
header('Content-type: image/png'); | ||
imagepng($img); | ||
imagedestroy($img); | ||
default_fir_render($key, $MASTER_DATE); |
This file was deleted.
This file was deleted.