小豆島温泉の駅近ホテル

“”) { //温泉別ホテル一覧のとき
$on4 = sprintf(‘%04d’, $g_onsenid);
$jaranurl = “http://jws.jalan.net/APIAdvance/HotelSearch/V1/?key=psc140f5dbc1e1&o_id=” . $on4 . “&onsen=1&5_station=1&order=4&count=100&xml_ptn=2″;
//echo $jaranurl.”
“;
} else { //県別ホテル一覧、駅別ホテル一覧のとき
$k2 = sprintf(‘%02d’, $g_ken);
$jaranurl = “http://jws.jalan.net/APIAdvance/HotelSearch/V1/?key=psc140f5dbc1e1&pref=” . $k2 . “0000&onsen=1&5_station=1&order=4&count=100&xml_ptn=2”;
}
$xml = simplexml_load_file($jaranurl);
if ($g_station == “”) printf(‘%d件あります
‘, $xml->NumberOfResults);
echo “
“;
foreach($xml->Hotel as $h) {
$sql = ” select e_hotel.HotelDetailURL, e_hotel.PictureURL”;
$sql .= ” from e_hotel”;
if ($g_station <> “”) $sql .= “, NearestStation”;
$sql .= ” where e_hotel.HotelID = ‘” . $h->HotelID . “‘”;
if ($g_station <> “”) {
$sql .= ” and e_hotel.HotelID = NearestStation.HotelID”;
$sql .= ” and NearestStation.Station = ‘” . $g_station . “‘”;
}
//echo $sql.”
“;
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$num = mysql_num_rows($result);

if ($num == 1) {

//echo ‘row[“HotelDetailURL”]=’. $row[“HotelDetailURL”].”
“;
//echo ‘row[“PictureURL”]=’. $row[“PictureURL”].”
“;
$afflink = getJaranAffiliateLink($h->HotelName, $row[“HotelDetailURL”], $row[“PictureURL”]);

echo “

“;
echo “

“;
// printf(‘

‘, $h->HotelDetailURL, $h->PictureURL);
echo “

‘, $h->AccessInformation);
printf(‘%sクチコミ=%s件 評点=%s
‘, $afflink[“notext”], $h->NumberOfRatings, $h->Rating);
// printf(‘クチコミ=%s件 評点=%s
‘, $h->HotelDetailURL, $h->NumberOfRatings, $h->Rating);
printf(‘%s’, $h->HotelCatchCopy);
echo “

“;
echo “

“;
}
mysql_free_result($result);
}
echo “

” . $afflink[“image”] . “ “;
echo $afflink[“text”] . “
“;
// printf(‘%s
‘, $h->HotelDetailURL, $h->HotelName);
printf(‘%s(%s)
‘, $h->OnsenName, $h->Area->SmallArea);
// printf(‘
%s

“;
mysql_close($link);
?>