1. Download the lab template from Blackboard 2. Extract it to a directory.
3. Rename the files/folders in accordance with the naming convention.
Solution The flow of the program is as follows:
1. A page is displayed prompting the user for the year and the month of which to display the calendar.
2. The user must select the Month and the Year from the form.
3. The user also has the option of selecting to mark a "special day" on the calendar.
If the user selects the special event they must input a special day, description and color for the event.
4. The user then presses the "Generate Calendar" button.
5. The form data is validated and the calendar is displayed according to the various options the user selected.
Requirements:
The program must by default seleft the current month and year.
The user can select the month and the year from two drop down lists.
Days that are not part of the calendar are greyed out.
The numbering must accuratly reflect the Calendar
All data must be validated
If the user seelcts the Mark a special Event option, the data associated with that feature must be validated as well.
Validation errors must appear on the screen. Prompting the user to fix them.
You must implement the following files & functions:
html.inc.php:
1. html_CalendarForm() - Generates the html form to prompt the user
2. html_Errors($errors) - Displays the User Errors.
3. html_Calendar($data) - Displays the html Calendar based on the data from getCalendarData() validation.inc.php:
1. validate_CalendarForm() - Validates the user input and returns an array of errors.
calendar.inc.php:
1. getCalendarData($month, $year) - Generates a single array of data containing all the information for the calendar.
Hints:
A calendar is always a grid of 7x6 rows.
It might be helpful to use two loops to generate the rows for the calendar.
If you pass the months and the year as integers you can use mktime to generate the appropriate timestamp.
It may be helpful to start as a single file and move your functions to the include files when they work It may also be helpful to try and just create the grid before you tackle the data structure.
Appendix Screenshot of the Form for the user.
Screenshot of the Calendar generated based on the previous form data.