getFromForm();
$ordObj->setAddSlashes();
if($ordObj->writeToDatabase($tables['DoctorContact']) == false)
{
$MESSAGE = "DBError!";
}
else
{
//Setup the email to be sent
$to = $configOptions['DoctorContactEmailAddress'];
$message = $ordObj->comments;
$subject = "TDV Contact From Message";
mail($to,$subject,$message,"From: ".$ordObj->email." (".$ordObj->firstName." ".$ordObj->lastName.")\n\nMime-Version: 1.0\nContent-Type: text/plain; charset=ISO-8859-1\nContent-Transfer-Encoding: 7bit");
// if($frmObj->sendTextEmail($to,$subject,$message,$ordObj->email,$ordObj->firstName." ".$ordObj->lastName) != false){ $MESSAGE = "Your Contact Message has been sent"; } else { $MESSAGE = "Failed to send your message!"; }
$MESSAGE = "Your message has been sent!";
}
unset($command);
}
#
#
##############################################################################################
#
# Display the "Contact our Doctor" form
#
if(!isset($command) || $command == "")
{
print "
";
$code = $frmObj->makeOpenTable().$frmObj->makeOpenForm();
$code .= $frmObj->makeDataListField("Salutation:","CTTITLE",array("Mr.","Mrs.","Miss","Ms.","Dr."),array("Mr.","Mrs.","Miss","Ms.","Dr."));
$code .= $frmObj->makeTextField("First Name:","CTFIRSTNAME");
$code .= $frmObj->makeTextField("Last Name:","CTLASTNAME");
$code .= $frmObj->makeTextField("Email:","CTEMAIL");
$code .= $frmObj->makeTextField("Home Phone:","CTPHONE","","onBlur=\"javascript:this.value=formatPhone(this);\"");
$code .= $frmObj->makeTextField("Office Phone:","CTOFFICEPHONE","","onBlur=\"javascript:this.value=formatPhone(this);\"");
$code .= $frmObj->makeTextField("Fax:","CTFAX","","onBlur=\"javascript:this.value=formatPhone(this);\"");
$code .= $frmObj->makeTextArea("Message","CTCOMMENTS","","5","25");
$code .= $frmObj->makeCheckField("Contact Me:","CTCONTACTME","Y");
$code .= $frmObj->makeHiddenField("command","doSend");
$code .= $frmObj->makeButtonField("Submit","javascript:if(validate(document.theForm) == true){ document.theForm.submit(); }");
$code .= $frmObj->makeDisplayField("
Click here for more information about our team of doctors","center");
$code .= "";
if(isset($MESSAGE) && $MESSAGE != ""){ print $MESSAGE; }
print $code;
}
#
#
##############################################################################################
#
# Display the footer
#
// include("./layout/footer.inc.php");
#
#
##############################################################################################
#
# Close the database connection
#
@mysql_close($db);
?>