Esempio n. 1
0
 public function getTourURL($id)
 {
     $findRow = Tours::find($id);
     $aliasLang = "alias_" . Lang::locale();
     $alias = $findRow->{$aliasLang};
     $urlTour = asset('/') . Lang::get('slugs.tours') . "/" . $alias . "/" . $findRow->tour_code;
     return $urlTour;
 }
Esempio n. 2
0
 public function show($tourSlug, $tour_code)
 {
     $tourDetails = Tours::where('tour_code', $tour_code)->first();
     $title = Translations::getTranslation($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_title', Lang::locale())->value;
     $description = Translations::getTranslation($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
     $destination = Tours::firstOrFail()->destination;
     $parentDestination = Tours::firstOrFail()->parentDestination;
     $prvi_datum = "";
     $drugi_datum = "";
     $event_time = "";
     $time = "";
     $event_time_end = "";
     if ($tourDetails->is_event == 1) {
         if ($tourDetails->tour_date != '0000-00-00') {
             $timestampEventDate = strtotime($tourDetails->tour_date);
             $prvi_datum = " " . date("d.m.Y", $timestampEventDate) . "  ";
             if ($tourDetails->tour_date_end == '0000-00-00') {
                 $drugi_datum = " ";
             } elseif ($tourDetails->tour_date_end != '0000-00-00') {
                 $timestampEventDate = strtotime($tourDetails->tour_date_end);
                 $drugi_datum = "-  " . date("d.m.Y", $timestampEventDate) . "  ";
             }
         }
         if ($tourDetails->tour_time != '00:00:00') {
             $event_time = date('H:i', strtotime($tourDetails->tour_time)) . " " . Lang::get('lang.EventHours') . " ";
             $time = Lang::get('lang.EventTime');
             if ($tourDetails->tour_time_end != '00:00:00') {
                 $event_time_end = " - " . date('H:i', strtotime($tourDetails->tour_time_end)) . " " . Lang::get('lang.EventHours');
             } else {
                 $event_time_end = ' ';
             }
         } else {
             $event_time = ' ';
             $time = "";
             $event_time_end = ' ';
         }
     }
     $duration_sintax = '';
     if ($tourDetails->tour_duration != "0" && $tourDetails->tour_duration_unit != "0") {
         if ($tourDetails->tour_duration == 1) {
             $duration_sintax = Lang::get('lang.Tour' . substr_replace($tourDetails->tour_duration_unit, "", -1));
         } elseif ($tourDetails->tour_duration > 1) {
             $duration_sintax = Lang::get('lang.Tour' . $tourDetails->tour_duration_unit);
         } else {
             $duration_sintax = '';
         }
     }
     $tourMainImage = $tourDetails->getMainTourImage($tourDetails->TOUR_ID);
     list($tourCategory, $tourSubCategory) = $tourDetails->getTourCategory($tourDetails->TOUR_SUBCATEGORY);
     $tourIcon = $tourDetails->getTourIcon($tourDetails->ICON_ID);
     $profileImage = $tourDetails->getTourProfileImage($tourDetails->tour_profile_image);
     return view('tours.show', compact('tourDetails', 'title', 'destination', 'parentDestination', 'description', 'tourMainImage', 'tourCategory', 'tourSubCategory', 'tourIcon', 'profileImage', 'prvi_datum', 'drugi_datum', 'event_time', 'time', 'event_time_end', 'duration_sintax'));
 }
Esempio n. 3
0
 public function map($tour_code)
 {
     $tourDetails = Tours::where('tour_code', $tour_code)->first();
     $mapInit = Mapper::map($tourDetails->GLat, $tourDetails->GLng, ['zoom' => $tourDetails->Zoom, 'type' => 'ROADMAP']);
     $map = Mapper::render();
     return view('tours.partials.map', compact('map'));
 }
Esempio n. 4
0
 public function getOwnerTours($owner_id)
 {
     $findOwnerTours = Tours::where('jos_estateagent_owner_id', $owner_id)->published()->get();
     return $findOwnerTours;
 }