public function show($id) { $destination = Destination::where('ID_Destination', '=', $id)->firstOrFail(); $listDest = Destination::where('Status', '=', 'Active')->get(); $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); return View::make('Destinations.show', compact('destination', 'listDest'))->with('data', $data); }
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; ?>
for ($i = 0; $i < $package->count(); $i++) { if (File::exists($filename)) { File::delete($filename); } $package->delete(); } } }); /*---------------------------------------------------*/ //home Route::get('/', function () { $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['dinas'] = Dinasevents::select(DB::raw("Event_ID, Event_Picture, Event_Date, Event_Title, CONCAT(SUBSTRING(Event_Description,1,100),'...') as IsiEvent"))->orderby('Event_Date', 'DESC')->take(40)->get()->all(); $data['travel'] = Travel::where('Status', '=', 'Active')->take(40)->get()->all(); $data['destination'] = Destination::where('Status', '=', 'Active')->take(40)->get()->all(); $data['gallery'] = Gallery::where("Status", "!=", "Delete")->get()->all(); $data['about'] = About::get()->all(); Session::put('key', 'expiry', 1); $value = Session::get('key'); return View::make('home')->with('index', 'active')->with('data', $data); }); Route::get('post/listing', array('uses' => 'PostController@listing', 'as' => 'get.post.listing')); Route::get('post/{id}', array('uses' => 'PostController@single', 'as' => 'get.post.single'))->where(array('id' => '[1-9][0-9]*', 'slug' => '[a-zA-Z0-9-_]+')); Route::post('post/{id}', array('uses' => 'PostController@update', 'as' => 'post.post.update'))->where(array('id' => '[1-9][0-9]*')); Route::resource('user', 'UserController'); //resource Route::resource('/tourism', 'DestinationController'); Route::resource('/book', 'BooksController'); Route::resource('/rooms', 'RoomsController'); Route::resource('/facilities', 'FacilitiesController');