[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: my_listing.php
<!-- Header include --> <?php include("header.php"); ?> <!-- Inner-banner --> <!-- <div class="inner-banner"> <img src="images/inner-banner-2.png"> <div class="container"> <h1>Add Apartment Preference</h1> </div> </div> --> <!-- Flatmate Preferences --> <div class="apartment-preferences"> <div class="container"> <div class="list-apartment"> <h2>My <span>Details</span></h2> <?php $aid=$_SESSION['login_id']; $stmt1=$show->readwithdata('apartment','apartment_id',$_SESSION['login_id']); echo $_SESSION['login_id']; $num1=$stmt1->rowCount(); if($num1>0){ while($row=$stmt1->fetch(PDO::FETCH_ASSOC)){ $category=$row['category']; $amen=array();$flat=array();$nearby=array();$tenant=array(); $st_amn=$show->readwithdata_clause('apartment_amenity','apart_id',$row['apartment_id'],'order by id asc'); while ($row_amn = $st_amn->fetch(PDO::FETCH_ASSOC)){ $amen .=":".$row_amn['amenity']; } $amn=explode(':',$amen); $st_flat=$show->readwithdata_clause('apartment_flatmate','apart_id',$row['apartment_id'],'order by id asc'); while ($row_flt = $st_flat->fetch(PDO::FETCH_ASSOC)){ $flat .=":".$row_flt['amenity']; } $flatment_profile=explode(':',$flat); $st_near=$show->readwithdata_clause('apartment_nearby','apart_id',$row['apartment_id'],'order by id asc'); while ($row_near = $st_near->fetch(PDO::FETCH_ASSOC)){ $nearby .=":".$row_near['amenity']; } $near=explode(':',$nearby); $st_tenant=$show->readwithdata_clause('apartment_tenant','apart_id',$row['apartment_id'],'order by id asc'); while ($row_tenant = $st_tenant->fetch(PDO::FETCH_ASSOC)){ $tenant .=":".$row_tenant['amenity']; } $tenant_profile=explode(':',$tenant); ?> <form action="" method="post" enctype= "multipart/form-data"> <div class="apartment-preferences-block"> <div class="apartment-preferences-box-content"> <input type="radio" value="flatmate-preference1" name="flatmate-preference" id="flatmate-preference1"> <label for="flatmate-preference1"> <img src="images/apartment-prefarence-1.png"> <h6><?=$row['category']?></h6> </label> </div> </div> <div class="apartment-location-block"> <p>Address : </p> <input type="text" id="neat-freak" value="<?=$row['address']?>" name="address" placeholder="Neighborhood"> <select name="city" required> <option value="">Choose City</option> <?php $stmt_city =$show->readwithdata_clause('city','status','ACTIVE','order by id asc'); $num = $stmt_city->rowCount(); if($num>0){ $count=1; while ($rowc = $stmt_city->fetch(PDO::FETCH_ASSOC)){ extract($rowc); ?> <option value="<?=$rowc['city']?>" <?php if($rowc['city']==$row['city']) echo "selected"; ?>><?=$rowc['city']?></option> <?php } }?> </select> <input type="text" id="postal" value="<?=$row['pincode']?>"name="pincode" placeholder="Postal Code"> <input type="text" id="state" value="<?=$row['state']?>" name="state" placeholder="State"> </div> <div class="apartment-location-block"> <p>Property Type : </p> <div class="apartment-location-box-content"> <input type="radio" value="Apartment" <?php if($row['property_type']=='Apartment') echo "checked";?> name="property_type" id="Apartment" > <label for="Apartment1"> Apartment<span>Living space in building</span> </label> </div> <div class="apartment-location-box-content"> <input type="radio" value="House" <?php if($row['property_type']=='House') echo "checked";?> name="property_type" id="Apartment"> <label for="House1"> House<span>Residential Building</span> </label> </div> <div class="apartment-location-box-content"> <input type="radio" value="PG" <?php if($row['property_type']=='PG') echo "checked";?> name="property_type" id="Apartment" > <label for="Condominium1"> PG<span>Paying Guests</span> </label> </div> <div class="apartment-location-box-content"> <input type="radio" value="Shared Accommodation" <?php if($row['property_type']=='Shared Accommodation') echo "checked";?> name="property_type" id="Apartment"> <label for="Accommodation1"> Shared Accommodation<span>Partially Occupied Property</span> </label> </div> </div> <div class="apartment-rent-block"> <p>Rent/Month : </p> <input type="text" id="messy" value="<?=$row['rent']?>" name="rent" placeholder="Rent/Month"> </div> <div class="apartment-rent-block"> <p>Total Bedrooms : </p> <?php $interests = array('1','2','3','4','5'); ?> <select name="total_bedroom" class="form-control"> <?php foreach( $interests as $interest ): ?> <option value="<?php echo $interest ?>"<?php if( $interest==$row['total_bedroom']): ?> selected="selected"<?php endif; ?>><?php echo $interest ?></option> <?php endforeach; ?> </select> </div> <div class="apartment-rent-block"> <p>Total Bathrooms : </p> <?php $interests = array('1','2','3','4','5'); ?> <select name="total_bathroom" class="form-control"> <?php foreach( $interests as $interest ): ?> <option value="<?php echo $interest ?>"<?php if( $interest==$row['total_bathroom']): ?> selected="selected"<?php endif; ?>><?php echo $interest ?></option> <?php endforeach; ?> </select> </div> <div class="apartment-location-block"> <p>Furnishing : </p> <div class="apartment-location-box-content furnishing-box"> <input type="radio" value="Furnished" name="furnishing" <?php if($row['furnishing']=='Furnished') echo "checked";?> id="Furnished"> <label for="Furnished1"> Furnished </label> </div> <div class="apartment-location-box-content furnishing-box"> <input type="radio" value="Semi Furnished" name="furnishing" <?php if($row['furnishing']=='Semi Furnished') echo "checked";?> id="Furnished" > <label for="Partially1"> Semi Furnished </label> </div> <div class="apartment-location-box-content furnishing-box"> <input type="radio" value="Unfurnished" name="furnishing" <?php if($row['furnishing']=='Unfurnished') echo "checked";?> id="Furnished"> <label for="Unfurnished1"> Unfurnished </label> </div> </div> <div class="apartment-check-block"> <p>Amenities : </p> <?php $count=1; $sr1='amenities'; $stmt1 =$show->readAll_clause($sr1,'order by id asc'); $num1 = $stmt1->rowCount(); $count=1; while ($row1 = $stmt1->fetch(PDO::FETCH_ASSOC)){ extract($row1); ?> <script> $(document).ready(function(){ $("#amen<?=$count?>").on('click', function(){ var amen = $("#amen<?=$count?>").val(); var img = $("#img<?=$count?>").val(); //alert(img); var apartid="<?=$_SESSION['login_id']?>";// alert(apartid) $.ajax({ type:"POST", url:"ajax_check.php", data: "amen="+amen+"&img="+img+"&apart_id="+apartid, success: function(response){ // alert(response); } }); }); }); </script> <?php if (in_array($row1['amenity'], $amn)) {?> <div class="apartment-check-block-content"> <input type="checkbox" value="<?=$row1['amenity']?>" checked="checked" name="amenities[]" id="amen<?=$count?>"> <label for="flatmate-preference1"> <img src="<?=$pic_img?>/<?=$row1['image']?>"> <input type="hidden" value="<?=$row1['image']?>" name="img[]" id="img<?=$count?>"> <h6><?=$row1['amenity']?></h6> </label> </div> <?php } else { ?> <div class="apartment-check-block-content"> <input type="checkbox" value="<?=$row1['amenity']?>" name="amenities[]" id="amen<?=$count?>"> <label for="flatmate-preference1"> <img src="<?=$pic_img?>/<?=$row1['image']?>"> <input type="hidden" value="<?=$row1['image']?>" name="img[]" id="img<?=$count?>"> <h6><?=$row1['amenity']?></h6> </label> </div> <?php } ?> <?php ++$count;} ?> </div> <div class="upload-photo-block"> <p>Add Apartment : </p> <div class="upload-photo-box"> <?php if($row['image1']!=""){?> <div class="photo-box-block"> <img src="<?=$pic_img?>/<?=$row['image1']?>"> <?php } ?> <input type="file" name="image1"> </div> <div class="photo-box-block"> <?php if($row['image2']!=""){?> <img src="<?=$pic_img?>/<?=$row['image2']?>"> <?php } ?> <input type="file" name="image2"> </div> <div class="photo-box-block"> <?php if($row['image3']!=""){?> <img src="<?=$pic_img?>/<?=$row['image3']?>"> <?php } ?> <input type="file" name="image3"> </div> <div class="photo-box-block"> <?php if($row['image4']!=""){?> <img src="<?=$pic_img?>/<?=$row['image4']?>"> <?php } ?> <input type="file" name="image4"> </div> <div class="photo-box-block"> <?php if($row['image5']!=""){?> <img src="<?=$pic_img?>/<?=$row['image5']?>"> <?php } ?> <input type="file" name="image5"> </div> </div> <h6>You can upload images upto <strong>25 MB</strong></h6> </div> <div class="apartment-check-block"> <p>Nearby Amenities : </p> <?php $sr2='amenities_nearby'; $stmt2 =$show->readAll_clause($sr2,'order by id asc'); $num2 = $stmt2->rowCount(); $count2=1; while ($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)){ extract($row2); ?> <script> $(document).ready(function(){ $("#near<?=$count2?>").on('click', function(){ var near = $("#near<?=$count2?>").val(); //alert(near); var img = $("#img1<?=$count2?>").val(); //alert(img); var apartid="<?=$_SESSION['login_id']?>";// alert(apartid) $.ajax({ type:"POST", url:"ajax_check.php", data: "near="+near+"&img="+img+"&apart_id="+apartid, success: function(response){ // alert(response); } }); }); }); </script> <?php if (in_array($row2['amenity'], $near)) {?> <div class="apartment-check-block-content"> <input type="checkbox" value="<?=$row2['amenity']?>" name="nearby_amenity[]" id="near<?=$count2?>" checked> <label for="flatmate-preference1"> <input type="hidden" value="<?=$row2['image']?>" name="img1[]"id="img1<?=$count2?>" > <img src="<?=$pic_img?>/<?=$row2['image']?>"> <h6><?=$row2['amenity']?></h6> </label> </div> <?php } else { ?> <div class="apartment-check-block-content"> <input type="checkbox" value="<?=$row2['amenity']?>" name="nearby_amenity[]" id="near<?=$count2?>"> <label for="flatmate-preference1"> <input type="hidden" value="<?=$row2['image']?>" name="img1[]" id="img1<?=$count2?>"> <img src="<?=$pic_img?>/<?=$row2['image']?>"> <h6><?=$row2['amenity']?></h6> </label> </div> <?php } ?> <?php ++$count2;} ?> </div> <div class="apartment-location-block"> <p>Do you want to make your mobile visible to other users?</p> <div class="apartment-location-box-content furnishing-box"> <input type="radio" <?php if($row['visible']=='Public') echo "checked";?> value="Public" name="visible" id="public" checked> <label for="public1"> Yes! make it public </label> </div> <div class="apartment-location-box-content furnishing-box"> <input type="radio" <?php if($row['visible']=='Private') echo "checked";?> value="Private" name="visible" id="public" > <label for="private1"> No! make it private </label> </div> </div> <div class="apartment-check-block"> <?php if($category=='tenant'){?> <p>Preferred Tenant Profile : </p> <?php // print_r($tenant_profile); $sr3='tenant_category'; $stmt3 =$show->readAll_clause($sr3,'order by id asc'); $num3 = $stmt3->rowCount(); $count3=1; while ($row3 = $stmt3->fetch(PDO::FETCH_ASSOC)){ extract($row3); ?> <script> $(document).ready(function(){ $("#tenant<?=$count3?>").on('click', function(){ var tenant = $("#tenant<?=$count3?>").val(); //alert(near); var img = $("#img2<?=$count3?>").val(); //alert(img); var apartid="<?=$_SESSION['login_id']?>";// alert(apartid) $.ajax({ type:"POST", url:"ajax_check.php", data: "tenant="+tenant+"&img="+img+"&apart_id="+apartid, success: function(response){ //alert(response); } }); }); }); </script> <?php if (in_array($row3['amenity'], $tenant_profile)) {?> <div class="apartment-check-block-content"> <input type="checkbox" value="<?=$row3['amenity']?>" name="tenant_profile[]" id="tenant<?=$count3?>" checked> <label for="MarriedCouple"> <input type="hidden" value="<?=$row3['image']?>" name="img2[]" id="img2<?=$count3?>"> <img src="<?=$pic_img?>/<?=$row3['image']?>"> <h6><?=$row3['amenity']?></h6> </label> </div> <?php }else{ ?> <div class="apartment-check-block-content"> <input type="checkbox" value="<?=$row3['amenity']?>" name="tenant_profile[]" id="tenant<?=$count3?>"> <label for="MarriedCouple"> <input type="hidden" value="<?=$row3['image']?>" name="img2[]" id="img2<?=$count3?>"> <img src="<?=$pic_img?>/<?=$row3['image']?>"> <h6><?=$row3['amenity']?></h6> </label> </div> <?php } ++$count3;} ?> <?php }else{ ?> <p>Preferred Flatmate Profile : </p> <?php // echo "aaaaaaaaaa"; $sr4='flatmate_category'; $stmt4 =$show->readAll_clause($sr4,'order by id asc'); $num4 = $stmt4->rowCount(); $count4=1; while ($row4 = $stmt4->fetch(PDO::FETCH_ASSOC)){ extract($row4); ?> <script> $(document).ready(function(){ $("#flatmate<?=$count4?>").on('click', function(){ var flatmate = $("#flatmate<?=$count4?>").val(); //alert(near); var img = $("#img3<?=$count4?>").val(); //alert(img); var apartid="<?=$_SESSION['login_id']?>";// alert(apartid) $.ajax({ type:"POST", url:"ajax_check.php", data: "flatmate="+flatmate+"&img="+img+"&apart_id="+apartid, success: function(response){ alert(response); } }); }); }); </script> <?php if (in_array($row4['amenity'], $flatment_profile)) { ?> <div class="apartment-check-block-content"> <input type="checkbox" value="<?=$row4['amenity']?>" name="flatment_profile[]" id="flatmate<?=$count4?>" checked> <label for="flatmate-preference1"> <input type="hidden" value="<?=$row4['image']?>" name="img3[]" id="img3<?=$count4?>"> <img src="<?=$pic_img?>/<?=$row4['image']?>"> <h6><?=$row4['amenity']?></h6> </label> </div> <?php }else{ ?> <div class="apartment-check-block-content"> <input type="checkbox" value="<?=$row4['amenity']?>" name="flatment_profile[]" id="flatmate<?=$count4?>"> <label for="flatmate-preference1"> <input type="hidden" value="<?=$row4['image']?>" name="img3[]" id="img3<?=$count4?>"> <img src="<?=$pic_img?>/<?=$row4['image']?>"> <h6><?=$row4['amenity']?></h6> </label> </div> <?php } ++$count4;} } ?> </div> <div class="apartment-location-block"> <p>Description : </p> <textarea placeholder="Description"><?=$row['description']?></textarea> </div> <div class="apartment-supply-block apartment-btn"> <input type="submit" value="Update" name="update"> </div> </form> <?php } } ?> <?php if(isset($_POST['update'])){ $table="apartment"; $amenities="";$nearby_amenity="";$tenant_profile="";$flatment_profile=""; $allowed = ["address","state","city","pincode","rent","total_bedroom","total_bathroom","furnishing","description","visible"]; $params = []; $setStr = ""; foreach ($allowed as $key) { if (isset($_POST[$key]) && $key != "uid") { $setStr .= "`$key` = :$key,"; $params[$key] = htmlspecialchars(strip_tags($_POST[$key])); } } if(file_exists($_FILES['image1']['tmp_name']) || is_uploaded_file($_FILES['image1']['tmp_name'])) { $setStr .= "`image1` = :image1,"; $img=$show->imageEdit($_FILES['image1']['name']); move_uploaded_file($_FILES['image1']['tmp_name'],"product_img/".$img); $params['image1'] =$img; } if(file_exists($_FILES['image2']['tmp_name']) || is_uploaded_file($_FILES['image2']['tmp_name'])) { $setStr .= "`image2` = :image2,"; $img=$show->imageEdit($_FILES['image2']['name']); move_uploaded_file($_FILES['image2']['tmp_name'],"product_img/".$img); $params['image2'] =$img; } if(file_exists($_FILES['image3']['tmp_name']) || is_uploaded_file($_FILES['image3']['tmp_name'])) { $setStr .= "`image3` = :image3,"; $img=$show->imageEdit($_FILES['image3']['name']); move_uploaded_file($_FILES['image3']['tmp_name'],"product_img/".$img); $params['image3'] =$img; } if(file_exists($_FILES['image4']['tmp_name']) || is_uploaded_file($_FILES['image4']['tmp_name'])) { $setStr .= "`image4` = :image4,"; $img=$show->imageEdit($_FILES['image4']['name']); move_uploaded_file($_FILES['image4']['tmp_name'],"product_img/".$img); $params['image4'] =$img; } if(file_exists($_FILES['image5']['tmp_name']) || is_uploaded_file($_FILES['image5']['tmp_name'])) { $setStr .= "`image5` = :image5,"; $img=$show->imageEdit($_FILES['image5']['name']); move_uploaded_file($_FILES['image5']['tmp_name'],"product_img/".$img); $params['image5'] =$img; } $setStr = rtrim($setStr, ","); $params['apartment_id'] =$aid; $params['amenities'] =$amenities; $params['nearby_amenity'] =$nearby_amenity; $params['tenant_profile'] =$tenant_profile; $params['flatment_profile'] =$flatment_profile; $show->table ='apartment'; $show->cols =$setStr; $show->id_name ='apartment_id'; $show->params =$params; //print_r($params); $r=$show->update_all(); if($r){ echo '<script> setTimeout(function() { swal({ title: "Thank You!", text: "Your details has been updated", type: "success" }, function() { window.location = ""; }); }, 1000); </script>'; }else{ echo "<script>swal('aa')</script>";} } ?> </div> </div> </div> <!-- Footer include --> <?php include("footer.php"); ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.7 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619