<?php
	include_once("$_SERVER[DOCUMENT_ROOT]/"."setup.php");
	include_once("$_SERVER[DOCUMENT_ROOT]/"."function.php");
	include_once("$_SERVER[DOCUMENT_ROOT]/"."classes.php");
	$dt=new datafetch();
	$link=connect();
	$catcaption = "Chartered Accountants Matrimonial Services";
	$dt1=date("l, j F Y");
echo "<?xml version=\"1.0\"  encoding=\"ISO-8859-1\"?>
<rss version=\"2.0\">";
		echo "<channel>
		<title>$catcaption</title>
		<link>http://www.cainindia.org</link>
		<description>$catcaption</description>
		<language>en-us</language>
		<pubDate>$dt1</pubDate>
		<generator>CAinINDIA RSS Generator developed by Binarysoft Technologies</generator>
		";	


foreach($matcat as $x => $v)
{
	$sql = "select * from matrimonial where mc='$x'  order by add_date desc"; 
	$result = mysql_query($sql);
	
	if(mysql_num_rows($result)>0)
	{
		while($row=mysql_fetch_array($result))
		{
			echo "<item>
			";
			echo "<category>".$matcat[$row["mc"]]."</category>
			";		
			echo "<description>
			<![CDATA[
			".htmlspecialchars(stripslashes($row["ads"]),ENT_QUOTES)."<br>".stripslashes($row["name"])."<br>".stripslashes($row["address"])."<br>".stripslashes($row["email"])."<br>".stripslashes($row["phone"])."
			]]>
			</description>
			";
			$t=explode("-",$row["add_date"]);
			$time=mktime(10,10,10,$t[1],$t[2],$t[0]);
			$dt=date("l, j F Y",$time);
			echo "<pubDate>$dt</pubDate>
			";
			echo "</item>
			";	
		}
		
	}

}
	echo "</channel>
	";
echo "</rss>
";
?>
