ZKLibrary icon indicating copy to clipboard operation
ZKLibrary copied to clipboard

Attendance data format

Open RahamSher opened this issue 7 years ago • 13 comments

@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.

RahamSher avatar Oct 15 '17 16:10 RahamSher

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.

kamshory avatar Oct 16 '17 02:10 kamshory

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 avatar Oct 16 '17 02:10 kamshory

@kamshory hats off.Thank you sir...

RahamSher avatar Oct 16 '17 04:10 RahamSher

sir can i take the break time??

abdulraheemzaqout avatar Dec 25 '17 13:12 abdulraheemzaqout

I have any time. Tell me what can I do.

kamshory avatar Jan 07 '18 09:01 kamshory

hello sir i mean can i take the break in /out for employee?

abdulraheemzaqout avatar Jan 07 '18 10:01 abdulraheemzaqout

I live in Jakarta. How do we can talk?

kamshory avatar Jan 26 '18 23:01 kamshory

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.

abdulraheemzaqout avatar Jan 28 '18 15:01 abdulraheemzaqout

@RahamSher were you able to differtentiate between check in and check out? If yes, then how?

junaidranjha avatar May 21 '18 06:05 junaidranjha

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.

kamshory avatar Jun 01 '18 07:06 kamshory

So is the checkin/checkout showing now?

wombiro avatar Dec 26 '18 07:12 wombiro

sir i want to take the leave time from the machine and the overtime can i take this moves??

abdulraheemzaqout avatar Dec 27 '18 10:12 abdulraheemzaqout

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 );
            }`

gusbenites avatar Feb 14 '19 11:02 gusbenites