protected function saveModel($hospitality = false) { if (Input::get('id')) { $hospitality = Hospitality::find(Input::get('id')); } if (!$hospitality) { $hospitality = new Hospitality(); } //$contact = Contact::where('last_name', Input::get('contact'))->first(); if (Input::get('first_hotel_option')) { $hotel1 = Hotel::where('name', Input::get('first_hotel_option'))->first(); $hospitality->first_hotel_distance_from_airport = Input::get('first_hotel_distance_from_airport'); if ($hotel1) { $hospitality->first_hotel_option()->associate($hotel1); } } if (Input::get('second_hotel_option')) { $hotel2 = Hotel::where('name', Input::get('second_hotel_option'))->first(); $hospitality->second_hotel_distance_from_airport = Input::get('second_hotel_distance_from_airport'); if ($hotel2) { $hospitality->second_hotel_option()->associate($hotel2); } } if (Input::get('venue_id')) { $venue = Venue::find(Input::get('venue_id')); $hospitality->venue()->associate($venue); } $hospitality->save(); return $hospitality; }
public function MyAccount() { $hotels = Hotel::where('publicado', '=', 1)->count(); $translados = Translado::where('publicado', '=', 1)->count(); $especiais = EventoEspecial::where('publicado', '=', 1)->count(); $passeios = Passeio::where('publicado', '=', 1)->count(); $produtos = Produto::Where('publicado', '=', 1)->orderBy('created_at', 'DESC')->take(6)->get(); return View::make('cliente.minhaconta', compact('hotels', 'translados', 'especiais', 'passeios', 'produtos')); }
public function profile($id = null) { if (is_null($id) or !is_numeric($id)) { return Redirect::to('404.html'); } else { $hotel = Hotel::where('id', '=', $id)->firstOrFail(); if (is_object($hotel)) { return View::make('hotel.profile', array('hotel' => $hotel)); } else { return Redirect::to('404.html'); } } }
if(!isset($_POST['value']) || $_POST['value'] != '437d04d169b9b9a592f944802c6b3c39'){ die('Try again.'); } $string = isset($_POST['key']) ? $_POST['key'] : ''; if(strlen($string) < 1){ die(false); } $quaries = ['c' => [], 'h' => [], 'd' => []]; $objC = new SubCity(); $list1 = $objC->where('name', 'like', '%' . $string . '%') ->take(7) ->get(['name']); foreach($list1 as $list1Val){ $quaries['c'][] = $list1Val->name; } $objH = new Hotel(); $list2 = $objH->where('name', 'like', '%' . $string . '%')->take(7)->get(['name']); foreach($list2 as $list2Val){ $quaries['h'][] = $list2Val->name; } $objD = new Destination(); $list3 = $objD->where('destination', 'like', '%' . $string . '%') ->take(7) ->get(['destination']); foreach($list3 as $list3Val){ $quaries['d'][] = $list3Val->destination; } $quaries = json_encode($quaries); echo $quaries; ?>
public function getForm() { $event = Session::get('hotelbookingevent'); $hotel = Hotel::where('eventname', '=', $event)->get(); return View::make('hotelbooking.form')->with(array('event' => $event, 'hotel' => $hotel)); }
<?php define('_MEXEC', 'OK'); require_once($_SERVER['DOCUMENT_ROOT'] . "/config/app.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/includes/auth.php"); $_SESSION['page_url'] = DOMAIN . 'dashboard/list-hotels'; $hotel = new Hotel(); $myHotels = $hotel->where('member_id', '=', $_SESSION['user']['id'])->get(); ?> <!DOCTYPE> <html> <?php require_once(DOC_ROOT . 'includes/head.php'); ?> <body> <div id="wrapper"> <?php include(DOC_ROOT . 'includes/header.php'); ?> <div class="home_banner inner" style="background-image:url(<?php echo DOMAIN; ?>/images/banner_home.jpg);"> <div class="container"></div> </div> <div class="container"> <div class="container-fluid main-container"> <?php require_once(DOC_ROOT . 'includes/dashboard_left.php'); ?> <div class="col-md-9 col-sm-12 col-xs-12 content no-padding-sm no-padding-xs"> <h1 class="h1"><i class="fa fa-tachometer text-info"></i> List Hotels</h1> <hr> <p class="lead"></p> <div class="panel panel-default"> <div class="panel-heading"><strong>Your hotels</strong> <span class="label label-info"><?php echo count($myHotels); ?></span></div> <div class="panel-body"> <table class="table table-bordered"> <thead>
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 } ?> </a> <div class="row"> <div class="col-md-6 col-sm-6 col-xs-12"> <a href="<?php echo HTTP_PATH; ?>sri-lanka/hotels-<?php echo strtolower($topCity['name']); ?>"><?php echo $topCity['name']; ?></a>
public function autoComplete() { if (isset($_POST['queryString'])) { $queryString = $_POST['queryString']; // Is the string length greater than 0? if (strlen($queryString) > 0) { $hotels = Hotel::where('name', 'LIKE', '%' . $queryString . '%')->select('name')->where('val', 1)->limit(4)->get(); $cities = City::where('city', 'LIKE', '%' . $queryString . '%')->select('city')->where('val', 1)->limit(4)->get(); //dd(DB::getQueryLog()); if (!is_null($cities)) { if ($cities) { // While there are results loop through them - fetching an Object. foreach ($cities as $city) { $directory = 'a'; $images = glob($directory . "location.png"); $img_path = array_shift($images); $img_name = basename($img_path); echo ' <div class="auto_complete"> <a value="' . $city->city . '" category="city"> <span class="search_thumb"> <img class="search_thumb" src="/images/site/location.png" /> </span> <span class="category">' . $city->city . ' </span> </a> </div>'; } } } if (!is_null($hotels)) { if ($hotels) { // While there are results loop through them - fetching an Object. foreach ($hotels as $hotel) { $directory = public_path() . '/images/site/'; $images = glob($directory . "hotel.png"); $img_path = array_shift($images); $img_name = basename($img_path); echo ' <div class="auto_complete"> <a value="' . $hotel->name . '" category="hotel"> <span class="search_thumb"> <img class="search_thumb" src="/images/site/hotel.png" /> </span> <span class="category">' . $hotel->name . ' </span> </a> </div>'; } } } } else { echo 'Please Type Again To Start The Search'; } // There is a queryString. } else { echo 'There should be no direct access to this script!'; } }
</div> <div class="container hidden-xs"> <div class="row"> <div class="otherCityHotels col-xs-12 no-padding"> <h3 class="text-center">Other destinations in sri lanka you might be like to visit. Check rest of the <span class="w_700 blue-text">[<?php echo count($otherCities) ?>]</span> destinations</h3> <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingOne"> <h3 class="panel-title"><a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">Other destinations <i class="glyphicon glyphicon-menu-down"></i></a></h3> </div> <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne"> <div class="panel-body"> <?php foreach($otherCities as $otherCity){ $OtherHotel = new Hotel(); $countOtherCityHotels = $OtherHotel->where('main_city_id', '=', $otherCity->id)->count(); ?> <div class="item col-xs-6 col-sm-4 col-md-3"> <a href="<?php echo HTTP_PATH; ?>sri-lanka/hotels-in-<?php echo implode('-', explode(' ', strtolower($otherCity['name']))); ?>" class="pull-left"> <?php $filename = DOC_ROOT . 'uploads/main-city/' . $otherCity['image']; if(file_exists($filename) && $otherCity['image'] != "") { ?> <img src="<?php echo HTTP_PATH; ?>timthumb.php?src=<?php echo HTTP_PATH; ?>uploads/main-city/<?php echo $otherCity['image']; ?>&w=271&h=150" class="img-responsive"> <?php }else{ ?> <img src="<?php echo HTTP_PATH; ?>timthumb.php?src=<?php echo HTTP_PATH; ?>images/no_image.jpg&w=271&h=150" class="img-responsive"> <?php } ?> <div class="mask"> <h4 class="text-center text-white"><i class="fa fa-map-marker"></i> <?php echo $otherCity['name']; ?></h4> <h5 class="text-center text-white"><?php echo $countOtherCityHotels; ?> hotel<?php if($countOtherCityHotels > 1){ echo 's'; } ?></h5> </div> </a>
<div class="heading">Recently Added Hotels in <span class="color_2">Sri Lanka</span></div> <?php $hotel = new Hotel(); $activeHotels = $hotel->where('active_status', '=', 1)->take(6)->orderBy('id', 'DESC')->get(); foreach($activeHotels as $activeHotel){ ?> <div class="box_1"> <div class="main_thumbnail"> <?php $filename = DOC_ROOT . 'uploads/hotels/thumbnails/' . explode(',', $activeHotel->cover_photo)[0]; if(file_exists($filename) && explode(',', $activeHotel->cover_photo)[0] != ""){ ?> <img src="<?php echo HTTP_PATH; ?>uploads/hotels/thumbnails/<?php echo explode(',', $activeHotel->cover_photo)[0]; ?>" width="151" height="109" alt="new_hotel" onclick="makeAlert(<?php echo $activeHotel->id; ?>);" style="cursor:pointer;"/> <?php }else{ ?> <img src="<?php echo HTTP_PATH; ?>images/no_image.jpg" alt="image" width="151" height="109"/> <?php } ?> </div> <div class="hotel_name" onclick="makeAlert(<?php echo $activeHotel->id; ?>);"> <?php echo $activeHotel->name; ?> <input type="hidden" id="<?php echo $activeHotel->id; ?>" name="<?php echo $activeHotel->id; ?>" value="<?php echo $activeHotel->seo_url; ?>"/> </div> <?php $hotelImages = $activeHotel->cover_photo; $hotelImages = explode(',', $hotelImages); if(count($hotelImages) >= 3){ for($i = 0; $i < 3; $i++){ ?> <div class="small_thumbnail"> <?php $filename = DOC_ROOT . 'uploads/hotels/thumbnails/' . $hotelImages[$i];