registerFunction("GetTown"); //取得鄉鎮 $xajax->registerFunction("GetTransit"); //取得摂運站 $xajax->registerFunction("GetSchool"); //取得學校 function GetTown($city_sn) // (1) 輸入縣市 , 取得鄉鎮 { $objResponse = new xajaxResponse(); $objResponse->setCharacterEncoding('utf-8'); if($city_sn==""){ $city_sn = 0; } #----------------------------------------------------------- $sql="select * from town where city_sn=$city_sn order by sn"; mysql_query('SET NAMES utf8'); mysql_query('SET CHARACTER_SET_CLIENT=utf8'); mysql_query('SET CHARACTER_SET_RESULTS=utf8'); $rs21 = new recordset($sql); #----------------------------------------------------------- $str =""; $objResponse->assign("town","innerHTML",$str); return $objResponse; } // END function GetTown function GetTransit($transit_line_sn) // (1) 輸入縣市 , 取得鄉鎮 { $objResponse = new xajaxResponse(); $objResponse->setCharacterEncoding('utf-8'); #----------------------------------------------------------- $sql = "select transit_runline.sn as sn, transit_line_sn , transit_sn , transit from transit_runline inner join transit on transit_sn = transit.sn where transit_line_sn = $transit_line_sn"; $rs22 = new recordset($sql); #----------------------------------------------------------- $str =""; $objResponse->assign("transit","innerHTML",$str); return $objResponse; } // END function GetTown function GetSchool($classify_c,$city_sn) // (1) 輸入縣市 , 取得鄉鎮 { $objResponse = new xajaxResponse(); $objResponse->setCharacterEncoding('utf-8'); #----------------------------------------------------------- $sql = "select * from school where classify_sn=$classify_c and city_sn=$city_sn order by school_name"; $rs23 = new recordset($sql); #----------------------------------------------------------- $str =""; $objResponse->assign("school","innerHTML",$str); return $objResponse; } // END function GetTown $xajax->processRequest(); if($_POST["city_sn"]!=""){ $city_sn = $_POST["city_sn"]; }elseif($_GET["city_sn"]!=""){ $city_sn = $_GET["city_sn"]; }else{ $city_sn = 0; } if($_POST["town_sn"]!=""){ $town_sn = $_POST["town_sn"]; }elseif($_GET["town_sn"]!=""){ $town_sn = $_GET["town_sn"]; }else{ $town_sn = 0; } if($_POST["transit_line_sn"]!=""){ $transit_line_sn = $_POST["transit_line_sn"]; }elseif($_GET["transit_line_sn"]!=""){ $transit_line_sn = $_GET["transit_line_sn"]; }else{ $transit_line_sn = 0; } if($_POST["transit_sn"]!=""){ $transit_sn = $_POST["transit_sn"]; }elseif($_GET["transit_sn"]!=""){ $transit_sn = $_GET["transit_sn"]; }else{ $transit_sn = 0; } if($_POST["classify_c"]!=""){ $classify_c = $_POST["classify_c"]; }elseif($_GET["classify_c"]!=""){ $classify_c = $_GET["classify_c"]; }else{ $classify_c = 0; } if($_POST["school_sn"]!=""){ $school_sn = $_POST["school_sn"]; }elseif($_GET["school_sn"]!=""){ $school_sn = $_GET["school_sn"]; }else{ $school_sn = 0; } if($_POST["distance"]!=""){ $distance = $_POST["distance"]; }elseif($_GET["distance"]!=""){ $distance = $_GET["distance"]; }else{ $distance = 0; } $sql = "select * from house "; $rs6 = new recordset($sql); $r_count = 0; if(! $rs6->eof){ for($i=1;$i<=$rs6->record_count;$i++){ $r_count = $rs6->record_count; $rs6->movenext(); } } $sql = "select * from house where DATE_ADD(adver_date, INTERVAL 30 DAY) >='" . strftime("%Y-%m-%d") . "'"; //echo $sql; $rs7 = new recordset($sql); $r_count_1 = 0; if(! $rs7->eof){ for($i=1;$i<=$rs7->record_count;$i++){ $r_count_1 = $rs7->record_count; $rs7->movenext(); } } ?>