<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  $email = $_POST['email'];
  $action = $_POST['action'];
  $status = $action === 'approve' ? 'Approved' : 'Rejected';

  $statusPath = 'kyc_status/' . md5($email) . '.json';
  file_put_contents($statusPath, json_encode(['status' => $status]));

  header("Location: admin-dashboard.php");
  exit;
}
?>
