Initial commit BIJ CI4
This commit is contained in:
58
public/ios/app/debug/test_final.php
Normal file
58
public/ios/app/debug/test_final.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../config.php';
|
||||
|
||||
echo "<h2>Test Final - Semua Endpoint</h2>";
|
||||
|
||||
// Login dulu
|
||||
echo "<h3>1. Login</h3>";
|
||||
$login_result = api_login('Widia', 'qwerty5*');
|
||||
echo "Login: " . ($login_result['success'] ? 'SUCCESS' : 'FAILED') . "<br>";
|
||||
|
||||
if ($login_result['success']) {
|
||||
$token = $login_result['data']['token'];
|
||||
echo "Token: " . substr($token, 0, 20) . "...<br><br>";
|
||||
|
||||
// Test semua endpoint
|
||||
$tests = [
|
||||
'Profil' => function () use ($token) {
|
||||
return api_get_profil($token);
|
||||
},
|
||||
'Presensi Today' => function () use ($token) {
|
||||
return api_get_presensi_today($token);
|
||||
},
|
||||
'Presensi' => function () use ($token) {
|
||||
return api_get_presensi($token);
|
||||
},
|
||||
'Berita' => function () use ($token) {
|
||||
return api_get_berita($token);
|
||||
},
|
||||
'Libur' => function () use ($token) {
|
||||
return api_get_libur($token);
|
||||
},
|
||||
'Cuti' => function () use ($token) {
|
||||
return api_get_cuti($token);
|
||||
},
|
||||
'Lembur' => function () use ($token) {
|
||||
return api_get_lembur($token);
|
||||
}
|
||||
];
|
||||
|
||||
echo "<h3>2. Test Endpoints</h3>";
|
||||
foreach ($tests as $name => $test) {
|
||||
$result = $test();
|
||||
$status = $result['success'] ? '✅ SUCCESS' : '❌ FAILED';
|
||||
$data_count = is_array($result['data']) ? count($result['data']) : 'N/A';
|
||||
echo "<strong>$name:</strong> $status (Data: $data_count)<br>";
|
||||
|
||||
if (!$result['success']) {
|
||||
echo " Error: " . json_encode($result['data']) . "<br>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<br><h3>3. Dashboard Links</h3>";
|
||||
echo "<a href='login.php' target='_blank'>Login Page</a><br>";
|
||||
echo "<a href='dashboard.php' target='_blank'>Dashboard</a><br>";
|
||||
echo "<a href='rekam.php' target='_blank'>Rekam Presensi</a><br>";
|
||||
} else {
|
||||
echo "Login gagal: " . json_encode($login_result['data']) . "<br>";
|
||||
}
|
||||
Reference in New Issue
Block a user