public function BuscarHabitaciones($id_hotel) { global $db; $sql = "select * from hotel_habitacion where(id_hotel ='{$this->id_hotel}')"; $result = $db->consultar($sql); foreach ($result['result'] as $r) { $habitacion = new habitacion(); $habitacion->BuscarHabitacion($r['id_habitacion']); $this->lista_habitaciones[] = $habitacion; } }