Пример #1
0
 /**
  * @Route("/tour/reserva", name="web_tour_reserva")
  * @Method("POST")
  */
 public function displayReservaTourAction(Request $request)
 {
     $idTour = $request->get('idTour');
     $fechaReserva = $request->get('fechaReserva');
     $numeroAdultos = $request->get('numeroAdultos');
     $numeroMenores = $request->get('numeroMenores');
     $datos = $this->getParamsTour($request);
     $tour = $this->getDoctrine()->getRepository('VisitaYucatanBundle:Tour')->getTourById($idTour, $datos[Generalkeys::NUMBER_ZERO], $datos[Generalkeys::NUMBER_ONE]);
     $tourTO = TourUtils::getTourTO($tour, new ArrayCollection());
     $tourTO->setFechaReserva($fechaReserva);
     $tourTO->setTotalAdultos($numeroAdultos);
     $tourTO->setTotalMenores($numeroMenores);
     $costoTotal = $tourTO->getTotalAdultos() * $tourTO->getTarifaadulto() + $tourTO->getTotalMenores() * $tourTO->getTarifamenor();
     return $this->render('VisitaYucatanBundle:web/pages:reserv-tour.html.twig', array('tour' => $tourTO, 'costoTotal' => number_format($costoTotal), 'tipoCambioMexico' => $this->getDoctrine()->getRepository('VisitaYucatanBundle:Moneda')->findMonedaMexico()));
 }
 /**
  * @Route("/admin/tour/find/images", name="tour_find_images")
  * @Method("POST")
  */
 public function findImagesTourByIdAction(Request $request)
 {
     $idTour = $request->get('idTour');
     $images = $this->getDoctrine()->getRepository('VisitaYucatanBundle:Tourimagen')->findTourImagesByIdTour($idTour);
     return new Response($this->get('serializer')->serialize(TourUtils::getListImagenTO($images), Generalkeys::JSON_STRING));
 }