<?php
require_once 'zklib.php';

$zk = new ZKLib('192.168.10.55', 4370);
$result = $zk->connect();

if ($result === true) {
    echo "✅ Connected to 192.168.10.55\n\n";

    // Test Users
    echo "🟢 Fetching Users...\n";
    $users = $zk->getUser();
    echo "Found " . count($users) . " users:\n";
    print_r($users);

    // Test Attendance
    echo "\n🟢 Fetching Attendance...\n";
    $attendance = $zk->getAttendance();
    echo "Found " . count($attendance) . " logs:\n";
    print_r(array_slice($attendance, 0, 5)); // First 5 logs

    $zk->disconnect();
} else {
    echo "❌ Connection failed: $result\n";
}
?>