Open MrAhmedSayedAli opened 6 years ago
My best practice is clear all attendance log after move it into the database. For invalid date, you can fix it at
$timestamp = $this->decodeTime(hexdec($this->reverseHex(substr($u[1], 58, 8))));
One of my machine (very old - ver 6.40-09 Jan 26 2010) returning att data in 16 bytes instead of 40 and with different header length. So i had to change code:
$attendance_data = substr($attendance_data, 12);
while(strlen($attendance_data) > 16)
{
$u = unpack('H30', substr($attendance_data, 0, 15));
$u1 = hexdec(substr($u[1], 0, 2));
$u2 = hexdec(substr($u[1], 2, 2));
$id = $u1+($u2*256);
$state = hexdec(substr( $u[1], 18, 2 ) );
$timestamp = $this->decodeTime(hexdec($this->reverseHex(substr($u[1], 8, 8))));
array_push($attendance, array(0, $id, $state, $timestamp));
$attendance_data = substr($attendance_data, 16 );
}
@li-on Thank you brother.
i used $zk->getAttendance(); but it get 1671 record of +4700
another issuse on date it out wrong date like "2000-01-01 00:00:00" to fix it in sdk dll lib new device use function (SSR_GetGeneralLogData) if is (IsTFTMachine) and old device use function (GetGeneralExtLogData)