Edit Profile

[ Go Back ]

Use the below form to edit your profile information. When you're satisfied, click "Submit" to update your profile. eof; $newaction = "updateprofile"; $result = $db->query("SELECT * FROM users WHERE user_id='$s->suser_id'"); $result->fetchInto($row); include("forms/profileForm.php"); break; ////////////////////////////////////////////////////////////////////////////////////////////////////////////// //updateprofile ////////////////////////////////////////////////////////////////////////////////////////////////////////////// case"updateprofile": print<< eof; //run tests... if ($post->email != $post->confirm_email){ print"

Error

The email address you entered did not match. Please make your corrections below and click \"Submit\" to continue.

"; print""; $row = $post; $newaction="updateprofile"; include("forms/profileForm.php"); exit; } //change the region_array into...um...a region array. $regions=$post->region_array; if (is_array($regions)){ $region_array=implode(",",$regions); }else{ $region_array=$regions; } // grab the region count for later... $dbRegions = $db->getOne("SELECT region_array FROM users WHERE user_id='$s->suser_id'"); $dbRegionArray = explode(",",$dbRegions); $oldCount = count($dbRegionArray); $newCount = count($regions); $db->query("UPDATE users SET firstname='$post->firstname', initial='$post->initial',lastname='$post->lastname',username='$post->username', email='$post->email',address_one='$post->address_one',address_two='$post->address_two',city='$post->city',state='$post->state',zipcode='$post->zipcode',country='$post->country',phone='$post->phone',fax='$post->fax',home_region_id='$post->home_region_id',contact_me='$post->contact_me',region_array='$region_array',schoolLocation='$post->schoolLocation' WHERE user_id='$s->suser_id'"); print<<Success

Your profile has been updated.

Click here to return to the index page.

eof; if ($oldCount < $newCount){ print"

Your selected regions have changed. If you would like to see the job postings that are in your new regions click here."; } print<< eof; $result = $db->query("SELECT * FROM users WHERE user_id='$s->suser_id'"); $result->fetchInto($row); $time=new timeConversion; $time->dbdate = $row->created; $created = $time->datetime2long(); if ($row->expires !=0){ $time->dbdate=$row->expires; $expires = $time->datetime2long(); }else{ $expires = "Not Active"; } $home_region = $db->getOne("SELECT CONCAT(state, ' - ', region_name) FROM regions WHERE region_id='$row->home_region_id'"); print<<

$row->firstname $row->initial $row->lastname

Click here to edit this information.

Application Date: $created
Expiration Date: $expires
Address: $row->address_one
$row->address_two
$row->city $row->state $row->zipcode $row->country
Email Address: $row->email
Phone: $row->phone
Fax: $row->fax
Home Region: $home_region
Other Regions: eof; $regions=explode(",",$row->region_array); if (is_array($regions)){ foreach($regions as $key=>$region_id){ $region = $db->getOne("SELECT CONCAT(state, ' - ', region_name) FROM regions WHERE region_id='$region_id'"); print"$region
"; } }else{ print"$regions"; } print<<
eof; break; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //changepass //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// case"changepass": print<<

Change Password

[ Go Back ]

Use the below form to change your password.

eof; $user_id=$s->suser_id; $newaction="updatepass"; include("forms/passForm.php"); break; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //updatepass //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// case"updatepass"; if ($post->password != $post->confirm_password){ print<<

Error

The passwords you entered did not match. Please use the form below to try again. eof; $user_id=$s->suser_id; $newaction="updatepass"; include("forms/passForm.php"); exit; } $cryptpass = md5($post->password); $db->query("UPDATE users SET password='$cryptpass' where user_id='$s->suser_id'"); $result = $db->query("SELECT * FROM users WHERE user_id='$s->suser_id'"); $result->fetchInto($row); $to = $row->email; $toname = $row->firstname . " " .$row->lastname; $from = "info@dentalassist.org"; $fromname = "DentalAssist.org"; $subject = "Your login information has changed"; $body = "$row->firstname $row->lastname,\r\nYour login information at DentalAssist.org has changed. Your new login information is\r\n\r\nUsername: $row->username\r\nPassword: $post->password\r\n\r\n"; $body.="You may now sign into DentalAssist.org by going to http://dentalassist.org/members/login.php and using the above information.\r\n\r\nThanks,\r\nDentalAssist.org"; sendEmail($to,$toname, $subject,$body,$from,$fromname); //mail the user the login info print<<

Success

Your password has been successfully changed to $post->password and you have been sent an email reminder.

Click here to return to the index.


eof; break; ////////////////////////////////////////////////////////////////////////////////////////////////////////////// //default ////////////////////////////////////////////////////////////////////////////////////////////////////////////// default: $result = $db->query("SELECT * FROM users WHERE user_id='$s->suser_id'"); $result->fetchInto($row); $time=new timeConversion; $time->dbdate = $row->created; $created = $time->datetime2long(); if ($row->expires !=0){ $time->dbdate=$row->expires; $expires = $time->datetime2long(); }else{ $expires = "Not Active"; } $home_region = $db->getOne("SELECT CONCAT(state, ' - ', region_name) FROM regions WHERE region_id='$row->home_region_id'"); print<<

$row->firstname $row->initial $row->lastname

[ Go Back ]

Click here to edit this information.

Application Date: $created
Expiration Date: $expires
Address: $row->address_one
$row->address_two
$row->city $row->state $row->zipcode $row->country
Email Address: $row->email
Phone: $row->phone
Fax: $row->fax
Home Region: $home_region
Other Regions: eof; $regions=explode(",",$row->region_array); if (is_array($regions)){ foreach($regions as $key=>$region_id){ $region = $db->getOne("SELECT CONCAT(state, ' - ', region_name) FROM regions WHERE region_id='$region_id'"); print"$region
"; } }else{ print"$regions"; } print<<
eof; break; ////////////////////////////////////////////////////////////////////////////////////////////////////////////// //end switch($action) ////////////////////////////////////////////////////////////////////////////////////////////////////////////// } include("inc/foot.php"); ?>