aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/AppBundle/Controller')
-rw-r--r--src/AppBundle/Controller/LastWeekDataController.php1
-rw-r--r--src/AppBundle/Controller/TrainScheduleController.php31
2 files changed, 31 insertions, 1 deletions
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 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: marcin
+ * Date: 07/12/17
+ * Time: 10:33
+ */
+
+namespace AppBundle\Controller;
+
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
+use SoapClient;
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+
+class TrainScheduleController extends Controller
+{
+ /**
+ * @Route("/TrainSchedule")
+ */
+
+ public function GetSchedule()
+ {
+ $client = new SoapClient( "http://traindata.dsb.dk/stationdeparture/Service.asmx?WSDL" );
+ $params = array( 'request' => 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