/
var
/
www
/
barefootlaw.org
/
will-generator
/
Upload File
HOME
<?php require 'vendor/autoload.php'; require 'generatedwill.php'; // Include the class definition // Start the session session_start(); $conn = new mysqli('localhost', 'will_generator', 'Gtscq_!hQnBDRC_u', 'will_generator'); if ($conn->connect_error) { die('Connection Failed: ' . $conn->connect_error); } // Retrieve session ID $session_id = $_SESSION['session_id']; // Fetch participant data from the database $sql = "SELECT * FROM will_info WHERE session_id = '$session_id'"; $result = $conn->query($sql); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); // Instantiate the CustomCertificate class $customCertificate = new CustomCertificate(); // Add participant data to the certificate $fname = $row['fname']; $lname = $row['lname']; $othername = $row['othername']; $subcounty = $row['subcounty']; $district = $row['district']; $age = $row['age']; $dob = $row['dob']; $marital_status = $row['marital_status']; $spouse_name = $row['spouse_name']; $spouse_age = $row['spouse_age']; $gender = $row['gender']; $email = $row['email']; $contact = $row['contact']; $childs_name = $row['childs_name']; $childs_age = $row['childs_age']; $dependants_name = $row['dependants_name']; $guardians_name = $row['guardians_name']; $guardians_address = $row['guardians_address']; $executor_name = $row['executor_name']; $heir_name = $row['heir_name']; $heir_address = $row['heir_address']; $property_name = $row['property_name']; $witness_name = $row['witness_name']; $witness_address = $row['witness_address']; $distribution = $row['distribution']; $distribution_name = $row['distribution_name']; $burry_wishes = $row['burry_wishes']; $charity = $row['charity']; $charity_distribution = $row['charity_distribution']; $other_wishes = $row['other_wishes']; // Add participant data to the certificate $customCertificate->addCertificateContent( $fname, $lname, $othername, $subcounty, $age, $dob, $marital_status, $spouse_name, $spouse_age, $gender, $email, $district, $contact, $childs_name, $childs_age, $dependants_name, $guardians_name, $guardians_address, $executor_name, $heir_name, $heir_address, $property_name, $witness_name, $witness_address, $distribution, $distribution_name, $burry_wishes, $charity, $other_wishes, $charity_distribution ); // Output the certificate to the browser $customCertificate->Output(); } else { // Participant not found echo 'Participant not found'; } $conn->close();