开发者

Creating a timesheet for work using PHP MySQL [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 6 years ago.

Improve this question

I am trying to create a time-sheet for my work. I don't know if getting myself into a lot of work by doing this as 开发者_开发知识库I am quiet new to PHP and MYSQL but I do have a good understanding/knowledge

of the two. I want the below fields in my database.

  • Job
  • weekPeriod ------A list of weeks Monday > Sunday
  • dateWorked ------List Of dates in the form coming from a database e.g. 1/1/2011
  • startTime ------List of times from 12:00am>11:00pm 30 min intervals e.g. 11:30-12:30
  • endTime ------List of times from 12:00am>11:00pm 30 min intervals e.g. 11:30-12:30
  • totalHours ------Automated
  • amount ------Automated based on dayWorked
  • comments ------Any messages here

I want to be able to fill in some drop down boxes through a form that will then submit all information to my database.

I want the script to know that if the date worked is on a Weekday Mon-Fri e.g. my rate of pay is 30.00ph On a sat it is 35.00ph and on a Sunday it is 40ph

I then want to create a page where i select a particular week and see how many hours i worked and how much i earn and so on.

Please let me know if there is such a program already established or if this is something that requires a bit of time and if I could do it being new to PHP and MYSQL


Try this it is great what you are looking for:- phpcollab


I made exactly the same program, but build on the facebook platform. Some things that you might want to consider are:

  • Shift start time
  • Shift end time
  • Paid Breaks
  • Unpaid Breaks
  • Overtime
  • Calculate break entitlements for overtime
  • Different rates of pay
  • DST
  • What happens if you finish early?
  • When are you pay periods, and what time of day does it cut off (mine was at 3am!)

The key thing you need to do is set down your rules currently in place at work. E.G if you do over time, what do you get paid. Would this mean you are entitled to another break, is it paid? What happens when the clocks change?

Concentrate on getting the program logic to work out the correct pay for different scenarios. I would use arrays to imitate form input. Once you've got it working then build the interface.

In your database all you need is

 - Job
 - Start time (date/timestamp)
 - End time (date/timestamp)
 - Comments (text/varchar)

Then in a seperate table

 - Week number (UID)
 - Start Date (date/timestamp)
 - End Date (date/timestamp)

Everything else can be calculated easily and doesn't really need to be stored. This means your logic can be updated much more easy if you calculate it when you do your lookups.

I would look up the following function: http://php.net/manual/en/book.datetime.php


This works very well for me. It's in an advanced stage of development. http://www.simpleinvoices.org/

But if you want to use this project as practice to gain comfort with php/mysql, it would be a fairly straightforward learning project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜