ZKLibrary
ZKLibrary copied to clipboard
Attendance data format
@kamshory I have the array of all attendances.My array structure is like this. [0] => 1 [1] => 1 [2] => 8 //it is state.What does this means for??? [3] => 2016-12-27 11:51:33
And one more thing that I have all the attendances of users,Please guide me that how I differentiate the check in and check out of user.
The state maybe difference each device. Normally, we don't need the state. The state of check in and check out can be determined from the sequence of attendance at certain time intervals. You should compare it with other attendance at that time span, for example employee shifts.
My best practice, I get the attendance data and I save it into the database. I create a event trigger on the table on insert. If there is no attendance of the user at the time span, so the attendance will be considered as check in, else the attendance will be considered as check out. To get the real check out, select the last attendance of the user at the time span. But if the is only one attendance of the user at the time span, check out is not exist.
@kamshory hats off.Thank you sir...
sir can i take the break time??
I have any time. Tell me what can I do.
hello sir i mean can i take the break in /out for employee?
I live in Jakarta. How do we can talk?
Dear kamashory Using Skype My skype ID is abdzozo this is in this pic [cid:[email protected]]
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Kamshory, MTmailto:[email protected] Sent: Saturday, January 27, 2018 1:46 AM To: kamshory/ZKLibrarymailto:[email protected] Cc: abdulraheemzaqoutmailto:[email protected]; Commentmailto:[email protected] Subject: Re: [kamshory/ZKLibrary] Attendance data format (#10)
I live in Jakarta. How do we can talk?
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/kamshory/ZKLibrary/issues/10#issuecomment-360936225, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeQmarwWVrli0LdldoyDBWgPb_nPL2beks5tOmPRgaJpZM4P5zUD.
@RahamSher were you able to differtentiate between check in and check out? If yes, then how?
The first check on the day is check in and the last check on the day is check out. So, at least user check twice in a day.
So is the checkin/checkout showing now?
sir i want to take the leave time from the machine and the overtime can i take this moves??
In the Zkteco MB360 the check in and check out value is in position 66 and they are 2 characters.
00: entry 01: output 04: intermediate entry 05: intermediate output
zkattendance.php in zkgetattendance($self) function
while ( strlen($attendancedata) > 40 ) {
$u = unpack( 'H78', substr( $attendancedata, 0, 39 ) );
//24s1s4s11s
//$uid = hexdec( substr( $u[1], 0, 6 ) );
//$uid = explode(chr(0), $uid);
//$uid = intval( $uid[0] );
/*$u1 = hexdec( substr($u[1], 4, 2) );
$u2 = hexdec( substr($u[1], 6, 2) );
$uid = $u1+($u2*256);*/
$uid = trim(substr( $attendancedata, 4, 14 ), "\x0");
$id = intval( str_replace("\0", '', hex2bin( substr($u[1], 6, 8) ) ) );
$state = hexdec( substr( $u[1], 56, 2 ) );
$timestamp = decode_time( hexdec( reverseHex( substr($u[1], 58, 8) ) ) );
$sentido =hexdec(substr($u[1], 66,2)); // <---------------- check in - check out
# Clean up some messy characters from the user name
#uid = unicode(uid.strip('\x00|\x01\x10x'), errors='ignore')
#uid = uid.split('\x00', 1)[0]
#print "%s, %s, %s" % (uid, state, decode_time( int( reverseHex( timestamp.encode('hex') ), 16 ) ) )
array_push( $attendance, array( $uid, $id, $sentido, $timestamp, $state ) ); // <-- modify
$attendancedata = substr( $attendancedata, 40 );
}`