Your scripts will enable a professor to set up times for class advising. As you know, advising for the next term takes place about mid-way through the semester. Professors post a sheet of paper on their office door and students write their name in a time slot. Your scripts will enable that sign up process to be online.
As seen in the Use Case diagram below, professors can create appointments and view appointments. Students can sign up for appointments. Each of these tasks will require two scripts: one script to create a form, one script to process the form.
The following screen shot shows Dannelly's form that allows students to sign up for times. Of course, if the system were in full use, there would be many more available times for advising. You will need to design your own interfaces.
Your most difficult decision is the format of the data. You need to track what times are available for appointments and whether or not a student has signed up for each of those times. Should all that information be in single file? Should available appointment times be in one file and occupied appointments be in a different file? How will you parse the data? For example, should each line represent a different appointment (delimited by \n) or should each record be separated by a unique character like '|'?
Before you write any code you should think about how each script (at least six of them) will process the data. Consider what string processing and file processing functions PHP provides you. You already know that PHP provides a function to read an entire file into an array. You know there are functions to turn arrays into strings and strings into arrays. There are several different ways to search the contents of strings. yadda yadda... Next week we will cover how to search files, replace text inside files, remove lines from the middle of a file, etc.
Creating Appointment Times: Create a script that will allow a professor to select possible days and dates. The days should be one of any of the next 21 days, excluding Saturdays and Sundays. The times should be one or more times throughout the work day. So, the professor will pick one day and several times for that day. Then the professor will pick another day with different times for that day.
Viewing Appointment Times: A professor needs to know who is showing up today. This script should print a nice looking list of which students have appointments today and the times of their appointments. To get a glimpse at the next few days, also show the upcoming appointments and the past appointments.
Selecting an Appointment Time: The student will be presented with all the available (not already taken) times. Of course, the student needs to enter his/her name. You should make sure that student puts their full name on the form. A blank name or a short name, e.g. "Joe", are not acceptable.