コード例 #1
0
ファイル: Destinations.php プロジェクト: asker-hr/laravel3
 public function getDestinationURL($id)
 {
     $findRow = Destinations::find($id);
     $findParent = $findRow->parent;
     if ($findParent == 0) {
         $urlDestination = asset('/') . Lang::get('slugs.destinations') . "/" . $findRow->alias . "/" . $findRow->alias;
     } else {
         $findParentRow = Destinations::find($findParent);
         $urlDestination = asset('/') . Lang::get('slugs.destinations') . "/" . $findParentRow->alias . "/" . $findRow->alias;
     }
     return $urlDestination;
 }
コード例 #2
0
ファイル: HousesController.php プロジェクト: asker-hr/visit
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($alias)
 {
     $aliasLang = 'alias' . getLangAlias(Lang::locale());
     $houseDetails = Houses::where($aliasLang, $alias)->first();
     list($apartments, $rooms, $houses, $countpersons) = $houseDetails->countUnitsInHouse($houseDetails->id);
     if ($houseDetails->destination->parent == 0) {
         $destinationName = getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = "";
     } else {
         $destinationName = getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = getTranslate($houseDetails->destination->parent, 'jos_estateagent_town', 'title', Lang::locale())->value;
     }
     $title = $houseDetails->name;
     $meta_title = $houseDetails->getHouseTitleName($houseDetails->jos_estateagent_house_title_id) . ' ' . $houseDetails->name;
     if ($parentDestinationName != '') {
         $meta_title .= ' | ' . $parentDestinationName;
     }
     $meta_title .= ' | ' . $destinationName . ' | ' . $houseDetails->getHouseTitleName($houseDetails->jos_estateagent_house_title_id) . ' ' . $houseDetails->name;
     $meta_description = Lang::get('lang.MetaDescriptionPrivateURL');
     if (getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value != '') {
         $meta_description .= getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
     } else {
         if (getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value != '') {
             $meta_description .= getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
         } else {
             $meta_description .= getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'description', Lang::locale())->value;
         }
     }
     $meta_description_all = strip_tags(shorttext($meta_description, 120));
     $description = getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
     $houseImages = Houses::find($houseDetails->id)->HouseImages;
     if ($houseImages->isEmpty()) {
         $houseMainImage = "nophoto.jpg";
     } else {
         $houseMainImage = Houses::find($houseDetails->id)->HouseImages()->first()->fname;
     }
     $ownerTours = $houseDetails->owner->getOwnerTours($houseDetails->jos_users_id);
     $getCategoryLinks = Destinations::find($houseDetails->town_id)->DestinationCategoryLinks;
     $categoryTitleLang = "jos_estateagent_town_category_links_" . Lang::locale();
     $getLinks = Destinations::find($houseDetails->town_id)->DestinationLinks->where('jos_estateagent_town_links_publish', 1);
     $titleLang = "jos_estateagent_town_links_title_" . Lang::locale();
     $linkLang = "jos_estateagent_town_links_url_" . Lang::locale();
     $labelColor = array('label-warning', 'label-info', 'label-danger', 'label-success');
     $allDestinationTours = $houseDetails->destination->allDestinationTours($houseDetails->town_id);
     $allUnits = Units::published()->where('jos_estateagent_object_id', $houseDetails->id)->with('unitPrice')->orderBy('redoslijed')->get();
     return view('accommodation.show-house', compact('houseDetails', 'houseMainImage', 'houseImages', 'parentDestinationName', 'destinationName', 'description', 'meta_title', 'meta_description_all', 'apartments', 'rooms', 'houses', 'countpersons', 'allUnits', 'ownerTours', 'getCategoryLinks', 'getLinks', 'titleLang', 'linkLang', 'categoryTitleLang', 'labelColor', 'allDestinationTours'));
 }
コード例 #3
0
 public function show($slugParent, $slug)
 {
     $destinationDetails = Destinations::where('alias', $slug)->first();
     $id = $destinationDetails->jos_estateagent_town_id;
     $title = getTranslate($id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     if ($destinationDetails->subtitle != NULL) {
         $subtitle = getTranslate($id, 'jos_estateagent_town', 'subtitle', Lang::locale())->value;
     }
     $description = getTranslate($id, 'jos_estateagent_town', 'description', Lang::locale())->value;
     $meta_title = getTranslate($id, 'jos_estateagent_town', 'meta_title', Lang::locale())->value;
     $meta_description = getTranslate($id, 'jos_estateagent_town', 'meta_description', Lang::locale())->value;
     $meta_keywords = getTranslate($id, 'jos_estateagent_town', 'meta_keywords', Lang::locale())->value;
     $getCategoryLinks = Destinations::find($id)->DestinationCategoryLinks;
     $categoryTitleLang = "jos_estateagent_town_category_links_" . Lang::locale();
     $getLinks = Destinations::find($id)->DestinationLinks->where('jos_estateagent_town_links_publish', 1);
     $titleLang = "jos_estateagent_town_links_title_" . Lang::locale();
     $linkLang = "jos_estateagent_town_links_url_" . Lang::locale();
     $labelColor = array('label-warning', 'label-info', 'label-danger', 'label-success');
     $destinationMainImage = $destinationDetails->getMainDestinationImage($id);
     $destinationImages = Destinations::find($id)->DestinationImages;
     $countTours = $destinationDetails->countAllDestinationTours($id);
     $travelGuideCategories = TourSubCategories::where('TOUR_CATEGORY', Config::get('constants.TRAVEL_GUIDE_ID'))->where('tour_subcategory_published', 1)->orderBy('tour_subcategory_order')->get();
     return view('destinations.show', compact('travelGuideCategories', 'destinationDetails', 'title', 'subtitle', 'description', 'meta_title', 'meta_description', 'meta_keywords', 'getLinks', 'titleLang', 'linkLang', 'getCategoryLinks', 'categoryTitleLang', 'destinationMainImage', 'destinationImages', 'countTours', 'labelColor'));
 }
コード例 #4
0
ファイル: Destinations.php プロジェクト: asker-hr/visit
 public function getFullDestination($town_id)
 {
     $parentDestination = "";
     $destination = "";
     $findRow = Destinations::find($town_id);
     $findParent = $findRow->parent;
     if ($findParent == 0) {
         $parentDestination = "";
         $destination = getTranslate($town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     } else {
         $findParentRow = Destinations::find($findParent);
         $parentDestination = getTranslate($findParentRow, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $destination = getTranslate($town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     }
     return array($parentDestination, $destination);
 }