Giter Club home page Giter Club logo

kamshory / zklibrary Goto Github PK

View Code? Open in Web Editor NEW
196.0 21.0 178.0 80 KB

ZKLibrary is PHP library for reading and writing data to attendance device using UDP protocol. This library useful to comunicate between web server and attendance device directly without addition program. This library is implemented in the form of class. So that you can create an object and use it functions.

License: GNU General Public License v2.0

PHP 100.00%
attendance-device attendance zk zk-technology fingerprint fingerprint-sensor fingerprint-authentication fingerprint-scanner fingerprint-validation facerecognition retina-api retinal-images biometric-identification fingerprint-identification

zklibrary's Issues

Get Big Amount of Attendance Data

We have a very big amount of data which take much time, some time connection has timeout, but I want to get the data of a specific date or limit data per request. How it would be possible. Please guide me to solve this issue. Thank you so much.

Add/Update functionality

Dear @kamshory first all thank you very much for guidance.Dear @kamshory is it possible to add/update the attendance of any user.Means If I want to add the attendance for userABC or want to update the attendance of userXYZ. Please guide.

Connect function return false

I have my zk-k14 fingerprint device accessible via local network and when i tried to connect using this library i get false connection
things i checked and still getting false connection :-
-the fingerprint device is accessible throw this ip : 192.168.1.201 AND port : 4370.
-i make sure that the device is accessible without any pin code or passwords.
when i try to connect to the device using the official SDK it connect successfully so using wireshark i compared the packet sent from the official sdk with the one using this library and i noticed.
-the packet sent using this library is an empty UDP packet.
-the one sent from the official sdk is a TCP packet with this content

PP.}............PP.}.......vw...PP.}....L.;zw...PP.}......3#w...Ver 6.60 Jun 16 2015.PP.}........w...~OS.PP.}........w...~OS=1.PP.}......L.w...~ExtendFmt.PP.}......Jcw...~ExtendFmt=0.PP.}......N|w...ExtendOPLog.PP.}.......vw...PP.}.......tw...ExtendOPLog.PP.}.......~w...PP.}......W|w...ExtendOPLog.PP.}.......~w...PP.}......V|w...ExtendOPLog.PP.}.......~w...PP.}......U|w...ExtendOPLog.PP.}.......~w...PP.}......8.w.	.~Platform.PP.}.......?w.	.~Platform=JZ4725_TFT.PP.}.......=w.
.~ZKFPVersion.PP.}........w.
.~ZKFPVersion=10.PP.}
...E.`Uw....(PP.}	......vw...	PP.}........w...WorkCode.PP.}........w...WorkCode=1.PP.}
.......w.
.~SSR.PP.}........w.
.~SSR=1.PP.}........w...~PIN2Width.PP.}.......zw...~PIN2Width=9.PP.}........w...FaceFunOn.PP.}.......vw...PP.}........w...~UserExtFmt.PP.}.......Vw...~UserExtFmt=0.PP.}....L.+zw...PP.}......##w...Ver 6.60 Jun 16 2015.PP.}......	=w...~ZKFPVersion.PP.}........w...~ZKFPVersion=10.PP.}........w...~IsOnlyRFMachine.PP.}.......ow...~IsOnlyRFMachine=0.PP.}........w...~OS.PP.}........w...~OS=1.PP.}.......|w.......PP.}.......vw...PP.}......[yw...,...PP.}.......vw...PP.}....2.?~w...PP.}X.......w...........................&.......................................P...............PP.}....2.>~w...PP.}X.......w...........................&.......................................P...............PP.}....2.=~w...PP.}X.......w...........................&.......................................P...............PP.}....2.<~w...PP.}X.......w...........................&.......................................P...............PP.}....2.;~w...PP.}X.......w...........................&.......................................P...............PP.}........w...~UserExtFmt.PP.}.......Vw...~UserExtFmt=0.PP.}.......zw...PP.}.......vw...PP.}......\5w...~SerialNumber.PP.}*.....m.w...~SerialNumber=OEG6060486051400346.PP.}........w...~DeviceName.PP.}.......-w...~DeviceName=K14.

can't connect to DW6(zkteco)

I'm sure the protocol TCP:4370,
but why are all zklib library connected using UDP?

I have to track code (function connect),
socket_recvfrom($this->socket, $this->received_data, 1024, 0, $this->ip, $this->port);
always return empty ,
But use zktime for win can connect

Disabling method before PHP processing

Hello! Thank you very much for so helpful library!
I have a question connecting with methods calling. I get the attendances and user data for variables. Can I enable and disconnect the device after this and then make the PHP array processing? For example, I have this code now:

       //connection here
        $data = $zk->getAttendance();
	$users = $zk->getUser();

	foreach($data as $key=>$value){
                 //processing        
         }

        $zk->enableDevice();
	$zk->disconnect();

I want to do like this:

        //connection here
        $data = $zk->getAttendance();
	$users = $zk->getUser();
        $zk->enableDevice();
	$zk->disconnect();

	foreach($data as $key=>$value){
                 //processing        
         }

Is it real? I would test this idea, but I work with frequently used gadget and don't want to interrupt its process :)

getting face template

Hi there, thanks for this awesome library.

I was wondering if there is any way to get the face template. I've read the communication protocol but it's pretty old (2006).

I'm aware that this library doesn't have this option, but I just want to know if any of you was able to achieve this.

Thank you in advance.

attendance

how get getAttendance()

getAttendance()
Retrieve the attendance log.

Return Value

getAttendance return array 2 dimension. The value of array is array containing.

serial number of the user
user id of the application
state
time of attendance in format YYYY-MM-DD HH:II:SS

update 2017

getAttendance not get all Att

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)

Attendance data format

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

not able to use this library on 32-bit windows

Hi thr,
this is my first post in Github, I may not know 'post' culture here.
so plz let me know if I missed anything..

first thing first: thank you very much for this library.
Issue:
I am not able to use zklibrary in 32-bit windows, though i m using it on 64-bit window n its working properly.

thanks in advance

connection problem

@kamshory I am unable to connect my biometric device using this library. I am using zkteco K14 . I successfully connect it with desktop app but on web it is not working. Could you please help me out. Do your library support zkteco k14 biometric device?

Could the library support Ronald Jack?

Dear Sir,

Could the library support Ronald Jack? I can connect RJ device with Zkeeper (C# library) but couldn't connect with ZKlibrary.

Could you help!

I cannot connect to ZKTeco Iface 950

the test.php page goes blank and nothing shows as if there is an error in creating the object //$zk = new ZKLibrary('192.168.1.202', 4370);
P.S. I changed the IP to the correct IP

Get image of a user

@kamshory , first of all I am very thankful to you for being there for guidelines.Dear @kamshory I want to get the image of a user from my bio metric device.Please guide me regarding this.

Codeigniter

How to connect this library to codeigniter?

Sending Data to library

Hi, could you please explain me, that how (and in which format) i will send data from device to test.php or zkLibrary?
How to use the library?
Please describe with an example.
Thanks

ZKLibrary with Online application

This library works only with localhost. When I host the code with it. It can no longer read the ip address/port or even access data!

getting attendance data

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

Return an empty Array No result

I tried a lot but i have always get an empty array and an empty table i have a zkteco mb160 and i get all data from the software they provide with the device but this library return an empty array can someone solve my issue
array (size=0)
empty

Which ZKTecho model works smoothly with this ZKLibray

Hello @kamshory,

I'm try to use your library with ZKTeco K40 attendance time terminal but it not giving me any response. I use this code,

<?php
include "zklibrary.php";
$zk = new ZKLibrary('192.168.1.102', 4370);
$zk->connect();
$zk->disableDevice();
$zk->testVoice();
$zk->enableDevice();
$zk->disconnect();
?>

Could you please help me that which ZKTecho model works smoothly with this library.

Thanks in advance.

setUserTemplate($data)

what is $data i have all values like size,pin,finger,id,pin and template ... how to place all these values in $data and in which format ... i have read the documentation but i did't get .. please help me to solve this issue

Blank page

getting blank page when i try to connect . i'm already using desktop software to get attendence but using these codes i'm getting a blank page , my device also has a communication key and a device id . i don't see any function to call that . what shall i do

how it works $zk ->getUserTemplate()

hi, could you explain how it works, for example:

Uid = 2, Finger_id = 0

$template = $zk -> getUserTemplate(2, 0);

No Works,

Thks in advanced.

Attendance state not working

Attendance state always give one(1). Another issue is the clearAttendance() method not working. Device Version is ZK 10.

The library can't connect to the device

I have a biometric device (Granding T9 model) that I want to use this library but I connection failed and this is the error :
object(ZKLibrary)#841 (9) { ["ip"]=> string(13) "192.168.1.201" ["port"]=> int(4370) ["socket"]=> resource(193) of type (Socket) ["session_id"]=> int(0) ["received_data"]=> string(0) "" ["user_data"]=> array(0) { } ["attendance_data"]=> array(0) { } ["timeout_sec"]=> int(5) ["timeout_usec"]=> int(5000000) }

This is the code I used
$zk = new ZKLibrary('192.168.1.201');
$zk->connect();
var_dump($zk);

P.S The T9 device don't have webserver builtin feature... is it needed for this library to work?... The previous I worked on which is "Granding gt100" have webserver in it and it worked.

Very Long Time Getting Data From Device

I used this library but it was very long time to get data from device (60-90 seconds), I think all many resource in web services would be taken, so All Aplication in same web services waiting for getting data finish.

Could you give me solution ? Thanks u very much

Set user state

Hello!

I want to disable or change his state to invalid for preventing the access to one zone, how can I do this? Is possible with this library? Thanks.

getSizeAttendance Not working

I have data in many machine but getSizeAttendance not working and i have try to many different way and your given way but its not working data are coming empty. So please guide me how can i get data from my EL-Dorado machine.

No results are showed

There is no results in when i run the test.php file. There is another thing that I need to do?

retrieve att data too slow

I found that when use this library connect through port 4370 to network it really slow. example I ping to device 1ms it spended 10sec when connect to device. if ping to device 20ms more than 200sec to connect.

note: only connection not yet retrieved data from device.

do you have any idea to solve this issue?

I think we could not make device ping 1ms or <1ms all the time.

thanks for your idea.

Best Regards,
NOV Piseth

cannot get data through public ip

I use your's package through call public ip( after that, it redirect to ip of fingerprint machine) but i cannot get anything ( when i connect fingerprint in LAN, i can get everthing), can you help me?

Add user card while setting user

Hello,

I would like to know if it is possible to add user with card number?
Function setUser takes $uid, $userid, $name, $password, $role) parameters, so is there any solution to add $cardNumber parameter?.

Get The Punch State

I always getting Check In as an output for the status and never change even I choose check out in the biometrics.

What is the possible problem?
And how to get the output the following (Check-In, Check-Out, Overtime-In, Overtime-Out) in my page?

It just always display Check In and never change.
The code I use is the following:

<html>
    <head>
        <title>ZK Test</title>
    </head>
    
    <body>
<?php
    include("zklib/zklib.php");
    
    $zk = new ZKLib("192.168.5.150", 4370);
    
    $ret = $zk->connect();
    sleep(1);
    if ( $ret ): 
        $zk->disableDevice();
        sleep(1);
    ?>
        
        <table border="1" cellpadding="5" cellspacing="2">
            <tr>
                <td><b>Status</b></td>
                <td>Connected</td>
                <td><b>Version</b></td>
                <td><?php echo $zk->version() ?></td>
                <td><b>OS Version</b></td>
                <td><?php echo $zk->osversion() ?></td>
                <td><b>Platform</b></td>
                <td><?php echo $zk->platform() ?></td>
            </tr>
            <tr>
                <td><b>Firmware Version</b></td>
                <td><?php echo $zk->fmVersion() ?></td>
                <td><b>WorkCode</b></td>
                <td><?php echo $zk->workCode() ?></td>
                <td><b>SSR</b></td>
                <td><?php echo $zk->ssr() ?></td>
                <td><b>Pin Width</b></td>
                <td><?php echo $zk->pinWidth() ?></td>
            </tr>
            <tr>
                <td><b>Face Function On</b></td>
                <td><?php echo $zk->faceFunctionOn() ?></td>
                <td><b>Serial Number</b></td>
                <td><?php echo $zk->serialNumber() ?></td>
                <td><b>Device Name</b></td>
                <td><?php echo $zk->deviceName(); ?></td>
                <td><b>Get Time</b></td>
                <td><?php echo $zk->getTime() ?></td>
            </tr>
        </table>
        <hr />
        <table border="1" cellpadding="5" cellspacing="2" style="float: left; margin-right: 10px;">
            <tr>
                <th colspan="5">Data User</th>
            </tr>
            <tr>
                <th>UID</th>
                <th>ID</th>
                <th>Name</th>
                <th>Role</th>
                <th>Password</th>
            </tr>
            <?php
            try {
                
               // $zk->setUser(999, '999', 'John Doe', '999', LEVEL_USER);
                $user = $zk->getUser();
                sleep(1);
                while(list($uid, $userdata) = each($user)):
                    if ($userdata[2] == LEVEL_ADMIN)
                        $role = 'ADMIN';
                    elseif ($userdata[2] == LEVEL_USER)
                        $role = 'USER';
                    else
                        $role = 'Unknown';
                ?>
                <tr>
                    <td><?php echo $uid ?></td>
                    <td><?php echo $userdata[0] ?></td>
                    <td><?php echo $userdata[1] ?></td>
                    <td><?php echo $role ?></td>
                    <td><?php echo $userdata[3] ?>&nbsp;</td>
                </tr>
                <?php
                endwhile;
            } catch (Exception $e) {
                header("HTTP/1.0 404 Not Found");
                header('HTTP', true, 500); // 500 internal server error                
            }
            //$zk->clearAdmin();
            ?>
        </table>
        
        <table border="1" cellpadding="5" cellspacing="2">
            <tr>
                <th colspan="6">Data Attendance</th>
            </tr>
            <tr>
                <th>Index</th>
                <th>UID</th>
                <th>ID</th>
                <th>Status</th>
                <th>Date</th>
                <th>Time</th>
            </tr>
            <?php
            $attendance = $zk->getAttendance();
            sleep(1);
            while(list($idx, $attendancedata) = each($attendance)):
                if ( $attendancedata[2] == 14 )
                    $status = 'Check Out';
                else
                    $status = 'Check In';
            ?>
            <tr>
                <td><?php echo $idx ?></td>
                <td><?php echo $attendancedata[0] ?></td>
                <td><?php echo $attendancedata[1] ?></td>
                <td><?php echo $attendancedata[2] ?></td>
               <!-- <td><?php echo $status ?></td>-->
                <td><?php echo date( "d-m-Y", strtotime( $attendancedata[3] ) ) ?></td>
                <td><?php echo date( "H:i:s", strtotime( $attendancedata[3] ) ) ?></td>
            </tr>
            <?php
            endwhile
            ?>
        </table>
        
        <fieldset>
            <legend><b>Example Using: </b></legend>
            
<pre style='color:#000000;background:#ffffff;'><pre>
<span style='color:#5f5035;'>&lt;?php</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>include</span><span style='color:#808030;'>(</span><span style='color:#0000e6;'>"zklib/zklib.php"</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#800000;font-weight:bold; '>new</span><span> ZKLib</span><span style='color:#808030;'>(</span><span style='color:#0000e6;'>"192.168.1.201"</span><span style='color:#808030;'>,</span><span> </span><span style='color:#008c00;'>4370</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$ret</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>connect</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>disableDevice</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>version</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>osversion</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>platform</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>fmVersion</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>workCode</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>ssr</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>pinWidth</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>faceFunctionOn</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>serialNumber</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>deviceName</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$user</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>getUser</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>while</span><span style='color:#808030;'>(</span><span> </span><span style='color:#800000;font-weight:bold; '>list</span><span style='color:#808030;'>(</span><span style='color:#797997;'>$uid</span><span style='color:#808030;'>,</span><span> </span><span style='color:#797997;'>$userdata</span><span style='color:#808030;'>)</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#400000;'>each</span><span style='color:#808030;'>(</span><span style='color:#797997;'>$user</span><span style='color:#808030;'>)</span><span> </span><span style='color:#808030;'>)</span><span> </span><span style='color:#800080;'>{</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>if</span><span> </span><span style='color:#808030;'>(</span><span style='color:#797997;'>$userdata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>2</span><span style='color:#808030;'>]</span><span> </span><span style='color:#808030;'>=</span><span style='color:#808030;'>=</span><span> LEVEL_ADMIN</span><span style='color:#808030;'>)</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$role</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#0000e6;'>'ADMIN'</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>elseif</span><span style='color:#808030;'>(</span><span style='color:#797997;'>$userdata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>2</span><span style='color:#808030;'>]</span><span> </span><span style='color:#808030;'>=</span><span style='color:#808030;'>=</span><span> LEVEL_USER</span><span style='color:#808030;'>)</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$role</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#0000e6;'>'USER'</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>else</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$role</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#0000e6;'>'Unknown'</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'UID: '</span><span style='color:#808030;'>.</span><span style='color:#797997;'>$uid</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'ID: '</span><span style='color:#808030;'>.</span><span style='color:#797997;'>$userdata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>0</span><span style='color:#808030;'>]</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'Name: '</span><span style='color:#808030;'>.</span><span style='color:#797997;'>$userdata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>1</span><span style='color:#808030;'>]</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'Role: '</span><span style='color:#808030;'>.</span><span style='color:#797997;'>$role</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'Password: '</span><span style='color:#808030;'>.</span><span style='color:#797997;'>$userdata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>3</span><span style='color:#808030;'>]</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800080;'>}</span><span></span>
<span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$attendance</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>getAttendance</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>while</span><span style='color:#808030;'>(</span><span> </span><span style='color:#800000;font-weight:bold; '>list</span><span style='color:#808030;'>(</span><span style='color:#797997;'>$idx</span><span style='color:#808030;'>,</span><span> </span><span style='color:#797997;'>$attendancedata</span><span style='color:#808030;'>)</span><span> </span><span style='color:#808030;'>=</span><span> </span><span style='color:#400000;'>each</span><span style='color:#808030;'>(</span><span style='color:#797997;'>$attendance</span><span style='color:#808030;'>)</span><span> </span><span style='color:#808030;'>)</span><span> </span><span style='color:#800080;'>{</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'Index: '</span><span style='color:#808030;'>.</span><span style='color:#797997;'>$idx</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'ID: '</span><span style='color:#808030;'>.</span><span style='color:#797997;'>$attendancedata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>0</span><span style='color:#808030;'>]</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'Status: '</span><span style='color:#808030;'>.</span><span style='color:#797997;'>$attendancedata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>1</span><span style='color:#808030;'>]</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'Date: '</span><span style='color:#808030;'>.</span><span style='color:#400000;'>date</span><span style='color:#808030;'>(</span><span style='color:#0000e6;'>"d-m-Y"</span><span style='color:#808030;'>,</span><span> </span><span style='color:#400000;'>strtotime</span><span style='color:#808030;'>(</span><span style='color:#797997;'>$attendancedata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>2</span><span style='color:#808030;'>]</span><span style='color:#808030;'>)</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800000;font-weight:bold; '>echo</span><span> </span><span style='color:#0000e6;'>'Time: '</span><span style='color:#808030;'>.</span><span style='color:#400000;'>date</span><span style='color:#808030;'>(</span><span style='color:#0000e6;'>"H:i:s"</span><span style='color:#808030;'>,</span><span> </span><span style='color:#400000;'>strtotime</span><span style='color:#808030;'>(</span><span style='color:#797997;'>$attendancedata</span><span style='color:#808030;'>[</span><span style='color:#008c00;'>2</span><span style='color:#808030;'>]</span><span style='color:#808030;'>)</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#800080;'>}</span><span></span>
<span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>getTime</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>enableDevice</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#797997;'>$zk</span><span style='color:#808030;'>-</span><span style='color:#808030;'>></span><span>disconnect</span><span style='color:#808030;'>(</span><span style='color:#808030;'>)</span><span style='color:#800080;'>;</span><span></span>
<span style='color:#5f5035;'>?></span>
</pre>
        
        </fieldset>
    <?php
       /* $zk->enrollUser('123');
        $zk->setUser(123, '123', 'Shubhamoy Chakrabarty', '', LEVEL_USER);
        $zk->enableDevice();
        sleep(1);
        $zk->disconnect();*/
    endif
?>
    </body>
</html>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.