require_once("../conn.php");
require_once("access.php");
if(isset($_POST[ss1]))
{
	while(list(,$v) = each($_POST[RegCategory]))
	{
		$NewCat = explode("|", $v);
		$NewCategory = $NewCat[0];
		$NewSubcategory = $NewCat[1];
		$MyID = $NewCat[2];
		$qup = "update yellow_posts set CategoryID = '$NewCategory' where ListingID = '$MyID' ";
		mysql_query($qup) or die(mysql_error());
	}
	include_once("LeftStyles.php");
	echo "
The listings information was updated successfully.
Click here to delete this category.";
	exit();
}
if(!empty($_GET[CategoryID]))
{
	if($_GET[n] == '0')
	{
		//delete subcategory's info
		$q1 = "delete from yellow_categories where CategoryID = '$_GET[CategoryID]' ";
		mysql_query($q1) or die(mysql_error());
		header("location:categories.php");
	}
	else
	{
		include_once("LeftStyles.php");
		//show the listings at this category
		$q1 = "select * from yellow_listing, yellow_agents, yellow_priority,yellow_posts where yellow_posts.CategoryID = '$_GET[CategoryID]' and yellow_posts.AgentID = yellow_agents.AgentID and yellow_agents.PriorityLevel = yellow_priority.PriorityLevel and yellow_agents.AccountStatus = 'active'";
		//$q1 = "select * from yellow_listing, yellow_priority, yellow_agents where yellow_agents.CategoryID = '$_GET[CategoryID]' and yellow_agents.PriorityLevel = yellow_priority.PriorityID ";
		$r1 = mysql_query($q1) or die(mysql_error());
		?>
 
  
  
		\n\n";
	}
}
?>