<?php include("session_start.php");

include("session_check.php");

include("database.php");

if($_GET['q']!="")

{	

	$q=$_GET["q"];

	

	$result = mysql_query("SELECT * FROM input_form where id='$q'");

	$row1=mysql_fetch_assoc($result);

	

	$sql="select t1.ward_office,t2.tree_name from input_form as t1 left join info as t2 on t1.id = t2.aid where t1.city= '$q'  ";

	//echo "SELECT * FROM input_form WHERE city= '$q'   ";

	$rest=mysql_query($sql);

	$num = mysql_num_rows($rest); 

	if($num >0)

	{

		?>

    <a href="print_city_total_tree_report.php?q=<?php echo $q?>"> 

    <input type="button" bgcolor="#a9c1de" name="print" id="print" value="Print" style="text-decoration:none" class="button_c" onClick=""></a>

    <br /><br />

    <?php

		echo "<b>Total Number of Trees In The City are :".$num ;

		echo "<br><br>";

		?> 

    

    <table border="1" cellpadding="2" cellspacing="2" width="100%" align="center" bordercolor="#bcd5e7" >

	   

	 <tr>

    	

        <td align="center"><font class="font4"><b>Ward Office</font></td>

        <td align="center"><font class="font4"><b>Tree Names</font></td>

 

     </tr>

     <?php

   while ($row =@mysql_fetch_object($rest)) 

{

	

	

	$query_ward = mysql_query("select * from master_ward where wid= '".$row->ward_office."'");

	//echo "select * from master_ward where wid= '".$row->ward_office."'";

	$result_ward = mysql_fetch_array($query_ward);

	

	$query_tree = mysql_query("select * from tree_name where tid= '".$row->tree_name."'");

	$result_tree = mysql_fetch_array($query_tree);

	

	echo "<tr>";

	

echo "<td  align='center'>"."<div align='center'>"."<font class='font4'>".$result_ward['wvalue']."</font></div></td>";

echo "<td  align='center'>"."<div align='center'>"."<font class='font4'>".$result_tree['tree_name']."</font></div></td>";



}?>



</table>

    

<?php }else

{

	echo "No Records To Display";

}

}





?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Survey Application</title>

</head>



<body>

</body>

</html>