Jump to content

PHP, MySQL Calendar


behrk2

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.