include("top.php");
if($page=='delete'){
if($id!='' && $e!=''){
if($form=='complete'){
$success="
|
Job Alert Removed |
Your job alert has been successfully removed. You will no longer be notified with results. You are welcome to create new alerts at any time.
If you have created multiple alerts, you will continue to receive results however you will not be notified with results that match this criteria.
Return to the homepage
Search Jobs
|
|
";
$failure="";
$query=mysql_query("DELETE FROM job_alerts WHERE id='$id' && email='$e'") && print($success) or print($failure);
}
else{
print("");
}
}
else{
print("
|
Error |
| You have not selected an email alert to delete. Please follow the link in your email to ensure that you access the correct job alert. |
|
");
}
}
elseif($page=='add'){
$time=time();
if($category=='All Categories'){$category='';}
$zip=strtoupper($zip);
$zip=str_replace(" ", "", $zip);
if(strlen($zip)>=6){$zip=substr($zip, 0, 3)." ".substr($zip, 3, 3);}
$pos1=strpos("$zip", '00');
$pos2=strpos("$zip", '0');
if($pos1 === false){}
elseif($pos1!== false){if($pos1==0){$zip=substr($zip, 1);}}
if($pos2=== false){}
elseif($pos2!== false){if($pos2==0){$zip=substr($zip, 1);}}
$zip_coordinates=mysql_query("SELECT lattitude, longitude FROM zip_code WHERE zip_code='$zip'");
$zip_coordinates=mysql_fetch_assoc($zip_coordinates);
$max_lat=$zip_coordinates[lattitude]+($distance/100);
$min_lat=$zip_coordinates[lattitude]-($distance/100);
$max_long=$zip_coordinates[longitude]+($distance/100);
$min_long=$zip_coordinates[longitude]-($distance/100);
$success="
|
Job Alert Added |
Your job alert has been successfully added. You will now receive emails notifying you of jobs that match your criteria.
Return to the homepage Search jobs |
|
";
$failure="";
$insert=mysql_query("INSERT INTO job_alerts(id, email, category, job_title, max_latitude, min_latitude, max_longitude, min_longitude, publication) values('$time', '$e', '$category', '$job_title', '$max_lat', '$min_lat', '$max_long', '$min_long', '$publication')") && print($success) or print($failure);
}
else{
print("");
}
include("bottom.php");
?>