// 2018/05/30 phpでリダイレクト
    /* 端末のUAを取得 */
    $ua = $_SERVER['HTTP_USER_AGENT'];
    /* iPhone/iPod/Androidスマホが該当 */
    if ((strpos($ua, 'iPhone') !== false)
    || (strpos($ua, 'iPod') !== false)
    || (strpos($ua, 'Android') !== false)
    && (strpos($ua, 'Mobile') !== false)) {
    	
    	$param = "agent=$agent&tour_cd=$tour_cd&dep_date=$dep_date";
	    header("Location: ./sp/system/detail.phtml?" . $param);
	    exit;
    }
?>
 include( "../../../lib/ticketlib.phtml" ) ?>
 include( "../../../lib/navilib.phtml" ) ?>
 include( "../../../lib/listlib.phtml" ) ?>
 include( "../../../lib/getlib.phtml" ) ?>
	$befor_dep_date = cal_date ( $dep_date, -7 ) ;
	$after_dep_date = cal_date ( $dep_date, 7 ) ;
    /*---< DBコネクト >---*/
    $conn = db_connect($db_connect_str) ;
    if ( !$conn ) {
		exit ;
    }
	/*---< TOPページ設定 >---*/
	if ( strlen ( $agent ) > 0 ) {
		$top_page = get_agent_url ( $conn, $agent ) ;
		$top_page = "http://210.232.177.211/askme/navi/src/tour/tour_sel_form.phtml".$top_page ;
	}
    /*---< ツアーテーブル検索 >---*/
	$sql_cmd = "SELECT * FROM TOUR_TICKET WHERE " ;
	$sql_cmd = $sql_cmd."TOUR_CD = '$tour_cd'" ;
    $result = pg_Exec ( $conn, $sql_cmd ) ;
	if ( !$result ) {
		echo $sql_cmd;
		pg_FreeResult ( $result ) ;
		pg_Close ( $conn ) ;
		exit() ;
	}
	$res_num = pg_NumRows ( $result ) ;
    if ( $res_num > 0 ) {
		$tour_name = pg_Result ( $result, 0, "tour_name" ) ;
		$tour_sub = pg_Result ( $result, 0, "tour_sub" ) ;
		$recom_flg = pg_Result ( $result, 0, "recom_flg" ) ;
		$new_flg = pg_Result ( $result, 0, "new_flg" ) ;
		$start_date = pg_Result ( $result, 0, "start_date" ) ;
		$end_date = pg_Result ( $result, 0, "end_date" ) ;
		$dep_place_cd = pg_Result ( $result, 0, "dep_place_cd" ) ;
		$min_partnum = pg_Result ( $result, 0, "min_partnum" ) ;
		$air_company = pg_Result ( $result, 0, "air_company" ) ;
		$mileage = pg_Result ( $result, 0, "mileage" ) ;
		$class_cd = pg_Result ( $result, 0, "class_cd" ) ;
		$via = pg_Result ( $result, 0, "via" ) ;
		$local_tax = pg_Result ( $result, 0, "local_tax" ) ;
		$meal_cd = pg_Result ( $result, 0, "meal_cd" ) ;
		$tourcon_cd = pg_Result ( $result, 0, "tourcon_cd" ) ;
		$remark = pg_Result ( $result, 0, "remark" ) ;
		$point = pg_Result ( $result, 0, "point" ) ;
		$price_comment = pg_Result ( $result, 0, "price_comment" ) ;
		$term=  pg_Result ( $result, 0, "term" ) ;
		$inv_comment = pg_Result ( $result, 0, "inv_comment" );
		$picture = pg_Result ( $result, 0, "picture" );
		// 2012/05/25 ダイビング追加
		$diving_joken = pg_Result ( $result, 0, "diving_joken" );
		$diving_joken  = get_item($conn, "diving_joken", "diving_joken_nm", $diving_joken);
		$diving_service = pg_Result ( $result, 0, "diving_service" );
		$diving_service_nm  = get_item($conn, "diving_service", "diving_service_nm", $diving_service);
		$diving_url  = get_item($conn, "diving_service", "url", $diving_service);
/* 2013/07/11 [料金備考の追加] ADD-START */
		$price_oil_comment = pg_Result($result, 0, "price_oil_comment");
		$price_tax_comment = pg_Result($result, 0, "price_tax_comment");
		$price_oth_comment = pg_Result($result, 0, "price_oth_comment");
		$price_oil_comment_flg = pg_Result($result, 0, "price_oil_comment_flg");
		$price_tax_comment_flg = pg_Result($result, 0, "price_tax_comment_flg");
		$price_oth_comment_flg = pg_Result($result, 0, "price_oth_comment_flg");
/* 2013/07/11 [料金備考の追加] ADD-END   */
/***** 2013/09/27 トラベルインフォメーション、料金備考、ダイビングインフォメーションの項目追加 ADD-START *****/
		$close_day = pg_Result ( $result, 0, "close_day" ) ;
		$pass_comment = pg_Result ( $result, 0, "pass_comment" ) ;
		$curr_comment = pg_Result ( $result, 0, "curr_comment" ) ;
		$bag_comment = pg_Result ( $result, 0, "bag_comment" ) ;
		$can_comment = pg_Result ( $result, 0, "can_comment" ) ;
		$pass_comment_flg = pg_Result ( $result, 0, "pass_comment_flg" ) ;
		$curr_comment_flg = pg_Result ( $result, 0, "curr_comment_flg" ) ;
		$bag_comment_flg = pg_Result ( $result, 0, "bag_comment_flg" ) ;
		$can_comment_flg = pg_Result ( $result, 0, "can_comment_flg" ) ;
		$diving_info = pg_Result ( $result, 0, "diving_info" ) ;
/***** 2013/09/27 トラベルインフォメーション、料金備考、ダイビングインフォメーションの項目追加 ADD-END   *****/
		$price_rank = get_tour_rank ( $conn, $tour_cd, $dep_date ) ;
		$tour_price = 0 ;
		$tour_price = get_tour_price ( $conn, $tour_cd, $price_rank ) ;
		$tourcon_nm = get_tourcon_nm ( $conn, $tourcon_cd ) ;
		$dep_place_num = str_target_num ( $dep_place_cd, "/" ) + 1 ;
		for ( $j=0 ; $j < $dep_place_num ; $j++ ) {
			$work = str_sep_target ( $dep_place_cd, "/", $j+1 ) ;
			$dep_place[$j] = $work ;
		}
		$air_company_num = str_target_num ( $air_company, "/" ) + 1 ;
		for ( $j=0 ; $j < $air_company_num ; $j++ ) {
			$work = str_sep_target ( $air_company, "/", $j+1 ) ;
			$company[$j] = $work ;
		}
		$class_nm = get_class_nm ( $conn, $class_cd ) ;
		for ( $i=0; $i < 15; $i++ ) {
			$target_date = cal_date ( $befor_dep_date, $i ) ;
			$arr_dep_date[$i] = $target_date ;
			$arr_tour_rank[$i] = get_tour_rank ( $conn, $tour_cd, $target_date ) ;
			$arr_tour_color[$i] = get_rank_color ( $conn, $arr_tour_rank[$i] ) ;
			$arr_tour_price[$i] = get_tour_price ( $conn, $tour_cd, $arr_tour_rank[$i] ) ;
		}
		$price_color[0] = get_rank_color ( $conn, "A" ) ;
		$price_color[1] = get_rank_color ( $conn, "B" ) ;
		$price_color[2] = get_rank_color ( $conn, "C" ) ;
		$price_color[3] = get_rank_color ( $conn, "D" ) ;
		$price_color[4] = get_rank_color ( $conn, "E" ) ;
		$price_color[5] = get_rank_color ( $conn, "F" ) ;
		$price_color[6] = get_rank_color ( $conn, "G" ) ;
		$price_color[7] = get_rank_color ( $conn, "H" ) ;
		$price_color[8] = get_rank_color ( $conn, "I" ) ;
		$price_color[9] = get_rank_color ( $conn, "J" ) ;
		$price_color[10] = get_rank_color ( $conn, "K" ) ;
		$price_color[11] = get_rank_color ( $conn, "L" ) ;
		$price_color[12] = get_rank_color ( $conn, "M" ) ;
		$price_color[13] = get_rank_color ( $conn, "N" ) ;
		$price_color[14] = get_rank_color ( $conn, "O" ) ;
		$price_color[15] = get_rank_color ( $conn, "P" ) ;
		$price_color[16] = get_rank_color ( $conn, "Q" ) ;
		$price_color[17] = get_rank_color ( $conn, "R" ) ;
		$price_color[18] = get_rank_color ( $conn, "S" ) ;
		$price_color[19] = get_rank_color ( $conn, "T" ) ;
		$price_color[20] = get_rank_color ( $conn, "U" ) ;
		$price_color[21] = get_rank_color ( $conn, "V" ) ;
		$price_color[22] = get_rank_color ( $conn, "W" ) ;
		$price_color[23] = get_rank_color ( $conn, "X" ) ;
		$price_color[24] = get_rank_color ( $conn, "Y" ) ;
		$price_color[25] = get_rank_color ( $conn, "Z" ) ;
		$price_type[0] = "A" ;
		$price_type[1] = "B" ;
		$price_type[2] = "C" ;
		$price_type[3] = "D" ;
		$price_type[4] = "E" ;
		$price_type[5] = "F" ;
		$price_type[6] = "G" ;
		$price_type[7] = "H" ;
		$price_type[8] = "I" ;
		$price_type[9] = "J" ;
		$price_type[10] = "K" ;
		$price_type[11] = "L" ;
		$price_type[12] = "M" ;
		$price_type[13] = "N" ;
		$price_type[14] = "O" ;
		$price_type[15] = "P" ;
		$price_type[16] = "Q" ;
		$price_type[17] = "R" ;
		$price_type[18] = "S" ;
		$price_type[19] = "T" ;
		$price_type[20] = "U" ;
		$price_type[21] = "V" ;
		$price_type[22] = "W" ;
		$price_type[23] = "X" ;
		$price_type[24] = "Y" ;
		$price_type[25] = "Z" ;
		$price_end = 0;
		for ( $i=0; $i < 26; $i++ ) {
			$work = get_tour_price ( $conn, $tour_cd, $price_type[$i] ) ;
			if ( strlen ( $work ) == 0 ) {
				$work = $space1 ;
			}
			else {
				// 2013/06/24 金額があるところまで表示
				$price_end = $i;
			}
			$price[$i] = $work ;
		}
		$start_disp_year = substr ( $start_date, 0, 4 ) ;
		$start_disp_month = substr ( $start_date, 5, 2 ) ;
		$start_disp_day = substr ( $start_date, 6, 2 ) ;
		$end_disp_year = substr ( $end_date, 0, 4 ) ;
		$end_disp_month = substr ( $end_date, 5, 2 ) ;
		$end_disp_day = substr ( $end_date, 6, 2 ) ;
	}
	/*---< ツアースケジュール検索 >---*/
	$sql_cmd = "SELECT * FROM TOUR_SCHEDULE WHERE TOUR_CD = '$tour_cd' ORDER BY SEQ_CD" ;
	$scd_res = pg_Exec ( $conn, $sql_cmd ) ;
	if ( !$scd_res ) {
		pg_FreeResult ( $result ) ;
		pg_FreeResult ( $scd_res ) ;
		pg_Close ( $conn ) ;
		exit () ;
	}
	$scd_num = pg_NumRows ( $scd_res ) ;
	/*---< ツアーホテル検索 >---*/
	$sql_cmd = "SELECT * FROM TOUR_HOTEL WHERE TOUR_CD = '$tour_cd' ORDER BY SEQ_CD" ;
	$hotel_res = pg_Exec ( $conn, $sql_cmd ) ;
	if ( !$hotel_res ) {
		pg_FreeResult ( $result ) ;
		pg_FreeResult ( $hotel_res ) ;
		pg_Close ( $conn ) ;
		exit () ;
	}
	$hotel_num = pg_NumRows ( $hotel_res ) ;
	/*---< ツアー画像取得 >---*/
	$sql_cmd = "SELECT * FROM TOUR_LINK WHERE TOUR_CD = '$tour_cd' ORDER BY SEQ_CD" ;
	$link_res = pg_Exec ( $conn, $sql_cmd ) ;
	if ( !$link_res ) {
		pg_FreeResult ( $link_res ) ;
		pg_Close ( $conn ) ;
		exit() ;
	}
	$link_num = pg_NumRows ( $link_res ) ;
	/*---< ツアー画像取得 >---*/
	$sql_cmd = "SELECT * FROM TOUR_IMAGE WHERE TOUR_CD = '$tour_cd' ORDER BY SEQ_CD" ;
	$image_res = pg_Exec ( $conn, $sql_cmd ) ;
	if ( !$image_res ) {
		pg_FreeResult ( $image_res ) ;
		pg_Close ( $conn ) ;
		exit() ;
	}
	$image_num = pg_NumRows ( $image_res ) ;
/***** 2013/09/27 トラベルインフォメーション、料金備考の項目追加 CHG-START *****/
	// 目的地のリストを取得
	$sql_cmd = "SELECT * FROM TOUR_ARR_PLACE ";
	$sql_cmd .= "WHERE TOUR_CD = '$tour_cd' ";
	$sql_cmd .= "ORDER BY AREA_CD_L,AREA_CD_M,AREA_CD_S ";
	$rs_tour_arr_place = pg_Exec($conn, $sql_cmd);
	$rs_tour_arr_place_num = pg_NumRows($rs_tour_arr_place);
	// 燃油サーチャージの設定
	if(!$price_oil_comment_flg) {
		$price_oil_comment = "";
		// 目的地都市検索
		$sql_cmd = "select * from tour_arr_place tr "
				 . "inner join area_middle_mst am on (tr.area_cd_l = am.area_cd_l and tr.area_cd_m = am.area_cd_m) "
				 . "where tr.tour_cd = '" . $tour_cd . "' "
				 . "and am.osc_city is not null and am.osc_city <> '' ";
		$a_res = db_exec ( $conn, $sql_cmd) ;
		$a_num = db_numrows ( $a_res ) ;
		if ($a_num > 0){	// OSC都市が設定されていたら
			$adt = get_column_loop($a_res, 0, "*");
			$w_str = "";
			// 登録されているエアー分ループ
			for ( $j=0; $j < $air_company_num ; $j++ ) {
				$sql_cmd = "select * from osc_mst "
						 . "where air_cd = '" . $company[$j] . "' "
						 . "and city like '%" . $adt['osc_city'] . "%' ";
				$o_res = db_exec($conn, $sql_cmd);
				$o_num = db_numrows($o_res);
				if ($o_num > 0){
					$odt = get_column_loop($o_res, 0, "*");
					if ($odt['charge']){	// 料金設定あり
						//  日本航空:\20000/中華航空:\18000 のようにする
						$air_nm = get_air_comp_nm ( $conn, $company[$j] ) ;
						if ($j > 0){
							$w_str .= "/";
						}
						if ($air_company_num > 1){
							if ($j == 0){			// 複数の場合の始め
								$w_str .= " ";
							}
							$w_str .= "" . $air_nm . ":";
						}
						// 2016/03/03 \→円
						$w_str .= number_format($odt['charge']) . "円";
						if ($air_company_num > 1 && $j == $air_company_num-1){		// 複数の場合の終わり
							$w_str .= " ";
						}
					}
					// 2016/03/03 0円の場合は下記文言 ===はだめだった。$odtにはstringで入ってくる
					else if ($odt['charge'] == "0"){
						$price_oil_comment = "燃油サーチャージは不要です。
*但し、航空会社等の都合により別途、追加徴収になる場合もございます。予めご了承ください。";
					}
				}
			}
			if ($w_str){
				$price_oil_comment = "◇燃油サーチャージは別途" . $w_str . "です。*予告なく改定になる事もございます。(お子様も同料金ですが2歳未満は不要です。)";
			}
		}
	}
	// 料金備考(空港税、現地諸税)の設定
	if(!$price_tax_comment_flg) {
		$price_tax_comment = "";
		for($i=0; $i<$dep_place_num; $i++) {
			for($j=0; $j<$air_company_num; $j++) {
				for($k=0; $k<$rs_tour_arr_place_num; $k++) {
					$area_cd_l = pg_Result($rs_tour_arr_place, $k, "area_cd_l");
					$area_cd_m = pg_Result($rs_tour_arr_place, $k, "area_cd_m");
					$area_cd_s = pg_Result($rs_tour_arr_place, $k, "area_cd_s");
					// コメント取得
					$sql_cmd = "select comment from comm_tax_mst "
							 . "where dep_place_cd = '".$dep_place[$i]."' "
							 . "  and area_cd_l = '".$area_cd_l."' "
							 . "  and area_cd_m = '".$area_cd_m."' "
							 . "  and area_cd_s = '".$area_cd_s."' "
							 . "  and air = '".$company[$j]."' ";
					$rs_comment = pg_Exec($conn, $sql_cmd);
				    $rs_comment_num = pg_NumRows($rs_comment);
					if(0 < $rs_comment_num) {
						$comment = pg_Result($rs_comment, 0, "comment");
						// 2016/04/27 最後にBRをつけない
						if ($price_tax_comment) $price_tax_comment .= "\n";
						$price_tax_comment .= $comment;
					} else {
						// コメント取得
						$sql_cmd = "select comment from comm_tax_mst "
								 . "where dep_place_cd = '".$dep_place[$i]."' "
								 . "  and area_cd_l = '".$area_cd_l."' "
								 . "  and area_cd_m = '".$area_cd_m."' "
								 . "  and air = '".$company[$j]."' ";
						$rs_comment = pg_Exec($conn, $sql_cmd);
					    $rs_comment_num = pg_NumRows($rs_comment);
						if(0 < $rs_comment_num) {
							$comment = pg_Result($rs_comment, 0, "comment");
							// 2016/04/27 最後にBRをつけない
							if ($price_tax_comment) $price_tax_comment .= "\n";
							$price_tax_comment .= $comment;
						}
					}
				}
			}
		}
	}
	// 料金備考(その他)
	if(!$price_oth_comment_flg) {
		$price_oth_comment = "";
		for($i=0; $i<$dep_place_num; $i++) {
			for($j=0; $j<$air_company_num; $j++) {
				for($k=0; $k<$rs_tour_arr_place_num; $k++) {
					$area_cd_l = pg_Result($rs_tour_arr_place, $k, "area_cd_l");
					$area_cd_m = pg_Result($rs_tour_arr_place, $k, "area_cd_m");
					$area_cd_s = pg_Result($rs_tour_arr_place, $k, "area_cd_s");
					// コメント取得
					$sql_cmd = "select comment from comm_oth_mst "
							 . "where dep_place_cd = '".$dep_place[$i]."' "
							 . "  and area_cd_l = '".$area_cd_l."' "
							 . "  and area_cd_m = '".$area_cd_m."' "
							 . "  and area_cd_s = '".$area_cd_s."' "
							 . "  and air = '".$company[$j]."' ";
					$rs_comment = pg_Exec($conn, $sql_cmd);
				    $rs_comment_num = pg_NumRows($rs_comment);
					if(0 < $rs_comment_num) {
						$comment = pg_Result($rs_comment, 0, "comment");
						$price_oth_comment .= $comment."\n";
					} else {
						// コメント取得
						$sql_cmd = "select comment from comm_oth_mst "
								 . "where dep_place_cd = '".$dep_place[$i]."' "
								 . "  and area_cd_l = '".$area_cd_l."' "
								 . "  and area_cd_m = '".$area_cd_m."' "
								 . "  and air = '".$company[$j]."' ";
						$rs_comment = pg_Exec($conn, $sql_cmd);
					    $rs_comment_num = pg_NumRows($rs_comment);
						if(0 < $rs_comment_num) {
							$comment = pg_Result($rs_comment, 0, "comment");
							$price_oth_comment .= $comment."\n";
						}
					}
				}
			}
		}
	}
	// 料金備考(パスポート・ビザについて)の設定
	if(!$pass_comment_flg) {
		$pass_comment = "";
		for($i=0; $i<$rs_tour_arr_place_num; $i++) {
			$area_cd_l = pg_Result($rs_tour_arr_place, $i, "area_cd_l");
			$area_cd_m = pg_Result($rs_tour_arr_place, $i, "area_cd_m");
			$area_cd_s = pg_Result($rs_tour_arr_place, $i, "area_cd_s");
			// コメント取得
			$sql_cmd = "select comment from comm_pass_mst "
					 . "where area_cd_l = '".$area_cd_l."' "
					 . "  and area_cd_m = '".$area_cd_m."' "
					 . "  and area_cd_s = '".$area_cd_s."' ";
			$rs_comment = pg_Exec($conn, $sql_cmd);
		    $rs_comment_num = pg_NumRows($rs_comment);
			if(0 < $rs_comment_num) {
				$comment = pg_Result($rs_comment, 0, "comment");
				$pass_comment .= $comment."\n";
			} else {
				// コメント取得
				$sql_cmd = "select comment from comm_pass_mst "
						 . "where area_cd_l = '".$area_cd_l."' "
						 . "  and area_cd_m = '".$area_cd_m."' ";
				$rs_comment = pg_Exec($conn, $sql_cmd);
			    $rs_comment_num = pg_NumRows($rs_comment);
				if(0 < $rs_comment_num) {
					$comment = pg_Result($rs_comment, 0, "comment");
					$pass_comment .= $comment."\n";
				}
			}
		}
	}
	// 料金備考(通貨、時差、その他)の設定
	if(!$curr_comment_flg) {
		$curr_comment = "";
		for($i=0; $i<$rs_tour_arr_place_num; $i++) {
			$area_cd_l = pg_Result($rs_tour_arr_place, $i, "area_cd_l");
			$area_cd_m = pg_Result($rs_tour_arr_place, $i, "area_cd_m");
			$area_cd_s = pg_Result($rs_tour_arr_place, $i, "area_cd_s");
			// コメント取得
			$sql_cmd = "select comment from comm_curr_mst "
					 . "where area_cd_l = '".$area_cd_l."' "
					 . "  and area_cd_m = '".$area_cd_m."' "
					 . "  and area_cd_s = '".$area_cd_s."' ";
			$rs_comment = pg_Exec($conn, $sql_cmd);
		    $rs_comment_num = pg_NumRows($rs_comment);
			if(0 < $rs_comment_num) {
				$comment = pg_Result($rs_comment, 0, "comment");
				$curr_comment .= $comment."\n";
			} else {
				// コメント取得
				$sql_cmd = "select comment from comm_curr_mst "
						 . "where area_cd_l = '".$area_cd_l."' "
						 . "  and area_cd_m = '".$area_cd_m."' ";
				$rs_comment = pg_Exec($conn, $sql_cmd);
			    $rs_comment_num = pg_NumRows($rs_comment);
				if(0 < $rs_comment_num) {
					$comment = pg_Result($rs_comment, 0, "comment");
					$curr_comment .= $comment."\n";
				}
			}
		}
	}
	// 料金備考(機内預け手荷物について)の設定
	if(!$bag_comment_flg) {
		$bag_comment = "";
		for($i=0; $i<$air_company_num; $i++) {
			for($j=0; $j<$rs_tour_arr_place_num; $j++) {
				$area_cd_l = pg_Result($rs_tour_arr_place, $j, "area_cd_l");
				$area_cd_m = pg_Result($rs_tour_arr_place, $j, "area_cd_m");
				$area_cd_s = pg_Result($rs_tour_arr_place, $j, "area_cd_s");
				// コメント取得
				$sql_cmd = "select comment from comm_bag_mst "
						 . "where area_cd_l = '".$area_cd_l."' "
						 . "  and area_cd_m = '".$area_cd_m."' "
						 . "  and area_cd_s = '".$area_cd_s."' "
						 . "  and air = '".$company[$i]."' ";
				$rs_comment = pg_Exec($conn, $sql_cmd);
				$rs_comment_num = pg_NumRows($rs_comment);
				if(0 < $rs_comment_num) {
					$comment = pg_Result($rs_comment, 0, "comment");
					$bag_comment .= $comment."\n";
				} else {
					// コメント取得
					$sql_cmd = "select comment from comm_bag_mst "
							 . "where area_cd_l = '".$area_cd_l."' "
							 . "  and area_cd_m = '".$area_cd_m."' "
							 . "  and air = '".$company[$i]."' ";
					$rs_comment = pg_Exec($conn, $sql_cmd);
					$rs_comment_num = pg_NumRows($rs_comment);
					if(0 < $rs_comment_num) {
						$comment = pg_Result($rs_comment, 0, "comment");
						$bag_comment .= $comment."\n";
					}
				}
			}
		}
	}
	// 料金備考(キャンセルチャージについて)の設定
	if(!$can_comment_flg) {
		$can_comment = "";
		for($i=0; $i<$air_company_num; $i++) {
			for($j=0; $j<$rs_tour_arr_place_num; $j++) {
				$area_cd_l = pg_Result($rs_tour_arr_place, $j, "area_cd_l");
				$area_cd_m = pg_Result($rs_tour_arr_place, $j, "area_cd_m");
				$area_cd_s = pg_Result($rs_tour_arr_place, $j, "area_cd_s");
				// コメント取得
				$sql_cmd = "select comment from comm_can_mst "
						 . "where area_cd_l = '".$area_cd_l."' "
						 . "  and area_cd_m = '".$area_cd_m."' "
						 . "  and area_cd_s = '".$area_cd_s."' "
						 . "  and air = '".$company[$i]."' ";
				$rs_comment = pg_Exec($conn, $sql_cmd);
				$rs_comment_num = pg_NumRows($rs_comment);
				if(0 < $rs_comment_num) {
					$comment = pg_Result($rs_comment, 0, "comment");
					$can_comment .= $comment."\n";
				} else {
					// コメント取得
					$sql_cmd = "select comment from comm_can_mst "
							 . "where area_cd_l = '".$area_cd_l."' "
							 . "  and area_cd_m = '".$area_cd_m."' "
							 . "  and air = '".$company[$i]."' ";
					$rs_comment = pg_Exec($conn, $sql_cmd);
					$rs_comment_num = pg_NumRows($rs_comment);
					if(0 < $rs_comment_num) {
						$comment = pg_Result($rs_comment, 0, "comment");
						$can_comment .= $comment."\n";
					}
				}
			}
		}
	}
	// 改行コードをBRタグに置換
	$price_oil_comment = str_replace("\n", "
", $price_oil_comment);
	$price_tax_comment = str_replace("\n", "
", $price_tax_comment);
	$price_oth_comment = str_replace("\n", "
", $price_oth_comment);
	$pass_comment = str_replace("\n", "
", $pass_comment);
	$curr_comment = str_replace("\n", "
", $curr_comment);
	$bag_comment = str_replace("\n", "
", $bag_comment);
	$can_comment = str_replace("\n", "
", $can_comment);
/***** 2013/09/27 トラベルインフォメーション、料金備考の項目追加 CHG-END   *****/
?>
", $inv_comment ); ?>
| 日程 | スケジュール | 食事 | 宿泊地 | 
|---|---|---|---|
| 朝: 昼: 夜: | 
※時間帯の説明
    早朝=04:00〜07:00、午前=07:00〜12:00、午後=12:00〜18:00、夜 =18:00〜23:00、深夜=23:00〜04:00
| 宿泊地 | ホテル名 | 宿泊条件 | |
|---|---|---|---|
| 施設グレード | |||
| 部屋カテゴリ | |||
| 部屋タイプ | |||
| 利用形態 | |||
| } ?> | 
|---|
| } ?> | } ?> | 
| } ?> | } ?> | 
| } ?> | 
| 燃油サーチャージ | echo str_replace("\\", "¥", $price_oil_comment); ?> | 
|---|---|
| 空港税・現地諸税 | echo str_replace("\\", "¥", $price_tax_comment); ?> | 
| その他 | echo str_replace("\\", "¥", $price_oth_comment); ?> | 
| 出発地 | for ( $j=0; $j < $dep_place_num ; $j++ ) { echo get_dep_place ( $conn, $dep_place[$j] ) ; echo $space1; } ?> | 予定航空会社 | for ( $j=0; $j < $air_company_num ; $j++ ) { //2012/05/26 リンク $air_url = get_item($conn, "air", "air_url", $company[$j]); $air_nm = get_air_comp_nm ( $conn, $company[$j] ) ; if ($air_url){ echo "" . $air_nm . ""; } else { echo $air_nm; } echo $space1; } ?> | 
|---|---|---|---|
| 座席クラス | マイレージ | if ( $mileage == 0 ) { echo "無し"; } else { echo "有り"; } ?> | |
| ダイビングサービス | } if ($diving_joken) { ?> | ダイビング条件 | |
| ダイビングインフォメーション | ", get_item($conn, "diving_service", "info", $diving_service)); ?> | ||
| 食事条件 | 添乗員 | ||
| 最少催行人員 | 人 | 現地税 | if ( $local_tax == 0 ) { $tax_nm = "含まない"; } else { $tax_nm = "含む"; } echo $tax_nm; ?> | 
| 備考 | ", $remark );?> | ||
ご出発日 日前 まで販売を行っております。
      ※上記が休業日の場合は、その前の営業日までとなります。