AvesonThyBot / Hotel-Booking

OOP PHP mini project to create a hotel booking system.
MIT License
0 stars 0 forks source link

Hotel booking: UX flaw for booking hotel #1

Open AvesonThyBot opened 4 months ago

AvesonThyBot commented 4 months ago

Checking for a rooms availability is done through picking date range and then picking room type. if the room type is not free it will not show up. Instead it would be more benifical to show all the rooms that will be available and the quantity of room that will be free during that time. Also only allow them to book one as the data or fetch data actively on every step of redirecting or there will be colliding booking.

AvesonThyBot commented 4 months ago

SQL query ->

SELECT * FROM hotel_info WHERE roomName = ? AND NOT EXISTS ( SELECT 1 FROM hotel WHERE hotel.roomType = hotel_info.roomID AND ( (startDate <= ? AND endDate >= ?) OR (startDate >= ? AND startDate <= ?) OR (endDate >= ? AND endDate <= ?) ) );

This query checks if the date time is valid and then return all information about rooms roomName startDate endDate startDate (repeated) endDate (repeated) startDate (repeated) endDate (repeated)