ZKLibrary
ZKLibrary copied to clipboard
Clear Attendance
Question, how to clear attendance data for last 3 month only? is it possible?
No. You must clear all attendance data
Hello how is this, the library works fine but I can not use "clearAttendance" does not do anything, what is the correct way to make it work
What device dou you have. I use Solution X-100C
I have the same issue with Granding 5000T-C
Hi there
I think you need to change this function
public function clearAttendance(){
$command = CMD_CLEAR_ATTLOG;
return $this->execCommand($command);
}
with this function, this is working perfectly fine with (ZK uFace 800) and I think this also working with other types
function clearAttendance() {
$command = CMD_CLEAR_ATTLOG;
$command_string = '';
$chksum = 0;
$session_id = $this->session_id;
$u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6/H2h7/H2h8', substr( $this->received_data, 0, 8) );
$reply_id = hexdec( $u['h8'].$u['h7'] );
$buf = $this->createHeader($command, $chksum, $session_id, $reply_id, $command_string);
socket_sendto($this->socket, $buf, strlen($buf), 0, $this->ip, $this->port);
try {
socket_recvfrom($this->socket, $this->received_data, 2048, 0, $this->ip, $this->port);
$u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6', substr( $this->received_data, 0, 39 ) );
$this->session_id = hexdec( $u['h6'].$u['h5'] );
return substr( $this->received_data, 39 );
}catch(exception $e) {
return False;
}
}