public function getCreate($data = null) { // ------------------------------------------------------------------------------------------------------------ // GET TRAVEL AGENTS // ------------------------------------------------------------------------------------------------------------ $travel_agents = \App\TravelAgent::orderBy('name')->get(); // ------------------------------------------------------------------------------------------------------------ // GET DESTINATIONS // ------------------------------------------------------------------------------------------------------------ $destinations = \App\Destination::orderBy('path')->get(); // ------------------------------------------------------------------------------------------------------------ // GET PLACES // ------------------------------------------------------------------------------------------------------------ $places = \App\Place::orderBy('long_name')->get(); // ------------------------------------------------------------------------------------------------------------ // GET TOUR OPTIONS // ------------------------------------------------------------------------------------------------------------ $tour_options = \App\TourOption::orderBy('name')->get(); // ------------------------------------------------------------------------------------------------------------ // GET TAGS // ------------------------------------------------------------------------------------------------------------ $tag_list = \App\Tag::orderBy('tag')->get(); // ------------------------------------------------------------------------------------------------------------ // SHOW DISPLAY // ------------------------------------------------------------------------------------------------------------ $this->layout->page = view($this->page_base_dir . 'create')->with('route_name', $this->route_name)->with('view_name', $this->view_name); $this->layout->page->data = $data; $this->layout->page->travel_agents = $travel_agents; $this->layout->page->destinations = $destinations; $this->layout->page->places = $places; $this->layout->page->tour_options = $tour_options; $this->layout->page->tag_list = $tag_list; $this->layout->page->required_images = $this->required_images; return $this->layout; }
function init_search_tour() { // ------------------------------------------------------------------------------------------------------------ // GET TRAVEL AGENT // ------------------------------------------------------------------------------------------------------------ $this->all_travel_agents = Cache::remember('all_travel_agent_list', 60, function () { return TravelAgent::orderby('name')->get(); }); // ------------------------------------------------------------------------------------------------------------ // GET DESTINATION // ------------------------------------------------------------------------------------------------------------ $this->all_destinations = Cache::remember('all_destination_list', 60, function () { return Destination::orderby('name')->get(); }); // ------------------------------------------------------------------------------------------------------------ // GET DEPARTURE LISTS // ------------------------------------------------------------------------------------------------------------ $month = ['', 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember']; $now = \Carbon\Carbon::now(); $departure_list = []; for ($i = 1; $i <= 12; $i++) { $departure_list[$now->year . str_pad($now->month, '2', '0', STR_PAD_LEFT)] = $month[$now->month] . ' ' . $now->year; $now->addMonth(); } $this->departure_list = $departure_list; // ------------------------------------------------------------------------------------------------------------ // GET BUDGET // ------------------------------------------------------------------------------------------------------------ $this->budget_list = [0 => "Semua budget", '0-1000000' => "Di bawah Rp. 1.000.000", '1000000-2500000' => "Rp. 1.000.000 - Rp. 2.500.000", '2500000-5000000' => "Rp. 2.500.000 - Rp. 5.000.000", '5000000-10000000' => "Rp. 5.000.000 - Rp. 10.000.000", '10000000-20000000' => "Rp. 10.000.000 - Rp. 20.000.000", '20000000' => "Rp. 20.000.000 ke atas"]; // ------------------------------------------------------------------------ // TOUR OPTIONS // ------------------------------------------------------------------------ $this->option_list = Cache::remember('all_option_list', 120, function () { return \App\TourOption::orderBy('name')->get(); }); // ------------------------------------------------------------------------ // SHORTCUT TOUR LIST // ------------------------------------------------------------------------ $this->tour_shortcut['destinations']['Eropa Barat'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'eropa,eropa-barat']); $this->tour_shortcut['destinations']['Eropa Timur'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'eropa,eropa-timur']); $this->tour_shortcut['destinations']['Asia'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'asia']); $this->tour_shortcut['destinations']['Australia'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'australia']); $this->tour_shortcut['destinations']['Amerika'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'amerika']); $this->tour_shortcut['destinations']['China'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'asia,china']); $this->tour_shortcut['destinations']['Domestik'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'domestik']); $this->tour_shortcut['tags']['#Religius'] = route('web.tour.tag', ['tag' => 'religius']); $this->tour_shortcut['tags']['#Adventure'] = route('web.tour.tag', ['tag' => 'adventure']); $this->tour_shortcut['tags']['#HoneyMoon'] = route('web.tour.tag', ['tag' => 'honeymoon']); ksort($this->tour_shortcut['destinations']); ksort($this->tour_shortcut['tags']); }