• メインページ
  • データ構造
  • ファイル
  • ファイル一覧

hotel_results.php

00001 <?php
00002 /*
00003  * hotel_results.php
00004  *
00005  * Copyright (c)2010 ValueCommerce, Co. Ltd.
00006  */
00007 ini_set( 'display_errors', 1 ); 
00008 /*
00009  * このページで上級クラスのホテル検索:結果ページをつくります
00010  */
00011 
00012 // 地域別・施設別の検索フォームの置換セット
00013 // トラベルAPIサンプル!
00014 require_once('VCSDBDriver/VCSDBDriverHotel.php');
00015 require_once('AdvancedHotelSearchPageHeader.php');
00016 require_once('PageBody.php');
00017 require_once('PageFrame.php');
00018 require_once('PageBodyRecommend.php');
00019 /*
00020  * このサンプルでは内部エンコーディングはUTF-8です。
00021  */
00022 mb_internal_encoding("UTF-8");
00023 
00024 /*
00025  * ページ本体の生成
00026  */
00027 $pageFrame = new PageFrame('templates/hotel_results.html');
00028 
00029 /*
00030  * 入力チェック
00031 s */
00032 if(!isset($_GET['larea_cd']) || $_GET['larea_cd'] == ''){
00033         header("Location:" . VC_HOMEFILENAME . "?error_flg=1" . PageFrame::getGetURLParams() );
00034 }
00035 
00036 
00037 /*
00038  * ホテル検索フォームの設置
00039  */
00040 if($pageFrame->isHotelSearchFormFlag() === true){
00041 
00042         /*
00043          * VCSDBDriverHotelクラスのインスタンスを生成します。
00044          */
00045         $hotel = new VCSDBDriverHotel();
00046         
00047         /*
00048          * ページヘッダ部分(検索フォーム)を生成します。
00049          */
00050         $pageHeader = new AdvancedHotelSearchPageHeader('Views/AdvancedSearchForm.html');
00051         /*
00052          * トラベルAPIへのパラメータは、フォームで指定するので、フォームのあるページヘッダで設定します。
00053          */
00054         $pageHeader->assignParams($hotel);
00055         /*
00056          * ページ本体にホテル検索フォームを設置します。
00057          */
00058         $pageFrame->setHotelSearchFormHTML($pageHeader->render());
00059         
00060 }
00061 
00062 
00063 /*
00064  *  一押しの宿泊施設の設置
00065  */
00066 if($pageFrame->isHotelRecommendationFlag() === true){
00067 
00068         /*
00069          * VCSDBDriverHotelクラスのインスタンスを生成します。
00070          */
00071         $recommend_hotel = new VCSDBDriverHotel();
00072         
00073         
00074         /*
00075          * おすすめホテルを検索するためのオブジェクト生成します。
00076          */
00077         $pageHeaderRecommend = new AdvancedHotelSearchPageHeader('Views/AdvancedSearchForm.html');
00078         
00079         /*
00080          * トラベルAPIへのパラメータは、フォームで指定するので、フォームのあるページヘッダで設定します。
00081          */
00082         $pageHeaderRecommend->assignParams($recommend_hotel, true);
00083         
00084         /*
00085          * APIへの問い合わせ実行、パラメータが設定されていない場合は、エラーコードが返ります。
00086          */
00087         $response = $recommend_hotel->executeQuery();
00088 
00089         /*
00090          * リストパネルの生成
00091          */
00092         $pageBodyRecommend = new PageBodyRecommend('Views/Pagination.html','Views/AdvancedFormattedHotelRecommend.html', 5, $response); 
00093         
00094         /*
00095          * ページ本体におすすめホテル情報を設置します。
00096          */
00097         $pageFrame->setHotelRecommendationHTML($pageBodyRecommend->render());
00098 }
00099 
00100 /*
00101  * ホテル検索結果一覧の設置
00102  */
00103 if($pageFrame->isHotelSearchResultsFlag() === true){
00104         /*
00105          * VCSDBDriverHotelクラスのインスタンスを生成します。
00106          */
00107         $hotel = new VCSDBDriverHotel();
00108         
00109         
00110         /*
00111          * ページヘッダ部分(検索フォーム)を生成します。
00112          */
00113         $pageHeader = new AdvancedHotelSearchPageHeader('Views/AdvancedSearchForm.html');
00114         
00115         /*
00116          * トラベルAPIへのパラメータは、フォームで指定するので、フォームのあるページヘッダで設定します。
00117          */
00118         $pageHeader->assignParams($hotel);
00119         
00120         /*
00121          * APIへの問い合わせ実行、パラメータが設定されていない場合は、エラーコードが返ります。
00122          */
00123         $response = $hotel->executeQuery();
00124         
00125         /*
00126          * リストパネルの生成
00127          */
00128         $pageBody = new PageBody('Views/Pagination.html','Views/AdvancedFormattedHotelList.html', 10, $response);
00129 
00130         $pageFrame->setHotelSearchResultsHTML($pageBody->render());
00131 }
00132 
00133 // ページ全体の表示
00134 $pageFrame->show();
00135 
00136 
00137 ?>

バリューコマース ウェブサービス トラベルAPIサンプル ドキュメンテーションに対してTue Jan 11 2011 19:25:16に生成されました。  doxygen 1.7.2