$mode=$_REQUEST['mode'];
if($mode=='top')
{
$hotsql="SELECT * FROM tbl_hotels WHERE fld_status='1'";
if($_REQUEST['stateid']!="")
{
$where.=" AND fld_state_id=".$_REQUEST['stateid']."";
}
if($_REQUEST['cityid']!="")
{
$cityid['fld_id']=$_REQUEST['cityid'];
$where.=" AND fld_city=".$_REQUEST['cityid']."";
}
if($_REQUEST['locationid']!="")
{
$where.=" AND fld_location=".$_REQUEST['locationid']."";
}
if($_REQUEST['categoryid']!="")
{
$where.=" AND fld_category=".$_REQUEST['categoryid']."";
}
if($_REQUEST['services']!="")
{
foreach($_REQUEST['services'] as $sval)
{
$wherese.=" FIND_IN_SET('$sval',fld_services) AND";
}
$where.=' AND'.substr($wherese,0,-3);
}
$hotelsql=$hotsql.$where;
}
else
{
$cityname=$_REQUEST['city'];
$hotelname=$_REQUEST['hotel'];
$type=$_REQUEST['type'];
$cityid=$obj_mysql->get_fetch_arr("SELECT * FROM tbl_city WHERE fld_city_name_en='$cityname'");
if($cityid!="" && $hotelname!="")
{
$hotelsql="SELECT * FROM tbl_hotels WHERE fld_city=".$cityid['fld_id']." AND fld_hotel_".$_SESSION['language']." LIKE '%".$hotelname."%'";
}
elseif($cityid=="" && $hotelname!="")
{
$hotelsql="SELECT * FROM tbl_hotels WHERE fld_hotel_".$_SESSION['language']." LIKE '%".$hotelname."%'";
}
elseif($cityid!="" && $hotelname=="")
{
$hotelsql="SELECT * FROM tbl_hotels WHERE fld_city=".$cityid['fld_id']." ";
}
elseif($type!="")
{
$hotelsql="SELECT * FROM tbl_hotels WHERE FIND_IN_SET('$type',fld_type) ";
}
else
{
$hotelsql="SELECT * FROM tbl_hotels ";
}
}
$hotelnum=$obj_mysql->get_num_rows($hotelsql);
$data=$obj_mysql->getAllData($hotelsql." ORDER BY RAND()");
Blogger templates
Blogger news
Blogroll
Archives
-
▼
2012
(231)
-
▼
May
(21)
- opens a directory with opendir() in php
- Generate random password
- About me and PHP
- MySQL Commands
- Form Validator
- file write in php
- Connecting to server, create database and creating...
- পিএইচপি অ্যারে
- How to start PHP?
- Drag and drop to order list elements with Scriptac...
- Create Online Shop using Paypal, PHP and Dreamweaver
- Step by step PHP video tutorials from start to fin...
- Membuat Script PHP untuk Kompresi File ZIP
- Control Structures in PHP: FOR
- Joomla-v-15-Configure-and-troubleshoot-SEF-URLs
- Registration Form
- Searh script
- Installing of Webserver : Apache 2.0.53
- What is PHP
- Drag and drop to order list elements with Scriptac...
- How to hack into a facebook account
-
▼
May
(21)