itstooloud Posted August 28, 2007 Share Posted August 28, 2007 Hello, I am new to this place. I am just trying to find someone that can shed some light or provide some guidance for what my brain can't seem to sort out. What I am trying to do is create a schedule that will block off times that are already booked, as well as color code a small calendar depending on whether there are AM or PM openings. I managed to create a working edition, but I took the easy route of making the time in 30min intervals and creating a column for each time (0800, 0830, 0900, etc) in the DB. Now I need to create it allowing ANY time to be booked for ANY interval. I have an idea as to what needs to be done, I am just not sure how to go about doing it. What I set-up was a table with the technicians names and times they can work that day. It simply had a column for name, column for start time (datetime field) and column for finish time (another datetime field). Then I had a bookings table with many columns for different fields to do with the booking, but it also had a field for the name and start/finish datetime columns. What I think I need to do is run a query first to grab the time range that someone is available that day. Format it somehow into a PHP array. Then look at the existing bookings and find the time free between the booking and the available hours using PHP. Display a color if there is availability in the AM, PM, or both. Then I need to create an HTML table to display the bookings and free time based on the DB info to allow creation of new bookings. Can anyone provide some guidance who has done something similar or would know how to do it? I just need the base of finding the free time between bookings and available hours and displaying a table with such info... Much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/67099-creating-a-phpmysql-scheduler-help/ Share on other sites More sharing options...
php_tom Posted August 28, 2007 Share Posted August 28, 2007 Hey. I lost you after the third paragraph, you'll have to explain again or put a link to your page. But for the times and intervals stuff, I'd use timestamps. Like for each shift of each employee or whatever have a DB entry with columns like the employee name or id, the timestamp of when they start work, and the timestamp of when they finish work. You can handle all the specifics of the timestamps with PHP's mktime(), time(), and strftime(). [Look these up in the PHP function reference if you don't know them] Maybe that helps a bit? Quote Link to comment https://forums.phpfreaks.com/topic/67099-creating-a-phpmysql-scheduler-help/#findComment-336540 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.