CSIS0521 Concepts and Tools for
Software Development
Assignment 2


Due Date: Nov 24, 2006.


Online Booking System Part I

The assignment is to implement an online booking system of the badminton court of the SAR School. The main booking page shows a monthly view calendar. (booking.php) The current month will be displayed at the beginning. The user can change to other months by clicking on some buttons. The user then selects a particular day by clicking at a link on the calendar. The dayview will be presented (dayview.php), showing the booking detail of a particular day. The court is available from 9:00am to 6:00pm with 1 hour interval. If the time slot is already booked, a button "view" will be displayed and the user can view the detail of the booking (including the Time and User who made the booking). If the time slot is available, a "book" button will be provided, and the user can click the button to do the booking. The database should be updated after that. (view.php and book.php for these function)


  1. The booking.php is given to you as example.

  2. You are required to write the dayview.php to display the dayview. Since database is not implemented yet, you can just display "Book" on all time slot.

  3. You can use the following code in the book.php to check whether you pass the correct information to the script:
    <? php
    phpinfo();
    ?>

  4. A sample script is available from
    http://www.cs.hku.hk/~kpchan/CSIS0521/html/booking.php
    You can try to run the script to see what is expected from the assignment

  5. The booking.php script will be discussed in class/tutorial.


Some useful notes

  1. You may find the following php function useful in writing dayview.php. You can find the detail description of the functions on www.php.net (use the search function)
    date() strtotime()
    Note that the value returned by strtotime is in seconds. You can added a number of seconds to this values to get other time.

  2. When you want to display the html in a new windows, use target="_blank" attribute in either the <a href> tag, or <form> tag.
    e.g.
    <a href=URL target="_blank">This link will be opened in a new window</a>
    or
    <form script=scriptname method="post" target="_blank"> will open a new window when the form is submitted.

  3. You can use the following getvar() function to get all the GET parameters into variables:
    function get_vars() {
    foreach($_GET as $key => $value) {
    global $$key;
    $$key = $value;
    }
    }