query("select id from patientForms where cart='$id_num'");
if ($db->nf() && $db->next_record()) {$_SESSION[patientid] = $last = $db->f("id");}
else {
$db->query("insert into `patientForms` (id,cart) values ('0','$id_num')");
$db->query("select id from `patientForms` where cart='$id_num'");
if ($db->nf() && $db->next_record()) {$_SESSION[patientid] = $last = $db->f("id");}
}
}
// initialize local variables
$map = "http://classic.mapquest.com/maps?city=Los+Angeles&state=CA&address=8631+W+3rd+St&zipcode=90048-5901&country=US&latitude=34.0736&longitude=-118.38058&geocode=ADDRESS";
// validate any incoming data
require("includes/validateIncomingData.inc.php");
// reload name etc. if we have it
if ($_SESSION["fname"]) {$fname = $_SESSION["fname"];}
if ($_SESSION["middle"]) {$middle = $_SESSION["middle"];}
if ($_SESSION["lname"]) {$fname = $_SESSION["lname"];}
if ($_SESSION["dobMonth"]) {$dobm = $_SESSION["dobMonth"];}
if ($_SESSION["dobDay"]) {$dobd = $_SESSION["dobDay"];}
if ($_SESSION["dobYear"]) {$doby = $_SESSION["dobYear"];}
// check for request to file
if ($_POST["doit"] && $_POST["doit"] == "File Package Electronically") {
/*
if (!$_SESSION[forms][introletter]) {$headline = "Please Read and Accept the Open Access Colonoscopy Letter first ...";}
else
//*/
if (!$_SESSION[forms][demographics]) {$headline = "Please complete the Patient Demographics form first ...";}
elseif (!$_SESSION[forms][history]) {$headline = "Please complete the Patient Medical History form first ...";}
elseif (!$_SESSION[forms][privacy]) {$headline = "Please Read and Accept the Privacy Statement first ...";}
elseif (!$_SESSION[forms][billing]) {$headline = "Please Read and Accept the Billing Entities Information first ...";}
elseif ($_SESSION[BlueCross] && !$_SESSION[forms][anesthesia]) {$headline = "Please Read and Accept the Blue Cross Anesthesia Letter first ...";}
else {
$_SESSION[forms][completed] = TRUE;
$db->query("update patientForms set completed='".date("Y-m-d H:i:s")."'");
include("control/downloadcheckedforms3.inc.php");
// send e-mail to Helen and Bob
$db->query("select * from patientForms where id='".$_SESSION[patientid]."'");
$db->next_record();
$msg = "
A new Registration has been completed online
".strtoupper($db->f("lname")).", ".ucfirst($db->f("fname"))." ".ucfirst($db->f("middle"))."
DOB: ".$db->f("dobm")."-".$db->f("dobd")."-".$db->f("doby")."
You can download the Registration Form from the
Control Panel
";
mail("bowker@inetwebinc.com","LAGASTRO Patient Registration",$msg,"From:webmaster@lagastro.org\nReply-To:webmaster@lagastro.org\nX-Mailer: PHP/".phpversion(),"-fwebmaster@lagastro.org");
if (!$debug) {
mail("helenforshare@gmail.com?","Patient Online Registration",$msg,"From:webmaster@lagastro.org\nReply-To:webmaster@lagastro.org\nX-Mailer: PHP/".phpversion()."\n-fwebmaster@lagastro.org");
}
}
}
// initialize for this page
$drop_months = $drop_years = "";
$drop_dob_month = "
";
if ($dobm) {$drop_dob_month = ereg_replace($dobm."'>",$dobm."' selected='selected'>",$drop_dob_month);}
$drop_dob_days = "";
for ($i=1;$i<=31;$i++) {$drop_dob_days .= "";}
if ($dobd) {$drop_dob_days = ereg_replace($dobd."'>",$dobd."' selected='selected'>",$drop_dob_days);}
$drop_dob_years = "";
for ($i=(date("Y")-85);$i<=date("Y");$i++) {$drop_dob_years .= "";}
if ($doby) {$drop_dob_years = ereg_replace(">".$doby," selected='selected'>".$doby,$drop_dob_years);}
$drop_years = ereg_replace("