Initial commit: Retribusi frontend dengan dashboard, event logs, dan settings

This commit is contained in:
mwpn
2025-12-18 11:21:40 +07:00
commit b3573ed390
35 changed files with 7368 additions and 0 deletions

21
api/cors_handler.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
/**
* CORS Handler - WAJIB di-include di awal SETIAP endpoint
*
* INSTRUKSI:
* 1. Copy file ini ke server API
* 2. Include di awal SETIAP file endpoint: require_once 'cors_handler.php';
* 3. Atau copy kode di bawah ke awal setiap endpoint
*/
// ================= CORS =================
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type, Authorization, X-API-KEY");
// Handle preflight OPTIONS request
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit;
}