Exemplo n.º 1
0
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-02'));
	}else if(!isset($_SESSION['step_03_completed']) || $_SESSION['step_03_completed'] != true){
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-03'));
	}else if(!isset($_SESSION['step_04_completed']) || $_SESSION['step_04_completed'] != true){
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-04'));
	}

	if(isset($_SESSION['hotel_step_error']) && (strlen($_SESSION['hotel_step_error']) > 0)){
?>
<div><?php echo $_SESSION['hotel_step_error']; $_SESSION['hotel_step_error'] = ''; ?></div>
<?php } ?>
<?php
	$hotel_id = isset($_SESSION['editing_hotel']) ? $_SESSION['editing_hotel'] : -1;
	$room = new Room();
	$roomRate = new RoomRate();
	$addedRates = $roomRate->where('hotel_id', '=', $hotel_id)
		->join('room_types', 'room_rates.room_type_id', '=', 'room_types.id')
		->select('room_rates.*', 'room_types.name as room_type_name')
		->groupBy('season')->get();
	$roomTypes = $room->where('hotel_id', '=', $hotel_id)
		->join('room_types', 'rooms.room_type_id', '=', 'room_types.id')
		->select('rooms.*', 'room_types.name as room_type_name', 'room_types.id as room_type_id')
		->get();
?>		
<?php if(count($addedRates)){ ?>
<table class="table table-bordered">
<thead>
	<tr>
		<th>Season name</th>
		<th>Type of room</th>
		<th>Date start</th>
Exemplo n.º 2
0
	}

	$hAttribute = new HotelAttribute();
	$hAttribute = $hAttribute->where('hotel_id', '=', $hotel->id)->first();
	$usefulInfo = [];
	$usefulInfo['Airport transfer availability by hotel'] = (isset($hAttribute->is_airport_transfer) && (strlen($hAttribute->is_airport_transfer) > 0)) ? 'Yes' : 'No';
	$usefulInfo['Average airport transfer fee'] = (isset($hAttribute->airport_transfer_fee) && (strlen($hAttribute->airport_transfer_fee) > 0)) ? $hAttribute->airport_transfer_fee . ' USD' : '';
	$usefulInfo['Distance to airport'] = (isset($hAttribute->distance_to_airport) && (strlen($hAttribute->distance_to_airport) > 0)) ? $hAttribute->distance_to_airport . ' km' : '';
	$usefulInfo['Check-In from'] = (isset($hAttribute->check_in) && (strlen($hAttribute->check_in) > 0)) ? $hAttribute->check_in : '';
	$usefulInfo['Check-Out until'] = (isset($hAttribute->check_out) && (strlen($hAttribute->check_out) > 0)) ? $hAttribute->check_out : '';

	$roomImage = new RoomImage();
	$hotelImages = $roomImage->where('hotel_id', '=', $hotel->id)->get();

	$roomRate = new RoomRate();
	$roomRates = $roomRate->where('hotel_id', '=', $hotel->id)->get();

	$searchBag['check_in'] = isset($_POST['date_arriving']) ? date('Y-m-d', strtotime($_POST['date_arriving'])) : date('Y-m-d');
	$searchBag['check_out'] = isset($_POST['date_departure']) ? date('Y-m-d', strtotime($_POST['date_departure'])) : date('Y-m-d', time() + 86400);
	$searchBag['rooms'] = isset($_POST['search_num_of_room']) ? intval($_POST['search_num_of_room']) : 1;

	$bookedDate = new BookedDate();
	$room = new Room();
	$rmvdRoomIds = [];
	$bookedRooms = [];
	$avlblHotels = [];

	//remove already booked hotels
	// -----(========)----- or [==================] or [========)---------- or ----------(========]
	$rmvdHotels = $bookedDate->where('checked_in', '<=', $searchBag['check_in'])
		->where('checked_out', '>=', $searchBag['check_out'], 'AND')