diff --git a/EuroScope.ttf b/EuroScope.ttf new file mode 100644 index 0000000..ec72b2b Binary files /dev/null and b/EuroScope.ttf differ diff --git a/Schedule.php b/Schedule.php index 38b2321..2400b1a 100644 --- a/Schedule.php +++ b/Schedule.php @@ -37,6 +37,7 @@ class Schedule { $this->wantedstations = $wantedstations; $this->improps = []; $this->darkmode = $darkmode; + //$this->debug = true; } 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, 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"]); diff --git a/Tuesday.jpg.php b/Tuesday.jpg.php index 5d963d2..ac9bb12 100644 --- a/Tuesday.jpg.php +++ b/Tuesday.jpg.php @@ -3,8 +3,13 @@ require_once "Schedule.php"; require_once "config.php"; +//echo "
";
+
 $sched = new Schedule(Schedule::EveryWeekday("Tuesday", 2), $stations_berlin, $optional, $wanted, $darkmode);
 $image = $sched->createImage();
 
 header("Content-Type: image/jpg");
-imagejpeg($image);
\ No newline at end of file
+imagejpeg($image);
+//imagejpeg($image, "test23.jpg");
+
+//echo "\n\n";
diff --git a/UbuntuMono-Bold.ttf b/UbuntuMono-Bold.ttf
new file mode 100644
index 0000000..0ac7e58
Binary files /dev/null and b/UbuntuMono-Bold.ttf differ
diff --git a/config.php b/config.php
index 4c91fca..1adab42 100644
--- a/config.php
+++ b/config.php
@@ -10,16 +10,20 @@ $stations = [
     "EDWW_K_CTR",
     "EDWW_F_CTR",
     "EDMM_M_CTR",
+    "EDMM_H_CTR",
     "EDMM_G_CTR",
-    "EDUU_O_CTR",
-    "EDUU_E_CTR",
+    "EDMM_O_CTR",
+    "EDUU_H_CTR",
+    "EDUU_P_CTR",
+    "EDUU_A_CTR",
+    "EDUU_R_CTR",
     "--",
-    "EDBB_S_APP",
-    "EDBB_N_APP",
-    "EDBB_U_APP",
-    "EDBB_F_APP",
-    "EDBB_S_DEP",
-    "EDBB_N_DEP",
+    "EDDB_S_APP",
+    "EDDB_N_APP",
+    "EDDB_U_APP",
+    "EDDB_F_APP",
+    "EDDB_S_DEP",
+    "EDDB_N_DEP",
     "--",
     "EDDB_N_TWR",
     "EDDB_S_TWR",
@@ -55,16 +59,20 @@ $stations_berlin = [
     "EDWW_K_CTR",
     "EDWW_F_CTR",
     "EDMM_M_CTR",
+    "EDMM_H_CTR",
     "EDMM_G_CTR",
-    "EDUU_O_CTR",
-    "EDUU_E_CTR",
+    "EDMM_O_CTR",
+    "EDUU_H_CTR",
+    "EDUU_P_CTR",
+    "EDUU_A_CTR",
+    "EDUU_R_CTR",
     "--",
-    "EDBB_S_APP",
-    "EDBB_N_APP",
-    "EDBB_U_APP",
-    "EDBB_F_APP",
-    "EDBB_S_DEP",
-    "EDBB_N_DEP",
+    "EDDB_S_APP",
+    "EDDB_N_APP",
+    "EDDB_U_APP",
+    "EDDB_F_APP",
+    "EDDB_S_DEP",
+    "EDDB_N_DEP",
     "--",
     "EDDB_N_TWR",
     "EDDB_S_TWR",
@@ -83,17 +91,21 @@ $optional = [
     "EDWW_K_CTR",
     "EDWW_F_CTR",
     "EDMM_M_CTR",
-    "EDUU_O_CTR",
-    "EDUU_E_CTR",
-    "EDBB_N_APP",
-    "EDBB_F_APP",
-    "EDBB_N_DEP",
-    "EDDB_S_TWR",
+    "EDMM_O_CTR",
+    "EDMM_H_CTR",
+    "EDUU_H_CTR",
+    "EDUU_P_CTR",
+    "EDUU_A_CTR",
+    "EDUU_R_CTR",
+    "EDDB_N_APP",
+    "EDDB_F_APP",
+    "EDDB_N_DEP",
+    "EDDB_N_TWR",
     "EDDB_E_GND",
-    "EDDB_S_GND",
+    "EDDB_N_GND",
     "EDDP_F_APP",
     "EDDP_N_APP",
-    "EDDP_S_TWR",
+    "EDDP_N_TWR",
     "EDDP_GND",
     "EDDP_DEL",
     "EDDC_APP",
@@ -106,13 +118,13 @@ $optional = [
 $wantedstns = [
     'EDWW_B_CTR', 
     'EDMM_G_CTR', 
-    'EDBB_S_APP', 
-    'EDBB_U_APP', 
-    'EDBB_S_DEP', 
-    'EDDB_N_TWR', 
+    'EDDB_S_APP', 
+    'EDDB_U_APP', 
+    'EDDB_S_DEP', 
+    'EDDB_S_TWR', 
     'EDDB_A_GND', 
     'EDDB_DEL', 
-    'EDDB_N_GND'
+    'EDDB_S_GND'
 ];
 
 $wanted = Schedule::processWantedDays(
@@ -125,4 +137,4 @@ if(isset($_COOKIE['darkmode']) && $_COOKIE['darkmode'] == 'On') {
     $darkmode = true;
 } else {
     $darkmode = false;
-}
\ No newline at end of file
+}