PHPackages                             erlangparasu/cobisja-tad-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. erlangparasu/cobisja-tad-php

ActiveLibrary

erlangparasu/cobisja-tad-php
============================

PHP class that allows you interact with ZK Time &amp; Attendance devices.

0.4.4(4y ago)142↓100%MITPHPPHP &gt;=5.3.0

Since Dec 23Pushed 4y agoCompare

[ Source](https://github.com/erlangparasu/cobisja-tad-php)[ Packagist](https://packagist.org/packages/erlangparasu/cobisja-tad-php)[ RSS](/packages/erlangparasu-cobisja-tad-php/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (11)Used By (0)

TAD-PHP
=======

[](#tad-php)

A simple PHP class to interacts with ZK Time &amp; Attendance Devices.

\##About

TAD: A class that implements an interface to interacts with ZK Time &amp; Attendance devices.

Documentation found about ZK SOAP api is very limited or poor, however TAD class implements most SOAP functions supported by ZK devices. Specifically TAD class exposes the following 35 methods:

```
get_date, get_att_log, get_user_info, get_all_user_info, get_user_template, get_combination, get_option, get_free_sizes, get_platform, get_fingerprint_algorithm, get_serial_number, get_oem_vendor, get_mac_address, get_device_name, get_manufacture_time, get_antipassback_mode, get_workcode, get_ext_format_mode, get_encrypted_mode, get_pin2_width, get_ssr_mode, get_firmware_version, set_date, set_user_info, set_user_template, delete_user, delete_template, delete_data, delete_user_password, delete_admin, enable, disable, refresh_db, restart, and poweroff.

```

All methods above are implemented by 2 classes: **Providers\\TADSoap** and **Providers\\TADZKLib**.

There are some SOAP functions supported by ZK devices that it's suppossed, according to the official docs (which incidentally it's very limited and so poor!!!) must show an expected behaviour, but when they are invoked don't work like is expected, so they become useless (e.g. Restart SOAP call). For these situations, TAD class implement them by **Providers\\TADZKLib** class (\[PHP\_ZKLib\] - [http://dnaextrim.github.io/php\_zklib/](http://dnaextrim.github.io/php_zklib/)). This class takes a different approach to "talk to the device": it uses UDP protocol at device standard port 4370.

PHP\_ZKLib class it's been fully integrated, after a refactoring process taking out all duplicated code (DRY).

For practical purposes, you don't have to be worried about when to use TAD class or PHP\_ZKLib class because you only have to get a TAD instance (as shown below) and call any of its methods available. The class decides about when runs the method invoked using TAD class or PHP\_ZKLib class.

\##Requirements

- Any flavour of PHP 5.4+
- PHPUnit to execute the test suite (optional).

Supported devices
-----------------

[](#supported-devices)

- All ZK Time &amp; Attendance devices with web server built-in (with ZEM600 or less).

\##Getting started ###Setting up the environment After download TAD-PHP, you have 2 ways to get your enviroment configured to use the classes:

\####Composer

[Composer](https://getcomposer.org) is the PHP's package manager and is the recommended way to get packages for your projects. It's also able to build automatically ***autoloaders*** if you wrote down your code using PSR-0 and/or PSR-4 standards, avoiding you headaches about everything related to loading classes.

**TADPHP** is built follows PSR-4 standard and comes with a specific file named **composer.json** that allows **Composer** to generate a file named **autoload.php** (beside others files of course). This files generated is the only one you need to include in your project to get all classes required by TADPHP loaded in memory:

1. Install Composer:

    ```
    curl -s https://getcomposer.org/installer | php

    ```
2. Get inside TADPHP root folder and generate the **autoload.php** file:

    ```
    php composer.phar dump-autoload

    ```

    The command above will generate a folder called **vendor**. Inside of it, you'll see the **autoload.php**
3. Require/Include **autoload.php** file in the **index.php** of your project or whatever file you need to use **TAD-PHP** classes:

    ```
