ZKLibrary icon indicating copy to clipboard operation
ZKLibrary copied to clipboard

attendance

Open omar0555 opened this issue 7 years ago • 7 comments

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

omar0555 avatar Nov 30 '17 18:11 omar0555

connect(); $zk->disableDevice(); $users = $zk->getUser(); ?>

$user) { $no++; ?>
No UID ID Name Role Password
getAttendance(); sleep(1); while(list($idx, $attendancedata) = each($attendance)): if ( $attendancedata[2] == 14 ) $status = 'Check Out'; else $status = 'Check In'; ?>
Data Attendance
Index UID ID Status Tanggal Jam

get user just not getAttendance?????

omar055 avatar Dec 01 '17 06:12 omar055

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

?>

kamshory avatar Dec 01 '17 14:12 kamshory

Thank you very much Good luck

omar0555 avatar Dec 09 '17 16:12 omar0555

@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

wombiro avatar Dec 26 '18 08:12 wombiro

No. Because device not push to the web server

kamshory avatar Jan 14 '19 11:01 kamshory

@kamshory how to insert for the new record only to db?

zkenstein avatar Apr 04 '19 07:04 zkenstein

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.

kamshory avatar Apr 18 '19 23:04 kamshory