kamshory / ZKLibrary

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.
GNU General Public License v2.0
193 stars 176 forks source link

Disconnect function message #125

Open jmaxb2691 opened 1 year ago

jmaxb2691 commented 1 year ago

Hello I'm making a module for a opensource ERP using zklibrary . So using this module how use that ERP could get data from it directly to the ERP DB.

I made button for connect and disconnect devices, and I want to get some Success Message or Error Messages if I try to connect or disconnect devices.

I could do it with Connect Button Using this lines.

`<?php require 'zklibrary.php';

$zk = new ZKLibrary($ipdevice, $port); $zk->connect(); if($zk == TRUE){ echo "Device Connected"; } else { echo "Error : Can't connect to this device"; }

$zk->disableDevice();

?> ` Then I have other buttons to getUsers and getAttendance.

But when I want to disconnect the device using this lines I can't get the message "Device was disconnected"

`<?php require 'zklibrary.php';

$zk->enableDevice(); $zk->disconnect(); if($zk == TRUE){ echo "Device was disconnected"; } else { echo "Device was already disconnected / There's no device connected / Device couldn't disconnected"; } ?> ` any ideas?