Hotel Booking Php Software Engineering

Posted on  by  admin

Active5 years, 7 months ago

I've built one, but I'm convinced it's wrong.

I had a table for customer details, and another table with the each date staying (i.e. a week's holiday would have seven records).

Development and Implementation of WEB-based Online Hotel Reservation System. 1Department of Management of. Keywords-hotel management system, online booking, information management system, B/S model. Acquired and the software that we are familiar with, the operating system of the Server is.

Php Software Free

Is there a better way?

I code in PHP with MySQL

hakre
164k33 gold badges323 silver badges638 bronze badges
Mei

12 Answers

I found it at this page:A list of free database models.

WARNING: Currently (November '11), Google is reporting that site as containing malware: http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=Firefox&hl=en-US&site=http://www.databaseanswers.org/data_models/hotels/hotel_reservations_popkin.htm

nickfnickf
389k176 gold badges596 silver badges692 bronze badges

I work in the travel industry and have worked on a number of different PMS's. The last one I designed had the row per guest per night approach and it is the best approach I've come across yet.Quite often in the industry there are particular pieces of information to each night of the stay. For example you need to know the rate for each night of the stay at the time the booking was made. The guest may also move room over the duration of their stay.

Performance wise it's quicker to do an equals lookup than a range in MySQL, so the startdate/enddate approach would be slower. To do a lookup for a range of dates do 'where date in (dates)'.

Roughly the schema I used is:

Satish Sharma
8,5686 gold badges22 silver badges44 bronze badges
PhpJ.D. Fitz.GeraldJ.D. Fitz.Gerald
2,2672 gold badges15 silver badges17 bronze badges

Some questions you need to ask yourself:

  • Is there a reason you need a record for each day of the stay?
  • Could you not just have a table for the stay and have an arrival date and either a number of nights or a departure date?
  • Is there specific bits of data that differ from day to day relating to one customer's stay?
Shaun AustinShaun Austin
3,2532 gold badges19 silver badges27 bronze badges

Some things that may break your model. These may not be a problem, but you should check with your client to see if they may occur.

  • Less than 1 day stays (short midday stays are common at some business hotels, for example)
  • Late check-outs/early check-ins. If you are just measuring the nights, and not dates/times, you may find it hard to arrange for these, or see potential clashes. One of our clients wanted a four hour gap, not always 10am-2pm.
DancingFoolDancingFool
1,2471 gold badge7 silver badges10 bronze badges

Wow, thanks for all the answers.

I had thought long and hard about the schema, and went with a record=night approach after trying the other way and having difficulty in converting to html.

I used CodeIgniter with the built in Calendar Class to display the booking info. Checking if a date was available was easier this way (at least after trying), so I went with it. But I'm convinced that it's not the best way, which is why I asked the question.

And thanks for the DB answers link, too.

Best,

Mei

Mei

What's wrong with that? logging each date that the customer is staying allows for what I'd imagine are fairly standard reports such as being able to display the number of booked rooms on any given day.

Joel MartinezJoel Martinez
33.6k24 gold badges116 silver badges177 bronze badges

The answer heavily depends on your requirements... But I would expect only storing a record with the start and stop date for their stay is needed. If you explain your question more, we can give you more details.

SamSam
1,5812 gold badges16 silver badges26 bronze badges

A tuple-per-day is a bit overkill, I think. A few columns on a 'stay' table should suffice.

Peter BaileyPeter Bailey
95.9k26 gold badges166 silver badges194 bronze badges

Is creating a record for each day a person stays neccessary? It should only be neccessary if each day is significant, otherwise have a Customer/Guest table to contain the customer details, a Booking table to contain bookings for guests. Booking table would contain room, start date, end date, guest (or guests), etc.

If you need to record other things such as activities paid for, or meals, add those in other tables as required.

Rob Gray

Small Hotel Booking Software

Rob Gray
2,0963 gold badges29 silver badges34 bronze badges

One possible way to reduce the number of entries for each stay is, store the time-frame e.g. start-date and end-date. I need to know the operations you run against the data to give a more specific advice.

Generally speaking, if you need to check how many customers are staying on a given date you can do so with a stored procedure.

For some specific operations your design might be good. Even if that's the case I would still hold a 'visits' table linking a customer to a unique stay, and a 'days-of-visit' table where I would resolve each client's stay to its days.

Asaf.

Asaf RSoftwareAsaf R
4,2938 gold badges38 silver badges62 bronze badges

You're trading off database size with query simplicity (and probably performance)

Your current model gives simple queries, as its pretty easy to query for number of guests, vacancies in room X on night n, and so on, but the database size will increase fairly rapidly.

Moving to a start/stop or start/num nights model will make for some ... interesting queries at times :)

So a lot of the choice is to do with your SQL skill level :)

Lea de GrootLea de Groot

I don't care for the schema in the diagram. It's rather ugly.

Schema Abstract

Table: Visit

The Visit table contains one row for each night stayed in a hotel.

Note: Visit contains

  • ixVisit
  • ixCusomer
  • dt
  • sNote

Table: Customer

  • ixCustomer
  • sFirstName
  • sLastName

Table: Stay

The Stay table includes one row that describes the entire visit. It is updated everytime Visit is udpated.

  • ixStay
  • dtArrive
  • dtLeave
  • sNote

Notes

A web app is two things: SELECT actions and CRUD actions. Most web apps are 99% SELECT, and 1% CRUD. Normalization tends to help CRUD much more than SELECT. You might look at my schema and panic, but it's fast. You will have to do a small amount of extra work for any CRUD activity, but your SELECTS will be so much faster because all of your SELECTS can hit the Stay table.

Hotel Booking Php Software Engineering

I like how Jeff Atwood puts it: 'Normalize until it hurts, denormalize until it works'

For a website used by a busy hotel manager, how well it works is just as important as how fast it works.

JustinJustin
1,9305 gold badges35 silver badges61 bronze badges
Coments are closed
© 2019 - hublogoboss
Scroll to top