Jump to content

Need PHP Script for a HTML Form.. Please help


srijon

Recommended Posts

Hi, I am new in PHP World, so please help me with the following problem. I have a HTML form which looks like the following..let’s say diagram. The DAY column is fixed, Sunday, Mondays..are just labels. I want my users to pick IN Time and OUT Time for different days and then select ON from dropdown list if they have picked any time, or otherwise select OFF. After submission I want these information to be saved in a table named "Attendance" and want to display the information later. Now would you please kindly tell me the PHP scripts for this and how would be the database table structure? 

 

 

Day                             In Time Out Time   Status

Sunday (fixed)            2:00 PM 4:05 PM     ON

Monday (fixed)                       -- --             OFF

Tuesday (fixed)                  2:00 PM 4:05 PM     ON

Wednesday (fixed)             --             --             OFF

Thursday (fixed)                 2:00 PM   4:05 PM      ON

Friday (fixed)                         --   --             OFF

Saturday (fixed)                 2:00 PM   4:05 PM     ON

 

Thanks in Advance

 

Link to comment
Share on other sites

Hi, I am new in PHP World, so please help me with the following problem. I have a HTML form which looks like the following..let’s say diagram. The DAY column is fixed, Sunday, Mondays..are just labels. I want my users to pick IN Time and OUT Time for different days and then select ON from dropdown list if they have picked any time, or otherwise select OFF. After submission I want these information to be saved in a table named "Attendance" and want to display the information later. Now would you please kindly tell me the PHP scripts for this and how would be the database table structure? 

 

Do you really need the "On" and "Off" flag? seems redundant. If they have entered times shouldn't they be considered "On" already? unless you want to add someone on the schedule with zero hours. Seems to me that a the table should only require Entry Id (instead if a single column Primary Key, you could also do a combination of User and Date to create a unique primary key), User, Date, Time In, Time Out, (breaks???). One thing you need to consider when you design your table is to think of growth. While you might just need a set Sun-Sat calendar at this moment, what happens of you need to change in the future? And if you do change the schedule, wouldn't it be nice to be able to see what the user had as an old schedule?

 

As to the PHP script... Entry from HTML Forms into SQL is very simple to accomplish, W3schools should have everything you need to create that script. You're looking at maybe a dozen lines of code to be off and running. Start writing it up and post to us what you come up with and we'll guild you in the right direction.

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.