ViperG Posted November 2, 2006 Share Posted November 2, 2006 I have someone that wants me to make them a timecard website. Where the employee can punch in, punch out, punch out for lunch and punch in for lunch. Then it saves all this to a database. I already have the part where they can create a new employee, and fill in the personal info, and the boss can remove new employes and change their info. Then the boss needs to be able to modify the times. each weak gives a total amount of hours. My question is how do I save the times? I was thinking to make a new table called Days, and have it have 4 fields that store the time. Quote Link to comment Share on other sites More sharing options...
Barand Posted November 2, 2006 Share Posted November 2, 2006 Something like this then[pre]employee timecard----------- ------------emp_id <------------- emp_idemp_name card_datereports_to time_in_1 time_out_1 time_in_2 time_out_2[/pre]If you want it for multiple departments then set up the employees like this[pre]1 | John Doe | 0 <-- Boss, reports to is 0 2 | Fred Smith | 1 3 | Mary Brown | 1 4 | Captain Slog | 0 <-- Boss, reports to is 0 5 | Luc Picard | 4 6 | Will Ryker | 4[/pre]the you know who the bosses are and who works for them Quote Link to comment Share on other sites More sharing options...
fenway Posted November 2, 2006 Share Posted November 2, 2006 Alternatively, you can just stores the times, and figure out in/out on your own. Quote Link to comment Share on other sites More sharing options...
gluck Posted November 2, 2006 Share Posted November 2, 2006 Adding four times will not solve the purpose. An employee can clock in and out as many times as he wants. So pretty much you just need an employee table with clock in and out with the time stamp of the transaction. So when you find the clock ins and outs of a day you aggregate by date of transaction. Quote Link to comment Share on other sites More sharing options...
Barand Posted November 2, 2006 Share Posted November 2, 2006 Not according to the given specification Quote Link to comment Share on other sites More sharing options...
fenway Posted November 2, 2006 Share Posted November 2, 2006 [quote author=Barand link=topic=113644.msg462030#msg462030 date=1162506679]Not according to the given specification[/quote]Who is this directed towards? Quote Link to comment Share on other sites More sharing options...
Barand Posted November 2, 2006 Share Posted November 2, 2006 Sorry, @gluck 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.