Esempio n. 1
0
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
use Trivago\Tas\Request\HotelDetailsRequest;
use Trivago\Tas\Request\HotelRatesRequest;
$config = (require_once __DIR__ . '/../config.php');
$tas = new \Trivago\Tas\Tas($config);
$hotelId = isset($_GET['item']) ? $_GET['item'] : null;
$dealsRequest = new HotelRatesRequest([HotelRatesRequest::ITEM => $hotelId]);
$hotelDeals = $tas->getHotelRates($dealsRequest);
$hotelDetails = $tas->getHotelDetails(new HotelDetailsRequest($hotelId));
?>

<!doctype html>
<html>
<head>
    <?php 
if (!$hotelDeals->pollingFinished()) {
    ?>
        <meta http-equiv="refresh" content="2">
    <?php 
}
?>
</head>
<body>