<? require 'include/announcements.php'; // ITECHBIDS Configuration File
require 'include/itechbids.php'; // Server compatibility Patch
 
       $category_sql1="select * from site_categories where category_head_id=$cate_id";
		$category_result1=mysql_query($category_sql1);
	    $category_row1=mysql_fetch_array($category_result1);
        $category_sql="select * from site_categories where category_id=$cate_id";
		$category_result2=mysql_query($category_sql);
		$main_categoryname_row=mysql_fetch_array($category_result2);
		$main_categoryname= $main_categoryname_row['category_name'];
		if(mysql_num_rows($category_result1)>0)
		{
?>

<table border="0" align="center" cellpadding="3" cellspacing="0" width="100%" class="table_border1_with_bg">
	<tr >
	<td width="3%" valign="top" class="tdhead">&nbsp;
	</td>
	<td width="100%" class="tdhead" height="30" valign="top"><?= $main_categoryname; ?></td></tr>
	<?
		$category_sql="select * from site_categories where category_head_id=$cate_id";
		
		$category_result=mysql_query($category_sql);
		while($category_row=mysql_fetch_array($category_result))
		 {
		 $categoryname= $category_row['category_name'];
	?>
	<tr><td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="subcategory.php?cate_id=<?= $category_row['category_id']; ?>&view=list" class="cata"><?= $categoryname; ?></a></td></tr>
	<?
	    $subcategory_sql="select * from site_categories where category_head_id=".$category_row['category_id'];
		$subcategory_result=mysql_query($subcategory_sql);
		$sub_count=1;
		while($subcategory_row=mysql_fetch_array($subcategory_result))
		 {

		$subcategoryname= $subcategory_row['category_name'];
		if($sub_count<=2)
		{
		?>
	<tr><td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="subcategory.php?cate_id=<?= $subcategory_row['category_id']; ?>&view=list" ><?=$subcategoryname?></a></td></tr>
	<?	
	}
			 $sub_count=$sub_count+1;
	} //while($subcategory_row=mysql_fetch_array($subcategory_result))
	}
	?>
	</table>
<?
 } //if(mysql_num_rows($category_result1)>0)
?>