$mainCityList = $category->where('categories.seo_name', '=', $type) ->join('category_hotel', 'categories.id', '=', 'category_hotel.category_id') ->join('hotels', 'category_hotel.hotel_id', '=', 'hotels.id') ->join('main_cities', 'hotels.main_city_id', '=', 'main_cities.id') ->orderBy('main_cities.name', 'ASC') ->groupBy('main_cities.name') ->select('main_cities.name', 'main_cities.id') ->get(); }else if(!isset($_GET['subCity']) || strlen($_GET['subCity']) < 1){ //by category and main city $mPlace = urldecode($_GET['mainCity']); $mPlace = explode('-', $mPlace); $mPlace = implode(' ', $mPlace); $inCity = $mPlace; $thisMainCity = $mainCity->where('name', '=', $mPlace)->first(); $thisMainCityId = isset($thisMainCity->id) ? $thisMainCity->id : -1; $hotelsList = $category->where('categories.seo_name', '=', $type) ->join('category_hotel', 'categories.id', '=', 'category_hotel.category_id') ->join('hotels', 'category_hotel.hotel_id', '=', 'hotels.id') ->where('hotels.main_city_id', '=', $thisMainCityId) ->orderBy('hotels.id', 'DESC') ->skip(0) ->take(30) ->get(); $hotelsListCount = $category->where('categories.seo_name', '=', $type) ->join('category_hotel', 'categories.id', '=', 'category_hotel.category_id') ->join('hotels', 'category_hotel.hotel_id', '=', 'hotels.id') ->where('hotels.main_city_id', '=', $thisMainCityId) ->orderBy('hotels.id', 'DESC') ->count();
<?php define('_MEXEC', 'OK'); require_once($_SERVER['DOCUMENT_ROOT'] . "/system/config/app.php"); if(!isset($_GET['start']) && !isset($_GET['end']) && !is_numeric($_GET['start']) && !is_numeric($_GET['end'])){ $start = 0; $end = 8; }else{ $start = $_GET['start']; $end = $_GET['end']; } $mainCity = new MainCity(); $topCities = $mainCity->where('top_cities', '=', 1)->skip($start)->take($end)->get(); ?> <div class="hotel-thumb-set col-xs-12 no-padding"> <?php foreach($topCities as $topCity){ $hotel = new Hotel(); $countHotels = $hotel->where('main_city_id', '=', $topCity->id)->count(); ?> <div class="hotel-thumb col-sm-3"> <a href="<?php echo HTTP_PATH; ?>sri-lanka/hotels-<?php echo implode('-', explode(' ', strtolower($topCity['name']))); ?>"> <?php $filename = DOC_ROOT . 'uploads/main-city/' . $topCity['image']; if(file_exists($filename) && $topCity['image'] != "") { ?> <img src="<?php echo HTTP_PATH; ?>timthumb.php?src=<?php echo HTTP_PATH; ?>uploads/main-city/<?php echo $topCity['image']; ?>&w=239&h=100"> <?php }else{ ?> <img src="<?php echo HTTP_PATH; ?>timthumb.php?src=<?php echo HTTP_PATH; ?>images/no_image.jpg&w=239&h=100"> <?php } ?>
if(!isset($_GET['mainCity']) && (strlen($_GET['mainCity']) < 1)){ die(header('Location: ' . DOMAIN . '404')); } $_SESSION['page_url'] = ($_GET['page_url']) ? DOMAIN . $_GET['page_url'] : DOMAIN; $_SESSION['eagerLoad'] = 30; $mainCity = new MainCity(); $subCity = new SubCity(); $hotel = new Hotel(); $hotelImage = new HotelImage(); $mPlace = urldecode($_GET['mainCity']); $mPlace = str_replace('-', ' ', $mPlace); $title = ucwords($mPlace); $bCrumb = ucwords($mPlace); $subCityList = $mainCity->where('main_cities.name', '=', $mPlace) ->join('hotels', 'main_cities.id', '=', 'hotels.main_city_id') ->join('sub_cities', 'hotels.sub_city_id', '=', 'sub_cities.id') ->orderBy('sub_cities.name', 'ASC') ->groupBy('sub_cities.name') ->select('sub_cities.name', 'sub_cities.seo', 'sub_cities.id') ->get(); if(!isset($_GET['subCity']) || (strlen($_GET['subCity']) < 1)){ //by main city $hotelsList = $mainCity->where('main_cities.name', '=', $mPlace) ->join('hotels', 'main_cities.id', '=', 'hotels.main_city_id') ->orderBy('hotels.id', 'DESC') ->skip(0) ->take(30) ->get(); }else if(isset($_GET['subCity']) && (strlen($_GET['subCity']) > 0)){
<?php define('_MEXEC', 'OK'); require_once($_SERVER['DOCUMENT_ROOT'] . "/config/app.php"); $_SESSION['page_url'] = HTTP_PATH; $hotel = new Hotel(); $mainCity = new MainCity(); $hotelImage = new HotelImage(); $news = new News(); $featuredHotels = $hotel->where('is_featured', '=', 1)->with('mainCity', 'subCity')->orderBy('id', 'DESC')->get(); $newsData = $news->where('status', '=', 1)->take(4)->get(); $topCities = $mainCity->where('top_cities', '=', 1)/*->take(2)*/->get(); $otherCities = $mainCity->where('top_cities', '=', 0)->get(); ?> <!DOCTYPE> <html> <?php require_once(DOC_ROOT . 'includes/head.php'); ?> <body> <div id="wrapper"> <?php include(DOC_ROOT . 'includes/header.php'); ?> <div id="content"> <div class="home_banner home" style="background-image:url(<?php echo HTTP_PATH; ?>images/banner_home_3.jpg);"> <div class="container"> <?php include(DOC_ROOT . 'includes/booking-form.php'); ?> </div> </div> <div class="container"> <div class="row"> <div class="col-xs-12 no-padding"> <div class="col-xs-12 no-padding">