[PHP] Time keeping in DB

2009-08-05 Thread Shawn McKenzie
So, obviously not PHP related, but I'm looking for thoughts on the best
way to record time sheets in a DB.  A time sheet for hours worked per
day, not like a time clock where you start and stop.

The two possibilities that I have thought of are (these are simplistic,
of course I'll be storing references to the user, the project code etc.):

1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
d6, d7) where the dX field holds the hours worked
2. One record for each day (date, hours)

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Time keeping in DB

2009-08-05 Thread Ashley Sheridan
On Wed, 2009-08-05 at 14:18 -0500, Shawn McKenzie wrote:
> So, obviously not PHP related, but I'm looking for thoughts on the best
> way to record time sheets in a DB.  A time sheet for hours worked per
> day, not like a time clock where you start and stop.
> 
> The two possibilities that I have thought of are (these are simplistic,
> of course I'll be storing references to the user, the project code etc.):
> 
> 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
> d6, d7) where the dX field holds the hours worked
> 2. One record for each day (date, hours)
> 
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com
> 
I'd go with a record per timesheet, so you might end up with more than
one timesheet per day. That way, it's just simple SQL to find out how
many hours you've worked on one day, or on one job, etc.

Thanks,
Ash
http://www.ashleysheridan.co.uk


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



Re: [PHP] Time keeping in DB

2009-08-05 Thread Jerry Wilborn
You don't mention what DB you're using, but mySQL can be quite a pain when
dealing with multiple time zones. Not impossible, but a hassle none the
less. Be sure to set aside a place to store this (and another spot for user
preferences to keep track of their TZ).
Jerry Wilborn
jerrywilb...@gmail.com


On Wed, Aug 5, 2009 at 2:20 PM, Ashley Sheridan 
wrote:

> On Wed, 2009-08-05 at 14:18 -0500, Shawn McKenzie wrote:
> > So, obviously not PHP related, but I'm looking for thoughts on the best
> > way to record time sheets in a DB.  A time sheet for hours worked per
> > day, not like a time clock where you start and stop.
> >
> > The two possibilities that I have thought of are (these are simplistic,
> > of course I'll be storing references to the user, the project code etc.):
> >
> > 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
> > d6, d7) where the dX field holds the hours worked
> > 2. One record for each day (date, hours)
> >
> > --
> > Thanks!
> > -Shawn
> > http://www.spidean.com
> >
> I'd go with a record per timesheet, so you might end up with more than
> one timesheet per day. That way, it's just simple SQL to find out how
> many hours you've worked on one day, or on one job, etc.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Time keeping in DB

2009-08-05 Thread Wolf

 Shawn McKenzie  wrote: 
> So, obviously not PHP related, but I'm looking for thoughts on the best
> way to record time sheets in a DB.  A time sheet for hours worked per
> day, not like a time clock where you start and stop.
> 
> The two possibilities that I have thought of are (these are simplistic,
> of course I'll be storing references to the user, the project code etc.):
> 
> 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
> d6, d7) where the dX field holds the hours worked
> 2. One record for each day (date, hours)
> 
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com

Depends on what you are looking to do..

Are you also needing to keep whether or not a specific project?  
If it is regular time/Overtime? 

It may be easier to set the database up: user,week,day,project,hours,type

Then you can query the info/user off that, it should allow you to expand as 
needed.

HTH,
Wolf

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