From 8147707052ee5281a5749ce1c1b85cc2613658cf Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Thu, 7 Dec 2017 13:25:29 +0100 Subject: Added train schedule. --- app/Resources/views/base.html.twig | 3 ++ .../views/default/TrainSchedule.html.twig | 32 ++++++++++++++++++++++ .../Controller/LastWeekDataController.php | 1 - .../Controller/TrainScheduleController.php | 31 +++++++++++++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 app/Resources/views/default/TrainSchedule.html.twig create mode 100644 src/AppBundle/Controller/TrainScheduleController.php diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index 36b2851..f8d8374 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -20,6 +20,9 @@ Last Week Data + + Train Schedule +
diff --git a/app/Resources/views/default/TrainSchedule.html.twig b/app/Resources/views/default/TrainSchedule.html.twig new file mode 100644 index 0000000..a2c8572 --- /dev/null +++ b/app/Resources/views/default/TrainSchedule.html.twig @@ -0,0 +1,32 @@ +{% extends 'base.html.twig' %} + +{% block body %} + + + + + + + + + + + + + + + {% for table in data %} + + + + + + + + + + {% endfor %} +
TrackTrain typeTrain numberDestination nameArrivalDepartureDelay
{{ table.Track }}{{ table.TrainType }}{{ table.TrainNumber }}{{ table.DestinationName }}{{ table.ScheduledArrival }}{{ table.ScheduledDeparture }}{{ table.DepartureDelay }}
+{% endblock %} +{% block javascripts %} +{% endblock %} \ No newline at end of file diff --git a/src/AppBundle/Controller/LastWeekDataController.php b/src/AppBundle/Controller/LastWeekDataController.php index f77a751..7b5d993 100644 --- a/src/AppBundle/Controller/LastWeekDataController.php +++ b/src/AppBundle/Controller/LastWeekDataController.php @@ -38,6 +38,5 @@ class LastWeekDataController extends Controller $parametersToTwig = array("data" => $data); return $this->render('default/LastWeekData.html.twig',$parametersToTwig); - } } \ No newline at end of file diff --git a/src/AppBundle/Controller/TrainScheduleController.php b/src/AppBundle/Controller/TrainScheduleController.php new file mode 100644 index 0000000..927be0c --- /dev/null +++ b/src/AppBundle/Controller/TrainScheduleController.php @@ -0,0 +1,31 @@ + array( 'UICNumber' => '8600617' ) ); + $response = $client->GetStationQueue( $params ); + $data = $response->GetStationQueueResult->Trains->Queue; + $parametersToTwig = array("data" => $data); + + return $this->render('default/TrainSchedule.html.twig',$parametersToTwig); + } +} \ No newline at end of file -- cgit v1.2.3