コード例 #1
0
ファイル: ToursController.php プロジェクト: asker-hr/visit
 public function show($tourSlug, $tour_code)
 {
     $tourDetails = Tours::where('tour_code', $tour_code)->first();
     $id = $tourDetails->TOUR_ID;
     list($category_ID, $tourCategory, $tourSubCategory) = $tourDetails->getTourCategory($tourDetails->TOUR_SUBCATEGORY);
     if ($tourDetails->town_id == $tourDetails->parent_town_id) {
         $destinationName = getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = "";
     } else {
         $destinationName = getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = getTranslate($tourDetails->parent_town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     }
     $title = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_title', Lang::locale())->value;
     $meta_title = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'meta_title', Lang::locale())->value;
     $meta_description1 = getTranslate($tourDetails->parent_town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     $meta_description1 .= ", " . getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     $meta_description1 .= ", " . Lang::get('lang.MetaTitleForDestinations');
     $meta_description1 .= ", " . getTranslate($category_ID, 'jos_estateagent_tour_category', 'tour_category_title', Lang::locale())->value;
     $meta_description1 .= ", " . getTranslate($tourDetails->TOUR_SUBCATEGORY, 'jos_estateagent_tour_subcategory', 'tour_subcategory_title', Lang::locale())->value;
     $meta_description1 .= ", " . getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
     $meta_description2 = "";
     if (getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value != '') {
         $strings2 = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
         $meta_description2 = strip_tags($strings2);
     }
     $meta_description = strip_tags(shorttext($meta_description1 . $meta_description2, 180));
     $meta_keywords = Lang::get('lang.MetaKeywords');
     $description = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
     $profileDescription = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_profile_description', Lang::locale())->value;
     $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 = '';
         }
     }
     $languageString = '';
     if ($tourDetails->croatian == '1') {
         $languageString .= Lang::get('lang.Croatian') . ', ';
     }
     if ($tourDetails->english == '1') {
         $languageString .= Lang::get('lang.English') . ', ';
     }
     if ($tourDetails->german == '1') {
         $languageString .= Lang::get('lang.German') . ', ';
     }
     if ($tourDetails->italian == '1') {
         $languageString .= Lang::get('lang.Italian') . ', ';
     }
     if ($tourDetails->french == '1') {
         $languageString .= Lang::get('lang.French') . ', ';
     }
     if ($tourDetails->slovenski == '1') {
         $languageString .= Lang::get('lang.Slovenian') . ', ';
     }
     if ($tourDetails->ruski == '1') {
         $languageString .= Lang::get('lang.Russian') . ', ';
     }
     if ($tourDetails->spanjolski == '1') {
         $languageString .= Lang::get('lang.Spanish') . ', ';
     }
     if ($tourDetails->portugalski == '1') {
         $languageString .= Lang::get('lang.Portuguese') . ', ';
     }
     if ($tourDetails->madjarski == '1') {
         $languageString .= Lang::get('lang.Hungarian') . ', ';
     }
     if ($tourDetails->ceski == '1') {
         $languageString .= Lang::get('lang.Czech') . ', ';
     }
     if ($tourDetails->poljski == '1') {
         $languageString .= Lang::get('lang.Polish') . ', ';
     }
     $languageString = substr($languageString, 0, -2);
     $getCategoryLinks = Tours::find($id)->TourCategoryLinks;
     $categoryTitleLang = "jos_estateagent_town_category_links_" . Lang::locale();
     $getLinks = Tours::find($id)->TourLinks->where('jos_estateagent_town_links_publish', 1);
     $titleLang = "jos_estateagent_town_links_title_" . Lang::locale();
     $linkLang = "jos_estateagent_town_links_url_" . Lang::locale();
     $tourMainImage = $tourDetails->getMainTourImage($tourDetails->TOUR_ID);
     $tourIcon = $tourDetails->getTourIcon($tourDetails->ICON_ID);
     $profileImage = $tourDetails->getTourProfileImage($tourDetails->tour_profile_image);
     $visitsCount = $tourDetails->getTourVisits($tourDetails->TOUR_ID);
     $tourImages = Tours::find($id)->TourImages;
     $tourCategories = TourCategories::where('tour_category_published', '=', 1)->orderBy('tour_category_order')->get();
     return view('tours.show', compact('tourDetails', 'title', 'meta_title', 'meta_description', 'meta_keywords', 'getLinks', 'titleLang', 'linkLang', 'getCategoryLinks', 'categoryTitleLang', 'destinationName', 'parentDestinationName', 'description', 'tourMainImage', 'tourCategory', 'tourSubCategory', 'tourIcon', 'profileImage', 'profileDescription', 'languageString', 'prvi_datum', 'drugi_datum', 'event_time', 'time', 'event_time_end', 'duration_sintax', 'visitsCount', 'tourImages', 'tourCategories'));
 }
コード例 #2
0
ファイル: NavigationComposer.php プロジェクト: asker-hr/visit
 public function composerTourCategoriesInNavigation($view)
 {
     $view->with('tourCategories', TourCategories::where('tour_category_published', '=', 1)->orderBy('tour_category_order')->with('tourSubCategory')->get());
 }