From 33d32256a38bccdc1848f5e15804a43b51abcc4f Mon Sep 17 00:00:00 2001 From: genuineparts Date: Sat, 5 Jul 2025 21:24:53 +0200 Subject: [PATCH] First functions --- .idea/.gitignore | 8 ++++++++ .idea/OebbApiWeb.iml | 8 ++++++++ .idea/modules.xml | 8 ++++++++ .idea/php.xml | 19 +++++++++++++++++++ .idea/vcs.xml | 7 +++++++ home.php | 42 +++++++++++++++++++++++++++++++++++++++++- suggest.php | 36 ++++++++++++++++++++++++++++++++++++ 7 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/OebbApiWeb.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/php.xml create mode 100644 .idea/vcs.xml create mode 100644 suggest.php diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/OebbApiWeb.iml b/.idea/OebbApiWeb.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/OebbApiWeb.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..09123ab --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..f324872 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..8306744 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/home.php b/home.php index 7bece3d..ed8c024 100644 --- a/home.php +++ b/home.php @@ -14,6 +14,28 @@ if (!isset($_SESSION['account_loggedin'])) { Home + @@ -48,10 +70,28 @@ if (!isset($_SESSION['account_loggedin'])) {

This is the home page. You are logged in!

+
+ Bildschirm 2:
+ Name: + Abfahrtszeit: + Zug (z.b. REX 3): + Station: + Endstation des Zugs: +
+ + + +
+
+ + + +
+
- \ No newline at end of file + diff --git a/suggest.php b/suggest.php new file mode 100644 index 0000000..0196787 --- /dev/null +++ b/suggest.php @@ -0,0 +1,36 @@ +2) { + $type = $_GET['type']; + //http://fahrplan.oebb.at/bin/ajax-getstop.exe/dn?REQ0JourneyStopsS0A=1&REQ0JourneyStopsB=12&S=""&js=true + $name = urldecode($_GET['name']); + $ch = curl_init(); + $buffer = ""; + curl_setopt($ch, CURLOPT_URL, 'https://fahrplan.oebb.at/bin/ajax-getstop.exe/dn?REQ0JourneyStopsS0A=1&REQ0JourneyStopsB=12&S='.$name.'&js=true'); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_TIMEOUT, 15); + curl_setopt($ch, CURLOPT_HEADER, false); + $fh=curl_exec($ch); + //var_dump(curl_getinfo($ch)); + // schließe den cURL-Handle und gebe die Systemresourcen frei + curl_close($ch); + if ($fh) { + $buffer = trim($fh); + } + $data = json_decode(mb_convert_encoding(str_replace("SLs.sls={\"suggestions\":","",str_replace("};SLs.showSuggestion();","",$buffer)),'UTF-8','ISO-8859-1')); + if($type=="station") { + $output = ''; + foreach ($data as $value) { + $output .= ''; + } + $output .= ''; + echo $output; + }else{ + $output = ''; + foreach ($data as $value) { + $output .= ''; + } + $output .= ''; + echo $output; + } +}