<?
$enviar_form = $_POST['enviar_form'];
if ($enviar_form == "1") {

	$nome = $_POST['nome'];
	$dia = $_POST['dia'];
	$mes = $_POST['mes'];
	$ano = $_POST['ano'];
	$sexo = $_POST['sexo'];
	$estado_civil = $_POST['estado_civil'];
	$endereco = $_POST['endereco'];
	$bairro = $_POST['bairro'];
	$cidade = $_POST['cidade'];
	$telefone = $_POST['telefone'];
	$celular = $_POST['celular'];
	$email = $_POST['email'];
	$area_interesse = $_POST['area_interesse'];
	$qualificacoes = $_POST['qualificacoes'];
	$experiencia = $_POST['experiencia'];

	$email_origem="$email";
	$email_destino="comercial@cis-erp.com.br.com.br";

	$assunto="Contato pelo formulário de Trabalhe Conosco do Site - Freire Rosa";
	
	$headers  = "MIME-Version: 1.0\n";
	$headers .= "Content-Type: text/html; charset=utf-8\n";
	$headers .= "From: <$email_origem>\n";
	$headers .= "Return-Path: <$email_origem>\n";
	
	$msg_email  = "<html>";
	$msg_email .= "<body>";
	$msg_email .= "<Br>Formulário enviado pela área de Trabalhe Conosco do site Freire Rosa!";
	$msg_email .= "<br><br>Nome: ".$nome;
	$msg_email .= "<br>Data de Nascimento: ".$dia."/".$mes."/".$ano;
	$msg_email .= "<br>Sexo: ".$sexo;
	$msg_email .= "<br>Estado Civil: ".$estado_civil;
	$msg_email .= "<br>Endereço: ".$endereco;
	$msg_email .= "<br>Bairro: ".$bairro;
	$msg_email .= "<br>Cidade: ".$cidade;
	$msg_email .= "<br>Telefone: ".$telefone;
	$msg_email .= "<br>Celular: ".$celular;
	$msg_email .= "<br>E-mail: ".$email;
	$msg_email .= "<br>Área de Interesse: ".$area_interesse;
	$msg_email .= "<br>Resumo de Qualificações: ".$qualificacoes;
	$msg_email .= "<br>Experiência Profissional: ".$experiencia;
	$msg_email .= "</body>";
	$msg_email .= "</html>";
	
	if ($SERVER_NAME!="localhost")
		$envia = mail($email_destino, $assunto, $msg_email, $headers); 		
	
	if ($envia)
		echo "<script>alert(\"E-mail enviado com Sucesso!!!\");</script>";
	else
		echo "<script>alert(\"Erro desconhecido. Por favor, confira seu formulário.\");</script>";
	}

?>

<script language="JavaScript">
function validacaoContato(frm)
	{
	
	if ( frm.nome.value=="")
		{
		alert ("Campo NOME Obrigatório");
		frm.nome.focus();
		return false;
		}
	if ( frm.dia.value=="")
		{
		alert ("Campo DIA Obrigatório");
		frm.dia.focus();
		return false;
		}
	if ( frm.mes.value=="")
		{
		alert ("Campo MES Obrigatório");
		frm.mes.focus();
		return false;
		}
	if ( frm.ano.value=="")
		{
		alert ("Campo ANO Obrigatório");
		frm.ano.focus();
		return false;
		}
	if ( frm.sexo.value=="")
		{
		alert ("Campo SEXO Obrigatório");
		frm.sexo.focus();
		return false;
		}
	if ( frm.estado_civil.value=="")
		{
		alert ("Campo ESTADO CIVIL Obrigatório");
		frm.estado_civil.focus();
		return false;
		}
	if ( frm.endereco.value=="")
		{
		alert ("Campo ENDERECO Obrigatório");
		frm.endereco.focus();
		return false;
		}
	if ( frm.bairro.value=="")
		{
		alert ("Campo BAIRRO Obrigatório");
		frm.bairro.focus();
		return false;
		}
	if ( frm.cidade.value=="")
		{
		alert ("Campo CIDADE Obrigatório");
		frm.cidade.focus();
		return false;
		}
	if ( frm.telefone.value=="")
		{
		alert ("Campo TELEFONE Obrigatório");
		frm.telefone.focus();
		return false;
		}
	if ( frm.celular.value=="")
		{
		alert ("Campo CELULAR Obrigatório");
		frm.celular.focus();
		return false;
		}
	if ( frm.email.value=="")
		{
		alert ("Campo E-MAIL Obrigatório");
		frm.email.focus();
		return false;
		}
	if ( frm.area_interesse.value=="")
		{
		alert ("Campo AREA DE INTERESSE Obrigatório");
		frm.area_interesse.focus();
		return false;
		}
	if ( frm.qualificacoes.value=="")
		{
		alert ("Campo RESUMO DE QUALIFICACOES Obrigatório");
		frm.qualificacoes.focus();
		return false;
		}
	if ( frm.experiencia.value=="")
		{
		alert ("Campo EXPERIENCIA PROFISSIONAL Obrigatório");
		frm.experiencia.focus();
		return false;
		}
		
	return true;
	}
</script>

<table width="750" cellpadding="2" cellspacing="0" align="center" border="0">
<form method="post" name="frmEmail" action="<? echo $PHP_SELF; ?>" onSubmit="return validacaoContato(this);">
  <tr>
    <td>Nome:</td>
    <td><input type="text" name="nome" size="50" /></td>
  </tr>
  <tr>
    <td>Nascimento:</td>
    <td>
      <select name="dia" size="1" id="dia">
        <option value="01">01</option>
        <option value="02">02</option>
        <option value="03">03</option>
        <option value="04">04</option>
        <option value="05">05</option>
        <option value="06">06</option>
        <option value="07">07</option>
        <option value="08">08</option>
        <option value="09">09</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>
        <option value="22">22</option>
        <option value="23">23</option>
        <option value="24">24</option>
        <option value="25">25</option>
        <option value="26">26</option>
        <option value="27">27</option>
        <option value="28">28</option>
        <option value="29">29</option>
        <option value="30">30</option>
        <option value="31">31</option>
        <option value="0" selected="selected">--</option>
      </select>
      /
      <select name="mes" id="mes">
        <option value="01">01</option>
        <option value="02">02</option>
        <option value="03">03</option>
        <option value="04">04</option>
        <option value="05">05</option>
        <option value="06">06</option>
        <option value="07">07</option>
        <option value="08">08</option>
        <option value="09">09</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="0" selected="selected">--</option>
      </select>
      /
      <select name="ano" id="ano">
        <option value="0" selected="selected">----</option>
        <option value="2000">2000</option>
        <option value="1999">1999</option>
        <option value="1998">1998</option>
        <option value="1997">1997</option>
        <option value="1996">1996</option>
        <option value="1995">1995</option>
        <option value="1994">1994</option>
        <option value="1993">1993</option>
        <option value="1992">1992</option>
        <option value="1991">1991</option>
        <option value="1990">1990</option>
        <option value="1989">1989</option>
        <option value="1988">1988</option>
        <option value="1987">1987</option>
        <option value="1986">1986</option>
        <option value="1985">1985</option>
        <option value="1984">1984</option>
        <option value="1983">1983</option>
        <option value="1982">1982</option>
        <option value="1981">1981</option>
        <option value="1980">1980</option>
        <option value="1979">1979</option>
        <option value="1978">1978</option>
        <option value="1977">1977</option>
        <option value="1976">1976</option>
        <option value="1975">1975</option>
        <option value="1974">1974</option>
        <option value="1973">1973</option>
        <option value="1972">1972</option>
        <option value="1971">1971</option>
        <option value="1970">1970</option>
        <option value="1969">1969</option>
        <option value="1968">1968</option>
        <option value="1967">1967</option>
        <option value="1966">1966</option>
        <option value="1965">1965</option>
        <option value="1964">1964</option>
        <option value="1963">1963</option>
        <option value="1962">1962</option>
        <option value="1961">1961</option>
        <option value="1960">1960</option>
        <option value="1959">1959</option>
        <option value="1958">1958</option>
        <option value="1957">1957</option>
        <option value="1956">1956</option>
        <option value="1955">1955</option>
        <option value="1954">1954</option>
        <option value="1953">1953</option>
        <option value="1952">1952</option>
        <option value="1951">1951</option>
        <option value="1950">1950</option>
        <option value="1949">1949</option>
        <option value="1948">1948</option>
        <option value="1947">1947</option>
        <option value="1946">1946</option>
        <option value="1945">1945</option>
        <option value="1944">1944</option>
        <option value="1943">1943</option>
        <option value="1942">1942</option>
        <option value="1941">1941</option>
        <option value="1940">1940</option>
        <option value="1939">1939</option>
        <option value="1938">1938</option>
        <option value="1937">1937</option>
        <option value="1936">1936</option>
        <option value="1935">1935</option>
        <option value="1934">1934</option>
        <option value="1933">1933</option>
        <option value="1932">1932</option>
        <option value="1931">1931</option>
        <option value="1930">1930</option>
        <option value="1929">1929</option>
        <option value="1928">1928</option>
        <option value="1927">1927</option>
        <option value="1926">1926</option>
        <option value="1925">1925</option>
        <option value="1924">1924</option>
        <option value="1923">1923</option>
        <option value="1922">1922</option>
        <option value="1921">1921</option>
      </select>
    </td>
  </tr>
  <tr>
    <td>Sexo:</td>
    <td>
      <input type="radio" value="Masculino" name="sexo" class="no" />
      M |
      <input type="radio" value="Feminino" name="sexo" class="no" />
      F
    </td>
  </tr>
  <tr>
    <td>Estado Civil:</td>
    <td>
      <select name="estado_civil" id="estado_civil">
        <option value="solteiro" selected="selected">Solteiro</option>
        <option value="casado">Casado</option>
        <option value="divorciado">Divorciado</option>
        <option value="viuvo">Vi&uacute;vo</option>
      </select>
    </td>
  </tr>
  <tr>
    <td>Endere&ccedil;o:</td>
    <td><input type="text" name="endereco" size="50" /></td>
  </tr>
  <tr>
    <td>Bairro:</td>
    <td><input type="text" name="bairro" size="50" /></td>
  </tr>
  <tr>
    <td>Cidade:</td>
    <td><input type="text" name="cidade" size="50" /></td>
  </tr>
  <tr>
    <td>Telefone:</td>
    <td><input type="text" name="telefone" size="50" /></td>
  </tr>
  <tr>
    <td>Celular:</td>
    <td><input type="text" name="celular" size="50" /></td>
  </tr>
  <tr>
    <td>E-mail:</td>
    <td><input type="text" name="email" size="50" /></td>
  </tr>
  <tr>
    <td>&Aacute;rea de interesse:</td>
    <td>
      <select name="area_interesse" id="area_interesse">
        <option value="0" selected="selected">----</option>
        <option value="Atendimento">Atendimento</option>
        <option value="Administração">Administração</option>
      </select>
    </td>
  </tr>
  <tr>
    <td>Resumo de Qualifica&ccedil;&otilde;es:</td>
    <td><textarea name="qualificacoes" cols="49" rows="9"></textarea></td>
  </tr>
  <tr>
    <td>Experi&ecirc;ncia Profissional:</td>
    <td><textarea name="experiencia" cols="49" rows="9"></textarea></td>
  </tr>
  <tr>
	<td colspan="2">&nbsp;
      
	</td>
  </tr>
  <tr>
	<td colspan="2" align="center">
      <input type="submit" name="btEnviar" value="Enviar" class="botao" />
      <input type="hidden" name="enviar_form" value="1" />
	</td>
  </tr>
</form>
</table>