srijon Posted March 14, 2011 Share Posted March 14, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/230635-need-php-script-for-a-html-form-please-help/ Share on other sites More sharing options...
.josh Posted March 15, 2011 Share Posted March 15, 2011 We're here to help you learn something, not to do your work for you. Read some tutorials, make an effort to learn. If you get stuck with something in particular then feel free to ask. If you aren't interested in doing that, then hire someone to do it for you. Quote Link to comment https://forums.phpfreaks.com/topic/230635-need-php-script-for-a-html-form-please-help/#findComment-1187556 Share on other sites More sharing options...
trinaryoc Posted March 15, 2011 Share Posted March 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/230635-need-php-script-for-a-html-form-please-help/#findComment-1187565 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.