ZKLibrary
ZKLibrary copied to clipboard
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
connect(); $zk->disableDevice(); $users = $zk->getUser(); ?>
No | UID | ID | Name | Role | Password |
Data Attendance | |||||
---|---|---|---|---|---|
Index | UID | ID | Status | Tanggal | Jam |
get user just not getAttendance?????
<?php
include "zklibrary.php";
$zk = new ZKLibrary('192.168.1.102', 4370);
$zk->connect();
$zk->disableDevice();
$data = $zk->getAttendance();
foreach($data as $key=>$value)
{
$uid = $value[0];
$id = $value[1];
$state = $value[2];
$time = $value[3];
$sql = "insert into attendace(uid, id, state, time) values
('$uid', '$id', '$state', '$time')
";
mysql_query($sql);
}
?>
Thank you very much Good luck
@kamshory, is it possible to this code be triggered Everytime a check-in/checkout event is done?
I want to add other function as text sent to a number with state as soon as finger is identified. Thank sir for the library too
No. Because device not push to the web server
@kamshory how to insert for the new record only to db?
You can check it by the user ID and attendance time. If it not exists in your database, you can insert it to the database.