マンション・アパート"; $html_result .= "
"; if($kensu > 0){ $html_result .= "" . $kensu . "件見つかりました。 "; if($flg == 1 && $kensu > 3){ $html_result .= ""; $html_result .= "\"さらに詳しく見る\""; $html_result .= ""; } } $html_result .= "
"; $html_result .= "
"; return $html_result; } function bukken_html_body_01($aryCol){ $html_result = ""; $html_result = ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= "
" . query_escape($aryCol["bukken_mei"]) . "

交通

所在地

徒歩

価格

間取り

専有面積

階/階建

築年月

駐車場

" . query_escape($aryCol["kotsu"]) . "
" . query_escape($aryCol["shozaichi"]) . "

" . query_escape($aryCol["eki_toho"]) . "

" . query_escape($aryCol["kakaku"]) . "

" . query_escape($aryCol["madori"]) . "

" . query_escape($aryCol["senyu_menseki"]) . "

" . query_escape($aryCol["kai"]) . "

" . query_escape($aryCol["kaidate"]) . "

" . query_escape($aryCol["chiku_nensu"]) . "

" . query_escape($aryCol["chushajyo"]) . "

"; $html_result .= ""; $html_result .= "\"詳細を見る\""; $html_result .= ""; $html_result .= "

動画案内

"; if($aryCol["url_movie"] != ""){ $html_result .= ""; $html_result .= query_escape($aryCol["caption_movie"]); $html_result .= ""; } else{ $html_result .= "
"; } $html_result .= "
"; return $html_result; } function bukken_html_footer_01(){ $html_result = ""; $html_result .= "
"; return $html_result; } //////////////////////////////////////// /// 戸建てのhtml //////////////////////////////////////// function bukken_html_header_02($kensu,$flg){ $html_result = ""; $html_result .= "

戸建て

"; $html_result .= "
"; if($kensu > 0){ $html_result .= "" . $kensu . "件見つかりました。 "; if($flg == 1 && $kensu > 3){ $html_result .= ""; $html_result .= "\"さらに詳しく見る\""; $html_result .= ""; } } $html_result .= "
"; $html_result .= "
"; return $html_result; } function bukken_html_body_02($aryCol){ $html_result = ""; $html_result = ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= "
" . query_escape($aryCol["bukken_mei"]) . "

交通

所在地

徒歩

価格

間取り

建物面積

土地面積

築年月

駐車場

" . query_escape($aryCol["kotsu"]) . "
" . query_escape($aryCol["shozaichi"]) . "

" . query_escape($aryCol["eki_toho"]) . "

" . query_escape($aryCol["kakaku"]) . "

" . query_escape($aryCol["madori"]) . "

" . query_escape($aryCol["tatemono_menseki"]) . "

" . query_escape($aryCol["tochi_menseki"]) . "

" . query_escape($aryCol["chiku_nensu"]) . "

" . query_escape($aryCol["chushajyo"]) . "

"; $html_result .= ""; $html_result .= "\"詳細を見る\""; $html_result .= ""; $html_result .= "

動画案内

"; if($aryCol["url_movie"] != ""){ $html_result .= ""; $html_result .= query_escape($aryCol["caption_movie"]); $html_result .= ""; } else{ $html_result .= "
"; } $html_result .= "
"; return $html_result; } function bukken_html_footer_02(){ $html_result = ""; $html_result .= "
"; return $html_result; } //////////////////////////////////////// /// 事業用のhtml //////////////////////////////////////// function bukken_html_header_03($kensu,$flg){ $html_result = ""; $html_result .= "

事業用

"; $html_result .= "
"; if($kensu > 0){ $html_result .= "" . $kensu . "件見つかりました。 "; if($flg == 1 && $kensu > 3){ $html_result .= ""; $html_result .= "\"さらに詳しく見る\""; $html_result .= ""; } } $html_result .= "
"; $html_result .= "
"; return $html_result; } function bukken_html_body_03($aryCol){ $html_result = ""; $html_result = ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= "
" . query_escape($aryCol["bukken_mei"]) . "

交通

所在地

徒歩

価格

使用部分

面積

土地面積

建物面積

築年月

駐車場

" . query_escape($aryCol["kotsu"]) . "
" . query_escape($aryCol["shozaichi"]) . "

" . query_escape($aryCol["eki_toho"]) . "

" . query_escape($aryCol["kakaku"]) . "

" . query_escape($aryCol["shiyo_menseki"]) . "

" . query_escape($aryCol["tochi_menseki"]) . "

" . query_escape($aryCol["tatemono_menseki"]) . "

" . query_escape($aryCol["chiku_nensu"]) . "

" . query_escape($aryCol["chushajyo"]) . "

"; $html_result .= ""; $html_result .= "\"詳細を見る\""; $html_result .= ""; $html_result .= "

物件構造

" . query_escape($aryCol["tatemono_kouzou"]) . "

総戸数

" . query_escape($aryCol["sou_kosu"]) . "

動画案内

"; if($aryCol["url_movie"] != ""){ $html_result .= ""; $html_result .= query_escape($aryCol["caption_movie"]); $html_result .= ""; } else{ $html_result .= "
"; } $html_result .= "
"; return $html_result; } function bukken_html_footer_03(){ $html_result = ""; $html_result .= "
"; return $html_result; } //////////////////////////////////////// /// 土地のhtml //////////////////////////////////////// function bukken_html_header_04($kensu,$flg){ $html_result = ""; $html_result .= "

土地

"; $html_result .= "
"; if($kensu > 0){ $html_result .= "" . $kensu . "件見つかりました。 "; if($flg == 1 && $kensu > 3){ $html_result .= ""; $html_result .= "\"さらに詳しく見る\""; $html_result .= ""; } } $html_result .= "
"; $html_result .= "
"; return $html_result; } function bukken_html_body_04($aryCol){ $html_result = ""; $html_result = ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= "
" . query_escape($aryCol["bukken_mei"]) . "

交通

所在地

徒歩

価格

間取り

土地面積

建ぺい率

容積率

 
" . query_escape($aryCol["kotsu"]) . "
" . query_escape($aryCol["shozaichi"]) . "

" . query_escape($aryCol["eki_toho"]) . "

" . query_escape($aryCol["kakaku"]) . "

" . query_escape($aryCol["madori"]) . "

" . query_escape($aryCol["tochi_menseki"]) . "

" . query_escape($aryCol["kenpei_ritsu"]) . "

" . query_escape($aryCol["youseki_ritsu"]) . "

 

"; $html_result .= ""; $html_result .= "\"詳細を見る\""; $html_result .= ""; $html_result .= "

最適用途

" . query_escape($aryCol["saiteki"]) . "

現況

" . query_escape($aryCol["genkyo"]) . "

動画案内

"; if($aryCol["url_movie"] != ""){ $html_result .= ""; $html_result .= query_escape($aryCol["caption_movie"]); $html_result .= ""; } else{ $html_result .= "
"; } $html_result .= "
"; return $html_result; } function bukken_html_footer_04(){ $html_result = ""; $html_result .= "
"; return $html_result; } //////////////////////////////////////// /// 投資用のhtml //////////////////////////////////////// function bukken_html_header_05($kensu,$flg){ $html_result = ""; $html_result .= "

投資用

"; $html_result .= "
"; if($kensu > 0){ $html_result .= "" . $kensu . "件見つかりました。 "; if($flg == 1 && $kensu > 3){ $html_result .= ""; $html_result .= "\"さらに詳しく見る\""; $html_result .= ""; } } $html_result .= "
"; $html_result .= "
"; return $html_result; } function bukken_html_body_05($aryCol){ $html_result = ""; $html_result = ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= "
" . query_escape($aryCol["bukken_mei"]) . "

交通

所在地

徒歩

価格

使用部分

面積

土地面積

建物面積

築年月

駐車場

" . query_escape($aryCol["kotsu"]) . "
" . query_escape($aryCol["shozaichi"]) . "

" . query_escape($aryCol["eki_toho"]) . "

" . query_escape($aryCol["kakaku"]) . "

" . query_escape($aryCol["shiyo_menseki"]) . "

" . query_escape($aryCol["tochi_menseki"]) . "

" . query_escape($aryCol["tatemono_menseki"]) . "

" . query_escape($aryCol["chiku_nensu"]) . "

" . query_escape($aryCol["chushajyo"]) . "

"; $html_result .= ""; $html_result .= "\"詳細を見る\""; $html_result .= ""; $html_result .= "

物件構造

" . query_escape($aryCol["tatemono_kouzou"]) . "

総戸数

" . query_escape($aryCol["sou_kosu"]) . "

動画案内

"; if($aryCol["url_movie"] != ""){ $html_result .= ""; $html_result .= query_escape($aryCol["caption_movie"]); $html_result .= ""; } else{ $html_result .= "
"; } $html_result .= "
"; return $html_result; } function bukken_html_footer_05(){ $html_result = ""; $html_result .= "
"; return $html_result; } //////////////////////////////////////// /// 物件が見つからなかった時のhtml //////////////////////////////////////// function bukken_html_body_notfound(){ $html_result = ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= "
見つかりませんでした。
"; return $html_result; } //////////////////////////////////////// /// ページナビ //////////////////////////////////////// function bukken_html_pagenavi(){ $html_result = ""; $html_result .= "
"; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= ""; $html_result .= "
"; return $html_result; } ######################################## ### メイン ######################################## //////////////////////////////////////// /// [検索]ボタン押下時の処理 //////////////////////////////////////// if(isset($_GET["n"])){ $mode = "detail"; $record_number = $_GET["n"]; $db = opendb(); $query = ""; $query .= "SELECT * "; $query .= "FROM tbl_baibai "; $query .= "WHERE number=" . query_escape($record_number); $result = query_sql($db,$query); $row_count = query_rows($result); if($row_count == 1){ $aryCol = query_fetch($result); } else{ ob_end_clean(); header ("Location:http://www.sakauta-smile.net/"); exit; } closedb($db); /// 値の取得 $bukken_type = $aryCol["bukken_type"]; $meisho = $aryCol["meisho"]; $bukken_mei = $aryCol["bukken_mei"]; $kotsu = $aryCol["kotsu"]; $shozaichi = $aryCol["shozaichi"]; $eki_toho = $aryCol["eki_toho"]; $kakaku = $aryCol["kakaku"]; $tsubo_tanka = $aryCol["tsubo_tanka"]; $mm_tanka = $aryCol["mm_tanka"]; $kanrihi = $aryCol["kanrihi"]; $shuzen_tsumitate = $aryCol["shuzen_tsumitate"]; $shakuchi_kikan = $aryCol["shakuchi_kikan"]; $kenrikin = $aryCol["kenrikin"]; $shikikin = $aryCol["shikikin"]; $hoshokin = $aryCol["hoshokin"]; $ijihi = $aryCol["ijihi"]; $ichijikin = $aryCol["ichijikin"]; $madori = $aryCol["madori"]; $madori_uchiwake = $aryCol["madori_uchiwake"]; $senyu_menseki = $aryCol["senyu_menseki"]; $tatemono_menseki = $aryCol["tatemono_menseki"]; $shiyo_menseki = $aryCol["shiyo_menseki"]; $tsubo_su = $aryCol["tsubo_su"]; $tochi_menseki = $aryCol["tochi_menseki"]; $chiku_nensu = $aryCol["chiku_nensu"]; $kaidate = $aryCol["kaidate"]; $kai = $aryCol["kai"]; $barukoni = $aryCol["barukoni"]; $chushajyo = $aryCol["chushajyo"]; $tatemono_kouzou = $aryCol["tatemono_kouzou"]; $tatemono_mei = $aryCol["tatemono_mei"]; $chushajyo_mei = $aryCol["chushajyo_mei"]; $shikichi_menseki = $aryCol["shikichi_menseki"]; $kanri = $aryCol["kanri"]; $sou_kosu = $aryCol["sou_kosu"]; $tochi_kenri = $aryCol["tochi_kenri"]; $kokudohou = $aryCol["kokudohou"]; $setsubi = $aryCol["setsubi"]; $biko = $aryCol["biko"]; $tokki = $aryCol["tokki"]; $shido_hutan = $aryCol["shido_hutan"]; $toshi_keikaku = $aryCol["toshi_keikaku"]; $youto = $aryCol["youto"]; $saiteki = $aryCol["saiteki"]; $kenpei_ritsu = $aryCol["kenpei_ritsu"]; $youseki_ritsu = $aryCol["youseki_ritsu"]; $setsudo = $aryCol["setsudo"]; $chimoku = $aryCol["chimoku"]; $chisei = $aryCol["chisei"]; $kenchiku_kakunin = $aryCol["kenchiku_kakunin"]; $genkyo = $aryCol["genkyo"]; $jyoken = $aryCol["jyoken"]; $hikiwatashi = $aryCol["hikiwatashi"]; $bukken_no = $aryCol["bukken_no"]; $koukai_bi = $aryCol["koukai_bi"]; $point = $aryCol["point"]; $torihiki = $aryCol["torihiki"]; $sakimono_bukken = $aryCol["sakimono_bukken"]; $motoduke = $aryCol["motoduke"]; $map_ido = $aryCol["map_ido"]; $map_keido = $aryCol["map_keido"]; $caption_01 = $aryCol["caption_01"]; $caption_02 = $aryCol["caption_02"]; $caption_03 = $aryCol["caption_03"]; $caption_04 = $aryCol["caption_04"]; $caption_05 = $aryCol["caption_05"]; $caption_06 = $aryCol["caption_06"]; $caption_07 = $aryCol["caption_07"]; $caption_08 = $aryCol["caption_08"]; $caption_09 = $aryCol["caption_09"]; $caption_10 = $aryCol["caption_10"]; $url_movie = $aryCol["url_movie"]; $caption_movie = $aryCol["caption_movie"]; $file_01 = $aryCol["filename_01"]; $file_02 = $aryCol["filename_02"]; $file_03 = $aryCol["filename_03"]; $file_04 = $aryCol["filename_04"]; $file_05 = $aryCol["filename_05"]; $file_06 = $aryCol["filename_06"]; $file_07 = $aryCol["filename_07"]; $file_08 = $aryCol["filename_08"]; $file_09 = $aryCol["filename_09"]; $file_10 = $aryCol["filename_10"]; $movie = ""; if($url_movie != ""){ $movie .= "" . $caption_movie . ""; } } //////////////////////////////////////// /// [検索]ボタン押下時の処理 //////////////////////////////////////// elseif(isset($_POST["kensaku_x"])){ $mode = "init"; ////////////////////////////// /// エリアの取得 ////////////////////////////// $count_area = 0; for($i=1;$i<=3;$i++){ if(isset($_REQUEST["area"][$i]) && $_REQUEST["area"][$i] == "1"){ $_SESSION[sprintf("area_%02d",$i)] = "1"; $count_area++; } else{ $_SESSION[sprintf("area_%02d",$i)] = "0"; } } /// エリアが選択されていない場合は全てが対象 if($count_area == 0){ for($i=1;$i<=3;$i++){ $_SESSION[sprintf("area_%02d",$i)] = "1"; } $count_area = 3; } ////////////////////////////// /// 種類の取得 ////////////////////////////// $_SESSION["count_type"] = 0; $_SESSION["type_bukken"] = ""; for($i=1;$i<=5;$i++){ if(isset($_REQUEST["type"][$i]) && $_REQUEST["type"][$i] == "1"){ $_SESSION[sprintf("type_%02d",$i)] = "1"; $_SESSION["count_type"]++; $_SESSION["type_bukken"] = $i; } else{ $_SESSION[sprintf("type_%02d",$i)] = "0"; } } /// 種類が選択されていない場合は全てが対象 if($_SESSION["count_type"] == 0){ for($i=1;$i<=5;$i++){ $_SESSION[sprintf("type_%02d",$i)] = "1"; } $_SESSION["count_type"] = 5; } /// ページのクリアー unset($_SESSION["max_page"]); unset($_SESSION["now_page"]); } //////////////////////////////////////// /// 初期設定 //////////////////////////////////////// else{ $mode = "init"; if(!(isset($_POST["first"]) || isset($_POST["prev"]) || isset($_POST["page"]) || isset($_POST["next"]) || isset($_POST["max"]))){ if(isset($_GET["t"])){ for($i=1;$i<=5;$i++){ if($i == $_GET["t"]){ $_SESSION[sprintf("type_%02d",$i)] = "1"; } else{ $_SESSION[sprintf("type_%02d",$i)] = "0"; } } $_SESSION["area_01"] = "1"; $_SESSION["area_02"] = "1"; $_SESSION["area_03"] = "1"; $_SESSION["count_type"] = 1; $_SESSION["type_bukken"] = $_GET["t"]; } else{ $_SESSION = array(); $_SESSION["area_01"] = "1"; $_SESSION["area_02"] = "1"; $_SESSION["area_03"] = "1"; $_SESSION["type_01"] = "1"; $_SESSION["type_02"] = "1"; $_SESSION["type_03"] = "1"; $_SESSION["type_04"] = "1"; $_SESSION["type_05"] = "1"; $_SESSION["count_type"] = 0; $_SESSION["type_bukken"] = "1"; } } } ######################################## ### 検索処理 ######################################## if(!isset($_GET["n"])){ $db = opendb(); ////////////////////////////// /// 条件の生成 ////////////////////////////// /// エリア $where_area = ""; if($_SESSION["area_01"] == "1"){ $where_area .= "(shozaichi like '%坂出市%' "; } if($_SESSION["area_02"] == "1"){ if($where_area == ""){ $where_area .= "( "; } else{ $where_area .= "or "; } $where_area .= "shozaichi like '%宇多津町%' "; } if($_SESSION["area_03"] == "1"){ if($where_area == ""){ $where_area .= "( "; } else{ $where_area .= "or "; } $where_area .= "(shozaichi not like '%坂出市%' and shozaichi not like '%宇多津町%') "; } if($where_area != ""){ $where_area .= ") "; } /// 条件の生成 $where = "WHERE active='1' "; if($where_area != ""){ if($where == ""){ $where .= "WHERE "; } else{ $where .= "and "; } $where .= $where_area; } ////////////////////////////// /// 結果一覧の生成 ////////////////////////////// $html_result = ""; /// 選択された種類が1つの場合 if($_SESSION["count_type"] == 1){ ////////////////////////////// /// 件数の取得 ////////////////////////////// $query = ""; $query .= "SELECT COUNT(*) as count_kensu "; $query .= "FROM tbl_baibai "; if($where != ""){ $query .= $where; $query .= "and bukken_type = '" . $_SESSION["type_bukken"] . "' "; } else{ $query .= "WHERE bukken_type = '" . $_SESSION["type_bukken"] . "' "; } $result = query_sql($db,$query); $row_count = query_rows($result); $aryCol = query_fetch($result); $count_kensu = $aryCol['count_kensu']; /// 最大ページの計算 $max_page = ceil($count_kensu / DF_PAGE_KENSU); if($max_page < 1){ $max_page = 1; } ////////////////////////////// /// ページの処理 ////////////////////////////// if(isset($_POST['first']) && isset($_SESSION['max_page']) && isset($_SESSION['now_page'])){ $_SESSION['now_page'] = 1; } elseif(isset($_POST['prev']) && isset($_SESSION['max_page']) && isset($_SESSION['now_page'])){ $_SESSION['now_page'] = $_SESSION['now_page'] - 1; } elseif(isset($_POST['next']) && isset($_SESSION['max_page']) && isset($_SESSION['now_page'])){ $_SESSION['now_page'] = $_SESSION['now_page'] + 1; } elseif(isset($_POST['max']) && isset($_SESSION['max_page']) && isset($_SESSION['now_page'])){ $_SESSION['now_page'] = $_SESSION['max_page']; } elseif(isset($_POST['page']) && isset($_SESSION['max_page']) && isset($_SESSION['now_page'])){ if(preg_match("/^[0-9]+$/",$_POST['select_page'])){ $_SESSION['now_page'] = $_POST['select_page']; } } elseif(isset($_SESSION['max_page']) && isset($_SESSION['now_page'])){ ; } else{ $_SESSION['max_page'] = $max_page; $_SESSION['now_page'] = 1; } if($_SESSION['now_page'] < 1){ $_SESSION['now_page'] = 1; } elseif($_SESSION['now_page'] > $_SESSION['max_page']){ $_SESSION['now_page'] = $_SESSION['max_page']; } /// 検索処理 $query = ""; $query .= "SELECT * "; $query .= "FROM tbl_baibai "; if($where != ""){ $query .= $where; $query .= "and bukken_type = '" . $_SESSION["type_bukken"] . "' "; } else{ $query .= "WHERE bukken_type = '" . $_SESSION["type_bukken"] . "' "; } $query .= "ORDER BY touroku DESC "; $query .= "LIMIT " . sprintf("%d,%d",(($_SESSION['now_page'] - 1) * DF_PAGE_KENSU),DF_PAGE_KENSU) . " "; $result = query_sql($db,$query); $row_count = query_rows($result); /// htmlヘッダ switch($_SESSION["type_bukken"]){ case "1": $html_result .= bukken_html_header_01($count_kensu,0); break; case "2": $html_result .= bukken_html_header_02($count_kensu,0); break; case "3": $html_result .= bukken_html_header_03($count_kensu,0); break; case "4": $html_result .= bukken_html_header_04($count_kensu,0); break; case "5": $html_result .= bukken_html_header_05($count_kensu,0); break; } if($row_count > 0){ while($aryCol = query_fetch($result)){ /// htmlボディ switch($_SESSION["type_bukken"]){ case "1": $html_result .= bukken_html_body_01($aryCol); break; case "2": $html_result .= bukken_html_body_02($aryCol); break; case "3": $html_result .= bukken_html_body_03($aryCol); break; case "4": $html_result .= bukken_html_body_04($aryCol); break; case "5": $html_result .= bukken_html_body_05($aryCol); break; } } } else{ $html_result .= bukken_html_body_notfound(); } /// htmlフッタ switch($_SESSION["type_bukken"]){ case "1": $html_result .= bukken_html_footer_01(); break; case "2": $html_result .= bukken_html_footer_02(); break; case "3": $html_result .= bukken_html_footer_03(); break; case "4": $html_result .= bukken_html_footer_04(); break; case "5": $html_result .= bukken_html_footer_05(); break; } /// ページナビ if($row_count > 0){ $html_result .= bukken_html_pagenavi(); } } /// 選択された種類が2つ以上の場合 else{ ////////////////////////////// /// 件数の確認 ////////////////////////////// $query = ""; $query .= "SELECT "; $query .= "count(CASE WHEN bukken_type='1' and active='1' THEN 1 END) as kensu_01, "; $query .= "count(CASE WHEN bukken_type='2' and active='1' THEN 1 END) as kensu_02, "; $query .= "count(CASE WHEN bukken_type='3' and active='1' THEN 1 END) as kensu_03, "; $query .= "count(CASE WHEN bukken_type='4' and active='1' THEN 1 END) as kensu_04, "; $query .= "count(CASE WHEN bukken_type='5' and active='1' THEN 1 END) as kensu_05 "; $query .= "FROM tbl_baibai "; $query .= $where; $result = query_sql($db,$query); $row_count = query_rows($result); if($row_count == 1){ $aryCol = query_fetch($result); } $kensu_01 = $aryCol["kensu_01"]; $kensu_02 = $aryCol["kensu_02"]; $kensu_03 = $aryCol["kensu_03"]; $kensu_04 = $aryCol["kensu_04"]; $kensu_05 = $aryCol["kensu_05"]; /// マンション・アパート if($_SESSION["type_01"] == "1"){ $query = ""; $query .= "SELECT * "; $query .= "FROM tbl_baibai "; if($where != ""){ $query .= $where; $query .= "and bukken_type = '1' "; } else{ $query .= "WHERE bukken_type = '1' "; } $query .= "ORDER BY touroku DESC "; $query .= "LIMIT 3 OFFSET 0 "; $result = query_sql($db,$query); $row_count = query_rows($result); $html_result .= bukken_html_header_01($kensu_01,1); if($row_count > 0){ while($aryCol = query_fetch($result)){ $html_result .= bukken_html_body_01($aryCol); } } else{ $html_result .= bukken_html_body_notfound(); } $html_result .= bukken_html_footer_01(); } /// 戸建て if($_SESSION["type_02"] == "1"){ $query = ""; $query .= "SELECT * "; $query .= "FROM tbl_baibai "; if($where != ""){ $query .= $where; $query .= "and bukken_type = '2' "; } else{ $query .= "WHERE bukken_type = '2' "; } $query .= "ORDER BY touroku DESC "; $query .= "LIMIT 3 OFFSET 0 "; $result = query_sql($db,$query); $row_count = query_rows($result); $html_result .= bukken_html_header_02($kensu_02,1); if($row_count > 0){ while($aryCol = query_fetch($result)){ $html_result .= bukken_html_body_02($aryCol); } } else{ $html_result .= bukken_html_body_notfound(); } $html_result .= bukken_html_footer_02(); } /// 事業用 if($_SESSION["type_03"] == "1"){ $query = ""; $query .= "SELECT * "; $query .= "FROM tbl_baibai "; if($where != ""){ $query .= $where; $query .= "and bukken_type = '3' "; } else{ $query .= "WHERE bukken_type = '3' "; } $query .= "ORDER BY touroku DESC "; $query .= "LIMIT 3 OFFSET 0 "; $result = query_sql($db,$query); $row_count = query_rows($result); $html_result .= bukken_html_header_03($kensu_03,1); if($row_count > 0){ while($aryCol = query_fetch($result)){ $html_result .= bukken_html_body_03($aryCol); } } else{ $html_result .= bukken_html_body_notfound(); } $html_result .= bukken_html_footer_03(); } /// 土地 if($_SESSION["type_04"] == "1"){ $query = ""; $query .= "SELECT * "; $query .= "FROM tbl_baibai "; if($where != ""){ $query .= $where; $query .= "and bukken_type = '4' "; } else{ $query .= "WHERE bukken_type = '4' "; } $query .= "ORDER BY touroku DESC "; $query .= "LIMIT 3 OFFSET 0 "; $result = query_sql($db,$query); $row_count = query_rows($result); $html_result .= bukken_html_header_04($kensu_04,1); if($row_count > 0){ while($aryCol = query_fetch($result)){ $html_result .= bukken_html_body_04($aryCol); } } else{ $html_result .= bukken_html_body_notfound(); } $html_result .= bukken_html_footer_04(); } /// 投資用 if($_SESSION["type_05"] == "1"){ $query = ""; $query .= "SELECT * "; $query .= "FROM tbl_baibai "; if($where != ""){ $query .= $where; $query .= "and bukken_type = '5' "; } else{ $query .= "WHERE bukken_type = '5' "; } $query .= "ORDER BY touroku DESC "; $query .= "LIMIT 3 OFFSET 0 "; $result = query_sql($db,$query); $row_count = query_rows($result); $html_result .= bukken_html_header_05($kensu_05,1); if($row_count > 0){ while($aryCol = query_fetch($result)){ $html_result .= bukken_html_body_05($aryCol); } } else{ $html_result .= bukken_html_body_notfound(); } $html_result .= bukken_html_footer_05(); } } } ######################################## ### 画面の表示 ######################################## switch($mode){ case "init": include(DF_HTML_01); break; case "detail": include(DF_HTML_02); break; default: $message = '操作中に不明なエラーが発生しました。'; include(DF_HTML_99); break; } ######################################## ### バッファ出力 ######################################## ob_end_flush(); ?>