Beispiel #1
0
 public function getTourCategory($subcategory_id)
 {
     $subCategory = DB::table('jos_estateagent_tour_subcategory')->where('TOUR_SUBCATEGORY', $subcategory_id)->first();
     $titleCategory = Translations::getTranslation($subCategory->TOUR_CATEGORY, 'jos_estateagent_tour_category', 'tour_category_title', Lang::locale())->value;
     $titleSubCategory = Translations::getTranslation($subcategory_id, 'jos_estateagent_tour_subcategory', 'tour_subcategory_title', Lang::locale())->value;
     return array($titleCategory, $titleSubCategory);
 }
Beispiel #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'));
 }
Beispiel #3
0
 public static function getTranslation($reference, $table, $field, $lang)
 {
     switch ($lang) {
         case "en":
             $lang = 1;
             break;
         case "de":
             $lang = 2;
             break;
         case "hr":
             $lang = 3;
             break;
         case "it":
             $lang = 4;
             break;
         default:
             $lang = 1;
     }
     $findRow = Translations::where('reference_id', '=', $reference)->where('reference_table', '=', $table)->where('reference_field', '=', $field)->where('language_id', '=', $lang)->first();
     return $findRow;
 }