I am trying to write out a calendar style html table with data in each cell, and with a column on the left that shows the times.
Basically it should look like this:
Time Mon Tues Wed Thur Fri Sat
8:00 data data2
9:30 data3 data4
10:00 data5 data6
11:00 data7 data8
The times are not always sequential.
There is no need to toggle from one month to the next and such, it’s just a listing of the current month to display the classes held on which days and at which times.
Very easy to do statically in html, but a bit more challenging dynamically.
Using MySQL, the table that holds the data looks like this:
schedule_id class_time class_title day_order
1 08:00 data 1
2 08:00 data2 3
3 09:30 data3 2
4 09:30 data4 4
5 10:00 data5 3
6 10:00 data6 5
7 11:00 data7 1
8 11:00 data8 3
The day_order field corresponds to the weekday - Mon is 1, Tues is 2, etc.
My query looks like this:
SELECT schedule_id, class_time, class_title, day_order
FROM `class_schedule` order by class_time, day_order
Here is the php code to write it out: