<?php
####################################################################################

$nume = str_ireplace(array('"', "'"), '', (stripslashes ( strip_tags ($_POST['nume']))));
$adresa = str_ireplace(array('"', "'"), '', (stripslashes ( strip_tags ($_POST['adresa']))));
$telefon = str_ireplace(array('"', "'"), '', (stripslashes ( strip_tags ($_POST['telefon']))));
$email = str_ireplace(array('"', "'"), '', (stripslashes ( strip_tags ($_POST['email']))));
$studii = str_ireplace(array('"', "'"), '', (stripslashes ( strip_tags ($_POST['studii']))));
$exp = str_ireplace(array('"', "'"), '', (stripslashes ( strip_tags ($_POST['exp']))));
$abilitati = str_ireplace(array('"', "'"), '', (stripslashes ( strip_tags ($_POST['abilitati']))));
$scrisoare = stripslashes ( strip_tags ($_POST['scrisoare']));
$cod_securitate = str_ireplace(array('"', "'"), '', (stripslashes ( strip_tags ($_POST['cod_securitate']))));

if($cod_securitate == "12" ){
	//$to = "office@libertrans.ro";
	$to = "office@libertrans.ro";
	$subject = 'O noua cerere de angajare';
	$headers = 'MIME-Version: 1.0'."\r\n";
	$headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
	$headers .= 'From: '.$email.'>'."\r\n";	
	
	$content = "<B>NUME SI PRENUME:</B>&nbsp;&nbsp;" . $_POST['nume'] ."<br>
				<B>ADRESA:</B>&nbsp;&nbsp;". $_POST['adresa'] ."<br>
				<B>TELEFON :</B>&nbsp;&nbsp;<a href='tel:".$_POST['telefon']."'>".$_POST['telefon']."</a><br>
				<B>EMAIL :</B>&nbsp;&nbsp;<a href='mailto:".$_POST['email']."'>".$_POST['email']."</a><br>
				<B>STUDII :</B>&nbsp;&nbsp;". $_POST['studii'] ."<br>
				<B>EXPERIENTA :</B>&nbsp;&nbsp;". $_POST['exp'] ."<br>
				<B>EXPERIENTA :</B>&nbsp;&nbsp;". $_POST['expe'] ."<br>
				<B>EXPERIENTA :</B>&nbsp;&nbsp;". $_POST['exper'] ."<br>
				<B>EXPERIENTA :</B>&nbsp;&nbsp;". $_POST['experi'] ."<br>
				<B>EXPERIENTA :</B>&nbsp;&nbsp;". $_POST['experie'] ."<br>
				<B>ABILITATI:</B>&nbsp;&nbsp;". $_POST['abilitati'] ."<br>
				<B>SCRISOARE DE INTENTIE:</B>&nbsp;&nbsp;". $_POST['scrisoare'];

	mail($to , $subject, $content, "From: ".$email." \n" ."MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1");
	echo "<script>alert('C.V.- ul a fost trimis. Urmeaza sa va contactam noi in cel mai scurt timp. Va multumim !')</script>";
	}else{
		echo "<script>alert('Codul de securitate nu este corect !')</script>";
		echo "<script>location.replace('index.php?pagina=cariera')</script>";
	}
	
echo "<script>location.replace('index.php?pagina=cariera')</script>";
?>