"; $CONFIG['errorWrapperStop'] = "\n"; $CONFIG['messageWrapperStart'] = "
  • "; $CONFIG['messageWrapperStop'] = "
  • \n"; $CONFIG['messageBoxOpen'] = "\n
    \n"; $CONFIG['errorDisplayWrapperStart'] = "\n"; $CONFIG['messageDisplayWrapperStart'] = "\n"; $CONFIG['messageBoxClose'] = "
    \n"; $print=FALSE; #### Define functions #### function SDIGaddError($msg){ global $CONFIG, $error; $error[] = $CONFIG['errorWrapperStart'] . $msg . $CONFIG['errorWrapperStop']; } function SDIGaddMessage($msg){ global $CONFIG, $message; $message[] = $CONFIG['messageWrapperStart'] . $msg . $CONFIG['messageWrapperStop']; } function SDIGaddSlashes($str){ /* Ensure addslashes works regardless of magic_quotes_gpc(). Use on all user input via forms, querystring and cookies. */ if (get_magic_quotes_gpc() == 1) { return $str; }else{ return addslashes($str); } } function SDIGantiHackContact($string, $maxlength=FALSE, $stripStrings=FALSE){ if($maxlength){ $string = substr($string, 0, $maxlength); } if($stripStrings){ foreach($stripStrings AS $k => $v){ $string = str_replace($v, "", $string); } } return $string; } function SDIGbuildRadios($name, $radioOptions, $selected, $br=FALSE){ if($br) $br = "
    "; else $br = ""; $output = ""; $i=0; foreach($radioOptions AS $k => $v){ if($i>0) $output .= "\n$br"; $output .= "\n\n"; $i++; } return $output; } function SDIGcheckEmail($email){ if(strlen($email) >= 5){ // Initial primitive email check if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$email)){ return FALSE; } }else{ return FALSE; } return TRUE; } function SDIGerrorField($field){ global $TEMPLATE, $errorFlagInvalidField; $TEMPLATE['errorFields'][$field] = "Error"; //if(!$errorFlagInvalidField) SDIGaddError("Error: invalid value(s) submitted (see marked fields)."); //$errorFlagInvalidField = TRUE; } function SDIGformatMessages($errorArray=FALSE, $messageArray=FALSE, $warningArray=FALSE){ global $CONFIG, $error, $message, $warning; if(!$errorArray) $errorArray=$error; if(!$messageArray) $messageArray=$message; if(!$warningArray) $warningArray=$warning; $ERR=FALSE; $MSG=FALSE; $WNG=FALSE; $output=FALSE; if(count($errorArray)>0){ #print_r($errorArray); #echo count($errorArray); #echo gettype($errorArray); foreach($errorArray AS $k => $v){ $ERR .= $v; } } if(count($messageArray)>0){ #print_r($messageArray); #echo count($messageArray); #echo gettype($messageArray); #echo $messageArray; foreach($messageArray AS $k => $v){ $MSG .= $v; } } if(count($warningArray)>0){ #print_r($warningArray); #echo count($warningArray); #echo gettype($warningArray); #echo $warningArray; foreach($warningArray AS $k => $v){ $WNG .= $v; } } if($ERR || $WNG || $MSG){ $output .= $CONFIG['messageBoxOpen']; } if($ERR){ $output .= $CONFIG['errorDisplayWrapperStart'] . $ERR . $CONFIG['errorDisplayWrapperStop']; } if($WNG){ $output .= $CONFIG['errorDisplayWrapperStart'] . $WNG . $CONFIG['errorDisplayWrapperStop']; } if($MSG){ $output .= $CONFIG['messageDisplayWrapperStart'] . $MSG . $CONFIG['messageDisplayWrapperStop']; } if($ERR || $WNG || $MSG){ $output .= $CONFIG['messageBoxClose']; } return $output; } function SDIGformatRequestData($requestArray, $SDIGaddSlashes, $addSlashes, $stripslashes, $htmlspecialchars){ // Formats data passed through GET, POST and COOKIE methods, including arrays and 2D arrays foreach($requestArray AS $k => $v){ global $$k; if(is_array($requestArray[$k])){ // treat arrays separately $numElements = count($requestArray[$k]); $$k = array(); foreach($requestArray[$k] AS $key => $val){ if(is_array($requestArray[$k][$key])){ // treat arrays separately $numElements2 = count($requestArray[$k][$key]); $$key = array(); foreach($requestArray[$k][$key] AS $key2 => $val2){ if($SDIGaddSlashes) $val2 = SDIGaddSlashes($val2); if($addSlashes) $val2 = addSlashes($val2); if($stripslashes) $val2 = stripslashes($val2); if($htmlspecialchars) $val2 = htmlspecialchars($val2); ${$key}[$key2] = $val2; } ${$k}[$key] = $$key; }else{ // handle all non-arrays here if($SDIGaddSlashes) $val = SDIGaddSlashes($val); if($addSlashes) $val = addSlashes($val); if($stripslashes) $val = stripslashes($val); if($htmlspecialchars) $val = htmlspecialchars($val); ${$k}[$key] = $val; } } }else{ // handle all non-arrays here if($SDIGaddSlashes) $v = SDIGaddSlashes($v); if($addSlashes) $v = addSlashes($v); if($stripslashes) $v = stripslashes($v); if($htmlspecialchars) $v = htmlspecialchars($v); $$k = $v; } } } #### Format data #### #SDIGformatRequestData($requestArray, $SDIGaddSlashes, $addSlashes, $stripslashes, $htmlspecialchars) SDIGformatRequestData($_REQUEST, TRUE, FALSE, TRUE, FALSE); #### Process form #### if($_POST['action']=="submit"){ /* #### Antihack processes #### $stripStrings = array( "boundary=" , "Boundary=" , "Content-Type:" , "content-type:" , "Content-Transfer-Encoding:" , "content-transfer-encoding:" , "Transfer-Encoding:" , "transfer-encoding:" , "This is a multi-part message in MIME format" ); $stripStrings2 = array( "@" ); $firstname = SDIGantiHackContact($firstname, 60, $stripStrings); $firstname = SDIGantiHackContact($firstname, FALSE, $stripStrings2); $surname = SDIGantiHackContact($surname, 60, $stripStrings); $surname = SDIGantiHackContact($surname, FALSE, $stripStrings2); $company = SDIGantiHackContact($company, 60, $stripStrings); $address = SDIGantiHackContact($address, 255, $stripStrings); $city = SDIGantiHackContact($city, 60, $stripStrings); $state = SDIGantiHackContact($state, 60, $stripStrings); $zip = SDIGantiHackContact($zip, 20, $stripStrings); $tel = SDIGantiHackContact($tel, 40, $stripStrings); $mobile = SDIGantiHackContact($mobile, 40, $stripStrings); $fax = SDIGantiHackContact($fax, 40, $stripStrings); $subject = SDIGantiHackContact($subject, 100, $stripStrings); $text = SDIGantiHackContact($text, 10000, $stripStrings); */ #### Validate form #### if(strlen($referringPractice)<1){ SDIGerrorField("referringPractice"); SDIGaddError("Please enter the name of the referring practice."); } if(strlen($practiceAddress)<1){ SDIGerrorField("practiceAddress"); SDIGaddError("Please enter the address of the referring practice."); } if(strlen($referringDentist)<1){ SDIGerrorField("referringDentist"); SDIGaddError("Please enter the name of the referring dentist."); } if(strlen($practiceTel)<1){ SDIGerrorField("practiceTel"); SDIGaddError("Please enter the telephone number of the referring practice."); } if(!SDIGcheckEmail($practiceEmail)){ SDIGerrorField("practiceEmail"); SDIGaddError("Please enter a valid email address for the referring practice."); } if(strlen($patientName)<1){ SDIGerrorField("patientName"); SDIGaddError("Please enter the name of the patient."); } if(strlen($patientAddress)<1){ SDIGerrorField("patientAddress"); SDIGaddError("Please enter the patient's address."); } if(strlen($patientDob)<1){ SDIGerrorField("patientDob"); SDIGaddError("Please enter the patient's date of birth."); } if(strlen($patientTel)<1){ SDIGerrorField("patientTel"); SDIGaddError("Please enter the patient's telephone number."); } if(strlen($patientMobile)<1){ SDIGerrorField("patientMobile"); SDIGaddError("Please enter the patient's mobile number."); } if(!SDIGcheckEmail($patientEmail) && $patientEmail != 'none' && $patientEmail != 'None'){ SDIGerrorField("patientEmail"); SDIGaddError("Please enter a valid email address for the patient (or enter "None" if they don't have one)."); } if(strlen($patientReferralUrgent)<1){ SDIGerrorField("patientReferralUrgent"); SDIGaddError("Please confirm if the referral is urgent."); } #### Build & send email #### if(!$error){ #### Format EOL chars #### $patientHistory = str_replace("\r\n", "\n", $patientHistory); $practiceAddress = str_replace("\r\n", ", ", $practiceAddress); $patientAddress = str_replace("\r\n", ", ", $patientAddress); #### Build email headers (addslashes() required) #### $emailSubject = $SETTINGS['siteName'] . " referral"; $emailFromName = $referringPractice; // $emailHeaders = // "From: " . addslashes($emailFromName) . "<" . addslashes($practiceEmail) . ">\r\n" // . "Reply-To: " . addslashes($emailFromName) . "<" . addslashes($practiceEmail) . ">\r\n"; $emailHeaders = "Reply-To: " . addslashes($emailFromName) . "<" . addslashes($practiceEmail) . ">\r\n"; if(!empty($emailBcc)) $emailHeaders .= 'Bcc: '.addslashes($emailBcc) . "\r\n"; #### Build email message (addslashes() not required) #### $emailMessage = " Referring Practice Details ------------------------------------ Name: {$referringPractice} Address: {$practiceAddress} Dentist name: {$referringDentist} Tel: {$practiceTel} Email: {$practiceEmail} Referral date: " . date("j M Y \a\\t g:ia") . " Patient Details ------------------------------------ Name: {$patientName} Address: {$patientAddress} Date of birth: {$patientDob} Tel: {$patientTel} Mobile: {$patientMobile} Email: {$patientEmail} Is referral urgent: {$patientReferralUrgent} Reasons For Referral ------------------------------------ Opinion only: " . ( $reasonOpinionOnly=='y' ? 'YES' : 'NO') . " Single tooth missing: " . ( $reasonSingleToothMissing=='y' ? 'YES' : 'NO') . " Totally edentulous jaw(s): " . ( $reasonEdentulous=='y' ? 'YES' : 'NO') . " Multiple teeth missing: " . ( $reasonMultipleTeethMissing=='y' ? 'YES' : 'NO') . " Full mouth rehabilitation: " . ( $reasonFullMouth=='y' ? 'YES' : 'NO') . " Cosmetic: " . ( $reasonCosmetic=='y' ? 'YES' : 'NO') . " Affected areas: {$affectedAreas} Types of implant retained restoration which have been explained to the patient ------------------------------------ Single tooth implant: " . ( $explainedSingleTooth=='y' ? 'YES' : 'NO') . " Implant and tooth retained bridge: " . ( $explainedImplantAndToothRetainedBridge=='y' ? 'YES' : 'NO') . " Partial overdenture: " . ( $explainedPartialOverdenture=='y' ? 'YES' : 'NO') . " Full restorative case incl. perio, prostho and implants: " . ( $explainedFullRestorative=='y' ? 'YES' : 'NO') . " Implant supported bridge: " . ( $explainedImplantSupportedBridge=='y' ? 'YES' : 'NO') . " Hybrid prosthesis: " . ( $explainedHybridProsthesis=='y' ? 'YES' : 'NO') . " Full overdenture: " . ( $explainedFullOverdenture=='y' ? 'YES' : 'NO') . " Teeth-in-an-hour: " . ( $explainedTeethInAnHour=='y' ? 'YES' : 'NO') . " Is your request for implant placement only? {$placementOnly} Has the patient been made aware of the level of investment that may be required? {$investmentAware} Diagnostic Aids ------------------------------------ OPG: " . ( $aidsOpg=='y' ? 'YES' : 'NO') . " PAs: " . ( $aidsPas=='y' ? 'YES' : 'NO') . " Other radiographs: " . ( $aidsOtherRadiographs=='y' ? 'YES' : 'NO') . " Study models to accompany the patient? {$studyModels} Brief History ------------------------------------ {$patientHistory} "; #### Send email #### mail($emailTo, $emailSubject, $emailMessage, $emailHeaders); #### Set success message #### SDIGaddMessage("Thank you, your referral has been sent successfully. Please print for your records or start over."); $print=TRUE; } } if($error || $print){ #### Retain form entries #### foreach($_REQUEST AS $k => $v){ $$k = stripslashes(SDIGaddSlashes($v)); $TEMPLATE[$k] = htmlspecialchars(stripslashes(SDIGaddSlashes($v))); } } #### Build form controls #### if($reasonOpinionOnly=='y') $TEMPLATE['reasonOpinionOnlyChecked']=" checked=\"checked\""; else $TEMPLATE['reasonOpinionOnlyChecked']=""; if($reasonSingleToothMissing=='y') $TEMPLATE['reasonSingleToothMissingChecked']=" checked=\"checked\""; else $TEMPLATE['reasonSingleToothMissingChecked']=""; if($reasonEdentulous=='y') $TEMPLATE['reasonEdentulousChecked']=" checked=\"checked\""; else $TEMPLATE['reasonEdentulousChecked']=""; if($reasonMultipleTeethMissing=='y') $TEMPLATE['reasonMultipleTeethMissingChecked']=" checked=\"checked\""; else $TEMPLATE['reasonMultipleTeethMissingChecked']=""; if($reasonFullMouth=='y') $TEMPLATE['reasonFullMouthChecked']=" checked=\"checked\""; else $TEMPLATE['reasonFullMouthChecked']=""; if($reasonCosmetic=='y') $TEMPLATE['reasonCosmeticChecked']=" checked=\"checked\""; else $TEMPLATE['reasonCosmeticChecked']=""; if($explainedSingleTooth=='y') $TEMPLATE['explainedSingleToothChecked']=" checked=\"checked\""; else $TEMPLATE['explainedSingleToothChecked']=""; if($explainedImplantAndToothRetainedBridge=='y') $TEMPLATE['explainedImplantAndToothRetainedBridgeChecked']=" checked=\"checked\""; else $TEMPLATE['explainedImplantAndToothRetainedBridgeChecked']=""; if($explainedPartialOverdenture=='y') $TEMPLATE['explainedPartialOverdentureChecked']=" checked=\"checked\""; else $TEMPLATE['explainedPartialOverdentureChecked']=""; if($explainedFullRestorative=='y') $TEMPLATE['explainedFullRestorativeChecked']=" checked=\"checked\""; else $TEMPLATE['explainedFullRestorativeChecked']=""; if($explainedImplantSupportedBridge=='y') $TEMPLATE['explainedImplantSupportedBridgeChecked']=" checked=\"checked\""; else $TEMPLATE['explainedImplantSupportedBridgeChecked']=""; if($explainedHybridProsthesis=='y') $TEMPLATE['explainedHybridProsthesisChecked']=" checked=\"checked\""; else $TEMPLATE['explainedHybridProsthesisChecked']=""; if($explainedFullOverdenture=='y') $TEMPLATE['explainedFullOverdentureChecked']=" checked=\"checked\""; else $TEMPLATE['explainedFullOverdentureChecked']=""; if($explainedTeethInAnHour=='y') $TEMPLATE['explainedTeethInAnHourChecked']=" checked=\"checked\""; else $TEMPLATE['explainedTeethInAnHourChecked']=""; if($aidsOpg=='y') $TEMPLATE['aidsOpgChecked']=" checked=\"checked\""; else $TEMPLATE['aidsOpgChecked']=""; if($aidsPas=='y') $TEMPLATE['aidsPasChecked']=" checked=\"checked\""; else $TEMPLATE['aidsPasChecked']=""; if($aidsOtherRadiographs=='y') $TEMPLATE['aidsOtherRadiographsChecked']=" checked=\"checked\""; else $TEMPLATE['aidsOtherRadiographsChecked']=""; $radioOptions=array(); $radioOptions['Yes']='Yes'; $radioOptions['No']='No'; $TEMPLATE['radiosPatientUrgent']=SDIGbuildRadios('patientReferralUrgent', $radioOptions, $patientReferralUrgent); $radioOptions=array(); $radioOptions['Upper']='Upper'; $radioOptions['Lower']='Lower'; $radioOptions['Both']='Both'; if(empty($affectedAreas)) $affectedAreas='Both'; // default value $TEMPLATE['radiosAffectedAreas']=SDIGbuildRadios('affectedAreas', $radioOptions, $affectedAreas); $radioOptions=array(); $radioOptions['Yes']='Yes'; $radioOptions['No']='No'; if(empty($placementOnly)) $placementOnly='No'; // default value $TEMPLATE['radiosPlacementOnly']=SDIGbuildRadios('placementOnly', $radioOptions, $placementOnly); $radioOptions=array(); $radioOptions['Yes']='Yes'; $radioOptions['No']='No'; if(empty($investmentAware)) $investmentAware='No'; // default value $TEMPLATE['radiosInvestmentAware']=SDIGbuildRadios('investmentAware', $radioOptions, $investmentAware); $radioOptions=array(); $radioOptions['Yes']='Yes'; $radioOptions['No']='No'; if(empty($studyModels)) $studyModels='No'; // default value $TEMPLATE['radiosStudyModels']=SDIGbuildRadios('studyModels', $radioOptions, $studyModels); $TEMPLATE['MSG'] = SDIGformatMessages(); ?> Dentist Referral Form - Dream Implant Clinic

    Dentist Referral Form

    Please complete the form as fully as possible, ensuring that all fields in the Practice Details and Patient Details sections are completed. When done, please click the Submit button to send the details to us. Once submitted you will be able to print the completed form for your records.

    Practice Details

    Patient Details

    Referral Information (please tick all relevant boxes)

    Reasons for referral:

    Affected areas:

    Types of implant retained restoration which have been explained to the patient:

    Is your request for implant placement only?

    Has the patient been made aware of the level of investment that may be required?

    Brief History (comments about this referral)

    Diagnostic Aids (please tick all relevant boxes)

    In order to minimise unnecessary exposure please indicate which radiographs you are sending with the referral:

    For more complex cases please indicate that study models will accompany the patient for the initial consultation:

    Please be assured that we will neither approach nor accept your patient for non-referred treatment.

    Dr R J Anderson BDS LDS RCS (Eng) MMedSci | Dr K Ruiz BMed Sci MB ChB FRCA
    Tel: 0114 287 2305