}else if(!isset($_SESSION['step_02_completed']) || $_SESSION['step_02_completed'] != true){ 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>
$roomRate->net_rate = $serviceType['nr']; $roomRate->agent_rate = $serviceType['ar']; $roomRate->sell_rate = $serviceType['sr']; //additional info $roomRate->foreign_discount_rate = $rates['foreignDiscountRate']; $roomRate->foreign_min_price = $rates['foreignMinPrice']; $roomRate->local_discount_rate = $rates['localDiscountRate']; $roomRate->local_min_price = $rates['localMinPrice']; $roomRate->save(); } } foreach($rates['tableLocal'] as $bedTypeIdLocal => $bedTypeLocal){ foreach($bedTypeLocal as $serviceTypeIdLocal => $serviceTypeLocal){ $roomRate = new RoomRate(); //main attributes $roomRate->hotel_id = $hotel_id; $roomRate->room_type_id = $rates['type']; $roomRate->currency_id = 1; $roomRate->season = $rates['season']; $roomRate->start = $rates['from']; $roomRate->end = $rates['to']; //sub attributes $roomRate->service_type_id = $serviceTypeIdLocal; $roomRate->room_bed_type_id = $bedTypeIdLocal; //rates $roomRate->fit_rate = $serviceTypeLocal['fr']; $roomRate->net_rate = $serviceTypeLocal['nr']; $roomRate->agent_rate = $serviceTypeLocal['ar']; $roomRate->sell_rate = $serviceTypeLocal['sr'];
} } $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'])