Jump to content

employee time sheet


will2002

Recommended Posts

Hi

Im pretty new to php and i am attempting to create a php/mysql application to store employees weekly hours worked ie. a timesheet.

I have developed basic address books using php/mysql so i am familiar with storing and retrieving data.

My main problem is trying to figure out how to store a new piece of information on an employee every week whithout over writing last weeks record. ie every week a new timesheet but also being able to record previous weeks timesheets.

Any application i have previously created has been one entry for each record eg name address etc. things that dont change every week.

 

Any suggestions at all would be greatly appreciated

 

Sorry if i have over complicated what is probably a pretty basic problem.

 

Link to comment
Share on other sites

I'm assuming you have two tables, right? A timecard table and an employees table. If that's the case, do an INSERT on the timecard table and and UPDATE on the employees table.

 

List your code and explain further what you want to do. What do you want to insert and what to you need to change in the employees table?

Link to comment
Share on other sites

well, what i would do is create a table containing an entry for each employee, give them a user and pass. make sure there is an id associated with that username.

 

create another table containing log in and out times and the userid of the person logging in and out.

 

on successful log in send a query to the database like 'insert into table (id, in) values(1, NOW())'

 

NOW() being a mysql datetime containing the servers current date and time at that point.

 

do the same on log out.

 

then when searching for a particular users log in and out time just search for thier user id in that table

Link to comment
Share on other sites

Thanks for the replies

 

The employees work on a building site and have no access to a computer. They complete a timesheet each week and hand it into the office so i guess wrathican your suggestion wouldnt work for this situation thanks for posting though.

 

I have developed a front end form which someone in the office will have to manually type the information on the timesheets into. it then saves the data in the database. the problem is is that i have only got one table and this weeks timesheet would overwrite last weeks and so on. ie at the moment i can only save one time sheet for each employee where i need to be able to store all past timesheets aswell.

i know i probably need a second table but im not sure how to save several timesheets for each employee as each timesheet is made up of 12 fields.

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.