This application is necessarily simple and incomplete to make it actually fit within the confines and mandate of this book. For this and subsequent samples, we offer a list of suggested improvements or changes you can do as exercises to complete the application and gain some experience playing with the appropriate technologies.
Change the Daily and Weekly Views
The daily and weekly views currently only list the appointments for a given day, chronologically ordered. An interesting improvement would be to actually show all the time slots in a working day and shade in those time slots where there is an appointment, similar to the UI shown in Figure 31-9.
Figure 31-9. Changing the way appointments display.
We have designed this web application for weeks in North America, which typically display Sunday through Saturday. In other parts of the world, weeks often display from Monday through Sunday.
A reasonably manageable exercise would be to convert this sample to display weeks from Monday through Sunday, or even to make the display user configurable.
Delete or Move Appointments
In a real-world appointment management system, people will need to cancel or move appointments. A good exercise is to add a page to remove an appointment for a user (perhaps let the user select a date and then make the user choose one of the appointments on that date) or create another page to let the user change the details of an appointment, including the dates and times during which it takes place.
Convert to PEAR Date Class
In this sample, we used a simple DateTime class we wrote to help manipulate dates and times. However, much of this is based on PHP timestamps, which have a limited range of dates. As a possible improvement, we could move this application to use the PEAR Date class and the Span class to help manage ranges of times.
Allow Overlapping Appointments
Our system, as currently implemented, only allows users to have one appointment scheduled at any given time, which prevents users from having one appointment spanning an entire week (perhaps indicating they are going on vacation) while still scheduling themselves an important phone call during that period.
A possible design change or improvement is to allow the system to work with multiple appointments at the same time. Perhaps some sort of warning could be implemented and shown, but otherwise the application would permit the user to do this.
Make System Multiuser
Finally, to truly fill in this system, we could try to make it a multiuser system, allowing users to invite each other to appointments. This would require a lot of work, and it is recommended that you first read the other samples to see how they implement multiuser systems.
However, these changes would take this from a sample to something truly compelling.