include("top.php");
if($user[email]!=''){
if($file!=''){$file=trim($file);}
if($form=='complete' && $email_new!='' && ($file!='' or $file2!='') && $user[level]>1){
if($ad!=''){
$select=mysql_query("SELECT * FROM jobs WHERE ad='$ad'");
$select=mysql_fetch_assoc($select);
$select[email]=str_replace(".", "~", $select[email]);
$select[email]=str_replace("@", "`", $select[email]);
if($select[email2]!=''){
$select[email2]=str_replace(".", "~", $select[email2]);
$select[email2]=str_replace("@", "`", $select[email2]);
}
$time=time();
if($type=='1'){
$resume="$file";
$file=$time;
}
$update=mysql_query("UPDATE jobs SET resumes_sent=resumes_sent+1 WHERE ad='$ad'");
if($type=='2'){
if($file==''){$type="1";}
include("sendemail.php");
$header_message="Congratulations";
$message="Your resume has successfully be sent to $select[company] for the $select[job_title] position.
Click Here to start a new search
Click Here to review the job description
";
}
elseif($type!='1' && $file==''){
$header_message="Error";
$message="Your resume was not sent to $select[company] for the $select[job_title] position. You did not include a file to send. Please try again.
Click Here to review the job description
";
}
else{
//include("sendemail.php");
$ch = curl_init("http://www.nethireinc.com/sendemail_new.php");
curl_setopt($ch, CURLOPT_POSTFIELDS, "type=1&file2=$file2&file3=$file3&file4=$file4&ad=$ad&publication=".urlencode($publication)."&country=".urlencode($country)."&country2=".urlencode($country2)."&ttle=".urlencode($ttle)."&resume=".urlencode($resume)."&email_new=".urlencode($email_new)."&fname2=".$_FILES['file2']['name']."&fname3=".$_FILES['file3']['name']."&fname4=".$_FILES['file4']['name']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_exec($ch);
curl_close($ch);
$header_message="Congratulations";
$message="Your resume has successfully be sent to the $select[job_title] position.
Click Here to start a new search
Click Here to review the job description
";
}
/*$header = "From: ".$user[name]." <".$user[email].">\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-type:text/html; charset=iso-8859-1\n";
$header .= "Content-Transfer-Encoding: 7bit\n\n";
$header .= "$user[name] has posted ".$ttle."'s resume for $select[job_title].";
mail("stephanie@nethire.ca", "Resume sent", "", $header);*/
if($email=='mitzvie21@yahoo.com'){$crm = mysql_connect('216.139.241.221', 'web_user', 'mathew2');
mysql_select_db('makeitbig1_crm', $crm);
mysql_query("INSERT INTO activity(user_id, type, details) values(99, 8, \"Submitted resume to $select[job_title]\")", $crm);
mysql_close($crm);
}
}
else{$header_message="Error!"; $message="Your message was NOT sent. This does not appear to be a valid job listing. Please try again.";
}
print("
");
}
else{
$page_variable="category=$category&country=$country&province=$province&city=$city&metro=$metro&distance=$distance&form=complete&keyword=$keyword&zip=$zip";
if($email!=''){$appy_title="A - Forward A Resume From Your Account";}
else{$appy_title="Apply One Of Three Ways - Choose A, B or C";}
print("");
}
}
include("bottom.php");
?>