-
Notifications
You must be signed in to change notification settings - Fork 31
/
submitpropertyupdate.php
492 lines (445 loc) · 19.9 KB
/
submitpropertyupdate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
<?php
ini_set('session.cache_limiter','public');
session_cache_limiter(false);
session_start();
include("config.php");
if(!isset($_SESSION['uemail']))
{
header("location:login.php");
}
//// code insert
//// add code
$msg="";
if(isset($_POST['add']))
{
$pid=$_REQUEST['id'];
$title=$_POST['title'];
$content=$_POST['content'];
$ptype=$_POST['ptype'];
$bhk=$_POST['bhk'];
$bed=$_POST['bed'];
$balc=$_POST['balc'];
$hall=$_POST['hall'];
$stype=$_POST['stype'];
$bath=$_POST['bath'];
$kitc=$_POST['kitc'];
$floor=$_POST['floor'];
$price=$_POST['price'];
$city=$_POST['city'];
$asize=$_POST['asize'];
$loc=$_POST['loc'];
$state=$_POST['state'];
$status=$_POST['status'];
$uid=$_SESSION['uid'];
$feature=$_POST['feature'];
$totalfloor=$_POST['totalfl'];
$aimage=$_FILES['aimage']['name'];
$aimage1=$_FILES['aimage1']['name'];
$aimage2=$_FILES['aimage2']['name'];
$aimage3=$_FILES['aimage3']['name'];
$aimage4=$_FILES['aimage4']['name'];
$fimage=$_FILES['fimage']['name'];
$fimage1=$_FILES['fimage1']['name'];
$fimage2=$_FILES['fimage2']['name'];
$temp_name =$_FILES['aimage']['tmp_name'];
$temp_name1 =$_FILES['aimage1']['tmp_name'];
$temp_name2 =$_FILES['aimage2']['tmp_name'];
$temp_name3 =$_FILES['aimage3']['tmp_name'];
$temp_name4 =$_FILES['aimage4']['tmp_name'];
$temp_name5 =$_FILES['fimage']['tmp_name'];
$temp_name6 =$_FILES['fimage1']['tmp_name'];
$temp_name7 =$_FILES['fimage2']['tmp_name'];
move_uploaded_file($temp_name,"admin/property/$aimage");
move_uploaded_file($temp_name1,"admin/property/$aimage1");
move_uploaded_file($temp_name2,"admin/property/$aimage2");
move_uploaded_file($temp_name3,"admin/property/$aimage3");
move_uploaded_file($temp_name4,"admin/property/$aimage4");
move_uploaded_file($temp_name5,"admin/property/$fimage");
move_uploaded_file($temp_name6,"admin/property/$fimage1");
move_uploaded_file($temp_name7,"admin/property/$fimage2");
$sql = "UPDATE property SET title= '{$title}', pcontent= '{$content}', type='{$ptype}', bhk='{$bhk}', stype='{$stype}',
bedroom='{$bed}', bathroom='{$bath}', balcony='{$balc}', kitchen='{$kitc}', hall='{$hall}', floor='{$floor}',
size='{$asize}', price='{$price}', location='{$loc}', city='{$city}', state='{$state}', feature='{$feature}',
pimage='{$aimage}', pimage1='{$aimage1}', pimage2='{$aimage2}', pimage3='{$aimage3}', pimage4='{$aimage4}',
uid='{$uid}', status='{$status}', mapimage='{$fimage}', topmapimage='{$fimage1}', groundmapimage='{$fimage2}',
totalfloor='{$totalfloor}' WHERE pid = {$pid}";
$result=mysqli_query($con,$sql);
if($result == true)
{
$msg="<p class='alert alert-success'>Property Updated</p>";
header("Location:feature.php?msg=$msg");
}
else{
$msg="<p class='alert alert-warning'>Property Not Updated</p>";
header("Location:feature.php?msg=$msg");
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Meta Tags -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" href="images/favicon.ico">
<!-- Fonts
========================================================-->
<link href="https://fonts.googleapis.com/css?family=Muli:400,400i,500,600,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Comfortaa:400,700" rel="stylesheet">
<!-- Css Link
========================================================-->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-slider.css">
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="css/layerslider.css">
<link rel="stylesheet" type="text/css" href="css/color.css">
<link rel="stylesheet" type="text/css" href="css/owl.carousel.min.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="fonts/flaticon/flaticon.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/login.css">
<!-- Title
=========================================================-->
<title>Homex - Real Estate Template</title>
</head>
<body>
<!-- Page Loader
=============================================================
<div class="page-loader position-fixed z-index-9999 w-100 bg-white vh-100">
<div class="d-flex justify-content-center y-middle position-relative">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
-->
<div id="page-wrapper">
<div class="row">
<!-- Header start -->
<?php include("include/header.php");?>
<!-- Header end -->
<!-- Banner --->
<div class="banner-full-row page-banner" style="background-image:url('images/breadcromb.jpg');">
<div class="container">
<div class="row">
<div class="col-md-6">
<h2 class="page-name float-left text-white text-uppercase mt-1 mb-0"><b>Submit Property</b></h2>
</div>
<div class="col-md-6">
<nav aria-label="breadcrumb" class="float-left float-md-right">
<ol class="breadcrumb bg-transparent m-0 p-0">
<li class="breadcrumb-item text-white"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Submit Property</li>
</ol>
</nav>
</div>
</div>
</div>
</div>
<!-- Banner --->
<!-- Submit property -->
<div class="full-row">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h2 class="text-secondary double-down-line text-center">Submit Property</h2>
</div>
</div>
<div class="row p-5 bg-white">
<form method="post" enctype="multipart/form-data">
<?php
$pid=$_REQUEST['id'];
$query=mysqli_query($con,"select * from property where pid='$pid'");
while($row=mysqli_fetch_row($query))
{
?>
<div class="description">
<h5 class="text-secondary">Basic Information</h5><hr>
<div class="row">
<div class="col-xl-12">
<div class="form-group row">
<label class="col-lg-2 col-form-label">Title</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="title" required value="<?php echo $row['1']; ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label">Content</label>
<div class="col-lg-9">
<textarea class="tinymce form-control" name="content" rows="10" cols="30"><?php echo $row['2']; ?></textarea>
</div>
</div>
</div>
<div class="col-xl-6">
<div class="form-group row">
<label class="col-lg-3 col-form-label">Property Type</label>
<div class="col-lg-9">
<select class="form-control" required name="ptype">
<option value="">Select Type</option>
<option value="appartment">Appartment</option>
<option value="flat">Flat</option>
<option value="bunglow">Bunglow</option>
<option value="house">House</option>
<option value="villa">Villa</option>
<option value="office">Office</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Selling Type</label>
<div class="col-lg-9">
<select class="form-control" required name="stype">
<option value="">Select Status</option>
<option value="rent">Rent</option>
<option value="sale">Sale</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Bathroom</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="bath" required value="<?php echo $row['7']; ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Kitchen</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="kitc" required value="<?php echo $row['9']; ?>">
</div>
</div>
</div>
<div class="col-xl-6">
<div class="form-group row mb-3">
<label class="col-lg-3 col-form-label">BHK</label>
<div class="col-lg-9">
<select class="form-control" required name="bhk">
<option value="">Select BHK</option>
<option value="1 BHK">1 BHK</option>
<option value="2 BHK">2 BHK</option>
<option value="3 BHK">3 BHK</option>
<option value="4 BHK">4 BHK</option>
<option value="5 BHK">5 BHK</option>
<option value="1,2 BHK">1,2 BHK</option>
<option value="2,3 BHK">2,3 BHK</option>
<option value="2,3,4 BHK">2,3,4 BHK</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Bedroom</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="bed" required value="<?php echo $row['6']; ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Balcony</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="balc" required value="<?php echo $row['8']; ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Hall</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="hall" required value="<?php echo $row['10']; ?>">
</div>
</div>
</div>
</div>
<h5 class="text-secondary">Price & Location</h5><hr>
<div class="row">
<div class="col-xl-6">
<div class="form-group row">
<label class="col-lg-3 col-form-label">Floor</label>
<div class="col-lg-9">
<select class="form-control" required name="floor">
<option value="">Select Floor</option>
<option value="1st Floor">1st Floor</option>
<option value="2nd Floor">2nd Floor</option>
<option value="3rd Floor">3rd Floor</option>
<option value="4th Floor">4th Floor</option>
<option value="5th Floor">5th Floor</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Price</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="price" required value="<?php echo $row['13']; ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">City</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="city" required value="<?php echo $row['15']; ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">State</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="state" required value="<?php echo $row['16']; ?>">
</div>
</div>
</div>
<div class="col-xl-6">
<div class="form-group row">
<label class="col-lg-3 col-form-label">Total Floor</label>
<div class="col-lg-9">
<select class="form-control" required name="totalfl">
<option value="">Select Floor</option>
<option value="1 Floor">1 Floor</option>
<option value="2 Floor">2 Floor</option>
<option value="3 Floor">3 Floor</option>
<option value="4 Floor">4 Floor</option>
<option value="5 Floor">5 Floor</option>
<option value="6 Floor">6 Floor</option>
<option value="7 Floor">7 Floor</option>
<option value="8 Floor">8 Floor</option>
<option value="9 Floor">9 Floor</option>
<option value="10 Floor">10 Floor</option>
<option value="11 Floor">11 Floor</option>
<option value="12 Floor">12 Floor</option>
<option value="13 Floor">13 Floor</option>
<option value="14 Floor">14 Floor</option>
<option value="15 Floor">15 Floor</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Area Size</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="asize" required value="<?php echo $row['12']; ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Address</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="loc" required value="<?php echo $row['14']; ?>">
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label">Feature</label>
<div class="col-lg-9">
<p class="alert alert-danger">* Important Please Do Not Remove Below Content Only Change <b>Yes</b> Or <b>No</b> or Details and Do Not Add More Details</p>
<textarea class="tinymce form-control" name="feature" rows="10" cols="30">
<?php echo $row['17']; ?>
</textarea>
</div>
</div>
<h5 class="text-secondary">Image & Status</h5><hr>
<div class="row">
<div class="col-xl-6">
<div class="form-group row">
<label class="col-lg-3 col-form-label">Image</label>
<div class="col-lg-9">
<input class="form-control" name="aimage" type="file" required="">
<img src="property/<?php echo $row['18'];?>" alt="pimage" height="150" width="180">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Image 2</label>
<div class="col-lg-9">
<input class="form-control" name="aimage2" type="file" required="">
<img src="property/<?php echo $row['20'];?>" alt="pimage" height="150" width="180">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Image 4</label>
<div class="col-lg-9">
<input class="form-control" name="aimage4" type="file" required="">
<img src="property/<?php echo $row['22'];?>" alt="pimage" height="150" width="180">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Status</label>
<div class="col-lg-9">
<select class="form-control" required name="status">
<option value="">Select Status</option>
<option value="available">Available</option>
<option value="sold out">Sold Out</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Basement Floor Plan Image</label>
<div class="col-lg-9">
<input class="form-control" name="fimage1" type="file">
<img src="property/<?php echo $row['26'];?>" alt="pimage" height="150" width="180">
</div>
</div>
</div>
<div class="col-xl-6">
<div class="form-group row">
<label class="col-lg-3 col-form-label">Image 1</label>
<div class="col-lg-9">
<input class="form-control" name="aimage1" type="file" required="">
<img src="property/<?php echo $row['19'];?>" alt="pimage" height="150" width="180">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">image 3</label>
<div class="col-lg-9">
<input class="form-control" name="aimage3" type="file" required="">
<img src="property/<?php echo $row['21'];?>" alt="pimage" height="150" width="180">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Floor Plan Image</label>
<div class="col-lg-9">
<input class="form-control" name="fimage" type="file">
<img src="property/<?php echo $row['25'];?>" alt="pimage" height="150" width="180">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">Ground Floor Plan Image</label>
<div class="col-lg-9">
<input class="form-control" name="fimage2" type="file">
<img src="property/<?php echo $row['27'];?>" alt="pimage" height="150" width="180">
</div>
</div>
</div>
</div>
<input type="submit" value="Submit" class="btn btn-primary"name="add" style="margin-left:200px;">
</div>
</form>
<?php
}
?>
</div>
</div>
</div>
<!-- Submit property -->
<!-- Footer start-->
<?php include("include/footer.php");?>
<!-- Footer start-->
<!-- Scroll to top -->
<a href="#" class="bg-secondary text-white hover-text-secondary" id="scroll"><i class="fas fa-angle-up"></i></a>
<!-- End Scroll To top -->
</div>
</div>
<!-- Wrapper End -->
<!-- Js Link
============================================================-->
<script src="js/jquery.min.js"></script>
<script src="js/tinymce/tinymce.min.js"></script>
<script src="js/tinymce/init-tinymce.min.js"></script>
<!--jQuery Layer Slider -->
<script src="js/greensock.js"></script>
<script src="js/layerslider.transitions.js"></script>
<script src="js/layerslider.kreaturamedia.jquery.js"></script>
<!--jQuery Layer Slider -->
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/tmpl.js"></script>
<script src="js/jquery.dependClass-0.1.js"></script>
<script src="js/draggable-0.1.js"></script>
<script src="js/jquery.slider.js"></script>
<script src="js/wow.js"></script>
<script src="js/custom.js"></script>
</body>
</html>