mattichu Posted June 10, 2012 Share Posted June 10, 2012 Hi, I have written a PHP clocking in system for staff to use. The user inputs their pin and the time they clocked in/out is recorded in an SQL database on the server. Ive found that the browser (firefox) occasionaly gets stuck when a user presses enter (maybe a dodgy internet connection) and prevents anyone else clocking in until refresh is pressed. Is there a way to store the data locally then upload it to the server every so often? or another way to fix this issue? many thanks! Quote Link to comment https://forums.phpfreaks.com/topic/263963-clocking-in-system/ Share on other sites More sharing options...
smoseley Posted June 11, 2012 Share Posted June 11, 2012 Use ajax to submit the clock-in. That will prevent the form from locking up. Quote Link to comment https://forums.phpfreaks.com/topic/263963-clocking-in-system/#findComment-1352776 Share on other sites More sharing options...
HDFilmMaker2112 Posted June 11, 2012 Share Posted June 11, 2012 Use ajax to submit the clock-in. That will prevent the form from locking up. I was thinking a locked table on the database. Are you using MyISAM or InnoDB for the DB Engine? Quote Link to comment https://forums.phpfreaks.com/topic/263963-clocking-in-system/#findComment-1352778 Share on other sites More sharing options...
smoseley Posted June 11, 2012 Share Posted June 11, 2012 A system like that will be several seconds between inserts, at least (consider it: one terminal, and a line of people typing in their ids to clock in). It's definitely not table locking. The problem sounds like the browser is waiting for an HTTP response. The solution will have to be JS-based. Honestly, though, a web-based time and attendance app is really not advisable. Most T&A systems have multiple servers- one at each reader, and a central app for the facility. Each card reader runs a local service, and they synchronize with the central DB via queues and daemons, ensuring all data is accurately recorded. I actually used to develop software for GE Security, so I know quite a bit about designing this type of system. If you want to duplicate that with a browser app, you can use Javascript to mimic a fat-client local service, queueing clock-ins and using ajax to verify that each is stored by the server. Quote Link to comment https://forums.phpfreaks.com/topic/263963-clocking-in-system/#findComment-1352779 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.