<?
include_once "../dbconnect.php";
$_REQUEST["gyo"] = "0495";
	//update_date
	$sql = "";
	$result = mysql_query("select * from vt_bukken_s1_w0 where vender_id = '".(int)$_REQUEST["gyo"]."' order by ins_date desc limit 10");
	if($rows = mysql_num_rows($result)){
		while($arr = mysql_fetch_array($result)){
			$sql .= " and bukkendata_id != '".$arr["bukkendata_id"]."'";
			$disp = array();
			if($arr["kubun3"] >=4){
				$arr["kubun1_desc"] = "リゾート土地";
			}
			if($arr["address2"]){
				$arr["address2"] .= "丁目";
			}
			if($arr["address23_non_flg"] != "1"){
				$disp["address"] = $arr["city_name1"]."".$arr["city_name2"]."".$arr["address1"]."".$arr["address2"]."".$arr["address3"];
			}else{
				$disp["address"] = $arr["city_name1"]."".$arr["city_name2"]."".$arr["address1"]."".$arr["address2"];
			}
			if($arr["kakaku_memo"]){
				$disp["kakaku"] = $arr["kakaku_memo"];
			}else{
				$disp["kakaku"] = $arr["kakaku_amt"]."万円";
			}
			if($arr["room_count"] or $arr["roomlayout_short"]){
				$disp["room"] = $arr["room_count"]."".$arr["roomlayout_short"];
			}
			if($arr["land_m2"]){
				$disp["land"] = $arr["land_m2"]."㎡";
			}else if($arr["land_tsubo"]){
				$disp["land"] = $arr["land_tsubo"]."坪";
			}
			if($disp["room"]){
				$disp["landroom"] = $disp["room"];
			}else if($disp["land"]){
				$disp["landroom"] = $disp["land"];
			}
$b[strtotime($arr["ins_date"])] .= "<rdf:li rdf:resource=\"http://www.kizokunoie.com/bukken/info2.php?id=".$arr["bukkendata_id"]."\"/>";
$a[strtotime($arr["ins_date"])] .= "<item rdf:about=\"http://www.kizokunoie.com/bukken/info2.php?id=".$arr["bukkendata_id"]."\">
<title>NEW ".$arr["kubun1_desc"]." ".$disp["address"]." ".$disp["kakaku"]." ".$disp["landroom"]."</title>
<link>http://www.kizokunoie.com/bukken/info2.php?id=".$arr["bukkendata_id"]."</link>
<description>".$disp["address"]." ".$disp["kakaku"]." ".$arr["pr_point"]."</description>
<dc:date>".date("Y-m-d",strtotime($arr["ins_date"]))."T".date("H:i:s",strtotime($arr["ins_date"]))."+09:00</dc:date>
</item>
";

		}
	}
	//
	$result = mysql_query("select * from vt_bukken_s1_w0 where vender_id = '".(int)$_REQUEST["gyo"]."'".$sql." order by update_date desc limit 20");
	if($rows = mysql_num_rows($result)){
		while($arr = mysql_fetch_array($result)){
			$disp = array();
			if($arr["kubun3"] >=4){
				$arr["kubun1_desc"] = "リゾート土地";
			}
			if($arr["address2"]){
				$arr["address2"] .= "丁目";
			}
			if($arr["address23_non_flg"] != "1"){
				$disp["address"] = $arr["city_name1"]."".$arr["city_name2"]."".$arr["address1"]."".$arr["address2"]."".$arr["address3"];
			}else{
				$disp["address"] = $arr["city_name1"]."".$arr["city_name2"]."".$arr["address1"]."".$arr["address2"];
			}
			if($arr["kakaku_memo"]){
				$disp["kakaku"] = $arr["kakaku_memo"];
			}else{
				$disp["kakaku"] = $arr["kakaku_amt"]."万円";
			}
			if($arr["room_count"] or $arr["roomlayout_short"]){
				$disp["room"] = $arr["room_count"]."".$arr["roomlayout_short"];
			}
			if($arr["land_m2"]){
				$disp["land"] = $arr["land_m2"]."㎡";
			}else if($arr["land_tsubo"]){
				$disp["land"] = $arr["land_tsubo"]."坪";
			}
			if($disp["room"]){
				$disp["landroom"] = $disp["room"];
			}else if($disp["land"]){
				$disp["landroom"] = $disp["land"];
			}
$b[strtotime($arr["update_date"])] .= "<rdf:li rdf:resource=\"http://www.kizokunoie.com/bukken/info2.php?id=".$arr["bukkendata_id"]."\"/>";
$a[strtotime($arr["update_date"])] .= "<item rdf:about=\"http://www.kizokunoie.com/bukken/info2.php?id=".$arr["bukkendata_id"]."\">
<title>更新 ".$arr["kubun1_desc"]." ".$disp["address"]." ".$disp["kakaku"]." ".$disp["landroom"]."</title>
<link>http://www.kizokunoie.com/bukken/info2.php?id=".$arr["bukkendata_id"]."</link>
<description>".$disp["address"]." ".$disp["kakaku"]." ".$arr["pr_point"]."</description>
<dc:date>".date("Y-m-d",strtotime($arr["update_date"]))."T".date("H:i:s",strtotime($arr["update_date"]))."+09:00</dc:date>
</item>
";

		}
	}

	if(count($a)){
header ("Content-Type: text/xml; charset=UTF-8");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\" xmlns=\"http://purl.org/rss/1.0/\">
<channel rdf:about=\"http://www.kizokunoie.com/\">
<title>木族の家</title>
<link>http://www.kizokunoie.com/</link>
<description>木族の家 - 不動産情報</description>
<dc:language>ja</dc:language>
<dc:date>".date("Y-m-d")."T".date("H:i:s")."+09:00</dc:date>
<items>
<rdf:Seq>";

		rsort($b);
		foreach($b as $key1 => $var1){
			echo $var1."\n";
		}
echo "</rdf:Seq>
</items>
</channel>

";
	}

	rsort($a);
	foreach($a as $key => $var){
		echo $var;
	}

	if(count($a)){
		echo "</rdf:RDF>";
	}
?><script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"version":"2024.11.0","token":"acf996252181409c8eb531934bbee25f","server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}' crossorigin="anonymous"></script>
