From 645dbaf77e9cd0c9fb12be53ca49d9c5e5357d7d Mon Sep 17 00:00:00 2001 From: adametz Date: Thu, 27 Dec 2018 16:40:18 +0000 Subject: [PATCH] return show_nationality_country_text git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3480 f459cee4-fb09-11de-96c3-f9c5f16c3c76 --- .../AppBundle/Controller/BookingController.php | 18 ++++++++++++++---- .../AppBundle/Resources/public/js/booking.js | 4 +--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/trunk/src/AppBundle/Controller/BookingController.php b/trunk/src/AppBundle/Controller/BookingController.php index 2dd599bb..51d92abf 100644 --- a/trunk/src/AppBundle/Controller/BookingController.php +++ b/trunk/src/AppBundle/Controller/BookingController.php @@ -63,22 +63,32 @@ class BookingController extends Controller public function indexAction(Page $travelProgramPage, $action, Request $request) { + if($action == '/show_nationality_country_text') { $ret = ""; $nationality_id = $request->request->get('nationality_id'); $country_ids = $request->request->get('country_ids'); + + foreach ($country_ids as $country_id){ - $country = $this->getEntityManager()->getRepository('AppBundle:TravelCountry') - ->findOneBy(['id' => $country_id]); + $country = $this->getEntityManager()->getRepository('AppBundle:TravelCountry')->findOneBy(['id' => $country_id]); + $req = $this->getDoctrine()->getRepository('AppBundle:TravelNationalityRequirement')->findOneByCountryAndNationality($country_id, $nationality_id); + + if($req && $country){ - $ret .= "

".$country->getName()."

"; - $ret .= "

".$req->getText()."

"; + + $setC = !empty($country->getName()) ? $country->getName() : "Einreiseland"; + $setT = !empty($req->getText()) ? $req->getText() : "Die Einreisebestimmungen erhalten Sie nach der Bestätigung Ihrer Anfrage."; + $ret .= "

".$setC."

"; + $ret .= "

".$setT."

"; $ret .= "
"; } } + echo $ret; + die(); } $travelProgram = $travelProgramPage->getTravelProgram(); diff --git a/trunk/src/AppBundle/Resources/public/js/booking.js b/trunk/src/AppBundle/Resources/public/js/booking.js index e8b50a72..f325d5f5 100644 --- a/trunk/src/AppBundle/Resources/public/js/booking.js +++ b/trunk/src/AppBundle/Resources/public/js/booking.js @@ -92,10 +92,8 @@ $(document).ready(function() { $(obj).find('.accordion-toggle').click(); toggle_first[ele.val()] = true; } - - }, function() { - summary$.html('Aufgrund eines Fehlers konnte kein Angebot ermittelt werden.'); + summary$.html('Aufgrund eines Fehlers konnte keine Anfrage übermittel werden.'); }); }else{ $(obj).hide();