Click here to Skip to main content
16,004,778 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am using PHP, MySQL to develop a website to be used in an educational institution.

One function of this is to allocate lectures when creating a batch. To allocate lectures to the starting batch, system will prompt available lectures based on their availability and qualifications. Then the course coordinator will take the decision.

My problem is how to check the availability of the lecture on a particular week day given time slot.(time slot is varying not fixed durations)

I am planning to keep lecture schedules in a table where it shows lecture_Id, Batch_Id, day, start_time, end_time, start_day , end_day.

Then when availability checking I need to write a complex query to check the available lecture_Id's. I couldn't figure out it yet.

Is there any other smart ways to do this?



Thanks
Posted
Comments
Mohibur Rashid 26-Apr-12 21:10pm    
Whats the deal with start_day and end_day?

why not just put two fields for lecture date and time:
StartTime type datetime
lecture length in minutes

SurangiTi 27-Apr-12 0:19am    
A batch may go for few months or an year. Teaching time will be on a specific day or more than one day for a week in a specific time duration.
For example; batch 1 will start on 1st of May 2012 and will end on 31st of July.And classes will held on Thursdays from 9.00 AM to 11.00 AM.
So if lecture A is assigned to teach in batch 1 he can't assigned to any class in Thursday 9.00 AM to 11.00 AM. but he may assign to a class on Thursdays 3.00 pm to 5.30pm.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900