<?php 

include("session_start.php");

include("session_check.php");

include("database.php");

include("paginator.class.php");



extract($_GET);

$cat = $_SESSION['cat'];

//echo $cat;

if($cat == "admin")

{

	//echo $cat;

	//echo $_SESSION['username'];

}



 ?>



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

<head>

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

<title>Survey Application</title>

<link rel="stylesheet" type="text/css" href="css/style.css" />

<link rel="stylesheet" type="text/css" href="css/page.css">

<script src="js/menuscript.js" language="javascript" type="text/javascript"></script>

<link rel="stylesheet" type="text/css" href="css/menustyle.css" media="screen, print" />

<link href="css/admincss.css" rel="stylesheet" type="text/css">

</head>



<body class="body">



<div id="wrap" >

  

  

  <div id="top">

    <?php include("header.php"); ?>

    <!--<div id="ban"><table width="1004" align="left"  >

  <tr>

    <td width="234"  align="left"  valign="top" ><img src="images/logoss.jpg" border="0" /></td>

    <td  valign="top" style="padding-top:5px;" width="758"  align="right" ><table align="left" width="707">

  <tr>

    <td width="386" align="left"><div ><a href="#" id="bantext1">REQUEST A DEMO</a></div></td>

    <td width="167" align="left"><div ><a href="#" id="bantext2">DOWNLOADS</a></div></td>

    <td width="138" align="left"><div ><a href="#" id="bantext2">DOWNLOADS</a></div></td>

  </tr>

  <tr>

    <td colspan="3" align="center" class="banquot">Be Smart and Survey Smartly </td>

  </tr>

</table></td>

    

    

  </tr>

</table>

    </div>-->

    

    </div>

    </div>

   <div id="menuholder"><?php include("adminmenu.php"); ?></div>

   <div id="contholder">

   

    

    <!--<div id="nav">

     <ul>

     <li><a href="adminhome.php" id="home_on">HOME</a></li>

        <li><a href="adminproducts.php" id="products_on">PRODUCTS</a></li>

		<li><a href="adminfeatures.php" id="features_on">FEATURES</a></li>

        <li><a href="adminadvantages.php" id="advantages_on">ADVANTAGES</a></li>

        <li><a href="adminhowitworks.php" id="howitworks_on">HOW IT WORKS</a></li>

        <li><a href="adminhelp.php" id="help_on">HELP</a></li>

        <li><a href="admincontactus.php" id="contactus_on">CONTACT US</a></li>

    

    </ul>

    

    </div>-->

    

    <div id="editorholder">

    	<div id="contdata">

    <form action="" name="tree_grid" id="tree_grid" method="get">

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

	   

	 <tr>

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

    	<?php if($cat == "admin"){ ?><td align="center" ><font class="font4"><b>Edit</b></font></td> <?php } ?>

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

        <?php if($cat == "admin"){ ?><td align="center"><font class="font4"><b>Delete</b></font></td> <?php } ?>

        

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

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

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

        <td align="center"><font class="font4"><b>Society Name</b></font></td>

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

        

        

        </td>

     </tr>

     <?php

	 $tot_result=mysql_query("select * from input_form");

	 $pages = new Paginator;

     $pages->items_total = @mysql_num_rows($tot_result);

	 $pages->mid_range = 10;

     $rnum=@mysql_num_rows($tot_result);

	 $ii=0;

	 $pages->paginate();

	 $res=mysql_query("select * from input_form $pages->limit");

	 echo"<center>";

	 echo  $pages->display_pages();

	 echo "&nbsp;&nbsp;"; // Optional call which will display the page numbers after the results.user_login_id='$logid'

	 echo $pages->display_jump_menu(); // Optional – displays the page jump menu

	 echo "<p class=\"paginate\">Page: $pages->current_page of $pages->num_pages</p>\n";

	 echo "<b><font face='Verdana' size='2'><p align='left'>Total Records: ".$rnum."</b><br>";

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

{

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

	$result_ward = mysql_fetch_array($query_ward);

	

	$query_sub = mysql_query("select * from master_ward_drop where did= '".$row->ward."'");

	$result_sub = mysql_fetch_array($query_sub);

	

	

	

	echo "<tr>";

	echo "<td align='center' valign='top'>"."<a href='phpsql_while.php?id=$row->id' ><font class='font4'>"."<img src='images/download.jpg' border='0'>"."</font></div></td>";

	if($cat == "admin"){ echo "<td align='center' valign='top'>"."<a href='edit_record.php?id=$row->id' ><font class='font4'>"."<img src='images/edit.jpg' border='0'>"."</font></div></td>"; }

	echo "<td align='center' valign='top' ><a href='view_records.php?id=$row->id'><font class='font4'>"."<img src='images/view.png' border='0'>"."</font></div></td>";

	if($cat == "admin"){ echo "<td align='center' valign='top'>"."<div align='center'>"."<a href='delete_record.php?id=$row->id' ><font class='font4'>"."<img src='images/delete.jpg' border='0'>"."</a></div></td>"; }			



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

echo "<td  align='center' valign='top'>"."<div align='center'>"."<font class='font4'>".$result_sub['dvalue']."</font></div></td>";

echo "<td  align='center' valign='top'>"."<div align='center'>"."<font class='font4'>".$row->current_date1."</font></div></td>";

echo "<td  align='center' valign='top'>"."<div align='center'>"."<font class='font4'>".$row->society_name."</font></div></td>";

echo "<td>";

?>

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

    	<tr>

        	<?php if($cat == "admin"){ ?><td align="center" ><b><font class="font4"> Delete </font></b></td> <?php } ?>

        	

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

            <td align="center" ><font class="font4"/><b> Scientific Name </b></td>

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

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

         </tr>

<?php

$query1="select * from info where aid='".$row->id."'";

 $rest1=mysql_query($query1);

while($row1 = @mysql_fetch_object($rest1))

{

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

	$result_tree = mysql_fetch_array($query_tree);

	//echo "select * from tree_name where did= '".$row1->tree_name."'";

echo " <tr> ";

			if($cat == "admin") {	echo "<td align='center' width='5%' >"."<div align='center'>"."<a href='delete_sub_records.php?pid=$row1->pid' ><font class='font4'>"."<img src='images/delete.jpg' border='0'>"."</a></div></td> "; }

				

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

				<td align='center'  width='15%'>"."<div align='center'>"."<font class='font4'>".$result_tree['scientific_name']."</font></div></td>

				<td align='center'  width='10%'>"."<div align='center'>"."<font class='font4'>".$row1->lng."</font></div></td>

				<td align='center'  width='10%'>"."<div align='center'>"."<font class='font4'>".$row1->lat."</font></div></td>

			</tr>

		

	";

}?>

</table>

<?php

echo "</td>";

}



?>



</table>

</form>

		

		</div>

    

   </div>

    



    	

   </div> 

<?php include("footer.php"); ?>

<!--<div id="footer">Copyright © 2012.Smart Survey All Rights Reserved.Website Designed & Developed by Kalpak Solutions</div>-->











</body>

</html>