GIF89a;
| Direktori : /home/serb/www/ |
| Current File : /home/serb/www/loc_escort_srch.php |
<?
session_start();
include("lib/globals.php");
include("lib/common.php");
include("lib/functions.php");
?>
<?
if($_POST)
{
if($_POST['findCat']!='Escort/MassageParlor')
{
$cat=$_POST['findCat'];
}
else
{
$cat='';
}
if($_POST['cityname']!='City')
{
$city=$_POST['cityname'];
}
else
{
$city='';
}
if(($cat) && ($city))
{
$sql="SELECT * FROM citys WHERE name='".$_POST['cityname']."'";
$res=execute_query($sql);
$row_city=mysql_fetch_array($res);
$sql_post="SELECT * FROM post_ad WHERE (ad_catagory='1' or ad_catagory='4') and ad_name='".$_POST['findCat']."' and city_id='".$row_city['id']."'";
$res_post=execute_query($sql_post);
$num=mysql_num_rows($res_post);
if($num>0)
{
$row_post=mysql_fetch_array($res_post);
$posthit=$row_post['no_of_hitt']+1;
$post_update="UPDATE post_ad SET no_of_hitt='$posthit' WHERE id='".$row_post['id']."'";
execute_query($post_update);
$no_hitcity="SELECT * FROM citys WHERE id='".$row_city['id']."'";
$res_hitcity=execute_query($no_hitcity);
$row_hitcity=mysql_fetch_array($res_hitcity);
$hitcount=$row_hitcity['no_of_hit']+1;
$up_cityhitct="UPDATE citys SET no_of_hit='$hitcount' WHERE id='".$row_city['id']."'";
execute_query($up_cityhitct);
?>
<script language="javascript">
location.href="escort-service-dtls.php?postid=<?=$row_post['id']?>&city_id=<?=$row_post['city_id']?>";
</script>
<? }
else {
$sql_msgprl="SELECT * FROM massageparlor WHERE name='".$_POST['findCat']."' and city_id='".$row_city['id']."'";
$res_msgprl=execute_query($sql_msgprl);
$num2=mysql_num_rows($res_msgprl);
if($num2>0)
{
$row_msgprl=mysql_fetch_array($res_msgprl);
$msghits=$row_msgprl['no_of_hits']+1;
$update_msghit="UPDATE massageparlor SET no_of_hits='$msghits' WHERE id='".$row_msgprl['id']."'";
execute_query($update_msghit);
$no_hitcity="SELECT * FROM citys WHERE id='".$row_city['id']."'";
$res_hitcity=execute_query($no_hitcity);
$row_hitcity=mysql_fetch_array($res_hitcity);
$hitcount=$row_hitcity['no_of_hit']+1;
$up_cityhitct="UPDATE citys SET no_of_hit='$hitcount' WHERE id='".$row_city['id']."'";
execute_query($up_cityhitct);
?>
<script language="javascript">
location.href="massageparlor-details.php?parlor_id=<?=$row_msgprl['id']?>&city_id=<?= $row_msgprl['city_id']?>";
</script>
<? } else{
$sql_scrpescort="SELECT * FROM escorts WHERE esc_title LIKE '%$_POST[findCat]%' and esc_location='".$row_city['id']."'";
$res_scrpescort=execute_query($sql_scrpescort);
$scrcount=mysql_num_rows($res_scrpescort);
if($scrcount>0)
{
$row_scrpescort=mysql_fetch_array($res_scrpescort);
$scraphit=$row_scrpescort['no_of_schit']+1;
$update_scrhit="UPDATE escorts SET no_of_schit='$scraphit' WHERE esc_id='".$row_scrpescort['esc_id']."'";
execute_query($update_scrhit);
$no_hitcity="SELECT * FROM citys WHERE id='".$row_city['id']."'";
$res_hitcity=execute_query($no_hitcity);
$row_hitcity=mysql_fetch_array($res_hitcity);
$hitcount=$row_hitcity['no_of_hit']+1;
$up_cityhitct="UPDATE citys SET no_of_hit='$hitcount' WHERE id='".$row_city['id']."'";
execute_query($up_cityhitct);
?>
<script language="javascript">
location.href="escort_service_dtls.php?postid=<?=$row_scrpescort['esc_id']?>&city_id=<?=$row_scrpescort['esc_location']?>";
</script>
<?
}
else {?>
<script language="javascript">
alert('You provide invalide Name or City Name');
location.href="index.php";
</script>
<? } }
}
}
if($cat)
{
$sql="SELECT * FROM citys WHERE name='".$_POST['cityname']."'";
$res=execute_query($sql);
$row_city=mysql_fetch_array($res);
$sql_post="SELECT * FROM post_ad WHERE (ad_catagory='1' or ad_catagory='4') and ad_name='".$_POST['findCat']."'";
$res_post=execute_query($sql_post);
$num=mysql_num_rows($res_post);
if($num>0)
{
$row_post=mysql_fetch_array($res_post);
if($city=='')
{
$post_n_hit=$row_post['no_of_hitt']+1;
$updt_post_ht="UPDATE post_ad SET no_of_hitt='$post_n_hit' WHERE id='".$row_post['id']."'";
execute_query($updt_post_ht);
}
?>
<script language="javascript">
location.href="escort-service-dtls.php?postid=<?=$row_post['id']?>&city_id=<?=$row_post['city_id']?>";
</script>
<? }
else
{
$sql_msgprl="SELECT * FROM massageparlor WHERE name='".$_POST['findCat']."'";
$res_msgprl=execute_query($sql_msgprl);
$num2=mysql_num_rows($res_msgprl);
if($num2>0)
{
$row_msgprl=mysql_fetch_array($res_msgprl);
if($city=='')
{
$msg_n_hit=$row_msgprl['no_of_hits']+1;
$updt_msg_ht="UPDATE massageparlor SET no_of_hits='$msg_n_hit' WHERE id='".$row_msgprl['id']."'";
execute_query($updt_msg_ht);
}
?>
<script language="javascript">
location.href="massageparlor-details.php?parlor_id=<?=$row_msgprl['id']?>&city_id=<?= $row_msgprl['city_id']?>";
</script>
<?
} else
{
$sql_scrpescort="SELECT * FROM escorts WHERE esc_title LIKE '%$_POST[findCat]%'";
$res_scrpescort=execute_query($sql_scrpescort);
$scrcount=mysql_num_rows($res_scrpescort);
if($scrcount>0)
{
$row_scrpescort=mysql_fetch_array($res_scrpescort);
if($city=='')
{
$scraphit=$row_scrpescort['no_of_schit']+1;
$update_scrhit="UPDATE escorts SET no_of_schit='$scraphit' WHERE esc_id='".$row_scrpescort['esc_id']."'";
execute_query($update_scrhit);
}
?>
<script language="javascript">
location.href="escort_service_dtls.php?postid=<?=$row_scrpescort['esc_id']?>&city_id=<?=$row_scrpescort['esc_location']?>";
</script>
<?
}
else {
?>
<script language="javascript">
alert('You provide invalide Name');
location.href="index.php";
</script>
<? }
}
}
}
if($city)
{
$sql_citysh="SELECT * FROM citys WHERE name='".$_POST['cityname']."'";
$res_citysh=execute_query($sql_citysh);
$row_citynum=mysql_num_rows($res_citysh);
if($row_citynum>0)
{
$row_cityname=mysql_fetch_array($res_citysh);
if($cat=='')
{
$noofhits=$row_cityname['no_of_hit']+1;
$sql_updatecityhit="UPDATE citys SET no_of_hit='$noofhits' WHERE id='".$row_cityname['id']."'";
execute_query($sql_updatecityhit);
}
?>
<script language="javascript">
location.href="list-massage-parlor.php?city_id=<?=$row_cityname['id']?>&city_name=<?=$row_cityname['name']?>";
</script>
<?
}
else
{
?>
<script language="javascript">
alert('You provide invalide City Name');
location.href="index.php";
</script>
<? }
}
if(($cat=='') && ($city==''))
{
?>
<script language="javascript">
location.href="index.php";
</script>
<?
}
}
?>