-
Notifications
You must be signed in to change notification settings - Fork 1
/
search.php
29 lines (29 loc) · 881 Bytes
/
search.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
<?php
include "check_login.php";
$val=check();
if($val):
$conn=new DBase("brokfree");
$pdo=$conn->pdo;
$s1=new Stmt($pdo);
$sql="SELECT username from users where email=:email";
$email=$_SESSION['email'];
$arr=['email'=>$email];
$s1=$s1->run($sql,$arr);
foreach($s1 as $row):
$username=$row['username'];
endforeach;
endif;
$city=$_GET['city'];
$array=['location'=>$city];
include "filter.php";
$conn = new DBase("brokfree");
$pdo=$conn->pdo;
$s1=new Stmt($pdo);
$sql="SELECT id_house,name,builtup,deposit,rent,furnishing,age,pt,availability from housedata where location=:location";
if(isset($q1))
$sql.=$q1;
$s1=$s1->run($sql,$array);
ob_start();
include "templates/search-homes.html.php";
$out=ob_get_clean();
echo $out;