prepare(" SELECT d.*, c.title_en as case_title, c.title_ar as case_title_ar FROM donations d JOIN cases c ON d.case_id = c.id WHERE d.id = ? AND d.status = 'completed' "); $stmt->execute([$donation_id]); $don = $stmt->fetch(); if (!$don) exit('Donation not found or not completed.'); $org = $pdo->query("SELECT * FROM org_profile LIMIT 1")->fetch(); // This is a simple HTML certificate that can be printed or saved as PDF by the user ?>