I am developing a php application to manage routine for subjects and teacher timing for my college. However I cannot get the idea (The Logic) behind the proper time management.
The classes are 50 to 100 minutes long and starting from 7 am to 2:30 pm.
I want my application to assign teacher as per the subject and semester and Year and the subjects are also assigned as the year and semester. The timing should not be collided during assignment of the teacher.
I have basic Table setup for my application for now as
Admin users table for admin log in:
1) id 2)username 3)password
Subjects table
1)id 2)name 3) year 4) semester 5) theory_marks 6) practicle_marks
Teacher Table
1)id 2)name 3)position 4)subject_id 5)teacher_time 6)year (which year subject as 1st or second or 3rd) 7)day (Sunday, Monday etc)
My first idea was very basic as to assign a different table for day only which will include column as day names and flag and subject id to know if the day for that subject is active or inactive. and Time in different table as column name as 7am, 730am etc.. however this also does not resolve the logic of assign flag as some subjects will be 100 min long and some will be 50 min only.
How can i make this happen? Right now im clueless behind the logic on how to manage time for subjects and teachers. Please, any help will be great.