public function process()
 {
     global $cookie;
     parent::process();
     $swhere = parent::getSearchWhere();
     $featureCount = HotelFeature::getFeatureCount($swhere);
     $this->pagination($featureCount);
     $hotelList = HotelFeature::getFeatureList($swhere, $this->p, $this->n);
     self::$smarty->assign("listData", $hotelList);
     self::$smarty->assign("featureList", $this->FeatureType);
 }
Пример #2
0
		die(header('Location: ' . $_SESSION['page_url']));
	}

	if(!isset($_SESSION['step_01_completed']) || $_SESSION['step_01_completed'] != true){
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-01'));
	}

	if(!isset($_POST['csrf']) || $_POST['csrf'] != '83620581b63ecf30c23cd5f97cc84939'){
		$_SESSION['hotel_step_error'] = 'Some error occurred with the submission, please try again.';
		die(header('Location: ' . $_SESSION['page_url']));
	}else{
		if(!isset($_POST['hotel_feature'])){
			$_SESSION['hotel_step_error'] = 'Please select at least one feature.';
			die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-02'));
		}
		$hFeatures = $_POST['hotel_feature'];
		foreach($hFeatures as $fTId => $hFeature){
			$hType = $fTId;
			$hFIds = implode(',', $hFeature);

			$hotelFeatures = new HotelFeature();
			$hotelFeatures->feature_type_id = $hType;
			$hotelFeatures->hotel_id = $hotel_id;
			$hotelFeatures->feature_ids = $hFIds;
			$hotelFeatures->save();
		}

		$_SESSION['step_02_completed'] = true;
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-03'));
	}
?>
Пример #3
0
	if(!isset($_GET['seo_url']) && (strlen($_GET['seo_url']) < 1)){ die(header('Location: ' . DOMAIN . '404')); }
	$_SESSION['page_url'] = ($_GET['page_url']) ? DOMAIN . $_GET['page_url'] : DOMAIN;	

	$seo_url = $_GET['seo_url'];
	$hotel = new Hotel();
	$hotel = $hotel->where('seo_url', '=', $seo_url)->first();
	if(!$hotel){ die(header('Location: ' . DOMAIN . '404')); }
//$headDescription = $hotel->meta_description;
//$headKeywords = $hotel->meta_keyword;
	$mainCity = new MainCity();
	$mainCity = $mainCity->find($hotel->main_city_id);
	$subCity = new SubCity();
	$subCity = $subCity->find($hotel->sub_city_id);

	$bCrumb = (trim(strtolower($subCity->name)) == trim(strtolower($mainCity->name))) ? 'Hotels in ' . ucwords($mainCity->name) . ' ' . ucwords($hotel->name) : ucwords($mainCity->name) . ' ' . ucwords($subCity->name) . ' ' . ucwords($hotel->name);
	$hFeature = new HotelFeature();
	$hFeatures = $hFeature->where('hotel_id', '=', $hotel->id)->get();
	$hFeatureList = [];
	foreach($hFeatures as $hFeature){
		$fTypeName = new HotelFeatureType();
		$fTypeName = $fTypeName->find($hFeature->feature_type_id);
		$fIds = $hFeature->feature_ids;
		$fIds = explode(',', $fIds);
		$fItems = new HotelFeatureList();
		$fItems = $fItems->whereIn('id', $fIds)->get();
		foreach($fItems as $fItem){
			$hFeatureList[$fTypeName->type][] = $fItem->feature;
		}
	}

	$hAttribute = new HotelAttribute();
Пример #4
0
	}

	if(!isset($_POST['csrf']) || $_POST['csrf'] != '83620581b63ecf30c23cd5f97cc84939'){
		$_SESSION['hotel_step_error'] = 'Some error occurred with the submission, please try again.';
		die(header('Location: ' . $_SESSION['page_url']));
	}else{
		if(!isset($_POST['hotel_feature'])){
			$_SESSION['hotel_step_error'] = 'Please select at least one feature.';
			die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-02'));
		}
		$hFeatures = $_POST['hotel_feature'];
		foreach($hFeatures as $fTId => $hFeature){
			$hType = $fTId;
			$hFIds = implode(',', $hFeature);

			$hotelFeatures = new HotelFeature();
			$toRemFeatures = $hotelFeatures->where('hotel_id', '=', $hotel_id)->get();
			$toRemFs = [];
			foreach($toRemFeatures as $toRemFeature){
				$toRemFs[] = $toRemFeature->id;
			}
			$hotelFeatures->whereIn('id', $toRemFs)->delete();
			$hotelFeatures->feature_type_id = $hType;
			$hotelFeatures->hotel_id = $hotel_id;
			$hotelFeatures->feature_ids = $hFIds;
			$hotelFeatures->save();
		}

		$_SESSION['step_02_completed'] = true;
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-03'));
	}