$trekker) { $getrokken[$trekker] = $targets[$i]; } // Oude ronde archiveren $archiefBestand = __DIR__ . '/../data/archief/' . date('Ymd_His') . '_lootjes.json'; if (file_exists(__DIR__ . '/../data/lootjes.json')) { rename(__DIR__ . '/../data/lootjes.json', $archiefBestand); } file_put_contents(__DIR__ . '/../data/lootjes.json', json_encode($getrokken, JSON_PRETTY_PRINT)); return $getrokken; } function getLootjeVoor($gebruiker) { $path = __DIR__ . '/../data/lootjes.json'; if (!file_exists($path)) return null; $lootjes = json_decode(file_get_contents($path), true); return $lootjes[$gebruiker] ?? null; } function isAdmin($username) { $config = require __DIR__ . '/../config/config.php'; return in_array($username, $config['admin_users']); }