behrk2 Posted October 23, 2007 Share Posted October 23, 2007 Hey all, I wanted to run this idea past you. I am looking to create a PHP Calendar with a MySQL Backend. How is this going to work? I have NOOO idea!! Here is what I need it for: I am a resident assistant, and am looking to make a calendar system to schedule duty. Only one person is on duty during the weekdays (Mon, Tues, Wed, Thurs, Sun) and two people are on duty during the Weekends (Fri, Sat). There needs to be an input system where one RA can go in and say that Person A is on duty on Weekday X of Month Y of Year Z or Person A and Person B are on duty on Weekend Day X of Month Y or Year Z. I also want to be able to keep track of how many weekdays/weekend days each person has for each month. I would like to be able to display all of this in a calendar (which can be an html table or whatever). Does anyone have any ideas as to how I can implement this? (sql table columns, dealing with different amounts of days in each month, etc.)? Thanks! Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 23, 2007 Share Posted October 23, 2007 i suggest that you search for and potentially use a pre-written script. in other words: it's not very straightforward. i've done it using html tables, but i started with someone else's code for drawing the table; figuring out what date goes where, not leaving out leap day, etc. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted October 23, 2007 Share Posted October 23, 2007 You have a table of "shifts" and then store them in there as a date field (For the date, don't break it apart that is pointless) then query for all dates that are like $q = "select fields from `Shifts` Where Date > 2007/10/0 && Date <2007/11/1"; That will have all the "shifts" in October 07, and then just output a calendar using some logic. The idea is to use the date funciton to say if(date('w'),$today == 'S'){//new row} You get $today off the query date, its sorta tricky, but I don't have time to lay it out right now, but this will get u started. Quote Link to comment 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.