<?php

$user_id = $_GET['userID'];



$sql_client = "SELECT * FROM clients WHERE id = '$user_id' ";
$query = $db_conx->query($sql_client);

$row = mysqli_fetch_assoc($query);

$tracking_code = $row['tracking_code'];
$final_decision_date = $row['final_decision_date'];
$final_decision_note = $row['final_decision_note'];
$principal_applicant = $row['principal_applicant'];
$uci = $row['uci'];
$application_number = $row['application_number'];
$date_received = $row['date_received'];
$biometrics_number = $row['biometrics_number'];
$date_biometrics_enrolment = $row['date_biometrics_enrolment'];
$expiry_date = $row['expiry_date'];
$details_status = $row['details_status'];
$review_of_eligibility = $row['review_of_eligibility'];
$review_of_medical = $row['review_of_medical'];
$review_of_additoinal_doc = $row['review_of_additoinal_doc'];
$interview = $row['interview'];
$biometrics = $row['biometrics'];
$background_check = $row['background_check'];
$final_decision = $row['final_decision'];
$date_created = $row['date_created'];


$sql_client = "SELECT * FROM clients WHERE id = '$user_id' ";
$query = $db_conx->query($sql_client);

$row = mysqli_fetch_assoc($query);

$tracking_code = $row['tracking_code'];


// now we will write a code to get all the stuff from the database 

$sql_permit1 = "SELECT * FROM work_permit WHERE id = '$user_id' ";

$query_permit1 = $db_conx->query($sql_permit1);

$row_p1 = mysqli_fetch_assoc($query_permit1);

$SelectedEng = $row_p1['SelectedEng'];
$file_reference = $row_p1['file_reference'];
$surname = $row_p1['surname'];
$firstName = $row_p1['firstName'];
$middleName = $row_p1['middleName'];
$mailingAddress = $row_p1['mailingAddress'];
$telephoneNumber = $row_p1['telephoneNumber'];
$faxNumber = $row_p1['faxNumber'];
$residentialAddress = $row_p1['residentialAddress'];
$dateOfBirth = $row_p1['dateOfBirth'];
$placeOfBirth = $row_p1['placeOfBirth'];
$provState = $row_p1['provState'];
$countryPays = $row_p1['countryPays'];
$citizen = $row_p1['citizen'];
$sex = $row_p1['sex'];
$martialStatus = $row_p1['martialStatus'];
$familyNameApplicant = $row_p1['familyNameApplicant'];
$familyNameSpouse = $row_p1['familyNameSpouse'];
$familyNamePartner  = $row_p1['familyNamePartner'];
$familyNamePartner = $row_p1['familyNamePartner'];
$familyNameChildren = $row_p1['familyNameChildren'];

$sql_permit2 = "SELECT * FROM work_permit_2 WHERE id  = '$user_id' ";
$query_permit2 = $db_conx->query($sql_permit2);

$row_p2 = mysqli_fetch_assoc($query_permit2);

$firstSecondNameApplicant = $row_p2['firstSecondNameApplicant'];
$firstSecondNameSpouse = $row_p2['firstSecondNameSpouse'];
$firstSecondNamePartner = $row_p2['firstSecondNamePartner'];
$firstSecondNameChildren = $row_p2['firstSecondNameChildren'];
$relationshipApplicant = $row_p2['relationshipApplicant'];
$relationshipSpouse = $row_p2['relationshipSpouse'];
$relationshipPartner = $row_p2['relationshipPartner'];
$relationshipChildren = $row_p2['relationshipChildren'];
$dobApplicant = $row_p2['dobApplicant'];
$dobSpouse = $row_p2['dobSpouse'];
$dobPartner = $row_p2['dobPartner'];
$dobChildren = $row_p2['dobChildren'];
$placeOfBirthApplicant = $row_p2['placeOfBirthApplicant'];
$placeOfBirthSpouse = $row_p2['placeOfBirthSpouse'];
$placeOfBirthPartner = $row_p2['placeOfBirthPartner'];
$placeOfBirthChildren = $row_p2['placeOfBirthChildren'];
$citizenshipApplicant = $row_p2['citizenshipApplicant'];
$citizenshipSpouse = $row_p2['citizenshipSpouse'];
$citizenshipPartner = $row_p2['citizenshipPartner'];
$citizenshipChildren = $row_p2['citizenshipChildren'];

$sql_permit3 = "SELECT * FROM work_permit_3 WHERE id = '$user_id'";
$query_permit3 = $db_conx->query($sql_permit3);

$row_p3 = mysqli_fetch_assoc($query_permit3);

$passportNoApplicant = $row_p3['passportNoApplicant'];
$passportNoSpouse = $row_p3['passportNoSpouse'];
$passportNoPartner = $row_p3['passportNoPartner'];
$passportNoChildren = $row_p3['passportNoChildren'];
$passportExpiryDateApplicant = $row_p3['passportExpiryDateApplicant'];
$passportExpiryDateSpouse = $row_p3['passportExpiryDateSpouse'];
$passportExpiryDatePartner = $row_p3['passportExpiryDatePartner'];
$passportExpiryDateChildren = $row_p3['passportExpiryDateChildren'];
$martialStatusApplicant = $row_p3['martialStatusApplicant'];
$martialStatusSpouse = $row_p3['martialStatusSpouse'];
$martialStatusPartner = $row_p3['martialStatusPartner'];
$martialStatusChildren = $row_p3['martialStatusChildren'];
$accompanyPartner = $row_p3['accompanyPartner'];
$accompanySpouse = $row_p3['accompanySpouse'];
$accompanyChildren = $row_p3['accompanyChildren'];
$officerAgent = $row_p3['officerAgent'];
$presentJob = $row_p3['presentJob'];
$heldJobMonths = $row_p3['heldJobMonths'];
$heldJobYears = $row_p3['heldJobYears'];
$nameAddressEmployer = $row_p3['nameAddressEmployer'];
$nameAddressEmployerCanada = $row_p3['nameAddressEmployerCanada'];
$myOccupationInCanada = $row_p3['myOccupationInCanada'];
$mySalary = $row_p3['mySalary'];
$iAmExpected = $row_p3['iAmExpected'];
$myEmployment = $row_p3['myEmployment'];

$sql_permit4 = "SELECT * FROM work_permit_4 WHERE id = '$user_id'";
$query_permit4 = $db_conx->query($sql_permit4);

$row_p4 = mysqli_fetch_assoc($query_permit4);

$beenTreated = $row_p4['beenTreated'];
$beenArrested = $row_p4['beenArrested'];
$refuseAdmission = $row_p4['refuseAdmission'];
$appliedFor = $row_p4['appliedFor'];
$beenRefusedAVisa = $row_p4['beenRefusedAVisa'];
$inPeriods = $row_p4['inPeriods'];
$duringThe = $row_p4['duringThe'];
$nameOne = $row_p4['nameOne'];
$countryOne = $row_p4['countryOne'];
$fromDeOne = $row_p4['fromDeOne'];
$toAOne = $row_p4['toAOne'];
$nameTwo = $row_p4['nameTwo'];
$countryTwo = $row_p4['countryTwo'];
$fromDeTwo = $row_p4['fromDeTwo'];
$toATwo = $row_p4['toATwo'];
$nameThree = $row_p4['nameThree'];
$countryThree = $row_p4['countryThree'];
$fromDeThree = $row_p4['fromDeThree'];
$toAThree = $row_p4['toAThree'];
$nameFour = $row_p4['nameFour'];
$countryFour = $row_p4['countryFour'];
$fromDeFour = $row_p4['fromDeFour'];
$toAFour = $row_p4['toAFour'];
$nameFive = $row_p4['nameFive'];
$countryFive = $row_p4['countryFive'];
$fromDeFive = $row_p4['fromDeFive'];
$toAFive = $row_p4['toAFive'];
$file = $row_p4['file'];
$docDate = $row_p4['docDate'];
$date_created = $row_p4['date_created'];
