View file File name : Propertieslist.php Content : <style> .modal-backdrop.show{ z-index: 8; } </style> <div class="container-fluid"> <div class="col-md-12 content-center pb-2"> <div class="card-plain"> <h2 class="text-center">MANAGE PROPERTIES</h2> <p> <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> Filter </button> </p> <div class="collapse" id="collapseExample"> <!--<form action="<?php echo base_url('Properties/filter_data'); ?>" method="post">--> <!-- <input type="text" id="minValue" placeholder="Min Value">--> <!-- <input type="text" id="maxValue" placeholder="Max Value">--> <!-- <input type="text" id="propertyType" placeholder="Property Type">--> <!-- <input type="text" id="location" placeholder="Location">--> <!-- <button type="submit">Filter</button>--> <!-- <button id="filterBtn">Filter</button>--> <!--</form>--> <form action="<?php echo base_url('Properties/filter_property'); ?>" method="post"> <div class="row"> <div class="col-md-3"> <select onchange="filter_demand();" class="form-control" name="asking_price" id="r1" > <?php for($i=500000; $i<=20000000; $i+=500000){ ?> <option <?php if(isset($budget)){ if($budget==$i){ echo "selected"; } } ?> value="<?=$i?>"><?php if(($i/100000)>1 && ($i/100000)<100){ echo number_format($i/100000,2); echo " Lacs"; } else if(($i/10000000)>=1){ echo number_format($i/10000000,2); echo " Cr "; }else{ echo number_format($i,2); } ?></option> <?php } ?> </select> </div> <div class="col-md-3"> <select onchange="filter_demand();" class="form-control" name="selling_price" id="r2"> <?php for($i=500000; $i<=20000000; $i+=500000){ ?> <option <?php if(isset($budget2)){ if($budget2==$i){ echo "selected"; } } ?> <?php if($i==2000000 && !isset($budget2)){ echo "selected"; } ?> value="<?=$i?>"><?php if(($i/100000)>1 && ($i/100000)<100){ echo number_format($i/100000,2); echo " Lacs"; } else if(($i/10000000)>=1){ echo number_format($i/10000000,2); echo " Cr "; }else{ echo number_format($i,2); } ?></option> <?php } ?> </select> </div> <script> function price_conversion(str){ var rupee =parseInt(str); if((rupee/100000)<100){ $("#range").val(rupee/100000+" Lacs"); } else if((rupee/100000)>99){ $("#range").val(rupee/10000000+" Cr "); } else{ $("#range").val(rupee); } } </script> <div class="col-md-2"> <select name="property_type" required placeholder="LOCALITY" class="form-control" > <option value="">Select type</option> <?php foreach($info['types'] as $l){ ?> <option value="<?=$l->type?>"><?=$l->type?></option> <?php } ?> </select> </div> <div class="col-md-2"> <select type="text" name="location" required class="form-control" > <option value="">Select Location</option> <?php foreach($info['locations'] as $l){ ?> <option value="<?=$l->name?>"><?=$l->name?></option> <?php } ?> </select> </div> <div class="col-md-2"> <button class="btn btn-success" type="submit">Find</button> </div> </div> </form> </div> <hr> </div> </div> <table id="myTable" style="overflow-x:hidden;" class="table-striped"> <thead> <tr> <th>Sr.No</th> <th>P_Code</th> <th>P_Image</th> <!--<th>Contact Number</th>--> <!--<th>Contact Mail</th>--> <!--<th>Lacality</th>--> <!--<th>Station</th>--> <!--<th>Area</th>--> <!--<th>Property Type</th>--> <!--<th>PSQFT Price</th>--> <!--<th>Description</th>--> <!--<th>Asking Price</th>--> <!--<th>Final Price</th>--> <!--<th>Discount</th>--> <!--<th>Furnishing</th>--> <!--<th>Available From</th>--> <!--<th>Downpayment</th>--> <!--<th>Aminities</th>--> <!--<th>Near By</th>--> <!--<th>Transaction</th>--> <!--<th>Muslim</th>--> <!--<th>Project Name</th>--> <!--<th>Builders/Owner Name</th>--> <!--<th>Builders/Owner Number</th>--> <!--<th>Broker Name</th>--> <!--<th>Broker Number</th>--> <!--<th>DHC Brokerage</th>--> <!--<th>CP Brokerage</th>--> <!--<th>Project Entered</th>--> <!--<th>Updated</th>--> <!--<th>Approval</th>--> <th>Project Name</th> <th>Status</th> <th>View all</th> <th>Edit_Property</th> <th>Edit_Image</th> <th>Delete</th> </tr> </thead> <tbody> <?php $count=0; foreach($test as $dt){ $count+=1; ?> <tr> <td class="user_id"><?=$count?></td> <td><?=$dt->project_code?></td> <td><img src="<?=$dt->property_image?>" style="height:70px;width:70px;border-radius:20px;"/></td> <!--<td><?=$dt->contact_number?></td>--> <!--<td><?=$dt->contact_mail?></td>--> <!--<td><?=$dt->lacality?></td>--> <!--<td><?=$dt->station?></td>--> <!--<td><?=$dt->area?></td>--> <!--<td><?=$dt->property_type?></td>--> <!--<td><?=$dt->per_sq_ft_price?></td>--> <!--<td><?=$dt->description?></td>--> <!--<td><?=$dt->price?></td>--> <!--<td><?=$dt->selling_price?></td>--> <!--<td><?=$dt->discount?></td>--> <!--<td><?=$dt->furnishing?></td>--> <!--<td><?=$dt->available_from?></td>--> <!--<td><?=$dt->downpayment?></td>--> <!--<td><?=$dt->aminities?></td>--> <!--<td><?=$dt->nearby?></td>--> <!--<td><?=$dt->transaction?></td>--> <!--<td><?=$dt->m_factor?></td>--> <!--<td><?=$dt->builder_owner_name?></td>--> <!--<td><?=$dt->builder_owner_no?></td>--> <!--<td><?=$dt->cp_name?></td>--> <!--<td><?=$dt->cp_no?></td>--> <!--<td><?=$dt->dhc_brokerage?></td>--> <!--<td><?=$dt->cp_brokerage?></td>--> <!--<td><?=$dt->project_person?></td>--> <!--<td><?=$dt->first_name?> <?=$dt->last_name?> </td>--> <!--<td><?php if($dt->approval=="approved") echo 'Approved'; else echo 'Waiting For Approval'; ?></td>--> <td><?=$dt->project_name?></td> <td> <?php if($dt->approval=="na"){ ?> <a class="btn <?php if($dt->approval=="na") echo 'btn-success'; else echo 'btn-danger'; ?>" href="<?=base_url()?>Properties/approve?properties_id=<?=$dt->id ?>"><?php if($dt->approval=="na") echo 'APPROVE'; else echo ''; ?></a> <?php } ?> <a class="btn <?php if($dt->deleted==0) echo 'btn-danger'; else echo 'btn-success'; ?>" href=<?php if($dt->deleted==0) echo base_url()."Properties/delet_properties?properties_id=".$dt->id; else echo base_url()."Properties/set_active_properties?properties_id=".$dt->id; ?> ><?php if($dt->deleted==0) echo 'Inactive'; else echo 'Active'; ?></a> </td> <!-- Button trigger modal --> <td><a class="btn btn-primary" type="button" data-toggle="modal" data-target="#propertyModal" data-id="<?=$dt->id ?>"> View_P</a></td> <td> <a class="btn btn-primary" href="<?=base_url()?>Properties/Edit_properties?properties_id=<?=$dt->id ?>">Property</a> <!--<a class="btn btn-warning" href="<?=base_url()?>Properties/bank?properties_id=<?=$dt->id ?>">Edit Bank</a>--> </td> <td> <a class="btn btn-info" href="<?=base_url()?>Properties/Edit_images?properties_id=<?=$dt->id ?>"> Images</a> <!--<a class="btn btn-warning" href="<?=base_url()?>Properties/aminities?properties_id=<?=$dt->id ?>">Edit Aminities</a>--> </td> <td> <!--<a class="btn btn-warning" href="<?=base_url()?>Properties/nearby?properties_id=<?=$dt->id ?>">Edit Nearby</a>--> <a class="btn btn-danger" href="<?=base_url()?>Properties/delete_property?properties_id=<?=$dt->id ?>">Delete</a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> <!--//ritesh new--------> <!-- Modal --> <div class="modal fade" id="propertyModal" tabindex="-1" role="dialog" aria-labelledby="propertyModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content" style="width: 850px; height:450px; margin-top: 89px;;"> <div class="modal-header"> <h5 class="modal-title" id="propertyModalLabel">Property Details</h5> <!--<button type="button" class="close" data-dismiss="modal" aria-label="Close">--> <!-- <span aria-hidden="true">×</span>--> <!--</button>--> </div> <div class="modal-body" style="overflow-y: scroll;"> <!-- Property details will be loaded here via AJAX --> <div class="text-center">Please wait...</div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div> <script> $(document).ready(function() { // AJAX request to fetch property details $('#propertyModal').on('show.bs.modal', function(event) { var button = $(event.relatedTarget); var propertyId = button.data('id'); $.ajax({ url: "<?php echo base_url('Properties/get_property_details'); ?>", method: "POST", data: {property_id: propertyId}, //dataType: "json", success: function(response) { $('#propertyModal .modal-body').html(response); // var modal = $('#propertyModal'); // var propertyDetails = $('#propertyDetails'); // propertyDetails.html(''); // $.each(data, function(key, value) { // propertyDetails.append('<p><strong>' + key + ':</strong> ' + value + '</p>'); //}); }, error: function(xhr, status, error) { //console.log(xhr.responseText); // Log the response text for debugging } }); }); }); </script> <!--//ritesh new----end----> <!--<script>--> <!-- $(document).ready(function() {--> <!-- $('#filterBtn').click(function() {--> <!-- var minValue = $('#minValue').val();--> <!-- var maxValue = $('#maxValue').val();--> <!-- var propertyType = $('#propertyType').val();--> <!-- var location = $('#location').val();--> <!-- $.ajax({--> <!-- url: 'Properties/filter_data',--> <!-- type: 'POST',--> <!-- dataType: 'json',--> <!-- data: {--> <!-- minValue: minValue,--> <!-- maxValue: maxValue,--> <!-- propertyType: propertyType,--> <!-- location: location--> <!-- },--> <!-- success: function(response) {--> <!--// Update DataTable with filtered data--> <!-- $('#myTable').DataTable().clear().rows.add(response).draw();--> <!-- }--> <!-- });--> <!-- });--> <!--});--> <!--</script>--> <!--<script>--> <!-- $(document).ready(function(){--> <!-- $('.view_data').click(function(e){--> <!-- e.preventDefault();--> <!--// console.log('ritesh');--> <!-- var user_id = $(this).closest('tr').find('.user_id').text();--> <!--// console.log('user_id');--> <!-- $.ajax(--> <!-- {--> <!-- method:"POST",--> <!-- url:"core.php",--> <!-- data:{--> <!-- 'click_view_btn':true,--> <!-- 'user_id':user_id,--> <!-- },--> <!-- success:fuction(response){--> <!-- }--> <!-- });--> <!-- });--> <!-- }); --> <!--</script>--> <!-- Modal --> <!--<div class="modal fade" id="propertyModal" tabindex="-1" role="dialog" aria-labelledby="propertyModalLabel" aria-hidden="true">--> <!-- <div class="modal-dialog" role="document">--> <!-- <div class="modal-content">--> <!-- <div class="modal-header">--> <!-- <h5 class="modal-title" id="propertyModalLabel">Property Details</h5>--> <!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close">--> <!-- <span aria-hidden="true">×</span>--> <!-- </button>--> <!-- </div>--> <!-- <div class="modal-body">--> <!-- <div class="row">--> <!-- <div class="col-md-6">--> <!-- <p><strong>YouTube:</strong> <?php echo $youtube; ?></p>--> <!-- <p><strong>Registration:</strong> <?php echo $registration; ?></p>--> <!-- <p><strong>Stamp Duty:</strong> <?php echo $stamp_duty; ?></p>--> <!-- Add more fields as necessary --> <!-- </div>--> <!-- <div class="col-md-6">--> <!-- <p><strong>Description:</strong> <?php echo $description; ?></p>--> <!-- <p><strong>Price:</strong> <?php echo $price; ?></p>--> <!-- <p><strong>Selling Price:</strong> <?php echo $sellingprice; ?></p>--> <!-- Add more fields as necessary --> <!-- </div>--> <!-- </div>--> <!-- </div>--> <!-- <div class="modal-footer">--> <!-- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>--> <!-- </div>--> <!-- </div>--> <!-- </div>--> <!--</div>-->