techker Posted August 28, 2008 Share Posted August 28, 2008 hey guy im looking in to making a small web site that i can access from my blackberry to log my hours i do at work.. can somebody guide me in the write direction fro the calculations? Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/ Share on other sites More sharing options...
jjacquay712 Posted August 29, 2008 Share Posted August 29, 2008 well what you could do is make a php file, that every time you accessed it, it would log the time to a database or txt file, then you could use that info to find out how many hours worked. Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/#findComment-628301 Share on other sites More sharing options...
techker Posted August 29, 2008 Author Share Posted August 29, 2008 well i was more thinking of input forms.from time to what time and lunch for every day. Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/#findComment-628312 Share on other sites More sharing options...
cooldude832 Posted August 29, 2008 Share Posted August 29, 2008 Sure The calculation for total hours worked = the sum of the individual inputted hours Hope it helps Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/#findComment-628315 Share on other sites More sharing options...
techker Posted August 29, 2008 Author Share Posted August 29, 2008 ya but what would be the php formula?cause lets say i make a database with monday input filed from to input field and it puts it in the database. to pull it out SELECT COUNT( `time` ) AS TotalNumber, SUM( `time` ) AS TotalPrice FROM `fc`; Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/#findComment-628319 Share on other sites More sharing options...
cooldude832 Posted August 29, 2008 Share Posted August 29, 2008 COUNT= number of matching row SUM = sum of values use sum Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/#findComment-628320 Share on other sites More sharing options...
techker Posted August 29, 2008 Author Share Posted August 29, 2008 so SELECT sum( `time` ) AS TotalNumber, SUM( `time` ) AS Totalhours FROM `fc`; Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/#findComment-628337 Share on other sites More sharing options...
cooldude832 Posted August 29, 2008 Share Posted August 29, 2008 sure give it a go Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/#findComment-628348 Share on other sites More sharing options...
techker Posted August 29, 2008 Author Share Posted August 29, 2008 problem.. every thing is working fine now..the only thing is that in my table time, i created field from_m1,from_m2..that represents from.. and 7 more to_m1,to_m2.. that represents the to in the days.. so i have this monday input filed(from_m1) to input filed(to_m1) now if i have more then one entry it screws up cause it show both. i need to assosiate monday to form_m1 and to_m1 and tuesday to form_m2 and to _m2...... i make one table week 1 and put the fields in that one. so the second time would go in week 2..... the only thing is for that to be associated ?(guess something like a drop down menu with week 1 week2 week 3 week 4 week 5..) the place that i would jam is how to determine if he selected week 1 to insert the data in that table.. Quote Link to comment https://forums.phpfreaks.com/topic/121783-hours-worked/#findComment-628626 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.