"") { $date = new DateTime($ptdob); $now = new DateTime(); $age = $now->diff($date)->y; } $pteml=$_GET["pteml"].$_POST['pteml']; $ptadr=ucwords($_GET["ptadr"].$_POST['ptadr']); $ptgender=$_GET["ptgender"].$_POST['ptgender']; $ptpostcode=$_GET["ptpostcode"].$_POST['ptpostcode']; $ptphone=$_GET["ptphone"].$_POST['ptphone']; $ptlandline=$_GET["ptlandline"].$_POST['ptlandline']; if ($ptlandline=="") $ptlandline="(none)"; $ptethnicity=$_GET["ptethnicity"].$_POST['ptethnicity']; $ptnhi=$_GET["ptnhi"].$_POST['ptnhi']; $ptnhiconf=$_GET["ptnhiconf"].$_POST['ptnhiconf']; // Place of birth $pttown=ucwords($_GET["pttown"].$_POST['pttown']); if ($pttown=="") $pttown="-"; $ptcountry=ucwords($_GET["ptcountry"].$_POST['ptcountry']); if ($ptcountry=="") $ptcountry="-"; $ptoccupation=ucwords($_GET["ptoccupation"].$_POST['ptoccupation']); $smoker=ucwords($_GET["smoker"].$_POST['smoker']); // Emerg contacts $emergname=ucwords($_GET["emergname"].$_POST['emergname']); $emergphone=ucwords($_GET["emergphone"].$_POST['emergphone']); $emergrelation=ucwords($_GET["emergrelation"].$_POST['emergrelation']); $signedby=ucwords($_GET["signedby"].$_POST['signedby']); $signedrel=ucwords($_GET["signedrel"].$_POST['signedrel']); // Attachments: passport, +/- VISA, enrolment form $picpas=$_GET["picpas"].$_POST['picpas']; $picvisa=$_GET["picvisa"].$_POST['picvisa']; $declaration=$_GET["declaration"].$_POST['declaration']; /// DELCARATION PDF PART... $sigimg=$_GET["sigimg"].$_POST["sigimg"]; /////////////////////////////////// function savefile($tmpfilein,$destfileout) { global $filetype; global $filedetails; global $response; global $allowedextensions; global $filesDestDir; global $conn; //$location = $tmpDir.$_FILES['file']['name'][$i]; $location = $destfileout; $file_extension = pathinfo($location, PATHINFO_EXTENSION); $file_extension = strtolower($file_extension); // print 'ext = '.$file_extension."\n"; // print 'res = '.$response."\n"; //echo "ext = $file_extension, allow = $allowedextensions\n"; //echo var_dump($_FILES['file']); //echo $location; if(in_array($file_extension,$allowedextensions)){ // Upload file //echo "moveup ".$_FILES['file']['tmp_name'][0]; //$response="suc"; if ($tmpfilein==$location OR move_uploaded_file($tmpfilein,$location)) { //$response .= $location.'|'; //print 'resp= '.$response."\n"; ///////////////////////////////// //$file = basename($location); //$fileMoved = rename($location, $filesDestDir.$hashdir.$file); $response="suc;".$destfileout; } else { $response="cantmove"; } } else { $response="extnotallowed"; } return $response; } if ($filetype>'') { // for uploads from BASH and 2nd page of web plugin... // require_once('dbconnect.php'); // require_once('gettempdir.php'); $response="nothing"; if (!empty($_FILES)) { //print "files array exists"; //print "filename=$filename"; //if ($filename>"") { // depends on upload_max_filesize in /etc/php/7.2/apache2/php.ini // set to 10M on 4Jul2020 // echo "
";
    // print_r($_FILES);
    // echo "
"; $total = count($_FILES['file']['name']); //$response.=",total=".$total; //print "1 = \n ".$_FILES['file']['name'][0]."\n"; //print "2 = \n ".$_FILES['file']['name'][1]."\n"; for( $i=0 ; $i < $total ; $i++ ) { //$response.=",i=".$i; //$response.=",sf=". $d = $filesDestDir.$_FILES['file']['name'][$i]; $d1=pathinfo($d, PATHINFO_DIRNAME); $d2=pathinfo($d, PATHINFO_BASENAME); $d3=pathinfo($d, PATHINFO_EXTENSION); $d2 = preg_replace( '/[\W]/', '', substr($d2,0,strlen($d2)-strlen($d3)-1)); $response=savefile($_FILES['file']['tmp_name'][$i], $d1.'/'.$d2.'.'.$d3 ); //$response.=",from=".$_FILES['file']['tmp_name'][$i].",to=".$filesDestDir.$_FILES['file']['name'][$i]; } } else { $response="emptyfileslist"; } //if ($filepath>"") { // savefile($filepath,$filepath); //} print $response; } else { require_once('header.php'); if ($page=="1" || $page=="") { //PRINT ''; PRINT ''; } if ($page=="2") { //PRINT ''; PRINT ''; } print ""; print '
Remuera Medical Centre

Apply to Enrol at Remuera Medical Centre

'; print '
'; if ($page=="1" || $page=="") { ///print "page1"; print '

Please complete the form below to apply to enrol as a patient at Remuera Medical Centre.

You will need the following to upload to us:

  • A scanned picture of your passport,
  • If you are not a NZ Citizen we also need a copy of your Visa,

We will need your full name, date of birth, address and previous GP details.

If you wish to enrol multiple family members, you will need to complete these steps for each person separately.

'; print '

Your details

 

Your entitlement to healthcare funding

 

Previous GP

We will contact your previous GP to get your records transferred to us.

I understand that my name will be removed from the register of my previous general practice.
 

Your emergency contacts

 

Enrolment Consent

I wish to enrol/re-enrol with this general practice. I understand that:

  • This provider is a member of a Primary Health Organisation (PHO) and I have been informed of the implications of enrolment with this PHO.
  • I cannot enrol with more than one practice at the same time.
  • This practice is funded on the basis of its enrolled register and information on this form will be sent to the Health Funding Organisation.
  • I agree to the practice sharing my health information with other health providers involved in my healthcare.
  • My information may be used for practice screening & recall programmes, and practice quality activities and audit.
  • I have read this document and understand and agree that I am now an enrolled patient of this practice.
  • I have been given and read the Health Information Privacy Statement

Please draw your signature here:

'; } if ($page=="2") { /* Page3"; Collect passport and VISA Generate PDF Declaration in background var str='API61|pid=0|nhi='+ptnhi+'|Firstname='+ptfirstname+'|Surname='+ptsurname+'|DD='+padLeadingZeros(d.getDate(),2)+'|MM='+padLeadingZeros(d.getMonth()+1,2)+'|YYYY='+d.getFullYear()+'|nhi='+ptnhi+'|chargeamt='+chargeamt+'|chargeaction='+chargeaction+'|'; DD='+padLeadingZeros(d.getDate(),2)+'|MM='+padLeadingZeros(d.getMonth()+1,2)+'|YYYY='+d.getFullYear()+' */ print '
'; /* print '

Upload Passport and photo

We need 2 files from you - a picture of your passport (open at the picture and details page), and a different (recent) picture of your face, head & shoulders.

1. Passport

Please send us a picture of your current passport details page. We need to be able to see your picture, passport number, name, and date of birth clearly.

a) Click here to find the picture of your passport on your computer:

b) Then click here to upload it:

'; */ if($citizen=="NZCitizen" || $citizen=="NZ2") { $visaignore="N/A"; print '

Upload Passport

We need a picture of your passport (open at the photo and details page).

Passport

Please send us a picture or PDF of your current passport details page. We need to be able to see your picture, passport number, name, and date of birth clearly.

a) Click here to find the picture of your passport on your computer:

b) Then click here to upload it:

'; } else { print '

Upload Passport and photo

We need 2 files from you - a picture of your passport (open at the photo and details page), and a picture of your VISA.

1. Passport

Please send us a picture of your current passport details page. We need to be able to see your picture, passport number, name, and date of birth clearly.

a) Click here to find the picture of your passport on your computer:

b) Then click here to upload it:

'; print '
 

2. VISA

Your visa document (currently emailed to you by Immigration as a PDF, but happy to accept a legible photo of your document).

a) Click here to find your ID photo on your computer:

b) Then click here to upload it:

'; } print '
 

'; } function copiereffect() { global $pdf; // Photocopier effect $pdf->SetAlpha(0.2); $pdf->Image('../resources/copiereffect.png',0,0,300,500); $pdf->SetAlpha(1); } if ($page=="3" || $page=="end") { //recieve success, send email, waiting image, move to page 6 with Messagfe (so msg does not get resent // same content - just don't email or show waiting end page if ($page=="3") { echo '
Thank you for requesting enrolment.
You should receive a confirmation email shortly...
'; ob_flush(); flush(); require('fpdf3.php'); // Define new class with different footer! class myPDF extends RoryPDF { function Footer(){ global $ptfname, $ptsname; // Position at 1.5 cm from bottom // Arial italic 8 $this->SetY(-15); $y = $this->getY(); $this->Line(9, $y, $this->GetPageWidth()-12, $y); // 20mm from each edge $this->SetFont('Arial','b',10); $this->SetY(-15); $this->MultiCell(0,10,' RMC Enrolment for: '.strtoupper(urldecode($ptfname.' '.$ptsname)),0,'C'); $this->SetFont('Arial','',10); $this->SetY(-15); $this->Cell(0,10,'Generated: '.date("d M Y H:i A"),0,0,'L'); // 26 May 2022 09:13 AM $this->Cell(0,10,'Page '.$this->PageNo().' of {nb}',0,0,'R'); } } $pdf = new myPDF('P', 'mm', 'A4'); $debug=false; $pdf->AliasNbPages(); //$pdf->header = 0; //$pdf->footer = 0; if ($debug) print ""; $pdf->SetTopMargin(8); $pdf->SetLeftMargin(8); $pdf->SetRightMargin(8); /* $pdf->AddFont('Helvetica','','font_helvetica.php'); $pdf->AddFont('Helvetica','b','font_helveticab.php'); $pdf->AddFont('Helvetica','i','font_helveticai.php'); $pdf->AddFont('Helvetica','bi','font_helveticabi.php'); */ $pdf->AddFont('Arial','','font_arial.php'); $pdf->AddFont('Arial','b','font_arialb.php'); /* $pdf->AddFont('Helvetica','b','font_helveticab.php'); $pdf->AddFont('Helvetica','i','font_helveticai.php'); $pdf->AddFont('Helvetica','bi','font_helveticabi.php'); */ $pdf->AddFont('Verdana','','verdana.php'); $pdf->AddFont('Verdana','b','verdanab.php'); //$pdf->AddFont('Arial','','arial.php'); //$pdf->AddFont('Arial','b','arialb.php'); //$pdf->AddFont('Verdana','b','verdanab.php'); $pdf->AddPage(); if ($debug) print ""; $fontsize=10; $fontname="Verdana"; //$pdf->WriteHTML('

Client Declaration and Notice (eMedical)

'); $pdf->SetFont($fontname,'b',$fontsize+2); // CENTRE // $pdf->MultiCell(0,0,'Client Declaration and Notice (eMedical)',0,'C'); $column_width = ($pdf->GetPageWidth()-20); if ($debug) print ""; $rowspacing=4.7; $rowbetween=1.6; $pdf->SetFont($fontname,'b',$fontsize+2); // CENTRE // $pdf->MultiCell(0,0,'Client Declaration and Notice (eMedical)',0,'C'); $pdf->WriteHTML('PATIENT ENROLMENT FORM
'); $pdf->SetFont($fontname,'',$fontsize-1); $pdf->WriteHTML('(Family members over the age of 16 to fill out their own form)'); $pdf->SetFont($fontname,'b',$fontsize); if ($debug) print ""; $y = $pdf->getY()+8; // LEFT SIDE (pratice name+address, then doctors) $pdf->SetXY(8, $y); //hack $pdf->MultiCell(100,4,"Remuera Medical Centre\n377a Remuera Road, Remuera\nAuckland 1050\n\n",0,'L'); $pdf->SetFont($fontname,'b',$fontsize-2); //$pdf -> SetXY(8, $y); //hack $pdf->MultiCell(100,4,"Dr Marcus Stone NZMC #13089\nDr Cathy Ferguson NZMC #13109\nDr Rory Johnston NZMC #74529",0,'L'); $y1=$pdf->getY(); // RIGHT SIDE (contact details, then patient NHI) $pdf -> SetXY(128, $y); //hack $pdf->SetFont($fontname,'b',$fontsize-1); $pdf->MultiCell(100,4,"Phone: 09 520 1565\nFax: 09 523 1723\nEDI: remueram\nEmail: office@remueramedical.co.nz\n\n",0,'L'); if ($ptnhiconf>100) { $pdf -> SetX(128); //hack $pdf->SetFont($fontname,'b',$fontsize+1); $pdf->MultiCell(100,4,"NHI: ".$ptnhi,0,'L'); $y2=$pdf->getY(); } if ($debug) print ""; // First table if ($y2>$y1) $y1=$y2; $pdf -> SetXY(8, $y1+4); //hack $pdf->SetFont($fontname,'',$fontsize-1); $pdf->WriteHTML('
Title Surname First Names Preferred name Date of Birth Gender
- '.urldecode($ptsname).' '.urldecode($ptfname).' '.urldecode($ptmname).' '.urldecode($ptfname).' '.urldecode($ptdob).' '.urldecode($ptgender).'
'); if ($debug) print ""; $y = $pdf->getY(); $pdf -> SetXY(8, $y+4); //hack $pdf->WriteHTML('
Residential Address
Street: '.urldecode($ptadr).'
Suburb: - Postal code: '.urldecode($ptpostcode).'
Landline: '.urldecode($ptlandline).' Mobile: '.urldecode($ptphone).' Work: -
Email: '.urldecode($pteml).'
Occupation: '.urldecode($ptoccupation).'
Place of birth: '.urldecode($pttown).' '.urldecode($ptcountry).'
'); $y = $pdf->getY(); $pdf -> SetXY(8, $y+4); //hack $pdf->WriteHTML('
Emergency contact: Name Phone number Relationship to you
'.urldecode($emergname).' '.urldecode($emergphone).' '.urldecode($emergrelation).'
'); $y = $pdf->getY(); $pdf -> SetXY(8, $y+4); //hack $pdf->WriteHTML('
Ethnicity
       
'); if ($debug) print ""; $mxmatched=''; function mxeth($str,$nm,$options = array()) { global $ptethnicity,$mxmatched; if ($ptethnicity==$str or in_array($ptethnicity,$options) or ($str=="Other" and $mxmatched=="")) { $oth=""; if ($str=="Other" and $mxmatched=="") $oth="\n _".urldecode($ptethnicity)."_"; $mxmatched=$str; return "[X] ".$nm." ".$str.$oth; } else { return "[ ] ".$nm." ".$str; } } $pdf->SetXY(9, $y+14); //hack $txt =mxeth("NZ European",11)."\n"; $txt.=mxeth("Other European",12,array("British","Irish","Scottish"))."\n"; $txt.=mxeth("NZ Maori",21)."\n Iwi: __________ \n"; $txt.=mxeth("Samoan",31)."\n"; $txt.=mxeth("Cook Island Maori",32); $pdf->MultiCell(100,4.5,$txt,0,'L'); $pdf->SetXY(57, $y+14); //hack $txt =mxeth("Tongan",33)."\n"; $txt.=mxeth("Niuean",34)."\n"; $txt.=mxeth("Tokelauan",35)."\n"; $txt.=mxeth("Fijian",36)."\n"; $txt.=mxeth("Other Pacific",37); $pdf->MultiCell(100,4.5,$txt,0,'L'); if ($debug) print ""; $pdf->SetXY(105, $y+14); //hack $txt =mxeth("South East Asian",41)."\n"; $txt.=mxeth("Chinese",42)."\n"; $txt.=mxeth("Indian",43)."\n"; $txt.=mxeth("Other Asian",44,array("Japanese","Korean","Singapore")); $pdf->MultiCell(100,4.5,$txt,0,'L'); $pdf->SetXY(153, $y+14); //hack $txt =mxeth("Middle Eastern",51)."\n"; $txt.=mxeth("Latin American",52)."\n"; $txt.=mxeth("African",53)."\n"; $txt.=mxeth("Other",54)."\n"; //if ($mxmatched>'') { // $txt.=" __________"; //} else { // $txt.=" _".$ptethnicity."_"; //} $pdf->MultiCell(100,4.5,$txt,0,'L'); // $y is set for the top of the table $pdf -> SetXY(8, $y+48); //hack $pdf->WriteHTML('
Community Services Card: [ ] Yes [ ] No Card no:
  Expiry Date:
High User Health Card: [ ] Yes [ ] No Card no:
  Expiry Date:
Do you smoke?: ['.($smoker=='Y'?'X':' ').'] Yes ['.($smoker=='N'?'X':' ').'] Never ['.($smoker=='X'?'X':' ').'] Ex-smoker
'); $y = $pdf->getY(); $pdf -> SetXY(8, $y+4); //hack $pdf->WriteHTML('
TRANSFER OF RECORDS (new patients only)
&npsp;
'); if ($debug) print ""; $pdf -> SetXY(8, $y+12); //hack if ($gppermission=="on") { if ($debug) print ""; $txt=" Do you authorise transfer of your medical records from your previous doctor: [X] Yes [ ] No\n\n"; $txt.=" I understand that my name will be removed from the register of my previous general practice.\n\n"; $txt.=" Name of former Doctor: ".urldecode($gpname)."\n"; $txt.=" Name of former Practice: ".urldecode($gpsurgery); } else { if ($debug) print ""; $txt=" Do you authorise transfer of your medical records from your previous doctor: [ ] Yes [X] No\n\n"; $txt.=" I understand that my name will be removed from the register of my previous general practice.\n\n"; $txt.=" Name of former Doctor and or Practice: DID NOT CONSENT\n\n"; } if ($debug) print ""; $txt.="\n\n Signature: Date: ".date("d M Y"); $pdf->MultiCell(200,4,$txt,0,'L'); if ($debug) print ""; $pdf->Image(urldecode($sigimg),10, $y+15, 120, 40, 'png'); if ($debug) print ""; $pdf->AddPage(); if ($debug) print ""; $pdf->SetFont($fontname,'',$fontsize); if ($debug) print ""; if ($debug) print ""; $pdf->MultiCellBlt($column_width,4.2,'','I intend to use Remuera Medical Centre as my regular and ongoing provider of general practice/GP/First Level primary healthcare services.',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+4); //hack $pdf->MultiCellBlt($column_width,4.2,'','I am eligible to enrol because I am residing permanently in New Zealand. I live in New Zealand and meet one of the following eligibility statements: ',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+4); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZCitizen'?'X':' ').'] '.' a) ','I am a New Zealand citizen (including those from Cook Islands, Niue or Tokelau) OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ1'?'X':' ').'] '.' b) ','I hold a resident visa or a permanent resident visa (or a residence permit if issued before December 2010) OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ2'?'X':' ').'] '.' c) ','I am an Australian citizen or Australian permanent resident AND able to show I have been in New Zealand or intend to stay in New Zealand for at least 2 consecutive years OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ3'?'X':' ').'] '.' d) ','I have a work visa/permit and can show that I am able to be in New Zealand for at least 2 years (previous permits included) OR ',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ4'?'X':' ').'] '.' e) ','I am an interim visa hold who is eligible immediately before my interim visa started OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ5'?'X':' ').'] '.' f) ','I am a refugee or protected person OR in the process of applying for, or appealing refugee or protection status, OR a victim or suspected victim of people trafficking OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ6'?'X':' ').'] '.' g) ','I am under 18 years and in the care and control of a parent/legal guardian/adopting parent who meets one criterion in clauses a-f above OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ7'?'X':' ').'] '.' h) ','I am 18 or 19 years old and can demonstrate that, on the 15 April 2011, I was the dependant of an eligible work permit holder OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ8'?'X':' ').'] '.' i) ','I am a New Zealand Aid Programme student studying in New Zealand and receiving Official Development Assistance funding (or their partner or child under 18 years old) OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ9'?'X':' ').'] '.' j) ','I am participating in the Ministry of Education Foreign language Teaching Assistantship scheme OR',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->MultiCellBlt($column_width,4.5,' ['.($citizen=='NZ10'?'X':' ').'] '.' k) ','I am a Commonwealth Scholarship holder studying in New Zealand and receiving funding from a New Zealand university under the Commonwealth Scholarship and Fellowship Fund. ',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+3); //hack $pdf->SetFont($fontname,'b',$fontsize); $pdf->MultiCellBlt($column_width,4.2,'','I confirm that, if requested, I can provide proof of my eligibility. ',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+4); //hack $pdf->SetFont($fontname,'',$fontsize); if ($debug) print ""; //$y = $pdf->getY(); $pdf -> SetXY(8, $y); //hack $pdf->WriteHTML('
I wish to enrol/re-enrol with this general practice [X] Yes [ ] No
 

'); $pdf->SetFont($fontname,'',$fontsize-1); $pdf -> SetXY(8, $y+14); //hack $pdf->MultiCellBlt($column_width,4.2,'','I understand that:',0,'L'); /// LAST PAGE //$y = $pdf->getY(); $pdf -> SetY($y+2); //hack $pdf->MultiCellBlt($column_width,4.5,' '.chr(149).' ','This provider is a member of a Primary Health Organisation (PHO) and I have been informed of the implications of enrolment with this PHO.',0,'L'); //$y = $pdf->getY(); $pdf -> SetY($y+2); //hack $pdf->MultiCellBlt($column_width,4.5,' '.chr(149).' ','I cannot enrol with more than one practice at the same time.',0,'L'); //$y = $pdf->getY(); $pdf -> SetY($y+2); //hack $pdf->MultiCellBlt($column_width,4.5,' '.chr(149).' ','This practice is funded on the basis of its enrolled register and information on this form will be sent to the Health Funding Organisation.',0,'L'); $pdf->MultiCellBlt($column_width,4.5,' '.chr(149).' ','I agree to the practice sharing my health information with other health providers involved in my healthcare. ',0,'L'); $pdf->MultiCellBlt($column_width,4.5,' '.chr(149).' ','My information may be used for practice screening & recall programmes, and practice quality activities and audit. ',0,'L'); $pdf->MultiCellBlt($column_width,4.5,' '.chr(149).' ','I have read this document and understand and agree that I am now an enrolled patient of this practice.',0,'L'); $pdf->MultiCellBlt($column_width,4.5,' [X] ','I have been given and read the Health Information Privacy Statement.',0,'L'); $y = $pdf->getY(); $pdf -> SetY($y+7); //hack $y = $pdf->getY(); // $pdf -> SetXY(8, $y); //hack $pdf->WriteHTML('
 
'); if ($debug) print ""; $txt=" Signature of patient:\n\n\n OR signed by authority"; $pdf->SetXY(8, $y+4); //hack $pdf->MultiCell(100,4,$txt,0,'L'); if ($signedby>"") { $txt="Print Name: ".ucwords($signedby)."\n\n\nRelationship to patient: ".ucwords($signedrel); } else { $txt="Print Name: $ptfname $ptsname\n\n\nRelationship to patient: ".ucwords($signedrel); } $pdf->SetXY(100, $y+4); //hack $pdf->MultiCell(100,4,$txt,0,'L'); $txt="Date: ".date("d M Y"); $pdf->SetXY(160, $y+4); //hack $pdf->MultiCell(100,4,$txt,0,'L'); //$pdf -> SetXY($x, $y); $pdf->Image(urldecode($sigimg),-6, $y-10, 120, 40, 'png'); if ($debug) print ""; // copiereffect(); $pdf->Output('F',$filesDestDir."EnrolmentForm.pdf"); // $pdf->Output('F',"/home1/remueram/tmp/Enrol523990651EnrolmentForm.pdf"); $declaration = $filesDestDir."EnrolmentForm.pdf"; //print "declar=$declaration
"; } $vars = "ptfname=".urldecode($ptfname)."&ptsname=".urldecode($ptsname)."&ptmname=".urldecode($ptmname)."&"; $vars .= "ptadr=".urldecode($ptadr)."&"; $vars .= "ptpostcode=".urldecode($ptpostcode)."&"; $vars .= "ptdob=".urldecode($ptdob)."&"; $vars .= "pteml=".urldecode($pteml)."&"; $vars .= "ptphone=".urldecode($ptphone)."&"; $vars .= "ptlandline=".urldecode($ptlandline)."&"; $vars .= "ptgender=".urldecode($ptgender)."&"; $vars .= "ptethnicity=".urldecode($ptethnicity)."&"; $vars .= "ptoccupation=".urldecode($ptoccupation)."&"; $vars .= "ptcountry=".urldecode($ptcountry)."&"; $vars .= "pttown=".urldecode($pttown)."&"; $vars .= "smoker=".urldecode($smoker)."&"; $vars .= "citizen=".urldecode($citizen)."&"; $vars .= "gppermission=".urldecode($gppermission)."&"; $vars .= "gpname=".urldecode($gpname)."&"; $vars .= "gpsurgery=".urldecode($gpsurgery)."&"; $vars .= "picpas=".urldecode($picpas)."&"; $vars .= "picvisa=".urldecode($picvisa)."&"; $vars .= "ptnhi=".urldecode($ptnhi)."&"; $vars .= "ptnhiconf=".urldecode($ptnhiconf)."&"; $vars .= "declaration=".urldecode($declaration)."&"; $payload=base64_encode($vars); $raw=base64_decode($payload); //print "Raw = $raw"; //print "out fname = ".$out['fname'].""; parse_str($raw,$out); $body = "RMC Enrolment Request
"; $body .= "
"; $body .= "Patient details
"; $body .= "Name: ".urldecode($out['ptfname'])." ".urldecode($out['ptmname'])." ".urldecode($out['ptsname'])."
"; $body .= "Address: ".urldecode($out['ptadr'])." ".urldecode($out['ptpostcode'])."
"; $body .= "DoB: ".urldecode($out['ptdob'])."
"; $body .= "Email: ".urldecode($out['pteml'])."
"; $body .= "Contact: ".urldecode($out['ptphone'])."
"; $body .= "
"; $body .= "Ethnicity and Funding entitlement
"; $body .= "Birth country: ".urldecode($out['ptcountry']).", town: ".urldecode($out['pttown'])."
"; $body .= "Ethnicity: ".urldecode($out['ptethnicity'])."
"; $body .= "Funded? ".urldecode($out['citizen'])."
"; $body .= "
"; $body .= "Health data
"; $body .= "NHI: ".urldecode($out['ptnhi']).", confidence: ".urldecode($out['ptnhiconf'])."/135
"; $body .= "Smoking status: ".urldecode($out['smoker'])."
"; $body .= "Previous GP: ".urldecode($out['gpname'])." at ".urldecode($out['gpsurgery'])."
"; $body1 = "RMC Enrolment Request
"; $body1 .= "
"; $body1 .= "Patient details
"; $body1 .= "Name: ".urldecode($out['ptfname'])." ".urldecode($out['ptmname'])." ".urldecode($out['ptsname'])."
"; $body1 .= "Address: ".urldecode($out['ptadr'])." ".urldecode($out['ptpostcode'])."
"; $body1 .= "DoB: ".urldecode($out['ptdob'])."
"; $body1 .= "Email: ".urldecode($out['pteml'])."
"; $body1 .= "Contact: ".urldecode($out['ptphone'])."
"; $body1 .= "
"; $body1 .= "Thank you for your enrolment request. Reception will be in touch if there are any questions.
"; $body1 .= "
If you would like to read our Health Information Privacy Statement, please find a copy attached to this email."; // Payment loggic // Use STRIPE (medonlines account) // sku_LjTORKUZ2Mx8Wr ADULT 220 // sku_LjTmxMzGe742a8 CHILD // sku_LjU9TDxuZCq5fl XRAY only print '

Enrolment Request sent!

'; print '

Reception will be in touch if there are any questions.

'; print "

Email confirmation of your application is on its way to ".$out['pteml']."

"; print '
'; ob_flush(); flush(); if ($page=="3") { //print "BODY---$body

"; //print "FILES---".urldecode($out['picselfie'])."|".urldecode($out['picpas'])."|".urldecode($out['declaration']); $files=urldecode($out['picpas'])."|".urldecode($out['declaration']); if ($out['picvisa']!='N/A') { $files.="|".urldecode($out['picvisa']); } require_once("mailer.php"); sendmail2("office@remmed.co.nz", "rory@remmed.co.nz", "Enrolment application - for ".urldecode($out['ptfname'])." ".urldecode($out['ptsname']), $body, $files); sendmail2(urldecode($out['pteml']), "rory@remmed.co.nz", "Remuera Medical Centre - Enrolment application - for ".urldecode($out['ptfname'])." ".urldecode($out['ptsname']), $body1, "../resources/procare_health_information_privacy.pdf"); //sendmail2("rory@johnstons.me.uk", "rory@remmed.co.nz", "Remuera Medical Centre - Enrolment application - for ".urldecode($out['fname'])." ".urldecode($out['sname']), $body, urldecode($out['picselfie'])."|".urldecode($out['picpas'])."|".urldecode($out['declaration'])); //sendmail2($out['pteml'], "rory@remmed.co.nz", "Remuera Medical Centre - Immigration Medical booking - for ".urldecode($out['fname'])." ".urldecode($out['sname']), $body1, ""); //print "fukes=$files

"; echo " "; } } require_once "footer.php"; } ?>