ZKLibrary
ZKLibrary copied to clipboard
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?.
The device that I used to develop this library is not support RFID card.
has anyone managed to add the $cardNumber field?
has anyone find a solution to get or set the cardNumber?
$u = unpack('H144', substr($user_data, 0, 72)); $u1 = hexdec(substr($u[1], 2, 2)); $u2 = hexdec(substr($u[1], 4, 2)); $uid = $u1+($u2*256); // 2 byte $role = hexdec(substr($u[1], 6, 2)).' '; // 1 byte $password = hex2bin(substr( $u[1], 8, 16 )).' '; // 8 byte $name = hex2bin(substr($u[1], 24, 48 )). ' '; // 24 byte $card = hexdec(reverseHex(substr($u[1], 72, 8))). ' '; // 4 byte $userid = hex2bin(substr($u[1], 98, 72)).' '; // 36 byte $passwordArr = explode(chr(0), $password, 2); // explode to array $password = $passwordArr[0]; // get password $useridArr = explode(chr(0), $userid, 2); // explode to array $userid = $useridArr[0]; // get user ID $nameArr = explode(chr(0), $name, 3); // explode to array $name = $nameArr[0]; // get name
how to get card from the database
Remember that this library is only to read attendance data and send it into your application. Card is not saved on the database but only on device. You are not necessary to read the card.
Does anyone found solution for how to read RFID card no and also write it on device? thanks
I did figure out.
On Wed, Mar 6, 2019 at 1:38 PM Tahseen Ullah [email protected] wrote:
Does anyone found solution for how to read RFID card no and also write it on device? thanks
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kamshory/ZKLibrary/issues/14#issuecomment-470058073, or mute the thread https://github.com/notifications/unsubscribe-auth/ALD4FKPCXV8XBLqHCCTcAc48DkiE8TApks5vT5qygaJpZM4QMlw- .
--
Regards,
P_Kemoi
Tel: 0716973612