public function userreservationAction() { //SET RESACHANGE TO FALSE $this->layout()->setLayout('reservation_layout_registration'); $this->view->headLink()->appendStylesheet(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/intl-tel-input-master/build/css/intlTelInput.css'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/select2/select2.min.js'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/intl-tel-input-master/build/js/intlTelInput.js'); if ($this->getParam("lg")) { $locale = new \Zend_Locale($this->_getParam("lg")); \Zend_Registry::set("Zend_Locale", $locale); $this->mySessionSite->Locale = $locale; } $societes = new Object\Societe\Listing(); $this->view->societes = $societes; if ($this->getParam("selectedLocationid")) { $selectedLocationid = $this->getParam("selectedLocationid"); } else { $selectedLocationid = 944; } $selectedLocation = Object\Location::getById($selectedLocationid, 1); if ($selectedLocation instanceof Object\Location) { $this->selectedLocation = $selectedLocation; $today = new zend_date(); $sixmonthsfromnow = $today->add('6', Zend_Date::MONTH); $fulltext = ""; $this->view->societe = $this->selectedLocation->getSociete(); foreach ($selectedLocation->getShifts($today, $sixmonthsfromnow) as $dayoff) { if ($dayoff->getAllDay() == 1) { $fulltext = $this->arrayToString($this->getAllDays($dayoff->getStart(), $dayoff->getEnd())) . "," . $fulltext; } } $this->view->offdaysrange = $fulltext; $this->view->closeddays = json_encode($this->checkClosedServings()); $this->view->selectedLocation = $selectedLocation; $this->view->resachange = false; $this->view->selectedlocationid = $this->selectedLocation->getId(); if ($this->selectedLocation->getGeolocalisation()) { $this->view->lat = $this->selectedLocation->getGeolocalisation()->getLatitude(); $this->view->long = $this->selectedLocation->getGeolocalisation()->getLongitude(); } else { $this->view->lat = 0; $this->view->long = 0; } if ($this->getParam('resadate')) { $this->view->resadate = $this->getParam('resadate'); } } else { $this->view->warning = "This is not a correct location"; } $this->view->inlineScript()->appendScript('jQuery(document).ready(function() { Main.init(); ReservationFormValidator.init(); var newresa="newresa"; var today=new Date(); var getMonth2=function(date) { var month = date.getMonth() + 1; return month < 10 ? "0" + month : "" + month; } var getDate2=function(date) { var day = date.getDate(); return day < 10 ? "0" + day : "" + day; } $("body").on("click", ".locationlinkfinal", function(){ $(".registergroup").addClass("no-display"); $(".registergroup1").addClass("no-display"); $(".registergroup2").addClass("no-display"); $(".selectgroup").addClass("no-display"); $(".slotgroup").addClass("no-display"); $("#calendarbox").removeClass("no-display"); var newresa="newresa"; $.ajax({url: "/fr/booking/userselectiongroup?locationid="+$("#select_location").val()+"&partysize="+ $("#party").val()+"&resadate="+ $("#mycalendar").val()+"&slot="+ $("#slotlinkdata").text()+"&method=CHANGE", success: function(result){ $(".selectiongroup").html(result); ReservationFormValidator1.init(); $(".locationlinkfinal").css( "cursor", "pointer" ); }}); }); });', 'text/javascript', array('noescape' => true)); }
public function reservationAction() { $this->layout()->setLayout('portal'); if ($this->getParam('reservationid')) { $reservationid = $this->getParam('reservationid'); $reservation = Object\Reservation::getById($reservationid); //Controls if ($reservation instanceof Object\Reservation) { //COLLECT OPEN/CLOSE DATA FOR THE LOCATION AND OPEN CLOSE DATA FOR SERVING if ($this->person->getSociete()->getId() != $reservation->getLocation()->getSociete()->getId()) { $this->_forward('error', 'booking', null, array('error' => 'TXT_NO_ACCESS_SOCIETE')); } if ($this->person->getPermits == 2) { if ($this->person->getLocation()->getId() != $reservation->getLocation()->getId()) { $this->_forward('error', 'booking', null, array('error' => 'TXT_NO_ACCESS_LOCATION')); } } if ($reservation->getLocation()->getId() != $this->selectedLocation->getId()) { $this->_forward('error', 'booking', null, array('error' => 'TXT_NO_ACCESS_RESERVATION')); } $today = new zend_date(); $sixmonthsfromnow = $today->add('6', Zend_Date::MONTH); $fulltext = ""; foreach ($reservation->getLocation()->getShifts($today, $sixmonthsfromnow) as $dayoff) { if ($dayoff->getAllDay() == 1) { $fulltext = $this->arrayToString($this->getAllDays($dayoff->getStart(), $dayoff->getEnd())) . "," . $fulltext; } } $this->view->offdaysrange = $fulltext; $this->view->closeddays = json_encode($this->checkClosedServings()); if ($reservation->getLocation()->getSociete()->getId() == $this->societe->getId()) { $reservationarray = $reservation->toArray(); foreach ($reservationarray as $key => $val) { //SET RESACHANGE TO TRUE $this->view->resachange = true; $this->view->selectedlocationid = $reservation->getLocation()->getId(); $this->view->{$key} = $val; } //var_dump($reservationarray);exit; } else { $this->_forward('error', 'booking', null, array('error' => 'TXT_NO_ACCESS_SOCIETE')); } } else { $this->_forward('error', 'booking', null, array('error' => 'TXT_NO_ACCESS_RESERVATION')); } } else { //SET RESACHANGE TO FALSE $this->view->resachange = false; $today = new zend_date(); $sixmonthsfromnow = $today->add('6', Zend_Date::MONTH); $fulltext = ""; foreach ($this->selectedLocation->getShifts($today, $sixmonthsfromnow) as $dayoff) { if ($dayoff->getAllDay() == 1) { $fulltext = $this->arrayToString($this->getAllDays($dayoff->getStart(), $dayoff->getEnd())) . "," . $fulltext; } } $this->view->closeddays = json_encode($this->checkClosedServings()); $this->view->offdaysrange = $fulltext; //echo $this->view->offdaysrange; echo "<br>"; //echo $this->view->closeddays; exit; if ($this->getParam('resadate')) { $this->view->resadate = $this->getParam('resadate'); } } $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/bootstrap-datepicker/js/locales/bootstrap-datepicker.fr.js'); $this->view->headLink()->appendStylesheet(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/jQuery-Tags-Input/jquery.tagsinput.css'); //$this->view->headScript()->appendFile('http://maps.google.com/maps/api/js?sensor=true'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/gmaps/gmaps.js'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/js/maps.js'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/js/reservationform-validation.js'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/js/reservationform-validation-1.js'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/jQuery-Tags-Input/jquery.tagsinput.js'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/select2/select2.min.js'); $this->view->headLink()->appendStylesheet(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/intl-tel-input-master/build/css/intlTelInput.css'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/plugins/intl-tel-input-master/build/js/intlTelInput.js'); $this->view->headScript()->appendFile(PIMCORE_WEBSITE_LAYOUTS . '/assets/js/form-elements.js'); $this->view->inlineScript()->appendScript('jQuery(document).ready(function() { Main.init(); ReservationFormValidator.init(); Maps.init(); $("body").on("click", ".locationlinkfinal", function(){ $.blockUI({ message: "<i class=\\"fa fa-spinner fa-spin\\"></i> "+t("js_please_wait") }); var newresa="newresa"; $.ajax({url: "/data/reservation/selectiongroup?locationid="+$("#select_location").val()+"&partysize="+ $("#party").val()+"&resadate="+ $("#mycalendar").val()+"&slot="+ $("#slotlinkdata").text()+"&method=CHANGE", success: function(result){ $(".selectiongroup").html(result); $("#registerbutton").addClass("no-display"); $(".registergroup").addClass("hidden-sm"); $("a.locationlinkfinal").css( "cursor", "pointer" ); ReservationFormValidator1.init(); $.unblockUI(); }}); }); SVExamples.init(); PagesUserProfile.init(); });', 'text/javascript', array('noescape' => true)); }