Scheduling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been trying to wrap my head around this for the last day or two but just can't seem to figure it out.. anyone who's up to the challenge please pipe up! Here's the situation:

I'm creating a tool to manage employee shifts. There are 3 shifts per day which are always at the same times. I have a javascript calendar in which the user selects their "start date". This passes year, month and day values through the URL to a page. I do a checkdate() to ensure the date is valid on the Gregorian calendar (in case the user was messing around and manually entering values in the URL). If checkdate is true, proceed, else pop an error. Simple so far, but here's where I'm hitting a wall.

Problem 1) I need to display the three shifts for that day as well as the next 6 days in a row (basically, a week's worth). Each shift on each day needs to display a drop-down with all the available users as well as an entry for "open shift". This form once submitted will update all those values, in case any of them changed.

Problem 2) How to store and manage the data in the database. I want it to be self sustaining, but I'm drawing a blank on how I can manage this without hammering out queries to check if the record of a certain shift exists and create one if it doesn't.

To note, each employee has a unique user id (int value entered when the employee is initially created) which is likely what I would store in the "schedule" table (shift_userid) to keep the database size down, and just in case a user changes their actual first or last name (say they get married?). The drop-down lists will need to display the employee names.

I'm thinking along the lines of using arrays to store all the data before spitting it out, but I'm really not that great with arrays yet. Plus updating the form with 21 different fields on it... how to identify them and make sure they update the right fields in the database?

Any tips or suggestions would be welcome. Cheers!

Armando

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux