<?php
include("session_start.php");
include("session_check.php");include("database.php");  
extract($_GET);
if($_GET['id']!="")
	{
	$result = mysql_query("SELECT * FROM input_form where id='$id'");
	$row=mysql_fetch_assoc($result);
	
	$date = $row['current_date1'];
	//echo $date;
	$j=explode("-",$date);
	$show_date = $j[2]."-".$j[1]."-".$j[0];
	
	$query = mysql_query("SELECT * FROM info where aid='$id'");
	
	$query_ward = mysql_query("select * from master_ward where wid= '".$row['ward_office']."'");
	$result = 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);
	
	$query_surveyor = mysql_query("select * from login where lid= '".$row['surveyor']."'");
	$result_surveyor = mysql_fetch_array($query_surveyor);
	
	$query_image = mysql_query("select * from image_path where aid='$id'");
	
	//$result_image = mysql_fetch_array($query_image);
	
	}
?>

<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 name="view">
    	<table border="1" cellpadding="2" cellspacing="2" align="center" width="100%" height="200px" bordercolor="#2a4a73">
        	<tr>
                <td bgcolor="#a9c1de" class="f"> View Details </td>
             </tr>
             <tr>
            	<td>  
                	<table width="90%" cellpadding="2" cellspacing="2" align="center" height="130px" >
                    	<br/> 
                        <tr>
                        	<td bgcolor="#c1d2e8" class="f" colspan="2" align="center" > Area Information </td>
                        </tr>
                         <tr> 
                        		<td>&nbsp; </td>	
                        </tr>
                        <tr>
            				<td class="c"  width="25%"> Ward Office</td>
                    		<td class="font4"><?php echo $result['wvalue']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Survey Sheet Number </td>
                    		<td class="font4"><?php echo $row['survey_sheet_no']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Ward </td>
                    		<td class="font4"><?php echo $result_sub['dvalue']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Date </td>
                    		<td class="font4"><?php echo $show_date; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Sub Area </td>
                    		<td class="font4"><?php echo $row['sub_area']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Plot Number </td>
                    		<td class="font4"><?php echo $row['plot_no']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Society Name </td>
                    		<td class="font4"><?php echo $row['society_name']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Landmark </td>
                    		<td class="font4"><?php echo $row['landmark']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Pincode </td>
                    		<td class="font4"><?php echo $row['pincode']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> City </td>
                    		<td class="font4"><?php echo $row['city']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> State </td>
                    		<td class="font4"><?php echo $row['state']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Country </td>
                    		<td class="font4"><?php echo $row['country']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Owner of House </td>
                    		<td class="font4"><?php echo $row['owner']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%">House Number </td>
                    		<td class="font4"><?php echo $row['house_no']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Total Area of Plot </td>
                    		<td class="font4"><?php echo $row['plot_area']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Type </td>
                    		<td class="font4"><?php echo $row['type']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Miscellaneous </td>
                    		<td class="font4"><?php echo $row['miscellaneous']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Informer </td>
                    		<td class="font4"><?php echo $row['informer']; ?> </td>
            			</tr>
                        <tr>
            				<td class="c" width="25%"> Surveyor </td>
                    		<td class="font4"><?php echo $result_surveyor['uname']; ?> </td>
            			</tr> 
                        <tr> 
                        		<td colspan="2">&nbsp; </td>	
                        </tr>
  
                     </table>
                     <br>
                     <table border="1" width="100%" align="center" height="10px" bordercolor="#2a4a73">
                     
                     	<tr>
                        	<td bgcolor="#c1d2e8" class="f" colspan="20" align="center"> Tree Information </td>
                        </tr>
                     
                        		<tr>
                    				<td align="left" class="c" > Tree Name </td>
                        			<td align="left" class="c" > Scientific Name </td>
                                    <td class="c" align="left"> GBH (cm) </td>
                                    <td class="c" align="left"> Height (ft)</td>
                                    <td class="c" align="left"> Canopy Diameter (ft)</td>
                                    <td class="c" align="left"> Age (yr)</td>
                                    <td class="c" align="left"> Condition </td>
                                  	<td class="c" align="left"> Longitude </td>
                                    <td class="c" align="left"> Latitude </td>
                                    <td class="c" align="left"> Observation </td>
                                    <td class="c" align="left"> Flowering Season </td>
                                    <td class="c" align="left"> Flower Color </td>
                                    <td class="c" align="left"> Fruiting Season </td>
                                    <td class="c" align="left"> Native/Exotic </td>
                                    <td class="c" align="left"> Growth Speed </td>
                                    <td class="c" align="left"> Wild/Cultivated </td>
                                    <td class="c" align="left"> Use </td>
                                    <td class="c" align="left"> Time </td>
                                    <td class="c" align="left"> Images </td>
                                </tr>
                               <?php
							while($row1 = @mysql_fetch_object($query))
							{
								$time = explode("_",$row1->current_time1);
								$b = ($time[3] == "1")? "pm" : "am";
								$time = $time[0].":".$time[1].":".$time[2]." ".$b;
								
								$query_tree = mysql_query("select * from tree_name where tid= '".$row1->tree_name."'");
								$result_tree = mysql_fetch_array($query_tree);
								

								$query_image = mysql_query("SELECT info.`aid`,`image_path`.`pid` , image_path.`img_path`,info.`tree_name` FROM info
								INNER JOIN `image_path` ON info.pid = image_path.pid WHERE info.`pid`='".$row1->pid."'");
								//echo "SELECT info.`aid`,`image_path`.`pid` , image_path.`img_path`,info.`tree_name` FROM info
								//INNER JOIN `image_path` ON info.pid = image_path.pid WHERE info.`pid`='".$row1->pid."'";
													
								$result_image = mysql_fetch_array($query_image);
								//echo "Anil".$result_image['img_path'];
								echo "<tr>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['tree_name']."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['scientific_name']."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$row1->width."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$row1->height."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$row1->diameter_of_tree."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$row1->age."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$row1->con."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$row1->lng."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$row1->lat."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$row1->observation."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['flowering_season']."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['flower_color']."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['fruiting_season']."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['native']."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['growth_speed']."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['wild_cultivated']."</font></div></td>
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$result_tree['use']."</font></div></td>
				
				<td align='center'>"."<div align='left'>"."<font class='font4'>".$time."</font></div></td>
				
				<td align='center'>"."<div align='left'><img src='$result_image[img_path]' style='height:80; width:80'></div></td>
			</tr>
		
	";
								
}?>		                    
                            </table>
                     
                     
                            <br />
                            </td>
                    	</tr>   
                  </td>
            </tr>
        </table>
        <br />
        <table  align="center" width="100%" bordercolor="#2a4a73" border="1">
        <tr>
        <td bgcolor="#a9c1de" class="f"align="right"><a href="index_grid.php " style="text-decoration:none"><input type="button" value = "Back" class="button_c" /></a></td>
        </tr>
        </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>