home/amitahospital/public_html/amita_master/ajax.php 0000644 00000005543 14721142514 0016747 0 ustar 00 dbLogin();
if(isset($_REQUEST['act']) && !empty($_REQUEST['act'])){
$task = $_REQUEST['act'];
}
switch($task){
case 'searchHotel':
$loca_id= $_POST['loca_id'];
$json=array();
$hotel='';
$query= 'SELECT * FROM hotel WHERE loca_id="'.$loca_id.'"';
$rs= mysqli_query($obj->mysqli,$query);
if(mysqli_num_rows($rs)>0)
{
$hotel.='';
while($row = mysqli_fetch_assoc($rs))
{
$hotel.="";
}
}
$json['hotel_name']=$hotel;
echo json_encode($json);
break;
case 'city_search':
$search= $_REQUEST['city_name'];
$city= $_REQUEST['city'];
$sql= "SELECT city_name FROM cities WHERE city_name LIKE '$search%' ORDER BY city_name";
$res= mysqli_query($obj->mysqli,$sql);
$num= mysqli_num_rows($res);
if($num>0)
{
$cities= "";
$fun= ($city == 's_city')? 'fill' : 'fill2';
while($data= mysqli_fetch_assoc($res))
{
$cities .= "
".$data['city_name']."";
}
echo $cities;
}
else{
echo "NO CITY FOUND...";
}
break;
case 'city_search2':
$search= $_REQUEST['city_name2'];
$sql= "SELECT city_name FROM cities WHERE city_name LIKE '$search%' ORDER BY city_name";
$res= mysqli_query($obj->mysqli,$sql);
$num= mysqli_num_rows($res);
if($num>0)
{
$cities= "";
while($data= mysqli_fetch_assoc($res))
{
$cities .= "".$data['city_name']."";
}
echo $cities;
}
else{
echo "NO CITY FOUND...";
}
break;
case 'city_search3':
$search= $_REQUEST['city_name3'];
$sql= "SELECT city_name FROM cities WHERE city_name LIKE '$search%' ORDER BY city_name";
$res= mysqli_query($obj->mysqli,$sql);
$num= mysqli_num_rows($res);
if($num>0)
{
$cities= "";
while($data= mysqli_fetch_assoc($res))
{
$cities .= "".$data['city_name']."";
}
echo $cities;
}
else{
echo "NO CITY FOUND...";
}
break;
case 'city_search_front':
$search= $_REQUEST['city_name'];
$city= $_REQUEST['city'];
$sql= "SELECT city_name FROM cities WHERE city_name LIKE '$search%' ORDER BY city_name";
$res= mysqli_query($obj->mysqli,$sql);
$num= mysqli_num_rows($res);
if($num>0)
{
$cities= "";
$fun= ($city == 'city')? 'fill' : 'fill2';
while($data= mysqli_fetch_assoc($res))
{
$cities .= "".$data['city_name']."";
}
echo $cities;
}
else{
echo "NO CITY FOUND...";
}
break;
}
?>