ZKLibrary icon indicating copy to clipboard operation
ZKLibrary copied to clipboard

Clear Attendance

Open zkenstein opened this issue 5 years ago • 5 comments

Question, how to clear attendance data for last 3 month only? is it possible?

zkenstein avatar Apr 02 '19 09:04 zkenstein

No. You must clear all attendance data

kamshory avatar Apr 10 '19 11:04 kamshory

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

Darkthecar avatar Jun 24 '19 16:06 Darkthecar

What device dou you have. I use Solution X-100C

kamshory avatar Jul 04 '19 04:07 kamshory

I have the same issue with Granding 5000T-C

samirqumsieh avatar Aug 27 '19 11:08 samirqumsieh

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

syedzain9 avatar Jul 04 '20 11:07 syedzain9