The project we are going to build is a booking application for the Oakbridge Community Center. Most recreation centers rely on a face-to-face or telephone booking systems for their facilities. Realizing their membership is quite technologically literate, they have decided to offer online booking of the various sports facilities, meeting rooms, and public recreational and entertainment activities undertaken by the community center.
To the uninitiated, this project could be a rather daunting prospect. In fact, it is rather uncomplicated. Our approach was to use a date book metaphor. By segmenting a day into hourly increments during the center's business hours, we could visualize what needed to be done.
To actually see what we were talking about, we created the layout in Freehand MX. We imported the .png file used for the home page in Chapter 10 into Freehand MX. We then created the time strips by using the Rectangle tool and duplicated it nine times to recreate a ten-hour day. The result is shown in Figure 13.1.
After we knew what it would look like, we started planning the data. The question was, "What data do we need for the date book?" Obviously, we needed to identify which facility was being booked. We needed to identify who booked the facility. We also needed to know the duration of the booking and when the booking was needed. With that information in hand, we had to put it into terms the database would understand.
This required an addition to the data dictionary developed for the tour, as shown in Figure 13.2. As you can see, a new table named "bookings" is created. It will be composed of four fields:
bookID: This will be an auto-incrementing number used to identify the reservation.
facilityID: This will be another number that will actually point to an entry in the facilities table.
startDate: This will be a timestamp entry which will be used to keep track of the starting date and time. We do this because it is simpler for the database to perform the required calculations needed for the front end.
duration: This will be another number used to determine how much time, in seconds, is being blocked off. Seconds are the basic unit of time measurement in MySQL.
Note
The data dictionary shown is available for download from the book's web site. It is a .pdf file named Booking.