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

HotelSearchPageHeader.php

00001 <?php
00002 require_once('PageHeader.php');
00003 
00007 class HotelSearchPageHeader extends PageHeader {
00008         
00014         private static $HOTEL_TYPES = array (
00015                 "" => "選択してください", 
00016         "1" =>"旅館", 
00017                 "2" => "ペンション", 
00018         "3" => "ホテル", 
00019                 "4" => "コンドミニアム", 
00020                 "5" => "トレーラーハウス", 
00021                 "6" => "ユースホステル", 
00022                 "7" => "ロッジ", 
00023                 "8" => "貸別荘", 
00024                 "9" => "民宿"         
00025         );
00026                 
00028         private $hotel_type = null;
00029                 
00035         public function __construct($fileName) {
00036                 parent::__construct($fileName);
00037                 
00038                 /*
00039                  * ホテルの形式
00040                  */
00041                 if (array_key_exists('hotel_type',$_GET) && is_numeric($_GET['hotel_type'])) {
00042                         $this->hotel_type = $_GET['hotel_type'];
00043                 }       
00044         }
00045         
00052         public function assignParams($hotel) {
00053                 parent::assignParams($hotel);
00054                 
00055                 /*
00056                  * ホテルの形式
00057                  */
00058                 if ($this->hotel_type) {
00059                         $hotel->setParam('hotel_type',$this->hotel_type);
00060                 }               
00061         }
00062         
00068         public function isAdvancedSearchOptionOn() {
00069                 return $this->sort_by || $this->c_card 
00070                                 || $this->price_min || $this->price_max
00071                                 || $this->hotel_type || $this->sort_by;
00072         }       
00073         
00080         protected function renderHotelType($itemHtml) {
00081                 $options = '';
00082                 
00083                 foreach (self::$HOTEL_TYPES as $code => $name) {
00084                         $options .= '<option value="' . $code . '" ';                   
00085                         if (($this->hotel_type && $code == $this->hotel_type)
00086                                 || (!$this->hotel_type && $code == '')) {
00087                                 $options .= 'selected'; 
00088                         }
00089                         $options .= '>' . $name . '</option>';
00090                 }
00091                 
00092                 $itemHtml = str_replace('${HOTEL_TYPES}',$options,$itemHtml);
00093                 
00094                 return $itemHtml;
00095         }
00096                 
00102         protected function render() {
00103                 global $_GET;
00104 
00105                 /*
00106                  * 元ネタとなるビュー部分を取得する。
00107                  */
00108             $itemHtml = $this->view;
00109 
00110                 $itemHtml = $this->renderKeyword($itemHtml);            
00111                 
00112                 $itemHtml = $this->renderLArea($itemHtml, 'JP', '地方');
00113                 $itemHtml = $this->renderSArea($itemHtml, $this->larea_cd);
00114                 $itemHtml = $this->renderCityBySArea($itemHtml, $this->sarea_cd);
00115                 
00116                 $itemHtml = $this->renderFlippering($itemHtml);         
00117                 $itemHtml = $this->renderHotelType($itemHtml);
00118                 $itemHtml = $this->renderSortBy($itemHtml);
00119                 $itemHtml = $this->renderPrice($itemHtml);
00120                 $itemHtml = $this->renderCreditCardOption($itemHtml);                                   
00121                 $itemHtml = $this->renderLocationCodes($itemHtml);
00122                 
00123                 return $itemHtml;                       
00124         }
00125 }
00126 ?>

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