"; $out_str = $out_str."
Select Category"; #$count = 1; while($row = mysql_fetch_array($result)){ $out_str = $out_str."
".$row["categories"]; $count++; } $out_str = $out_str."
"; $out_str = str_replace("
", "
", $out_str); echo $out_str; return 1; } function signup(){ $js_str = " "; echo $js_str; echo "
.
Volunteer Signup
This signup is for volunteers.
Voluntary organisations
can signup by
clicking here
.
By signing up you subscribe to the newsletter and register your interests. Your details are NOT used by organisations to email/contact you.
We will
never
rent, sell or give away your
personal details.
Help!
Name
Email
"; echo "
Primary Interest
"; show_cats(0,"primary_cat"); echo "
Secondary Interest
"; show_cats(0,"secondary_cat"); echo "
Other Interests
"; show_cats(0,"other_cat"); echo "
Recieve relevent messages from select partners
"; echo "
"; echo "
"; } function check_email($nl_id_glob){ require("db_conn.php3"); $select_str = "SELECT nl_id, email FROM newsletter WHERE email='".trim($GLOBALS["email"])."'"; $result = mysql_query($select_str); $row = mysql_fetch_array($result); $nl_id_glob = $row["nl_id"]; return mysql_affected_rows(); } function insert(){ #require("db_conn.php3"); $start_date = date("Y-m-d", time()); ($GLOBALS["opt_in"] == "on") ? ($opt_in = 1) : ($opt_in = 0); $insert_str = "INSERT newsletter (name,email,start_date,primary_cat,secondary_cat,other_cat,opt_in) VALUES ('".$GLOBALS["name"]."', '".trim($GLOBALS["email"])."', '".$start_date."', '".$GLOBALS["primary_cat"]."', '".$GLOBALS["secondary_cat"]."', '".$GLOBALS["other_cat"]."', ".$opt_in.")"; $result = mysql_query($insert_str); } function update(){ #require("db_conn.php3"); ($GLOBALS["opt_in"] == "on") ? ($opt_in = 1) : ($opt_in = 0); $update_str = "UPDATE newsletter SET name='".$GLOBALS["name"]."', email='".trim($GLOBALS["email"])."', primary_cat=".$GLOBALS["primary_cat"].", secondary_cat=".$GLOBALS["secondary_cat"].", other_cat=".$GLOBALS["other_cat"].", opt_in=".$opt_in." WHERE nl_id=".$GLOBALS["nl_id"]; $result = mysql_query($update_str); } function delete(){ #handled by listserver } function delete_OK(){ #handled by listserver } function edit(){ #require("db_conn.php3"); $select_str = "SELECT * FROM newsletter WHERE email='".trim($GLOBALS["email"])."'"; $result = mysql_query($select_str); $row = mysql_fetch_array($result); $row["opt_in"] == "1" ? $opt_in = "CHECKED" : $opt_in = ""; $js_str = " "; echo $js_str; echo "
.
Edit Volunteer Profile
Name
Email
"; echo "
Primary Interest
"; show_cats($row["primary_cat"],"primary_cat"); echo "
Secondary Interest
"; show_cats($row["secondary_cat"],"secondary_cat"); echo "
Other Interests
"; show_cats($row["other_cat"],"other_cat"); echo "
Recieve relevent email from select partners
"; echo "
"; echo "
"; } function saved(){ echo "
.
Volunteer Signup
Thank you, your changes have been saved.
You can change your interest profile anytime by typing in your email address in the
home page
and clicking 'Edit Profile!'.
You will be receiving your first email newsletter very shortly. Please remember to keep checking back for any new positions or organisations.
"; } menu_bar("signup"); switch ($action_flag){ case "edit": if (check_email(&$nl_id_glob) == 1){ edit(); } else { echo "
Invalid email address.
Are you sure you have
signed up as a volunteer?
Please go back and try again.
If login problems persist, please contact
support@evolunteer.co.uk
"; } break; case "insert"; if (check_email(&$nl_id_glob) == 0){ insert(); #edit(); saved(); } else { echo "
Email already in use or invalid.
Please go back and try again.
If login problems persist, please contact
support@evolunteer.co.uk
"; } break; case "update": $nl_id_glob; if ((check_email(&$nl_id_glob) == 1 && $nl_id_glob == $nl_id) || (check_email(&$nl_id_glob) == 0)){ update(); #edit(); saved(); } else { echo "
Email already in use or invalid.
Please go back and try again.
If login problems persist, please contact
support@evolunteer.co.uk
"; } break; case "delete": delete(); break; case "delete_OK": delete_OK(); break; default: signup(); break; } ?>