D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u166148318
/
domains
/
avrd.org
/
public_html
/
admin
/
Filename :
view_property.php
back
Copy
<?php include '../components/connect.php'; if(isset($_COOKIE['admin_id'])){ $admin_id = $_COOKIE['admin_id']; }else{ $admin_id = ''; header('location:login.php'); } if(isset($_GET['get_id'])){ $get_id = $_GET['get_id']; }else{ $get_id = ''; header('location:dashboard.php'); } if(isset($_POST['delete'])){ $delete_id = $_POST['delete_id']; $delete_id = filter_var($delete_id, FILTER_SANITIZE_STRING); $verify_delete = $conn->prepare("SELECT * FROM `property` WHERE id = ?"); $verify_delete->execute([$delete_id]); if($verify_delete->rowCount() > 0){ $select_images = $conn->prepare("SELECT * FROM `property` WHERE id = ?"); $select_images->execute([$delete_id]); while($fetch_images = $select_images->fetch(PDO::FETCH_ASSOC)){ $image_01 = $fetch_images['image_01']; $image_02 = $fetch_images['image_02']; $image_03 = $fetch_images['image_03']; $image_04 = $fetch_images['image_04']; $image_05 = $fetch_images['image_05']; unlink('../uploaded_files/'.$image_01); if(!empty($image_02)){ unlink('../uploaded_files/'.$image_02); } if(!empty($image_03)){ unlink('../uploaded_files/'.$image_03); } if(!empty($image_04)){ unlink('../uploaded_files/'.$image_04); } if(!empty($image_05)){ unlink('../uploaded_files/'.$image_05); } } $delete_listings = $conn->prepare("DELETE FROM `property` WHERE id = ?"); $delete_listings->execute([$delete_id]); $success_msg[] = 'Listing deleted!'; }else{ $warning_msg[] = 'Listing deleted already!'; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>property details</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css" /> <!-- font awesome cdn link --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"> <!-- custom css file link --> <link rel="stylesheet" href="./css/admin_style.css"> </head> <body> <!-- header section starts --> <?php include '../components/admin_header.php'; ?> <!-- header section ends --> <section class="view-property"> <h1 class="heading">property details</h1> <?php $select_properties = $conn->prepare("SELECT * FROM `property` WHERE id = ? ORDER BY id DESC LIMIT 1"); $select_properties->execute([$get_id]); if($select_properties->rowCount() > 0){ while($fetch_property = $select_properties->fetch(PDO::FETCH_ASSOC)){ $property_id = $fetch_property['id']; $select_user = $conn->prepare("SELECT * FROM `users` WHERE id = ?"); $select_user->execute([$fetch_property['user_id']]); $fetch_user = $select_user->fetch(PDO::FETCH_ASSOC); ?> <div class="details"> <div class="swiper images-container"> <div class="swiper-wrapper"> <img src="../uploaded_files/<?= $fetch_property['image_01']; ?>" alt="" class="swiper-slide"> <?php if(!empty($fetch_property['image_02'])){ ?> <img src="../uploaded_files/<?= $fetch_property['image_02']; ?>" alt="" class="swiper-slide"> <?php } ?> <?php if(!empty($fetch_property['image_03'])){ ?> <img src="../uploaded_files/<?= $fetch_property['image_03']; ?>" alt="" class="swiper-slide"> <?php } ?> <?php if(!empty($fetch_property['image_04'])){ ?> <img src="../uploaded_files/<?= $fetch_property['image_04']; ?>" alt="" class="swiper-slide"> <?php } ?> <?php if(!empty($fetch_property['image_05'])){ ?> <img src="../uploaded_files/<?= $fetch_property['image_05']; ?>" alt="" class="swiper-slide"> <?php } ?> </div> <div class="swiper-pagination"></div> </div> <h3 class="name"><?= $fetch_property['property_name']; ?></h3> <p class="location"><i class="fas fa-map-marker-alt"></i><span><?= $fetch_property['address']; ?></span></p> <div class="info"> <p><i class="fas fa-indian-rupee-sign"></i><span><?= $fetch_property['price']; ?></span></p> <p><i class="fas fa-user"></i><span><?= $fetch_user['name']; ?></span></p> <p><i class="fas fa-phone"></i><a href="tel:+256744578890"><?= $fetch_user['number']; ?></a></p> <p><i class="fas fa-building"></i><span><?= $fetch_property['type']; ?></span></p> <p><i class="fas fa-house"></i><span><?= $fetch_property['offer']; ?></span></p> <p><i class="fas fa-calendar"></i><span><?= $fetch_property['date']; ?></span></p> </div> <h3 class="title">details</h3> <div class="flex"> <div class="box"> <p><i>rooms :</i><span><?= $fetch_property['bhk']; ?> BHK</span></p> <p><i>deposit amount : </i><span><span class="fas fa-indian-rupee-sign" style="margin-right: .5rem;"></span><?= $fetch_property['deposite']; ?></span></p> <p><i>status :</i><span><?= $fetch_property['status']; ?></span></p> <p><i>bedroom :</i><span><?= $fetch_property['bedroom']; ?></span></p> <p><i>bathroom :</i><span><?= $fetch_property['bathroom']; ?></span></p> <p><i>balcony :</i><span><?= $fetch_property['balcony']; ?></span></p> </div> <div class="box"> <p><i>carpet area :</i><span><?= $fetch_property['carpet']; ?> areas</span></p> <p><i>age :</i><span><?= $fetch_property['age']; ?> years</span></p> <p><i>total floors :</i><span><?= $fetch_property['total_floors']; ?></span></p> <p><i>room floor :</i><span><?= $fetch_property['room_floor']; ?></span></p> <p><i>furnished :</i><span><?= $fetch_property['furnished']; ?></span></p> <p><i>loan :</i><span><?= $fetch_property['loan']; ?></span></p> </div> </div> <h3 class="title">amenities</h3> <div class="flex"> <div class="box"> <p><span><?php if($fetch_property['lift'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>lifts</span></p> <p><span><?php if($fetch_property['security_guard'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>security guards</span></p> <p><span><?php if($fetch_property['play_ground'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>play ground</span></p> <p><span><?php if($fetch_property['garden'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>gardens</span></p> <p><span><?php if($fetch_property['water_supply'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>water supply</span></p> <p><span><?php if($fetch_property['power_backup'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>power backup</span></p> </div> <div class="box"> <p><span><?php if($fetch_property['parking_area'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>parking area</span></p> <p><span><?php if($fetch_property['gym'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>gym</span></p> <p><span><?php if($fetch_property['shopping_mall'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>shopping mall</span></p> <p><span><?php if($fetch_property['hospital'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>hospital</span></p> <p><span><?php if($fetch_property['school'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>schools</span></p> <p><span><?php if($fetch_property['market_area'] == 'yes'){echo "<font size='3px' color='blue' padding:'2px'; ;>yes</font>";}else{echo "<font size='3px' color='red' padding:'2px'; ;>no</font>";} ?>: </span> <span>market area</span></p> </div> </div> <h3 class="title">description</h3> <p class="description"><?= $fetch_property['description']; ?></p> <form action="" method="post" class="flex-btn"> <input type="hidden" name="delete_id" value="<?= $property_id; ?>"> <input type="submit" value="delete property" name="delete" class="delete-btn" onclick="return confirm('delete this listing?');"> </form> </div> <?php } }else{ echo '<p class="empty">property not found! <a href="listings.php" style="margin-top:1.5rem;" class="option-btn">go to listings</a></p>'; } ?> </section> <script src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script> <!-- custom js file link --> <script src="../js/admin_script.js"></script> <?php include '../components/message.php'; ?> <script> var swiper = new Swiper(".images-container", { effect: "coverflow", grabCursor: true, centeredSlides: true, slidesPerView: "auto", loop:true, coverflowEffect: { rotate: 0, stretch: 0, depth: 200, modifier: 3, slideShadows: true, }, pagination: { el: ".swiper-pagination", }, }); </script> </body> </html>