} else {
         $patientnotes = $Profile['patientnotes'];
     }
     if (isset($_POST['text_swnotes'])) {
         $profileActityNotes = sanitize($_POST['text_swnotes']);
     } else {
         $profileActityNotes = "";
     }
     $current_activity = new ProfileActivity(0, 0, $familyID, $sw_id, $sw_lname, $sw_fname, 0, "", "", $dateSubmit, 0, $activityType, $profileActitivityStatus, $parentfname, $parentlname, $parentemail, $parentphone1, $parentphone2, $parentAddr, $parentcity, $parentstate, $parentzip, $parentcountry, $patientfname, $patientlname, $patientrelation, $patientdob, $patientformpdf, $patientnotes, $profileActityNotes);
     //if there is a change, insert a new profileActivity object
     if ($change) {
         if (insert_ProfileActivity($current_activity)) {
             echo "Successfully inserted a profile activity request";
             //Send email to notify the rmh approvers
             $RequestKey = $current_activity->get_profileActivityRequestId();
             if (newFamilyMod($RequestKey, $familyID, $dateSubmit)) {
                 echo "An email is sent to the RMH Approver";
             }
             echo '<a href="' . BASE_DIR . '/referralForm.php?family=' . $familyID . '">Create Room Reservation</a>';
             exit;
         }
     } else {
         if (!$change) {
             echo "You did not make any changes.";
         }
     }
 } else {
     if (isset($_POST['form_token']) && !validateTokenField($_POST)) {
         //if the security validation failed. display/store the error:
         echo "The request could not be completed.";
     } else {
echo "<p>Testing RequesDeny<p>";
RequestDeny(7, '3/2', '3/3', 2, 2);
echo "testing FamilyModConfirm<p>";
FamilyModConfirm(7, 2, 2);
echo "<p>Testing FamilyModAccept<p>";
FamilyModAccept(7, 2, 2);
echo "<p>testing FamilyModDeny<p>";
FamilyModDeny(7, 2, 2);
echo "<p>Testing newRequest<p>";
newRequest(123, '3/1', '3/2', '3/3');
echo "<p>Testing NewReservationMod<p>";
newReservationMod(1234, '3/1', 2);
echo "<p>Testing NewCancel<p>";
newCancel(1321321321, '3/1', 2);
echo "<p>Testing newFamilyMod</br>";
newFamilyMod(1321321321, '3/1', 2);
echo "<p>testing family confirm<p>";
FamilyConfirm(2, '3/1', '3/2', 'nsdjasdjad');
//Testing Mail to STjohns Email
echo "<p> Testing  ST johns Email</br>";
$to = '*****@*****.**';
//valid destination email address
$subject = 'testing php mail function windows';
$message = 'This is a test email, I am testing the php mail function';
$mailed = mail($to, $subject, $message);
if ($mailed) {
    echo 'The email was sent (Stjohns).</br>';
} else {
    echo 'The email could not be sent, please try again (Stjohns)';
}
echo "<p> Testing  Gmail Email</br>";