function hotel($idHotel) { $mhotels = new MHotels(); $result = $mhotels->buscar_id($idHotel); foreach ($result['result'] as $r) { $nombreHotel = $r['nom_hotel']; $prov = $r['provincia']; $local = $r['localidad']; $calle = $r['calle']; $ncalle = $r['nro_calle']; $tel = $r['telefono']; $precio = $r['precio_persona']; $cant_imagenes = $r['cant_imagenes']; $descripcion = $r['descripcion']; } $tp = new TemplatePower("templates/hotel.html"); $tp->prepare(); $tp->gotoBlock("_ROOT"); $tp->assign("nombre", $nombreHotel); for ($i = 1; $i <= $cant_imagenes; $i++) { $tp->newBlock("imagenes"); $tp->assign("nombre", $nombreHotel); $tp->assign("numero", $i); } $tp->gotoBlock("_ROOT"); $tp->assign("descripcion", $descripcion); $tp->assign("prov", $prov); $tp->assign("local", $local); $tp->assign("calle", $calle); $tp->assign("ncalle", $ncalle); $tp->assign("tel", $tel); $tp->assign("precio", $precio); if (isset($_SESSION['user'])) { $tp->newBlock("reservar"); $tp->assign("idHotel", $idHotel); } if (!isset($_SESSION['user'])) { $tp->newBlock("iniciarSesion"); } echo $tp->getOutputContent(); }
public function datosbaja($id_hotel) { $tp = new TemplatePower("templates/BajaHotel.html"); $tp->prepare(); $tp->gotoBlock("_ROOT"); $tp->newBlock("hotelbaja"); $mhotels = new MHotels(); $result = $mhotels->buscar_id($id_hotel); foreach ($result['result'] as $r) { $nombreHotel = $r['nom_hotel']; $prov = $r['provincia']; $local = $r['localidad']; $calle = $r['calle']; $ncalle = $r['nro_calle']; $tel = $r['telefono']; $precio = $r['precio_persona']; $cant_imagenes = $r['cant_imagenes']; $descripcion = $r['descripcion']; } $tp->assign("nombre", $nombreHotel); $tp->assign("descripcion", $descripcion); $tp->assign("prov", $prov); $tp->assign("local", $local); $tp->assign("calle", $calle); $tp->assign("ncalle", $ncalle); $tp->assign("tel", $tel); $tp->assign("precio", $precio); $tp->assign("idHotel", $id_hotel); echo $tp->getOutputContent(); }