dnaextrim / php_zklib

Attendance Machine Library for PHP with a connection to the network using the UDP protocol and port 4370
http://dnaextrim.github.io/php_zklib/
GNU General Public License v2.0
162 stars 135 forks source link

Getting attendance data #23

Closed junaidranjha closed 6 years ago

junaidranjha commented 7 years ago

my device is connected i can get user data and attendance data but problem is i am not able to get attendance of last whole month its like if i am accessing getattendance() it returns data from last months 31st uptill now while i want it to get all the data. untitled

RahamSher commented 6 years ago

Dear @junaidranjha I get all the data by calling this function $zk->getAttendance().It return data without any issue.My problem is that I want the attendance of a specific user.Kindly guide if you have the key.

RahamSher commented 6 years ago

@suryacaprice & @junaidranjha I have the data but please guide me that how i differentiate check in and check out of a user,please I am stuck over here.

send2dawood commented 6 years ago

Two things to do 👍 1) go to zklib->zkattendance.php and function zkgetattendance() replace this line $state = hexdec( substr( $u[1], 56, 2 ) ); with this one $state = hexdec( reverseHex(substr( $u[1], 66, 2 )) );

2) zktest.php Replace this code while(list($idx, $attendancedata) = each($attendance)): if ( $attendancedata[2] == 14 ) $status = 'Check Out'; else $status = 'Check In';

With this code if ( $attendancedata[2] == 1 ) $status = 'Check Out'; else $status = 'Check In';

And you done !!!

RahamSher commented 6 years ago

Dear @send2dawood thank you for sharing your great idea.:+1:

effiehubahib commented 6 years ago

@RahamSher , does it work on your part? because still it doesnt work in my code.

RahamSher commented 6 years ago

@effiehubahib it works for me.Thank you sir @send2dawood

RahamSher commented 6 years ago

sir @send2dawood actually I have a very big amount of data which take much time but I want to get the data of a specific date.How it would be possible.Kindly guide please.

shubhamoy commented 6 years ago

It's better you take a DB dump in case of size, the machine uses an SQLite DB and then process it on your system.