<?php require_once("header1.php");?>

<style>
    td, th {
  padding: 2px;
}
</style>

<?php
$arr_order = mysqli_fetch_array(mysqli_query($connection,"SELECT * FROM `pd_property` WHERE `property_id` = '".$_REQUEST['property_id']."'"));

if($arr_order['floor'] == 0)
{
    $flr = "Ground";
}
else
{
    $flr = $arr_order['floor'];
}

$get_location = mysqli_fetch_array(mysqli_query($connection,"SELECT * FROM `pd_locations` WHERE `location_id` = '".$arr_order['location_id']."'"));
$get_type = mysqli_fetch_array(mysqli_query($connection,"SELECT * FROM `pd_property_type` WHERE `type_id` = '".$arr_order['type_id']."'"));
$get_subtype = mysqli_fetch_array(mysqli_query($connection,"SELECT * FROM `pd_property_subtype` WHERE `subtype_id` = '".$arr_order['subtype_id']."'"));
$get_otype = mysqli_fetch_array(mysqli_query($connection,"SELECT * FROM `pd_ownership_type` WHERE `otype_id` = '".$arr_order['otype_id']."'"));
$get_broker = mysqli_fetch_array(mysqli_query($connection,"SELECT * FROM `pd_brokers` WHERE `user_id` = '".$arr_order['broker_id']."'"));
?>

            <script language="javascript" type="text/javascript">
            function change_picture(picture_name)
            {
                $('#hkl').html('<a href="uploads/property/'+picture_name+'" data-title="" data-lightbox="example-set"><div class="thumb" style=""><img class="img-fullwidth" alt="" src="uploads/property/'+picture_name+'"></div></a>');
            }
            </script>
		
			<!-- page template area start -->
			<section id="about">
				<div class="container mt-10 pb-10 pt-0">
				    <div class="section-content">
				        <h1 class="title mt-5 mb-15" style="text-align:left;">Property Details</h1>
    				    <div class="row">
    						<div class="col-lg-5">
    						    <div id="hkl">
    							<a href="uploads/property/<?php echo $arr_order['cover_photo'];?>" data-title="" data-lightbox="example-set"><div class="thumb" style="">
    								<img class="img-fullwidth" alt="" src="uploads/property/<?php echo $arr_order['cover_photo'];?>">
    							</div></a></div>
    							<div>&nbsp;</div>
    							<div class="">
    							<div class="owl-carousel-4col" data-nav="true">
							    <?php
    							$sql_photo = "SELECT * FROM `pd_property_photos` WHERE `photo_status` = 'Active' AND `property_id` = '".$_REQUEST['property_id']."' ORDER BY `photo_id` ASC";
    							$exe_photo = mysqli_query($connection,$sql_photo);
    							while($arr_photo = mysqli_fetch_array($exe_photo))
    							{									
    								?>
									<div class="item" style="margin-bottom:20px;">
										<div>
											<a href="javascript:void(0); " onclick="change_picture('<?php echo $arr_photo['photo'];?>');"><div class="thumb">
												<img class="" alt="" src="uploads/property/<?php echo $arr_photo['photo'];?>" style="width:100%;">
											</div></a>
										</div>
									</div>
								    <?php
    							}
    							?>    								
        							</div>
    						    </div>
						    </div>
    						<div class="col-lg-7">
    						    <table border="0" cellspacing="2" cellpadding="2" width="100%">
    						        <tr>
    						            <td colspan="2"><h4 style="margin-bottom:0; margin-top:0;"><?php echo stripslashes($get_type['type']);?> - <?php echo $get_subtype['subtype'];?></h4></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Location</td>
    						            <td><?php echo $get_location['location'];?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Address</td>
    						            <td><?php echo stripslashes($arr_order['address']);?></td>
    						        </tr> 
    						        <tr>
    						            <td style="color:#888;">Landmark</td>
    						            <td><?php echo stripslashes($arr_order['landmark']);?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Pincode</td>
    						            <td><?php echo stripslashes($arr_order['zip']);?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Ownership Type</td>
    						            <td><?php echo stripslashes($get_otype['otype']);?></td>
    						        </tr>
    						        <?php if($arr_order['type_id'] == 1) { ?>
    						        <tr>
    						            <td style="color:#888;">Carpet Area</td>
    						            <td><?php echo stripslashes($arr_order['carpet_area']);?> sqft</td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Floor</td>
    						            <td><?php echo $flr;?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Bedroom</td>
    						            <td><?php echo stripslashes($arr_order['bedroom']);?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Bathroom</td>
    						            <td><?php echo stripslashes($arr_order['bathroom']);?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Balcony</td>
    						            <td><?php echo stripslashes($arr_order['balcony']);?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Furnishing Status</td>
    						            <td><?php echo stripslashes($arr_order['furnishing_type']);?></td>
    						        </tr>
    						        <?php } ?>
    						        <?php if($arr_order['type_id'] == 2) { ?>
    						        <tr>
    						            <td style="color:#888;">Carpet Area</td>
    						            <td><?php echo stripslashes($arr_order['carpet_area']);?> sqft</td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Floor</td>
    						            <td><?php echo $flr;?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Bathroom</td>
    						            <td><?php echo stripslashes($arr_order['bathroom']);?></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Furnishing Status</td>
    						            <td><?php echo stripslashes($arr_order['furnishing_type']);?></td>
    						        </tr>
    						        <?php } ?>
    						        <?php if($arr_order['type_id'] == 3) { ?>
    						        <tr>
    						            <td style="color:#888;">Total Area</td>
    						            <td><?php echo stripslashes($arr_order['plot_area']);?> sqft</td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Open Sides</td>
    						            <td><?php echo stripslashes($arr_order['open_sides']);?></td>
    						        </tr>
    						        <?php } ?>
    						        <tr>
    						            <td style="color:#888;"><b>Total Price</b></td>
    						            <td><b>&#8377;<?php echo stripslashes($arr_order['price']);?></b></td>
    						        </tr>
    						        <tr>
    						            <td style="color:#888;">Agent Code</td>
    						            <td><?php echo stripslashes($get_broker['broker_code']);?></td>
    						        </tr>
    						    </table>
        						 <h3 class="title mt-0 mb-10" style="text-align:left; color:#333;">Description</h3>
        						<p style="margin-bottom:10px"><?php echo stripslashes($arr_order['description']);?></p>
        						<p><button type="button" class="btn btn-flat btn-theme-colored border-left-theme-color-2-4px" data-toggle="modal" data-target="#myModalApply">Post Enquiry</button><!--&nbsp;&nbsp;<a class="btn btn-colored btn-theme-colored btn-lg mt-0" href="property-list.php?type_id=<?php echo $arr_order['type_id']?>">Back</a>--></p>
        				    </div>
    					</div>
    				</div>
				</div>
			</section>
			<!-- page template area end -->
  
<?php require_once("footer1.php");?>