prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); // ✅ فك تشفير الحقول الحساسة foreach ($result as &$row) { $fieldsToDecrypt = [ "phone", "email", "gender", "birthdate", "site", "first_name", "last_name", "sosPhone", "education", "employmentType", "maritalStatus", "passengerToken" ]; foreach ($fieldsToDecrypt as $field) { if (isset($row[$field]) && $row[$field] !== null) { $row[$field] = $encryptionHelper->decryptData($row[$field]); } } } if ($stmt->rowCount() > 0) { jsonSuccess($result); } else { jsonError("No records found"); } ?>