コード例 #1
0
 /**
  * @Route("/hotel/reserva", name="web_hotel_reserva")
  * @Method("POST")
  */
 public function reservaHotelAction(Request $request)
 {
     $datos = $this->getParamsTour($request);
     $idHotel = $request->get('idHotel');
     $idHabitacion = $request->get('idHabitacion');
     $fechaInicio = $request->get('fechaInicio');
     $fechaFin = $request->get('fechaFin');
     $adultos = $request->get('adultos');
     $menores = $request->get('menores');
     //echo "hotel = ".$idHotel." habitacion = ".$idHabitacion." fechaInicio = ".$fechaInicio." fechafin = ".$fechaFin." adultos = ".$adultos." menores = ".$menores;
     $hotel = $this->getDoctrine()->getRepository('VisitaYucatanBundle:Hotel')->getHotelById($idHotel, $datos[Generalkeys::NUMBER_ZERO], $datos[Generalkeys::NUMBER_ONE]);
     $tarifa = $this->getDoctrine()->getRepository('VisitaYucatanBundle:HotelTarifa')->findDetailHotel(DateUtil::formatDate($fechaInicio), $idHotel, $idHabitacion, $datos[Generalkeys::NUMBER_ZERO], $datos[Generalkeys::NUMBER_ONE]);
     $reserva = HotelUtils::getHotelReserva($fechaInicio, $fechaFin, $adultos, $menores, $hotel, $tarifa);
     $reserva->setIdHotel((int) $idHotel);
     $reserva->setIdHabitacion((int) $idHabitacion);
     return $this->render('VisitaYucatanBundle:web/pages:reserv-hotel.html.twig', array('dateFrom' => $fechaInicio, 'dateTo' => $fechaFin, 'reserva' => $reserva, 'tipoCambioMexico' => $this->getDoctrine()->getRepository('VisitaYucatanBundle:Moneda')->findMonedaMexico()));
 }