|
@@ -37,6 +37,7 @@ class Schedule {
|
|
|
$this->wantedstations = $wantedstations;
|
|
|
$this->improps = [];
|
|
|
$this->darkmode = $darkmode;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public function createImage() {
|
|
@@ -125,7 +126,7 @@ class Schedule {
|
|
|
}
|
|
|
|
|
|
$height += $this->improps['lineheight'] + 5;
|
|
|
- imagefttext($this->image, 11, 0, 10, $height, $this->improps['wanted'], $this->improps['font'], 'Wanted');
|
|
|
+
|
|
|
imagefttext($this->image, 11, 0, 100, $height, $this->improps['training'], $this->improps['font'], 'Training');
|
|
|
imagefttext($this->image, 11, 0, 200, $height, $this->improps['event'], $this->improps['font'], 'Event');
|
|
|
imagefttext($this->image, 11, 0, 300, $height, $this->improps['eventtraining'], $this->improps['font'], 'Event + Training');
|
|
@@ -151,7 +152,6 @@ class Schedule {
|
|
|
$this->image = imagecrop($this->image, ['x' => 0, 'y' => 0, 'width' => $this->improps['width'], 'height' => $height+5]);
|
|
|
|
|
|
return $this->image;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private function addBookingData($station, $date, $bookings, $x, $height) {
|
|
@@ -179,7 +179,9 @@ class Schedule {
|
|
|
}
|
|
|
|
|
|
private function fetchData() {
|
|
|
- $url = sprintf("https://vatsim-germany.org/api/booking/atc/daterange/%s/%s", $this->displaydates[0]->format("d.m.Y"), $this->displaydates[count($this->displaydates) -1]->format("d.m.Y"));
|
|
|
+ $url = sprintf("https://vatsim-germany.org/api/booking/atc/daterange/%s/%s", $this->displaydates[0]->modify("-1 day")->format("d.m.Y"), $this->displaydates[count($this->displaydates) -1]->format("d.m.Y"));
|
|
|
+ $this->displaydates[0]->modify("+1 day");
|
|
|
+ if($this->debug) echo "\nUrl: $url";
|
|
|
$curl = curl_init();
|
|
|
curl_setopt($curl, CURLOPT_URL, $url ) ;
|
|
|
curl_setopt($curl, CURLOPT_HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]);
|