1. Notes:
1. Use the following code to get the current day: "$current_day = date('N');"
2. For the purpose of this assignment, the numbers associated with the day of the week
will be.
1
2
3
4
5
6
7
Num
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Days of Week
String
3. The school apollo server, and likely your local server, have the timezone set to UCT
which is +6 hours (USA Central Time zone). I do not want you losing time resetting this
so just be aware of this setting when doing your assignment.
2. Functions:
1. Folder: create a folder entitled functions in your root PHP directory.
2. File: create a file called functions_ssp03.php in that folder.
3. fn_tableOpen(): Create a function entitled fn_tableOpen(). This function will have one
paramater for the tables caption. It will contain static code to open a table, apply your
CSS formatting class(es), and create the header columns. Your header columns will be
the same as what you did in SSPO2 which were Day, Details, and Time. Note, when
populating the day column with the functions below you will use the string (e.g.,
"Monday") instead of the number (e.g. "1").
4. fn_tableClose(): Create a function entitled fn_tableClose(). THis function will not have
any paramaters. It will contain static code for a table closing tag followed by two-line
breaks (e.g., "
").
5. fn_tableRowCurrent(): Create a function entitled fn_tableRowCurrent(). This function
will have three paramaters for the three different columns. You will have the/nCS 2623-Week 2 Assignment
appropriate code to display these parameters in a new row. Also, it will have CSS
coding to highlight the row. By that I mean change this rows background color to yellow
(e.g., #FFFF66). Sorry in advance if that does not align with your pages color scheme. I
need something standard for grading purposes.
6. fn_tableRow(): Create a function entitled fn_tableRow(). This will be the same as
fn_tableRowCurrent() except you will NOT have the special highlighting.
7. fn_dayOfWeek(): Create a function entitled fn_dayOfWeek(). This will have one
parameter for the numerical day of the week. You will return the actual string day of the
week. For example, if you get a 1 it will be "Monday", 2 it will be "Tuesday", etc.
Reference the table above! I expect you to use an if staement with a else if for this.
8. fn_dayDetails(): Create a function entitled fn_dayDetails(). Use a switch statement,
create details about your CS2623 study goals for eadh day of the week. The function will
take one parameter which is the numerical day of the week. For this assignment, you
must dedicate at least four days to the course with a certain amount of study time for
each day.
9. fn_dayTime(): Create a function entitled fn_dayTime(). Using an if else/if statement,
write code to give the amount of time you will study on CS2623 for days of the week.
For two of your four days, the study time will be the same. The other two must be
unique. For the ones with the same day, you must use an "OR" the logical operator.
3. Loops:
1. Folder: Create folder in your root directly entitled SSPO3.
2. File: Create a copy of your SSP02.php file and name it SSPO3. Save it in the SSP03
folder.
3. Navigation: Update your navigation to include the SSPO3 page on your SSP03.php.
4. Content: Remove the include dymanic content from your body. Where it was in your
SSP03.php file you will be entering PHP information for the following loops.
5. For Loop: Create a table with a for loop for each day of the week. Your table should
start on Monday and go to Sunday. Your caption should be "CS2623: Weekly Planner"
where will be your actual name. The tables content and syntax should be done with the
functions (minus the loop syntax). If the rows day is the current day than use
fn_tableRowCurrent() for the day rows. Otherwise, you would use fn_tableRow().
6. While Loop: Create a table with a while loop for the weekdays only. A weekday is
Monday to Friday. Your caption should be "CS2623: Weekday Planner" where will be
your actual name. The tables content and syntax should be done with the functions
(minus the loop syntax). If the rows day is the current day than use
fn_tableRowCurrent() for the day rows. Otherwise, you would use fn_tableRow().
7. Do-While Loop: Create a table with a do-while loop that starts from today and ends
on Sunday. Your caption should be "CS2623: To-Do Planner" where will be your actual
name.
Note: this table will end up being dynamic in that the number of rows will differ from day to
day. If it's Sunday you should still see a row for Sunday.
Fig: 1
Fig: 2