<?php 

include("session_start.php");

include("session_check.php");

include("database.php");

include("paginator.class.php");



extract($_GET);



//echo $_SESSION['lid'];



/*$sql = "select lid from login where username='".$_SESSION['username']."'";

echo $sql;

$rest=mysql_query($sql)or die(mysql_error());

$row3 =@mysql_fetch_array($rest);

$lid =  $row3['lid'];

echo "lid (login) is : ".$lid;





$surveyor = "select * from master_surveyor where lid = '".$lid."'";

$result = mysql_query($surveyor)or die(mysql_error());

$row2 = mysql_fetch_array($result);

$id = $row2['surveyor_name'];

//echo "surveyor lid is".$id; */



?>





<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">

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

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

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

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

</script>



<script type="text/javascript">



ddsmoothmenu.init({

	mainmenuid: "smoothmenu1", //menu DIV id

	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"

	classname: 'ddsmoothmenu', //class added to menu's outer DIV

	//customtheme: ["#1c5a80", "#18374a"],

	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]

})







</script>

</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="contdata">

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

<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>Edit</font></td> -->

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

        <!--<td align="center"><font class="font4"><b>Delete</font></td>-->

        

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

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

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

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

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

        

        

        </td>

     </tr>

     <?php

	 $tot_result=mysql_query("select * from input_form where surveyor = '".$_SESSION['userid']."'");

	 //echo "select * from input_form where surveyor = '".$_SESSION['lid']."'"; exit;

	 $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 where surveyor = '".$_SESSION['userid']."' $pages->limit");

	 //echo "select * from input_form where surveyor = '".$id."' $pages->limit"; exit;

	 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'>User Report </b><br>";

	 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."'");

	//echo "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."'");

	//echo "select * from master_ward_drop where did= '".$row->ward."'";

	$result_sub = mysql_fetch_array($query_sub);

	//echo $row->id;

	echo "<tr>";

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

//echo "<td align='center' >"."<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'>"."<div align='center'>"."<font class='font4'>".$result_ward['wvalue']."</font></div></td>";

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

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

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

echo "<td>";

?>

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

    	<tr>

        	<!--<td align="center" ><b><font class="font4"> Delete </font></b></td>-->

        	

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

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

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

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

         </tr>

<?php

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

 $rest1=mysql_query($query1);

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

{

echo "

		

			<tr>

				<!--/*<td align='center' >"."<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>*/-->

				

				<td align='center'>"."<div align='center'>"."<font class='font4'>".$row1->tree_name."</font></div></td>

				<td align='center'>"."<div align='center'>"."<font class='font4'>".$row1->scientific_name."</font></div></td>

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

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

			</tr>

		

	";

}?>

</table>

<?php

echo "</td>";

}



?>



</table>

</form>

		

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

    

   </div>

    



    	

   </div> 



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











</body>

</html>