Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

LuhDesign

data nao entra no banco de dados em um servidor, mas no outro e

Recommended Posts

Olá, estou fazendo a integração do sistema de cadastro entre o SugarCrm e um sistema aqui da empresa, e um campo nao entra no mysql em um servidor, mas aqui no nosso, entra...

 

=/

 

PS.: Peguei o sistema para mexer agora, nao sei quem fez ¬¬

 

"candidato.php"

//error_reporting(E_ALL);

include_once ('variavelglobal.php');

require_once ($DiretorioClasses . 'clscandidato.php');
require_once ($DiretorioClasses . 'clscandidato_documents.php');
require_once ($DiretorioClasses . 'clsdocuments.php');
require_once ($DiretorioClasses . 'clsdocuments_revision.php');
require_once ($DiretorioInclude . 'FuncoesGenericas.php');
require_once ($DiretorioLanguageCrm . 'pt_br.lang.php');
//require_once($DiretorioIncludeCrm . 'utils.php');


// Cria os Objetos 
$Objcandidatos = New candidato ();
$ObjcandidatosAux = New candidato ();
$ObjcandidatosDocuments = New candidato_documents ();
$ObjDocumentos = New documents ();
$ObjDocumentosRevision = New document_revisions ();

$Objcandidatos->id = RecebeParametro ( 'id' );
// Grava os Dados


if (isset($_POST['Acao']) && $_POST['Acao'] == 'salvar')
{
	
	if ($_SESSION ['id'])
	{
		$ObjcandidatosAux->id = $_SESSION ['id'];
		$ObjcandidatosAux->Seleciona();
		
		$Objcandidatos->date_entered = $ObjcandidatosAux->date_entered;
		$Objcandidatos->date_modified = date ( 'Y-m-d H:i:s' );
		$Objcandidatos->deleted = '0';
		$Objcandidatos->email_c = RecebeParametro ( 'email_c' );
		$Objcandidatos->first_name = RecebeParametro ( 'nome' );
		$Objcandidatos->last_name = RecebeParametro ( 'sobrenome' );
		$Objcandidatos->phone_home = RecebeParametro ( 'telefoneresidencial' );
		$Objcandidatos->phone_mobile = RecebeParametro ( 'celular' );
		$Objcandidatos->phone_work = RecebeParametro ( 'telefonecomercial' );
		$Objcandidatos->emailpessoal = RecebeParametro ( 'emailpessoal' );
		$Objcandidatos->emailcomercial = RecebeParametro ( 'emailcomercial' );
		$Objcandidatos->primary_address_street = RecebeParametro ( 'endereco' );
		$Objcandidatos->complemento = RecebeParametro ( 'complemento' );
		$Objcandidatos->primary_address_city = RecebeParametro ( 'cidade_c' );
		$Objcandidatos->primary_address_state = RecebeParametro ( 'estado_c' );
		$Objcandidatos->primary_address_postalcode = RecebeParametro ( 'cep' );
		$Objcandidatos->primary_address_country = RecebeParametro ( 'pais' );
		$Objcandidatos->bairro_c = RecebeParametro ( 'bairro_c' );
		$Objcandidatos->cpf2_c = RecebeParametro ( 'cpf2_c' );
		$Objcandidatos->sexo = RecebeParametro ( 'sexo' );
		$Objcandidatos->empresa = RecebeParametro ( 'empresa' );
		$Objcandidatos->setor = RecebeParametro ( 'setor' );
		$Objcandidatos->subsetor = RecebeParametro ( 'subsetor' );
		$Objcandidatos->cargo = RecebeParametro ( 'cargo' );
		$Objcandidatos->empresab = RecebeParametro ( 'empresab' );
		$Objcandidatos->setorb = RecebeParametro ( 'setorb' );
		$Objcandidatos->subsetorb = RecebeParametro ( 'subsetorb' );
		$Objcandidatos->cargob = RecebeParametro ( 'cargob' );
		$Objcandidatos->unidadenegocio = RecebeParametro ( 'unidadenegocio' );
		$Objcandidatos->unidadenegociob = RecebeParametro ( 'unidadenegociob' );
		$Objcandidatos->datanasc = RecebeParametro ( 'datanasc' );
		$Objcandidatos->atual_c = RecebeParametro ( 'atual_c' );
		$Objcandidatos->datanasc = FormataDataBanco ( RecebeParametro ( 'datanasc' ), 0 );
		$Objcandidatos->datainicio = FormataDataBanco ( RecebeParametro ( 'datainicio' ), 0 );
		$Objcandidatos->datainiciob = FormataDataBanco ( RecebeParametro ( 'datainiciob' ), 0 );
		$Objcandidatos->datadesligamento = FormataDataBanco ( RecebeParametro ( 'datadesligamento' ), 0 );
		$Objcandidatos->datadesligamentob = FormataDataBanco ( RecebeParametro ( 'datadesligamentob' ), 0 );
		$Objcandidatos->salario_c = RecebeParametro ( 'salario_c' );
		$Objcandidatos->salario2_c = RecebeParametro ( 'salario2_c' );
		$Objcandidatos->relacaoempresa = RecebeParametro ( 'relacaoempresa' );
		$Objcandidatos->relacaoempresab = RecebeParametro ( 'relacaoempresab' );
		$Objcandidatos->setorc = RecebeParametro ( 'setorc' );
		$Objcandidatos->cargoc = RecebeParametro ( 'cargoc' );
		$Objcandidatos->subsetorc = RecebeParametro ( 'subsetorc' );
		$Objcandidatos->tiponecessidade = RecebeParametro ( 'tiponecessidade' );
		$Objcandidatos->ingles = RecebeParametro ( 'ingles' );
		$Objcandidatos->espanhol = RecebeParametro ( 'espanhol' );
		$Objcandidatos->outro = RecebeParametro ( 'outroidioma' );
		$Objcandidatos->nivelacademico = RecebeParametro ( 'nivelacademico' );
		$Objcandidatos->cidade_c = RecebeParametro ( 'cidade_c' );
		$Objcandidatos->estado_c = RecebeParametro ( 'estado_c' );
		$Objcandidatos->senha_c = RecebeParametro ( 'senha_c' );
		$Objcandidatos->numero_c = RecebeParametro ( 'numero_c' );
		//$Objcandidatos->email_c						= RecebeParametro('email_c');
		$Objcandidatos->setorf_c = RecebeParametro ( 'setorf_c' );
		$Objcandidatos->setor_c = RecebeParametro ( 'setor_c' );
		$Objcandidatos->subsetor_c = RecebeParametro ( 'subsetor_c' );
		$Objcandidatos->cargo_c = RecebeParametro ( 'cargo_c' );
		
		$Objcandidatos->cv_c = RecebeParametro ( 'cv_c' );
		$Objcandidatos->atual2_c = RecebeParametro ( 'atual2_c' );
		$Objcandidatos->foto_c = RecebeParametro ('foto_c');
		$Objcandidatos->nivel_outro_idioma_c  = RecebeParametro ( 'nivel_outro_idioma_c' );
		$Objcandidatos->descri_necessidade_c  = RecebeParametro ( 'descri_necessidade_c' );
		
		$Objcandidatos->Altera ();
		
		if (is_array ( $_FILES ['arquivo'] ))
		{
			$Retorno = Upload('arquivo', md5(create_guid()), $DiretorioArquivoCrm);
			
			if ($Retorno != false)
			{
				$IdDocumento = md5 ( create_guid () );
				$IdRevisao = $Retorno;
				$IdDocumentoCandidato = md5 ( create_guid () );
				
				$ObjDocumentos->id = $IdDocumento;
				$ObjDocumentos->deleted = '0';
				$ObjDocumentos->date_entered = date ( 'Y-m-d H:i:s', (time()+(60*60*3)));
				$ObjDocumentos->date_modified = $ObjDocumentos->date_entered;
				$ObjDocumentos->document_name = $_FILES['arquivo']['name'];
				$ObjDocumentos->document_revision_id = $IdRevisao;
				$ObjDocumentos->status_id = 'Active';
				$ObjDocumentos->is_template = '0';
				
				$ObjDocumentos->Insere();
				
				$ObjDocumentosRevision->id = $IdRevisao;
				$ObjDocumentosRevision->document_id = $IdDocumento;
				$ObjDocumentosRevision->date_entered = $ObjDocumentos->date_entered;
				$ObjDocumentosRevision->filename = $_FILES ['arquivo'] ['name'];
				$ObjDocumentosRevision->file_ext = ExtensaoArquivo ( $_FILES['arquivo']['name']);
				$ObjDocumentosRevision->file_mime_type = $_FILES ['arquivo']['type'];
				$ObjDocumentosRevision->deleted = '0';
				$ObjDocumentosRevision->date_modified = $ObjDocumentos->date_entered;
				
				$ObjDocumentosRevision->Insere();
				
				$ObjcandidatosDocuments->id = $IdDocumentoCandidato;
				$ObjcandidatosDocuments->date_modified = $ObjDocumentos->date_entered;
				$ObjcandidatosDocuments->deleted = '0';
				$ObjcandidatosDocuments->sab_candid200fndidato_ida = $Objcandidatos->id;
				$ObjcandidatosDocuments->sab_candid270dcuments_idb = $IdDocumento;
				$ObjcandidatosDocuments->document_revision_id = $IdRevisao;
				
				$ObjcandidatosDocuments->Insere();
			
			}
		}
		
		$Msg = 'Registro Alterado com Sucesso!';
		$Direciona = 'candidato.php';
	}
	else
	{
		$Objcandidatos->id = md5 ( create_guid () );
		$Objcandidatos->date_entered = date ( 'Y-m-d H:i:s' );
		$Objcandidatos->date_modified = date ( 'Y-m-d H:i:s' );
		$Objcandidatos->deleted = '0';
		$Objcandidatos->email_c = RecebeParametro ( 'email_c' );
		$Objcandidatos->first_name = RecebeParametro ( 'nome' );
		$Objcandidatos->last_name = RecebeParametro ( 'sobrenome' );
		$Objcandidatos->phone_home = RecebeParametro ( 'telefoneresidencial' );
		$Objcandidatos->phone_mobile = RecebeParametro ( 'celular' );
		$Objcandidatos->phone_work = RecebeParametro ( 'telefonecomercial' );
		$Objcandidatos->emailpessoal = RecebeParametro ( 'emailpessoal' );
		$Objcandidatos->emailcomercial = RecebeParametro ( 'emailcomercial' );
		$Objcandidatos->primary_address_street = RecebeParametro ( 'endereco' );
		$Objcandidatos->numero_c = RecebeParametro ( 'numero_c' );
		$Objcandidatos->complemento = RecebeParametro ( 'complemento' );
		$Objcandidatos->primary_address_city = RecebeParametro ( 'cidade_c' );
		$Objcandidatos->primary_address_state = RecebeParametro ( 'estado_c' );
		$Objcandidatos->primary_address_postalcode = RecebeParametro ( 'cep' );
		$Objcandidatos->primary_address_country = RecebeParametro ( 'pais' );
		$Objcandidatos->bairro_c = RecebeParametro ( 'bairro_c' );
		$Objcandidatos->cpf2_c = RecebeParametro ( 'cpf2_c' );
		$Objcandidatos->sexo = RecebeParametro ( 'sexo' );
		$Objcandidatos->empresa = RecebeParametro ( 'empresa' );
		$Objcandidatos->setor = RecebeParametro ( 'setor' );
		$Objcandidatos->subsetor = RecebeParametro ( 'subsetor' );
		$Objcandidatos->cargo = RecebeParametro ( 'cargo' );
		$Objcandidatos->empresab = RecebeParametro ( 'empresab' );
		$Objcandidatos->setorb = RecebeParametro ( 'setorb' );
		$Objcandidatos->subsetorb = RecebeParametro ( 'subsetorb' );
		$Objcandidatos->cargob = RecebeParametro ( 'cargob' );
		$Objcandidatos->unidadenegocio = RecebeParametro ( 'unidadenegocio' );
		$Objcandidatos->unidadenegociob = RecebeParametro ( 'unidadenegociob' );
		$Objcandidatos->datanasc = FormataDataBanco ( RecebeParametro ( 'datanasc' ), 0 );
		$Objcandidatos->datainicio = FormataDataBanco ( RecebeParametro ( 'datainicio' ), 0 );
		$Objcandidatos->datainiciob = FormataDataBanco ( RecebeParametro ( 'datainiciob' ), 0 );
		$Objcandidatos->datadesligamento = FormataDataBanco ( RecebeParametro ( 'datadesligamento' ), 0 );
		$Objcandidatos->datadesligamentob = FormataDataBanco ( RecebeParametro ( 'datadesligamentob' ), 0 );
		$Objcandidatos->salario_c = RecebeParametro ( 'salario_c' );
		$Objcandidatos->salario2_c = RecebeParametro ( 'salario2_c' );
		$Objcandidatos->relacaoempresa = RecebeParametro ( 'relacaoempresa' );
		$Objcandidatos->relacaoempresab = RecebeParametro ( 'relacaoempresab' );
		$Objcandidatos->setorc = RecebeParametro ( 'setorc' );
		$Objcandidatos->cargoc = RecebeParametro ( 'cargoc' );
		$Objcandidatos->subsetorc = RecebeParametro ( 'subsetorc' );
		$Objcandidatos->tiponecessidade = RecebeParametro ( 'tiponecessidade' );
		$Objcandidatos->ingles = RecebeParametro ( 'ingles' );
		$Objcandidatos->espanhol = RecebeParametro ( 'espanhol' );
		$Objcandidatos->outro = RecebeParametro ( 'outroidioma' );
		$Objcandidatos->nivelacademico = RecebeParametro ( 'nivelacademico' );
		$Objcandidatos->cidade_c = RecebeParametro ( 'cidade_c' );
		$Objcandidatos->estado_c = RecebeParametro ( 'estado_c' );
		$Objcandidatos->senha_c = RecebeParametro ( 'senha_c' );
		$Objcandidatos->numero_c = RecebeParametro ( 'numero_c' );
		$Objcandidatos->atual_c = RecebeParametro ( 'atual_c' );
		$Objcandidatos->setorf_c = RecebeParametro ( 'setorf_c' );
		$Objcandidatos->setor_c = RecebeParametro ( 'setor_c' );
		$Objcandidatos->subsetor_c = RecebeParametro ( 'subsetor_c' );
		$Objcandidatos->cargo_c = RecebeParametro ( 'cargo_c' );
		$Objcandidatos->cv_c = RecebeParametro ( 'cv_c' );
		$Objcandidatos->atual2_c = RecebeParametro ( 'atual2_c' );
		$Objcandidatos->foto_c = RecebeParametro ( 'foto_c' );
		$Objcandidatos->nivel_outro_idioma_c  = RecebeParametro ( 'nivel_outro_idioma_c' );
		$Objcandidatos->descri_necessidade_c  = RecebeParametro ( 'descri_necessidade_c' );
		
		$Objcandidatos->Insere ();
		
		if (is_array ( $_FILES ['arquivo'] ))
		{
			$Retorno = Upload('arquivo', md5(create_guid()), $DiretorioArquivoCrm);
			
			if ($Retorno != false)
			{
				$IdDocumento = md5 ( create_guid () );
				$IdRevisao = $Retorno;
				$IdDocumentoCandidato = md5 ( create_guid () );
				
				$ObjDocumentos->id = $IdDocumento;
				$ObjDocumentos->deleted = '0';
				$ObjDocumentos->date_entered = date ( 'Y-m-d H:i:s' );
				$ObjDocumentos->date_modified = $ObjDocumentos->date_entered;
				$ObjDocumentos->document_name = $_FILES['arquivo']['name'];
				$ObjDocumentos->document_revision_id = $IdRevisao;
				$ObjDocumentos->status_id = 'Active';
				$ObjDocumentos->is_template = '0';
				
				$ObjDocumentos->Insere();
				
				$ObjDocumentosRevision->id = $IdRevisao;
				$ObjDocumentosRevision->document_id = $IdDocumento;
				$ObjDocumentosRevision->date_entered = $ObjDocumentos->date_entered;
				$ObjDocumentosRevision->filename = $_FILES ['arquivo'] ['name'];
				$ObjDocumentosRevision->file_ext = ExtensaoArquivo ( $_FILES['arquivo']['name']);
				$ObjDocumentosRevision->file_mime_type = $_FILES ['arquivo']['type'];
				$ObjDocumentosRevision->deleted = '0';
				$ObjDocumentosRevision->date_modified = $ObjDocumentos->date_entered;
				
				$ObjDocumentosRevision->Insere();
				
				$ObjcandidatosDocuments->id = $IdDocumentoCandidato;
				$ObjcandidatosDocuments->date_modified = $ObjDocumentos->date_entered;
				$ObjcandidatosDocuments->deleted = '0';
				$ObjcandidatosDocuments->sab_candid200fndidato_ida = $Objcandidatos->id;
				$ObjcandidatosDocuments->sab_candid270dcuments_idb = $IdDocumento;
				$ObjcandidatosDocuments->document_revision_id = $IdRevisao;
				
				$ObjcandidatosDocuments->Insere();
			
			}
		}
		
		$Msg = 'Registro Inserido com Sucesso!';
		$Direciona = 'candidato.php';
	}
}

if (isset($_SESSION['id']) && !empty($_SESSION ['id']))
{
	$Objcandidatos->id = $_SESSION ['id'];

	$Objcandidatos->Seleciona ();
}
else if ((RecebeParametro ( 'id' ) != '') && (RecebeParametro ( 'id' ) == 0))
{
	$Objcandidatos->id = 0;
}
else
{
	echo '<script> window.location = "login.php" </script>';
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Caccuri Consultores - Executive Search</title>


<meta name=description
	content="A Caccuri Consultores é uma consultoria especializada em executive search, que tem por foco selecionar profissionais altamente capacitados para dar resultados e transformar empresas em excelentes lugares para se trabalhar.">

<meta name="keywords"
	content="hunting,caça,executive search,recursos humanos,RH,profissionais talentosos,resultados,melhores empresas para trabalhar,contratação de executivos,fazer diferença,currículos,banco de dados,vagas,mercado de trabalho,média gerência,alta gerência,diretores,boarding,presidentes de empresas,conselho de administração,organizações,empresas de ponta,Hugo Caccuri Jr.,Best Companies,Maria Amalia Bernardi,Cristina Gurgel,Great Place to Work,México,Brasil">

<link href="estilos/geral.css" rel="stylesheet" type="text/css">

<script type="text/javascript">
<!--

function MudaSubTipo(id, nome, valorcompara)
{
	$('#' + id).load('carregasubtipo.php?nome=' + urlencode(nome) + '&valorcompara=' + urlencode(valorcompara));
}

function bodyonload()
{
	MudaSubTipo('subsetor', document.form1.setor.value, 
			'<?php echo $Objcandidatos->subsetor?>');
	MudaSubTipo('subsetorb', document.form1.setorb.value, 
			'<?php echo $Objcandidatos->subsetorb?>'); 
	MudaSubTipo('subsetorc', document.form1.setorc.value,
			'<?php echo $Objcandidatos->subsetorc?>'); 
	MudaSubTipo('subsetor_c', document.form1.setor_c.value, 
			'<?php echo $Objcandidatos->subsetor_c?>');
}

-->
</script>
</head>
<body onLoad="bodyonload()">
<script type="text/javascript" src="<?php echo $DiretorioVirtualInclude?>jquery.js">
</script>
<script type="text/javascript" src="<?php echo $DiretorioVirtualInclude?>Funcoes.js">
</script>
<script language="javascript">
<!--
	<?php if(isset($Msg) && $Msg != ''): ?>
		alert("<?=$Msg?>");
	<?php endif; ?>
	<?php if(isset($Direciona) && $Direciona != ''): ?>
		window.location = '<?=$Direciona?>';
	<?php endif; ?>

	function Validar()
	{
		// Valida os campos
		if (!ValidaCampo('E-mail', document.form1.email_c.value, 3, 0, 150)){
			document.form1.email_c.focus(); return false;
		}		
		
		<?php if ($Objcandidatos->id == 0): ?>
		if (!ValidaCampo('Senha', document.form1.senha_c.value, 1, 0, 50)){
			document.form1.senha_c.focus(); return false;
		}			
		
		if (!ValidaCampo('Nova Senha', document.form1.novasenha.value, 1, 0, 50)){
			document.form1.novasenha.focus(); return false;
		}	

		if(document.form1.senha_c.value != document.form1.novasenha.value){
			alert('Os campos Senha e Confirme sua Senha não conferem, eles devem ser iguais');
			return false;
		}	
			
		<?php else: ?>
		
		if (!ValidaCampo('Senha', document.form1.senha_c.value, 1, 0, 50)){
			document.form1.senha_c.focus(); return false;
		}
		
		<?php endif; ?>		
		
		
		if (!ValidaCampo('Nome', document.form1.nome.value, 1, 0, 150)){
			document.form1.nome.focus(); return false;
		}
		
		if (!ValidaCampo('Sobrenome', document.form1.sobrenome.value, 1, 0, 150)){
			document.form1.sobrenome.focus(); return false;
		}
		if (!ValidaCampo('E-mail Pessoal', document.form1.emailpessoal.value, 3, 0, 150)){
			document.form1.emailpessoal.focus(); return false;
		}
		if (!ValidaCampo('E-mail Comercial', document.form1.emailcomercial.value, 3, 1, 150)){
			document.form1.emailcomercial.focus(); return false;
		}
		if (!ValidaCampo('Telefone Residencial', document.form1.telefoneresidencial.value, 1, 1, 20)){
			document.form1.telefoneresidencial.focus(); return false;
		}
		if (!ValidaCampo('Celular', document.form1.celular.value, 1, 1, 20)){
			document.form1.celular.focus(); return false;
		}
		if (!ValidaCampo('Telefone Comercial', document.form1.telefonecomercial.value, 0, 0, 20)){
			document.form1.telefonecomercial.focus(); return false;
		}
		if (!ValidaCampo('Endereço', document.form1.endereco.value, 1, 0, 250)){
			document.form1.endereco.focus(); return false;
		}
			if (!ValidaCampo('Número', document.form1.numero_c.value, 1, 0, 150)){
			document.form1.numero_c.focus(); return false;
		}
		if (!ValidaCampo('Cidade', document.form1.cidade_c.value, 1, 0, 150)){
			document.form1.cidade_c.focus(); return false;
		}
		if (!ValidaCampo('Estado', document.form1.estado_c.value, 1 , 0, 100)){
			document.form1.estado_c.focus(); return false;
		}
		if (!ValidaCampo('Cep', document.form1.cep.value, 1, 1, 15)){
			document.form1.cep.focus(); return false;
		}
		if (!ValidaCampo('País', document.form1.pais.value, 1, 0, 100)){
			document.form1.pais.focus(); return false;
		}
		
		if (!ValidaCampo('Inglês', document.form1.ingles.value, 1, 0, 100)){
			document.form1.ingles.focus(); return false;
		}
		
		if (!ValidaCampo('Espanhol', document.form1.espanhol.value, 1, 0, 100)){
			document.form1.espanhol.focus(); return false;
		}
	/*	if (!ValidaCampo('Nível', document.form1.nivel_outro_idioma_c.value, 1, 0, 100)){
			document.form1.nivel_outro_idioma_c.focus(); return false;
		}
		*/
		if (!ValidaCampo('Cpf', document.form1.cpf2_c.value, 2, 1, 11)){
			document.form1.cpf2_c.focus(); return false;
		}
		
		if (!ValidaCampo('Sexo', document.form1.sexo.value, 1, 0, 11)){
			document.form1.sexo.focus(); return false;
		}
		
		if (!ValidaCampo('Empresa', document.form1.empresa.value, 1, 0, 150)){
			document.form1.empresa.focus(); return false;
		}
		
		if (!ValidaCampo('Setor', document.form1.setor.value, 1, 1, 150)){
			document.form1.setor.focus(); return false;
		}
		
		if (!ValidaCampo('Subsetor', document.form1.subsetor.value, 1, 1, 150)){
			document.form1.subsetor.focus(); return false;
		}
		
		if (!ValidaCampo('Cargo', document.form1.cargo.value, 1, 0, 150)){
			document.form1.cargo.focus(); return false;
		}
		
		if (!ValidaCampo('Empresa', document.form1.empresab.value, 0, 0, 150)){
			document.form1.empresab.focus(); return false;
		}
		if (!ValidaCampo('Setor', document.form1.setorb.value, 0, 1, 150)){
			document.form1.setorb.focus(); return false;
		}
		
		if (!ValidaCampo('Subsetor', document.form1.subsetorb.value, 0, 1, 150)){
			document.form1.subsetorb.focus(); return false;
		}
		if (!ValidaCampo('Cargo', document.form1.cargob.value, 0, 0, 150)){
			document.form1.cargob.focus(); return false;
		}
		if (!ValidaCampo('Unidade de Negócio / Divisão', document.form1.unidadenegocio.value, 1, 1, 150)){
			document.form1.unidadenegocio.focus(); return false;
		}
		if (!ValidaCampo('Unidade de Negócio / Divisão', document.form1.unidadenegociob.value, 0, 1, 150)){
			document.form1.unidadenegociob.focus(); return false;
		}
		if (!ValidaCampo('Data de Nascimento', document.form1.datanasc.value, 1, 0, 11)){
			document.form1.datanasc.focus(); return false;
		}
		if (!ValidaCampo('Data de Início', document.form1.datainicio.value, 1, 0, 11)){
			document.form1.datainicio.focus(); return false;
		}
		if (!ValidaCampo('Data de Início', document.form1.datainiciob.value, 0, 0, 11)){
			document.form1.datainiciob.focus(); return false;
		}
		if (!ValidaCampo('Data de Desligamento', document.form1.datadesligamento.value, 1, 1, 11)){
			document.form1.datadesligamento.focus(); return false;
		}
		
		if (!ValidaCampo('Data de Desligamento', document.form1.datadesligamentob.value, 0, 0, 11)){
			document.form1.datadesligamentob.focus(); return false;
		}
		if (!ValidaCampo('Salário', document.form1.salario_c.value, 1, 0, 50)){
			document.form1.salario_c.focus(); return false;
		}
		if (!ValidaCampo('Salário', document.form1.salario2_c.value, 0, 0, 50)){
			document.form1.salario2_c.focus(); return false;
		}
		if (!ValidaCampo('Relação com a Empresa', document.form1.relacaoempresa.value, 1, 0, 100)){
			document.form1.relacaoempresa.focus(); return false;
		}
		if (!ValidaCampo('Relação com a Empresa', document.form1.relacaoempresab.value, 0, 0, 100)){
			document.form1.relacaoempresab.focus(); return false;
		}
		if (!ValidaCampo('Setor', document.form1.setorc.value, 1, 0, 150)){
			document.form1.setorc.focus(); return false;
		}
		if (!ValidaCampo('Cargo', document.form1.cargoc.value, 1, 1, 150)){
			document.form1.cargoc.focus(); return false;
		}
		if (!ValidaCampo('Subsetor', document.form1.subsetorc.value, 0, 1, 150)){
			document.form1.subsetor_c.focus(); return false;
		}
		if (!ValidaCampo('Setor', document.form1.setorc.value, 0, 0, 150)){
			document.form1.setor_c.focus(); return false;
		}
		if (!ValidaCampo('Cargo', document.form1.cargoc.value, 0, 1, 150)){
			document.form1.cargo_c.focus(); return false;
		}
		if (!ValidaCampo('Subsetor', document.form1.subsetorc.value, 1, 1, 150)){
			document.form1.subsetor_c.focus(); return false;
		}	
		if (!ValidaCampo('Tipo de Necessidade', document.form1.tiponecessidade.value, 1, 1, 100)){
			document.form1.tiponecessidade.focus(); return false;
		}
	//	if (!ValidaCampo('Outro Idioma', document.form1.outroidioma.value, 1, 1, 100)){
		//	document.form1.outroidioma.focus(); return false;
	//	}
		if (!ValidaCampo('Nível Acadêmico', document.form1.nivelacademico.value, 1, 0, 100)){
			document.form1.nivelacademico.focus(); return false;
		}
	
		document.form1.Acao.value = 'salvar';
		document.form1.submit();	
	}
-->
</script>

<style type="text/css">
#tudo{width:600px; font-family:Arial, Helvetica, sans-serif; margin:auto;}
#barra{background-image:url(img/bg_titulo.png); height:30px; background-repeat:repeat-x; font-size:16px; color:#FFFFFF; font-weight:bold; padding-top:5px; padding-left:10px;}
#linklogin a {color:#002748; text-decoration:none;}
#lonklogin a:hover{color:#666666; text-decoration:underline;}

.input {border:1px solid #1E405D; color:#1E405D; padding:0px; margin-left:5px;}
.input:hover {border:1px solid #666;}
.input:focus {border:1px solid #1E405D; background-color:#FFFF99;}
</style>
<form name="form1" action="candidato.php" enctype="multipart/form-data"
	method="post"><input type="hidden" name="id"
	value="<?php echo $_SESSION ['id']?>">
<table width="600" align="center" cellpadding="0"  border="0"><tr><td height="20">
<div id="tudo">
	<p align="right" id="linklogin"><a href="login.php?acao=logout">Sair</a></p>
    <center><span style="font-size:13px;"><span style="color:#FF0000; font-weight:lighter;">*</span> Campos obrigatórios</span></center>
	<div id="barra">LOGIN</div>
						<table width="100%" border="0" cellspacing="2">
						<tr>
							<td height="20" width="32%" align="center" bgcolor="ECECEC">
							
										<div align="right">
											
												<font face="Verdana" 
													color="000000">
													<small>
														<strong>
															E-mail:<span style="color:#FF0000; font-weight:lighter;">*</span>
														</strong>
													</small>
												</font>
											
										</div>

							</td>
							<td height="20" width="68%" bgcolor="ECECEC">
								<input type="text" name="email_c" size="60" value="<?=$Objcandidatos->email_c?>" class="input">
							</td>
						</tr>
						<tr>
							<table width="100%" border="0" cellspacing="2"
								>
							<tr>
								<td height="20" width="32%" align="center" 
									bgcolor="ECECEC">
									<table border="0" cellpadding="0" 
										 width="100%">
									<tr>
										<td height="20" width="100%" align="right">
											
												<small>
													<font face="Verdana">
														<strong>
															Senha:<span style="color:#FF0000; font-weight:lighter;">*</span>
														</strong>
													</font>
												</small>
											
										</td>
									</tr>
									</table>
								</td>
								<td height="20" width="68%" bgcolor="ECECEC">
									<input type=PASSWORD name="senha_c" size="20" value="<?php echo $Objcandidatos->senha_c?>" class="input"> 
									<small>
										<font face="verdana" size="1">
										</font></small></td>
							</tr>

							<table width="100%" border="0" cellspacing="2"
								>
								<tr>
									<td height="20" width="32%" align="center" bgcolor="ECECEC">
									<table border="0" cellpadding="0"  width="100%">
										<tr>
											<td height="20" width="100%" align="right">
											<small><font face="Verdana"><strong>Confirme sua Senha:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small>
											
											</td>
										</tr>
									</table>
									</td>
									<td height="20" width="68%" bgcolor="ECECEC"><input type=PASSWORD
										name="novasenha" size="20" value="<?php echo $Objcandidatos->senha_c?>" class="input"></td>
								</tr>
								</table>
	<div id="barra">Dados Pessoais</div>

								<table width="100%" border="0" cellspacing="2"
									>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellspacing="2" width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<font face="Verdana" color="000000"><small><strong>Nome:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></small></font>
												
												</div>
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text"
											name="nome" size="60" value="<?=$Objcandidatos->first_name?>" class="input"></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellspacing="2" width="100%">
											<tr>
												<td height="20" width="100%" align="right">
												<font face="Verdana" color="000000"><small><strong>Sobrenome:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></small></font>
												</div>
												
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text"
											name="sobrenome" size="60" value="<?=$Objcandidatos->last_name?>" class="input"></td>
									</tr>
								</table>

								<table width="100%" border="0" cellspacing="2"
									>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellpadding="0"  width="100%">
											<tr>
												<td height="20" width="100%" align="right">
												<small><font face="Verdana"><strong>Data de Nascimento:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small>
												
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text"
											name="datanasc" size="10" value="<?= FormataDataPagina ($Objcandidatos->datanasc)?>" class="input"> <small><font
											face="verdana" size="1">(dd/mm/aaaa)</font></small></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="right" bgcolor="ECECEC"><small><font
											face="Verdana"><strong>Sexo:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="sexo" size="1" class="input">
					<?php
					if ($GLOBALS ['app_list_strings'] ['sexo_list'])
					{
						foreach ( $GLOBALS ['app_list_strings'] ['sexo_list'] as $key => $value )
						{
							$selected = '';
							if (utf8_decode ( $key ) == $Objcandidatos->sexo) $selected = 'selected';
							echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
						}
					}
					
					?>
					</select></td>
									</tr>

									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellpadding="0"  width="100%">
											<tr>
												<td height="20" width="100%" align="right">
												<small><font face="Verdana"><strong>CPF:</strong></font></small>
												
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text"
											name="cpf2_c" size="16" value="<?=$Objcandidatos->cpf2_c?>" class="input"><font
											face="Verdana" size="1"><small> Exemplo: 40684569565 </small></font></td>
									</tr>
								</table>


								<table width="100%" border="0" cellspacing="2"
									>
									<tr>
										<td height="20" width="100%" colspan="5">
	<div id="barra">Contatos</div>
										</td>
									</tr>
									<tr>
										<td height="20" width="32%" align="right" bgcolor="ECECEC"><small><font
											face="Verdana"><strong>Telefone Comercial:</strong></font></small>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="telefonecomercial" size="15" value="<?=$Objcandidatos->phone_work?>"> <font face="Verdana" size="1"><small>
										Seguir padrão: 55 (11) 3077-5400 </small></font></td>
										</td>
									</tr>
									<tr>
										<td height="20" width="32%" align="right" bgcolor="ECECEC"
											style="font-weight: bold;"><small><font face="Verdana">Telefone
										Residencial:</font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="telefoneresidencial" size="15" value="<?=$Objcandidatos->phone_home?>"> <font face="Verdana" size="1"><small>
										Seguir padrão: 55 (11) 3077-5400 </small></font></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="right" bgcolor="ECECEC"
											style="font-weight: bold;"><small><font face="Verdana">Celular:</font></small>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="celular" size="15" value="<?=$Objcandidatos->phone_mobile?>"> <font
											face="Verdana" size="1"><small> Seguir padrão: 55 (11) 3077-5400 </small></font>
										</td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellpadding="0"  width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<small><font face="Verdana"><strong>E-mail Pessoal:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small>
												
												</div>
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC">
                                        <script language="javascript">
										function validaemail(){
										if(document.form1.emailpessoal.value == ''){
										 alert("Campo E-mail pessoal obrigatório");
										 return false;
										}
										}
										</script>
                                        <input type="text" class="input"
											name="emailpessoal" size="35" value="<?=$Objcandidatos->emailpessoal?>"></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellpadding="0"  width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<small><font face="Verdana"><strong>E-mail Comercial:</strong></font></small>
												
												</div>
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="emailcomercial" size="35" value="<?=$Objcandidatos->emailcomercial?>"></td>
									</tr>
									<tr>
										<td height="20" width="100%" colspan="5" bgcolor="ECECEC">
											<div id="barra">Endereço Residencial:</div>
										</td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellspacing="2" width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<font face="Verdana" color="000000"><small><strong>Endereço:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></small></font>
												
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="endereco" size="60"
											value="<?=$Objcandidatos->primary_address_street?>"></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellspacing="2" width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<font face="Verdana" color="000000"><small><strong>Número:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></small></font>
												
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="numero_c" size="15"
											value="<?=$Objcandidatos->numero_c?>">          												<font face="Verdana" color="000000"><small><strong>Complemento:</strong></small></font>
 <input type="text" class="input" name="complemento" size="15"value="<?=$Objcandidatos->complemento?>"></td>
									</tr>
									
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellspacing="2" width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<small><strong><font face="Verdana">Bairro:</font></strong></small>
												
												</div>
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="bairro_c" size="30" value="<?=$Objcandidatos->bairro_c?>"></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellpadding="0"  width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<small><strong><font face="Verdana">CEP:</font></strong></small>
												
												</div>
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" name="cep" class="input"
											size="10" value="<?=$Objcandidatos->primary_address_postalcode?>"> <font
											face="Verdana" size="1"><small> Exemplo: 11350100 </small></font></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellspacing="2" width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<small><strong><font face="Verdana">País:<span style="color:#FF0000; font-weight:lighter;">*</span></font></strong></small>
												
												</div>
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="pais" size="30" value="<?=$Objcandidatos->primary_address_country?>"></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellspacing="2" width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<small><strong><font face="Verdana">Estado:<span style="color:#FF0000; font-weight:lighter;">*</span></font></strong></small>
												
												</div>
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="estado_c" class="input"
											size="1">
				<?php
				if ($GLOBALS ['app_list_strings'] ['estado_list'])
				{
					foreach ( $GLOBALS ['app_list_strings'] ['estado_list'] as $key => $value )
					{
						$selected = '';
						if ($Objcandidatos->estado_c == utf8_decode ( $key )) $selected = 'selected';
						
						echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
					}
				}
				?>
				</select></td>
									</tr>
									<tr>
										<td height="20" width="32%" align="center" bgcolor="ECECEC">
										<table border="0" cellspacing="2" width="100%">
											<tr>
												<td height="20" width="100%">
												<div align="right">
												<small><strong><font face="Verdana">Cidade:<span style="color:#FF0000; font-weight:lighter;">*</span></font></strong></small>
												
												</div>
												</td>
											</tr>
										</table>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="cidade_c" class="input"
											size="1">
				<?php
				if ($GLOBALS ['app_list_strings'] ['cidade_list'])
				{
					foreach ( $GLOBALS ['app_list_strings'] ['cidade_list'] as $key => $value )
					{
						$selected = '';
						if ($Objcandidatos->cidade_c == utf8_decode ( $key )) $selected = 'selected';
						
						echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
					}
				}
				?>
				</select></td>
									</tr>
									<tr>
										<td height="20" width="100%" colspan="5" bgcolor="ECECEC">
											<div id="barra">Necessidade Especial</div>
										</td>
									</tr>
									<tr>
										<td height="20" width="32%" align="right" bgcolor="ECECEC"><small><font
											face="Verdana"><strong>Tipo de Necessidade:</strong></font></small>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><select class="input"
											name="tiponecessidade" size="1">
		<?php
		if ($GLOBALS ['app_list_strings'] ['tipo_necessidade_list'])
		{
			foreach ( $GLOBALS ['app_list_strings'] ['tipo_necessidade_list'] as $key => $value )
			{
				$selected = '';
				if (utf8_decode ( $key ) == $Objcandidatos->tiponecessidade) $selected = 'selected';
				echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
			}
		}
		?>
		</select>
									         <font face="Verdana" color="000000"><small><strong>Outra:</strong></small></font>
									<input type="text" class="input" name="descri_necessidade_c" size="33" value="<?=$Objcandidatos->descri_necessidade_c?>"> 

		</td>
									</tr>
									<tr>
										<td height="20" width="100%" colspan="5" bgcolor="ECECEC">
											<div id="barra">Idiomas</div>
										</td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Inglês:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="ingles" class="input"
											size="1">
		<?php
		if ($GLOBALS ['app_list_strings'] ['idiomas_list'])
		{
			foreach ( $GLOBALS ['app_list_strings'] ['idiomas_list'] as $key => $value )
			{
				$selected = '';
				if (utf8_decode ( $key ) == $Objcandidatos->ingles) $selected = 'selected';
				echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
			}
		}
		?>
		
		</select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Espanhol:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="espanhol" class="input"
											size="1">
		<?php
		if ($GLOBALS ['app_list_strings'] ['idiomas_list'])
		{
			foreach ( $GLOBALS ['app_list_strings'] ['idiomas_list'] as $key => $value )
			{
				$selected = '';
				if (utf8_decode ( $key ) == $Objcandidatos->espanhol) $selected = 'selected';
				echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
			}
		}
		?>
		
		</select></td>
									</tr>

									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Outro Idioma:</strong></font></small>
										</td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input" name="outroidioma" size="15" value="<?=$Objcandidatos->outro?>"> 
										
										<select name="nivel_outro_idioma_c" class="input">
		<?php
		if ($GLOBALS ['app_list_strings'] ['idiomas_list'])
		{
			foreach ( $GLOBALS ['app_list_strings'] ['idiomas_list'] as $key => $value )
			{
				$selected = '';
				if (utf8_decode ( $key ) == $Objcandidatos->nivel_outro_idioma_c) $selected = 'selected';
				echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
			}
		}
		?>
		
		</select></td>

										</td>
										<tr>
											<td height="20" width="100%" colspan="5">
												<div id="barra">Nível Acadêmico</div>
											</td>
										</tr>
										<tr>
											<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
												face="Verdana"><strong>Nivel Acadêmico:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small>
											</td>
											<td height="20" width="68%" bgcolor="ECECEC"><select class="input"
												name="nivelacademico" size="1">
		<?php
		if ($GLOBALS ['app_list_strings'] ['nivel_academico_list'])
		{
			foreach ( $GLOBALS ['app_list_strings'] ['nivel_academico_list'] as $key => $value )
			{
				$selected = '';
				if (utf8_decode ( $value ) == $Objcandidatos->nivelacademico) $selected = 'selected';
				echo '<option value="' . utf8_decode ( $value ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
			}
		}
		
		?>
		</select></td>
										</tr>
										<tr>
											<td height="20" width="100%" colspan="5">
												<div id="barra">Experiência Profissional (Atual / Recente)</div>
											</td>
										</tr>
										<tr>
											<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
												face="Verdana"><strong>Empresa:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
											<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
												name="empresa" size="60"
												value="<?=$Objcandidatos->empresa?>"></td>
										</tr>
										<tr>
											<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
												face="Verdana"><strong>Setor:</strong></font></small></td>
											<td height="20" width="68%" bgcolor="ECECEC"><select name="setor" class="input"
												size="1"
												onchange="MudaSubTipo('subsetor',this.options[this.selectedIndex].value)">
		<?php
		if ($GLOBALS ['app_list_strings'] ['setor_list'])
		{
			foreach ( $GLOBALS ['app_list_strings'] ['setor_list'] as $key => $value )
			{
				$selected = '';
				if (utf8_decode ( $key ) == $Objcandidatos->setor) $selected = 'selected';
				echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
			}
		}
		?>
		</select></td>
										</tr>
										<tr>
											<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
												face="Verdana"><strong>Subsetor:</strong></font></small></td>
											<td height="20" width="68%" bgcolor="ECECEC"><select name="subsetor" class="input"
												size="1" id="subsetor">
											</select></td>
										</tr>
										<tr>
											<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
												face="Verdana"><strong>Cargo:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
											<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
												name="cargo" size="30" value="<?=$Objcandidatos->cargo?>"></td>
										</tr>
										<tr>
											<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
												face="Verdana"><strong>Unidade de Negócio /
											Divisão:</strong></font></small></td>
											<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
												name="unidadenegocio" size="30" value="<?=$Objcandidatos->unidadenegocio?>"></td>
										</tr>
										<tr>
											<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
												face="Verdana"><strong>Data de Início:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
											<td height="20" width="68%" bgcolor="ECECEC"><!--<select name="datainicio" size="1">
                     <option value="" selected>Mês</option>
                      <option value="01" >Jan</option>
                      <option value="02" >Fev</option>
                      <option value="03" >Mar</option>
                      <option value="04" >Abr</option>
                      <option value="05" >Mai</option>
                      <option value="06" >Jun</option>
                      <option value="07" >Jul</option>
                      <option value="08" >Ago</option>
                      <option value="09" >Set</option>
                      <option value="10" >Out</option>
                      <option value="11" >Nov</option>
                      <option value="12" >Dez</option>
                    </select>
                    / <strong> <font face="Verdana, Arial, Helvetica, sans-serif"> -->
											<input type="text" name="datainicio" size="10" value="<?=FormataDataPagina ( $Objcandidatos->datainicio )?>" class="input">
											</font></strong><font
												face="Verdana, Arial, Helvetica, sans-serif"><small><font
												face="verdana" size="1">(dd/mm/aaaa)</font></small>
											<tr>
												<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
													face="Verdana"><strong>Atual:</td>
												<td height="20" width="68%" bgcolor="ECECEC"><input type="checkbox"
													name="atual_c"  class="input"
													value="1"
													<?php if($Objcandidatos->atual_c) echo ' checked'; ?>
													>
												</td>
											</tr>
											<tr>
												<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
													face="Verdana"><strong>Data de Desligamento:</strong></font></small></td>
												<td height="20" width="68%" bgcolor="ECECEC"><!-- <select name="datadesligamento" size="1">
                      <option value="" selected>Mês</option>
                      <option value="01" >Jan</option>
                      <option value="02" >Fev</option>
                      <option value="03" >Mar</option>
                      <option value="04" >Abr</option>
                      <option value="05" >Mai</option>
                      <option value="06" >Jun</option>
                      <option value="07" >Jul</option>
                      <option value="08" >Ago</option>
                      <option value="09" >Set</option>
                      <option value="10" >Out</option>
                      <option value="11" >Nov</option>
                      <option value="12" >Dez</option>
                    </select>
                    / <strong><font face="Verdana, Arial, Helvetica, sans-serif"> -->
												<input class="input" type="text" name="datadesligamento" size="10" value="<?=FormataDataPagina ( $Objcandidatos->datadesligamento )?>">
											
											</font></strong><font
												face="Verdana, Arial, Helvetica, sans-serif"><small><font
												face="verdana" size="1">(dd/mm/aaaa)</font></small></font><strong><font
												face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></td>
										</tr>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Salário:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="salario_c"
											size="1" class="input">
					<?php
					if ($GLOBALS ['app_list_strings'] ['salario_list'])
					{
						foreach ( $GLOBALS ['app_list_strings'] ['salario_list'] as $key => $value )
						{
							$selected = '';
							if (utf8_decode ( $key ) == $Objcandidatos->salario_c) $selected = 'selected';
							echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
						}
					}
					?>
                    </select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Relação com a Empresa:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="relacaoempresa"
											size="1" class="input">
					<?php
					if ($GLOBALS ['app_list_strings'] ['Candidatos_relacao_empresa_list'])
					{
						foreach ( $GLOBALS ['app_list_strings'] ['Candidatos_relacao_empresa_list'] as $key => $value )
						{
							$selected = '';
							if (utf8_decode ( $value ) == $Objcandidatos->relacaoempresa) $selected = 'selected';
							echo '<option value="' . utf8_decode ( $value ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
						}
					}
					?>
                    </select></td>
									</tr>
									<tr>
										<td height="20" width="100%" colspan="5">
											<div id="barra">Experiência Profissional (Atual 2 / Anterior)</div>										
                                        </td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Empresa:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="empresab" size="60" value="<?=$Objcandidatos->empresab?>"></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Setor:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="setorb" class="input"
											size="1"
											onchange="MudaSubTipo('subsetorb',this.options[this.selectedIndex].value)">
		<?php
		if ($GLOBALS ['app_list_strings'] ['setor_list'])
		{
			foreach ( $GLOBALS ['app_list_strings'] ['setor_list'] as $key => $value )
			{
				$selected = '';
				if (utf8_decode ( $key ) == $Objcandidatos->setorb) $selected = 'selected';
				echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
			}
		}
		?>
		</select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Subsetor:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="subsetorb" class="input"
											id="subsetorb" size="1">
										</select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Cargo:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="cargob" size="30" value="<?=$Objcandidatos->cargob?>"></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Unidade de Negócio /
										Divisão:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="unidadenegociob" size="30" value="<?=$Objcandidatos->unidadenegociob?>"></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Data de Início:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><!--<select name="select6" size="1">
                      <option value="" selected>Mês</option>
                      <option value="01" >Jan</option>
                      <option value="02" >Fev</option>
                      <option value="03" >Mar</option>
                      <option value="04" >Abr</option>
                      <option value="05" >Mai</option>
                      <option value="06" >Jun</option>
                      <option value="07" >Jul</option>
                      <option value="08" >Ago</option>
                      <option value="09" >Set</option>
                      <option value="10" >Out</option>
                      <option value="11" >Nov</option>
                      <option value="12" >Dez</option>
                    </select>
                    / <strong> <font face="Verdana, Arial, Helvetica, sans-serif"> -->
										<input type="text" name="datainiciob" size="10" class="input" value="<?=FormataDataPagina ( $Objcandidatos->datainiciob )?>">
										</font></strong><font
											face="Verdana, Arial, Helvetica, sans-serif"><small><font
											face="verdana" size="1">(dd/mm/aaaa)</font></small>
										<tr>
												<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
													face="Verdana"><strong>Atual:</td>
												<td height="20" width="68%" bgcolor="ECECEC"><input type="checkbox" class="input"
													name="atual2_c" 
													value="1"
													<?php if($Objcandidatos->atual2_c) echo ' checked'; ?>
													>
												</td>
										</tr>
										<tr>
											<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
												face="Verdana"><strong>Data de Desligamento:</strong></font></small></td>
											<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
												name="datadesligamentob" size="10" value="<?=FormataDataPagina ( $Objcandidatos->datadesligamentob )?>">
										
										</font></strong><font
											face="Verdana, Arial, Helvetica, sans-serif"><small><font
											face="verdana" size="1">(dd/mm/aaaa)</font></small></font><strong><font
											face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></td>
									</tr>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Salário:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="salario2_c" class="input"
											size="1">
					<?php
					if ($GLOBALS ['app_list_strings'] ['salario_list'])
					{
						foreach ( $GLOBALS ['app_list_strings'] ['salario_list'] as $key => $value )
						{
							$selected = '';
							if (utf8_decode ( $key ) == $Objcandidatos->salario2_c) $selected = 'selected';
							echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
						}
					}
					?>
					
			
                    </select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Relação com a Empresa:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select class="input"
											name="relacaoempresab" size="1">
					<?php
					if ($GLOBALS ['app_list_strings'] ['Candidatos_relacao_empresa_list'])
					{
						foreach ( $GLOBALS ['app_list_strings'] ['Candidatos_relacao_empresa_list'] as $key => $value )
						{
							$selected = '';
							if (utf8_decode ( $key ) == $Objcandidatos->relacaoempresab) $selected = 'selected';
							echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
						}
					}
					?>
                    </select></td>
									</tr>
									<tr>
										<td height="20" width="100%" colspan="5">
										<div id="barra">Objetivo 1</div>
										</td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Setor:<span style="color:#FF0000; font-weight:lighter;">*</span></strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="setorc" class="input"
											size="1"
											onchange="MudaSubTipo('subsetorc',this.options[this.selectedIndex].value)">
				<?php
				if ($GLOBALS ['app_list_strings'] ['setor_list'])
				{
					foreach ( $GLOBALS ['app_list_strings'] ['setor_list'] as $key => $value )
					{
						$selected = '';
						if (utf8_decode ( $key ) == $Objcandidatos->setorc) $selected = 'selected';
						echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
					}
				}
				?>
                    </select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Subsetor:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="subsetorc" class="input"
											id="subsetorc" size="1">
										</select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Cargo:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="cargoc" size="30" value="<?=$Objcandidatos->cargoc?>"> <small><font
											face="verdana" size="1">(Sem abreviação) </font></small></td>
									</tr>
									<td height="20" width="100%" colspan="5">
											<div id="barra">Objetivo 2</div>
									</td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Setor:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="setor_c" class="input"
											size="1"
											onchange="MudaSubTipo('subsetor_c',this.options[this.selectedIndex].value)">
				<?php
				if ($GLOBALS ['app_list_strings'] ['setor_list'])
				{
					foreach ( $GLOBALS ['app_list_strings'] ['setor_list'] as $key => $value )
					{
						$selected = '';
						if (utf8_decode ( $key ) == $Objcandidatos->setor_c) $selected = 'selected';
						echo '<option value="' . utf8_decode ( $key ) . '" ' . $selected . '>' . utf8_decode ( $value ) . '</option>';
					}
				}
				?>
                    </select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Subsetor:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><select name="subsetor_c" class="input"
											id="subsetor_c" size="1">

										</select></td>
									</tr>
									<tr>
										<td height="20" width="32%" bgcolor="ECECEC" align="right"><small><font
											face="Verdana"><strong>Cargo:</strong></font></small></td>
										<td height="20" width="68%" bgcolor="ECECEC"><input type="text" class="input"
											name="cargo_c" size="30" value="<?=$Objcandidatos->cargo_c?>"> <small><font
											face="verdana" size="1">(Sem abreviação) </font></small></td>
									</tr>
									<tr>
										<td height="20" width="100%" colspan="5">
										<div id="barra">Currículo</div>
										</td>
									</tr>
									<tr>
										<td height="20" bgcolor="ECECEC" colspan="2">
										<?php 
// ======================================================================================================										
// ======================================================================================================										
// ======================================================================================================										
// ======================================================================================================										

if(!empty($Objcandidatos->id)):

	$candidato = $Objcandidatos->id;
	$candidato_docs = new candidato_documents;
	$condicao = 'sab_candid200fndidato_ida="' . $candidato . '" order by date_modified';
	$documents = $candidato_docs->Lista(0, 0, $condicao);
	//echo '<pre>'; var_dump($documents); echo '</pre>';

if($documents):
?>
<table bordercolor="#FFFFFF">
<thead>
<tr bgcolor="DBDBDB">
	<th width="100%" align="left">Nome</th>
	<th nowrap>Data da inclusão</th>
</tr>
</thead>
<tbody>
<?php foreach($documents as $document): ?>
<tr>
		<?php
		$doc_rev = new document_revisions;
		$doc_rev->id = $document['document_revision_id'];
		$doc_rev->Seleciona();
		$doc = new documents;
		$doc->id = $doc_rev->document_id;
		$doc->Seleciona();
		//echo '<pre>'; var_dump($doc_rev); echo '</pre>';
		//echo '<pre>'; var_dump($doc); echo '</pre>';
		$download = 'download.php?id=' . $doc_rev->id . '&mime=' . $doc_rev->file_mime_type .
			'&file=' . urlencode($doc_rev->filename);
		?>
		<td height="20"><a href="<?php echo $download; ?>"><?php echo $doc_rev->filename; ?></a></td>
		<td height="20" nowrap><?php echo FormataDataHoraPagina($doc_rev->date_entered); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
endif;
endif;

// ======================================================================================================										
// ======================================================================================================										
// ======================================================================================================										
// ======================================================================================================										
?>
									
									
									
									
									
									
										</td>
									</tr>
                                    <tr>
                                        <td height="20" align="right"><small><font face="Verdana"><strong>Foto:</strong></font></td>
                                        <td>
                                        
												
                                              <label><input type="file" name="file[]" class="input"></label>
                                             

                                              <span style="font-size:12px; line-height:15px;"><strong>*</strong>Máximo 5 Mb.</span>
                                        </td>
                                    </tr>
									<tr>
										<td height="20" align="right"><small><font face="Verdana"><strong>Arquivo:</strong></font></small>
										</td>
										<td height="20">
										<input type="file" name="arquivo" class="input"> <span style="font-size:12px; line-height:15px;"><strong>*</strong>Máximo 5 Mb.</span></td>
									</tr>

									<tr>
										<td height="20" align="center" colspan="2"><small><font face="verdana"
											size="1">(Copie e cole aqui seu currículo detalhado em
										formato de texto. Não se preocupe com a formatação. O que
										interessa é o conteúdo. Inclua também neste campo seu CV em
										outro idioma).</font></small></td>
									</tr>
									<tr>
										<td height="20" colspan="2"><textarea style="width: 100%; height: 250px;"
											name="cv_c" class="input"><?php echo $Objcandidatos->cv_c?></textarea></td>
									</tr>
									<tr align="center">
										<td height="20" id="barra" colspan="2">

										<input type="button" onClick="Validar(); verificaemail();" value="Cadastrar" style="height:28px;">
										
										</td>
									</tr>

								</table>
								</center>
								</div>
								<div align="center">
								<center>
                                
								<table border="0" cellspacing="2" width="100%">
									<tr>
										<td height="20" colspan="2" class="">
										</td>
									</tr>
								</table>
								</td>
								<td height="20" width="15" valign="top"> </td>
								</tr>
							
							</table>



							</td>
							</tr>
						</table>

						<input type="hidden" name="Acao">



						</form>
</div>
</td></tr></table>
</body>
</html>
?>

"clscandidato.php"

<? 
require_once('variavelglobal.php');
require_once($DiretorioClasses . 'clsbanco.php');
require_once($DiretorioInclude . 'FuncoesGenericas.php');
require_once($DiretorioClasses . 'clsemail.php');

class candidato
{
	var $id;
	var $date_entered;
	var $date_modified;
	var $modified_user_id;
	var $created_by;
	var $description;
	var $deleted;
	var $assigned_user_id;
	var $salutation;
	var $first_name;
	var $last_name;
	var $title;
	var $department;
	var $do_not_call;
	var $phone_home;
	var $phone_mobile;
	var $phone_work;
	var $phone_other;
	var $phone_fax;
	var $primary_address_street;
	var $primary_address_city;
	var $primary_address_state;
	var $primary_address_postalcode;
	var $primary_address_country;
	var $alt_address_street;
	var $alt_address_city;
	var $alt_address_state;
	var $alt_address_postalcode;
	var $alt_address_country;
	var $assistant;
	var $assistant_phone;
	var $datanasc;
	var $sexo;
	var $emailpessoal;
	var $emailcomercial;
	var $complemento;
	var $empresa;
	var $setor;
	var $subsetor;
	var $cargo;
	var $unidadenegocio;
	var $datainicio;
	var $datadesligamento;
	var $salario;
	var $relacaoempresa;
	var $empresab;
	var $setorb;
	var $subsetorb;
	var $cargob;
	var $unidadenegociob;
	var $datainiciob;
	var $salariob;
	var $relacaoempresab;
	var $setorc;
	var $subsetorc;
	var $cargoc;
	var $ingles;
	var $espanhol;
	var $outro;
	var $cpf;
	var $datadesligamentob;
	var $nivelacademico; 
	var $tiponecessidade;
	var $salario_c;
	var $cpf2_c;
	var $bairro_c;
	var $salario2_c;
	var $cidade_c;
	var $estado_c;
	var $senha_c;
	var $numero_c;
	var $atual_c;
	var $email_c;
	var $setorf_c;
	var $setor_c;
	var $subsetor_c;
	var $cargo_c;
	var $cv_c;
	var $atual2_c;
	var $nivel_outro_idioma_c;
	var $descri_necessidade_c;
	
//alterar campos
	function Insere()
	{
	
	 
												if($_FILES['file'] != ''){
												//Diretório aonde ficará os arquivos
												$dir = '../custom/SynoFieldPhoto/phpThumb/images/';
												
												//Extensões permitidas
												$ext = array("gif","jpg","png", "bmp");
												
												//Quant. de campos do tipo FILE
												$campos = 6;
												
												//Se for enviado
												if ($_FILES['file']['name'] != '') {
												
												//Obtendo info. dos arquivos
												$f_name = $_FILES['file']['name'];
												$f_tmp = $_FILES['file']['tmp_name'];
												$f_type = $_FILES['file']['type'];
												
												
												//Contar arquivos enviados
												$cont=0;
												
												//Repetindo de acordo com a quantidade de campos FILE
												for($i=0;$i<$campos;$i++){
												
												//Pegando o nome
												$name = $f_name[$i];
												
												//Verificando se o campo contem arquivo
												  if ( ($name!="") and (is_file($f_tmp[$i])) and (in_array(substr($name, -3),$ext)) ) {
												
													if ($cont==0) {
													 // echo "<b>Arquivo(s) enviados:
												//</b>";
													}
													//  echo $name." - ";
												
													  //Movendo arquivo's do upload
													  $up = move_uploaded_file($f_tmp[$i], $dir.$name);
												
														//Status
														if ($up==true):
														//	echo  "<i>Enviado!</i>";
															  $cont++;
														else:
														//	echo "<i>Falhou!</i>";
														endif;
												
													  echo "
												";
												  }
												if($f_name[0] <> ''){
												$caminho_paths =  $dir . $f_name[0];
												//echo $caminho_paths;
												
												$largura_alvo = 84;
 
												$img = imagecreatefromjpeg($caminho_paths);
												 
												$largura_original = imagesX($img);
												$altura_original = imagesY($img);
												 
												$altura_nova = (int) ($altura_original * $largura_alvo)/$largura_original;
												 
												$nova = ImageCreateTrueColor($largura_alvo,$altura_nova);
												imagecopyresampled($nova, $img, 0, 0, 0, 0, $largura_alvo, $altura_nova, $largura_original,  $altura_original);
												$foto_c = 'sab_Candidato_foto_c' . md5 ( $f_name[0] ). '.jpg';
												
												header("Content-type: image/jpg");
												imagejpeg($nova,$dir . $foto_c);
												}
												}
												
												//echo ($cont!=0) ? "<i>Total de arquivos enviados: </i>".$cont : "Nenhum arquivo foi enviado!";

												}
												header("Content-Type: text/html"); 	
												}											
		//$idescolhido = rand(00000000,99999999);
		$Sql = 'insert into sab_candidato ';
		$Sql .= '(
			id, 
			date_entered, 
			date_modified, 
			modified_user_id, 
			created_by, 
			description, 
			deleted, 
			assigned_user_id, 
			salutation, 
			first_name, 
			last_name, 
			title, 
			department, 
			do_not_call, 
			phone_home, 
			phone_mobile, 
			phone_work, 
			phone_other, 
			phone_fax, 
			primary_address_street, 
			primary_address_city, 
			primary_address_state, 
			primary_address_postalcode, 
			primary_address_country, 
			alt_address_street, 
			alt_address_city, 
			alt_address_state, 
			alt_address_postalcode, 
			alt_address_country,
			assistant, 
			datanasc,
			sexo,
			emailpessoal,
			emailcomercial,
			complemento, 
			empresa,
			setor,
			subsetor,
			cargo,
			unidadenegocio,
			datainicio,
			datadesligamento,
			salario,
			relacaoempresa,
			empresab,
			setorb,
			subsetorb,
			cargob,
			unidadenegociob,
			datainiciob,
			datadesligamentob, 
			salariob,
			relacaoempresab,
			setorc,
			subsetorc,
			cargoc,
			ingles,
			espanhol,
			outro,
			cpf,
			nivelacademico,
			tiponecessidade
		) values (';

		//$Sql .= FormataCampoBanco($idescolhido, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->id, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->date_entered, 3, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->date_modified, 3, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->modified_user_id, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->created_by, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->description, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->deleted, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->assigned_user_id, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->salutation, 1, 1). ', '; 
		$Sql .= FormataCampoBanco($this->first_name, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->last_name, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->title, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->department, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->do_not_call, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->phone_home, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->phone_mobile, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->phone_work, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->phone_other, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->phone_fax, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->primary_address_street, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->primary_address_city, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->primary_address_state, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->primary_address_postalcode, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->primary_address_country, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->alt_address_street, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->alt_address_city, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->alt_address_state, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->alt_address_postalcode, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->alt_address_country, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->assistant, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->datanasc, 3, 1) . ', ';
		$Sql .= FormataCampoBanco($this->sexo, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->emailpessoal, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->emailcomercial, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->complemento, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->empresa, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->setor, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->subsetor, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->cargo, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->unidadenegocio, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->datainicio, 3, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->datadesligamento, 3, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->salario, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->relacaoempresa, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->empresab, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->setorb, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->subsetorb, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->cargob, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->unidadenegociob, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->datainiciob, 3, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->datadesligamentob, 3, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->salariob, 1, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->relacaoempresab, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->setorc, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->subsetorc, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->cargoc, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->ingles, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->espanhol, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->outro, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->cpf, 2, 1) . ', '; 
		$Sql .= FormataCampoBanco($this->nivelacademico, 1, 1) . ', ';
		$Sql .= FormataCampoBanco($this->tiponecessidade, 1, 1);
		$Sql .= '); ';		 
				
		$Sql2 = ' insert into sab_candidato_cstm ';
		$Sql2 .= '(
			id_c, 
			salario_c, 
			cpf2_c, 
			bairro_c, 
			salario2_c, 
			cidade_c, 
			estado_c, 
			status_c, 
			senha_c, 
			numero_c, 
			atual_c, 
			email_c, 
			setorf_c, 
			setor_c, 
			subsetor_c, 
			cargo_c,
			cv_c,
			atual2_c,
			foto_c,
			descri_necessidade_c,
			nivel_outro_idioma_c
		) values (';

		$Sql2 .= FormataCampoBanco($this->id , 1, 1) . ', '; 
		$Sql2 .= FormataCampoBanco($this->salario_c, 1, 1) . ', '; 
		$Sql2 .= FormataCampoBanco($this->cpf2_c, 2, 1) . ', '; 
		$Sql2 .= FormataCampoBanco($this->bairro_c, 1, 1) . ', '; 
		$Sql2 .= FormataCampoBanco($this->salario2_c,  1, 1) . ', '; 
		$Sql2 .= FormataCampoBanco($this->cidade_c,  1, 1) . ', '; 
		$Sql2 .= FormataCampoBanco($this->estado_c,  1, 1) . ', '; 
		$Sql2 .= FormataCampoBanco('Internet',  1, 1) . ', '; 
		$Sql2 .= FormataCampoBanco($this->senha_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->numero_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->atual_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->email_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->setorf_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->setor_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->subsetor_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->cargo_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->cv_c,  1, 1) . ', ';
		$Sql2 .= FormataCampoBanco($this->atual2_c,  1, 1) . ', ';	
		$Sql2 .= FormataCampoBanco("$foto_c", 1 ,1) . ',';
		$Sql2 .= FormataCampoBanco($this->descri_necessidade_c, 1 ,1) . ',';
		$Sql2 .= FormataCampoBanco($this->nivel_outro_idioma_c,  1, 1);
		$Sql2 .= '); ';

		//echo $Sql . '<br><br>' . $Sql2 . '<br><br>';
		//exit;
		InsereBanco($Sql);
		InsereBanco($Sql2);
	} 


	function Altera()
	 {
	 											
													//Diretório aonde ficará os arquivos
												$dir = '../custom/SynoFieldPhoto/phpThumb/images/';
												
												//Extensões permitidas
												$ext = array("gif","jpg","png", "bmp");
												
												//Quant. de campos do tipo FILE
												$campos = 6;
												
												//Se for enviado
												if ($_FILES['file']['name'] != '') {
												
												//Obtendo info. dos arquivos
												$f_name = $_FILES['file']['name'];
												$f_tmp = $_FILES['file']['tmp_name'];
												$f_type = $_FILES['file']['type'];
												
												
												//Contar arquivos enviados
												$cont=0;
												
												//Repetindo de acordo com a quantidade de campos FILE
												for($i=0;$i<$campos;$i++){
												
												//Pegando o nome
												$name = $f_name[$i];
												
												//Verificando se o campo contem arquivo
												  if ( ($name!="") and (is_file($f_tmp[$i])) and (in_array(substr($name, -3),$ext)) ) {
												
													if ($cont==0) {
													  //echo "<b>Arquivo(s) enviados:
												//</b>";
													}
													 // echo $name." - ";
												
													  //Movendo arquivo's do upload
													  $up = move_uploaded_file($f_tmp[$i], $dir.$name);
												
														//Status
														if ($up==true):
														//	echo  "<i>Enviado!</i>";
															  $cont++;
														else:
															//echo "<i>Falhou!</i>";
														endif;
												
													  echo "
												";
												  }
												
												if($f_name[0] <> ''){
												$caminho_paths =  $dir . $f_name[0];
												//echo $caminho_paths;
												
												$largura_alvo = 84;
 
												$img = imagecreatefromjpeg($caminho_paths);
												 
												$largura_original = imagesX($img);
												$altura_original = imagesY($img);
												 
												$altura_nova = (int) ($altura_original * $largura_alvo)/$largura_original;
												 
												$nova = ImageCreateTrueColor($largura_alvo,$altura_nova);
												imagecopyresampled($nova, $img, 0, 0, 0, 0, $largura_alvo, $altura_nova, $largura_original,  $altura_original);
												$foto_c = 'sab_Candidato_foto_c' . md5 ( $f_name[0] ). '.jpg';
												
												header("Content-type: image/jpg");
												imagejpeg($nova,$dir . $foto_c);
												}
												}
												
												//echo ($cont!=0) ? "<i>Total de arquivos enviados: </i>".$cont : "Nenhum arquivo foi enviado!";

												}
												header("Content-Type: text/html"); 	
	 											
	 
		$Sql = 'Update sab_candidato';
		$Complemento = ' Set ';
		$Sql .= $Complemento . 'date_entered = ' 				.FormataCampoBanco($this->date_entered, 3, 1); 
		$Complemento = ', ';
		$Sql .= $Complemento . 'date_modified = ' 				.FormataCampoBanco($this->date_modified, 3, 1); 
		$Sql .= $Complemento . 'modified_user_id = ' 			.FormataCampoBanco($this->modified_user_id, 1, 1); 
		$Sql .= $Complemento . 'created_by = '					.FormataCampoBanco($this->created_by, 1, 1);
		$Sql .= $Complemento . 'description = '					.FormataCampoBanco($this->description, 1, 1);
		$Sql .= $Complemento . 'deleted	= '						.FormataCampoBanco($this->deleted, 1, 1);
		$Sql .= $Complemento . 'assigned_user_id = '			.FormataCampoBanco($this->assigned_user_id, 1, 1);
		$Sql .= $Complemento . 'salutation= '					.FormataCampoBanco($this->salutation, 1, 1);
		$Sql .= $Complemento .' first_name = '					.FormataCampoBanco($this->first_name, 1, 1); 			
		$Sql .= $Complemento .' last_name = '					.FormataCampoBanco($this->last_name, 1, 1);
		$Sql .= $Complemento .' title = '						.FormataCampoBanco($this->title, 1, 1); 	
		$Sql .= $Complemento .' department = '					.FormataCampoBanco($this->department, 1, 1); 
		$Sql .= $Complemento .' do_not_call = '					.FormataCampoBanco($this->do_not_call, 1, 1); 
		$Sql .= $Complemento .' phone_home = '					.FormataCampoBanco($this->phone_home,  1, 1); 
		$Sql .= $Complemento .' phone_mobile = '				.FormataCampoBanco($this->phone_mobile,  1, 1); 
		$Sql .= $Complemento .' phone_work = '					.FormataCampoBanco($this->phone_work,  1, 1); 
		$Sql .= $Complemento .' phone_other = '					.FormataCampoBanco($this->phone_other,  1, 1); 
		$Sql .= $Complemento .' phone_fax = '					.FormataCampoBanco($this->phone_fax,  1, 1); 
		$Sql .= $Complemento .' primary_address_street = '		.FormataCampoBanco($this->primary_address_street,  1, 1); 
		$Sql .= $Complemento .' primary_address_city = '		.FormataCampoBanco($this->primary_address_city,  1, 1); 
		$Sql .= $Complemento .' primary_address_state = '		.FormataCampoBanco($this->primary_address_state,  1, 1); 
		$Sql .= $Complemento .' primary_address_postalcode = '	.FormataCampoBanco($this->primary_address_postalcode,  1, 1); 
		$Sql .= $Complemento .' primary_address_country = '		.FormataCampoBanco($this->primary_address_country,  1, 1); 
		$Sql .= $Complemento .' alt_address_street = '			.FormataCampoBanco($this->alt_address_street,  1, 1); 
		$Sql .= $Complemento .' alt_address_city = '			.FormataCampoBanco($this->alt_address_city,  1, 1); 
		$Sql .= $Complemento .' alt_address_postalcode = '		.FormataCampoBanco($this->alt_address_postalcode,  1, 1); 
		$Sql .= $Complemento .' alt_address_country = '			.FormataCampoBanco($this->alt_address_country,  1, 1); 
		$Sql .= $Complemento .' assistant = '					.FormataCampoBanco($this->assistant,  1, 1); 
		$Sql .= $Complemento .' datanasc = '					.FormataCampoBanco($this->datanasc,  3, 1); 
		$Sql .= $Complemento .' sexo = '						.FormataCampoBanco($this->sexo,  1, 1); 
		$Sql .= $Complemento .' emailpessoal = '				.FormataCampoBanco($this->emailpessoal,  1, 1); 
		$Sql .= $Complemento .' emailcomercial = '				.FormataCampoBanco($this->emailcomercial,  1, 1);
		$Sql .= $Complemento .' complemento = '					.FormataCampoBanco($this->complemento,  1, 1);  
		$Sql .= $Complemento .' empresa = '						.FormataCampoBanco($this->empresa,  1, 1); 
		$Sql .= $Complemento .' setor = '						.FormataCampoBanco($this->setor,  1, 1); 
		$Sql .= $Complemento .' subsetor = '					.FormataCampoBanco($this->subsetor,  1, 1); 
		$Sql .= $Complemento .' cargo = '						.FormataCampoBanco($this->cargo,  1, 1); 
		$Sql .= $Complemento .' unidadenegocio = '				.FormataCampoBanco($this->unidadenegocio,  1, 1); 
		$Sql .= $Complemento .' datainicio = '					.FormataCampoBanco($this->datainicio,  3, 1); 
		$Sql .= $Complemento .' datadesligamento = '			.FormataCampoBanco($this->datadesligamento,  3, 1); 
		$Sql .= $Complemento .' salario = '						.FormataCampoBanco($this->salario,  1, 1); 
		$Sql .= $Complemento .' relacaoempresa = '				.FormataCampoBanco($this->relacaoempresa,  1, 1); 
		$Sql .= $Complemento .' empresab = '					.FormataCampoBanco($this->empresab,  1, 1); 
		$Sql .= $Complemento .' setorb = '						.FormataCampoBanco($this->setorb,  1, 1); 
		$Sql .= $Complemento .' subsetorb = '					.FormataCampoBanco($this->subsetorb,  1, 1); 
		$Sql .= $Complemento .' cargob = '						.FormataCampoBanco($this->cargob,  1, 1); 
		$Sql .= $Complemento .' unidadenegociob = '				.FormataCampoBanco($this->unidadenegociob,  1, 1);  
		$Sql .= $Complemento .' salariob = '					.FormataCampoBanco($this->salariob,  1, 1); 
		$Sql .= $Complemento .' relacaoempresab = '				.FormataCampoBanco($this->relacaoempresab,  1, 1); 
		$Sql .= $Complemento .' setorc = '						.FormataCampoBanco($this->setorc, 1, 1); 
		$Sql .= $Complemento .' subsetorc = '					.FormataCampoBanco($this->subsetorc, 1, 1); 
		$Sql .= $Complemento .' cargoc = '						.FormataCampoBanco($this->cargoc, 1, 1); 
		$Sql .= $Complemento .' ingles = '						.FormataCampoBanco($this->ingles, 1, 1); 
		$Sql .= $Complemento .' espanhol = '					.FormataCampoBanco($this->espanhol, 1, 1);
		$Sql .= $Complemento .' outro = '		 				.FormataCampoBanco($this->outro, 1, 1);  
		$Sql .= $Complemento .' cpf = '							.FormataCampoBanco($this->cpf,  1, 1); 
		$Sql .= $Complemento .' datadesligamentob = '			.FormataCampoBanco($this->datadesligamentob,  3, 1);
		$Sql .= $Complemento .' nivelacademico = '				.FormataCampoBanco($this->nivelacademico,  1, 1);
		$Sql .= $Complemento .' tiponecessidade = '				.FormataCampoBanco($this->tiponecessidade,  1, 1);
		
		
		$Sql2 = 'Update sab_candidato_cstm';
		$Complemento = ' Set ';
		$Sql2 .= $Complemento . ' salario_c = '					.FormataCampoBanco($this->salario_c, 1, 1); 
		$Complemento = ', ';
		$Sql2 .= $Complemento . ' cpf2_c = '					.FormataCampoBanco($this->cpf2_c, 1, 1); 
		$Sql2 .= $Complemento . ' bairro_c = '					.FormataCampoBanco($this->bairro_c, 1, 1); 
		$Sql2 .= $Complemento . ' salario2_c = '				.FormataCampoBanco($this->salario2_c, 1, 1);
		$Sql2 .= $Complemento . ' cidade_c = '					.FormataCampoBanco($this->cidade_c, 1, 1);
		$Sql2 .= $Complemento . ' estado_c = '					.FormataCampoBanco($this->estado_c, 1, 1);
		$Sql2 .= $Complemento . ' numero_c = '					.FormataCampoBanco($this->numero_c, 1, 1);
		$Sql2 .= $Complemento . ' atual_c = '					.FormataCampoBanco($this->atual_c, 1, 1);
		$Sql2 .= $Complemento . ' email_c = '					.FormataCampoBanco($this->email_c, 1, 1);
		$Sql2 .= $Complemento . ' setorf_c = '					.FormataCampoBanco($this->setorf_c, 1, 1);
		$Sql2 .= $Complemento . ' setor_c = '					.FormataCampoBanco($this->setor_c, 1, 1);
		$Sql2 .= $Complemento . ' subsetor_c = '				.FormataCampoBanco($this->subsetor_c, 1, 1);
		$Sql2 .= $Complemento . ' cargo_c = '					.FormataCampoBanco($this->cargo_c, 1, 1);
		$Sql2 .= $Complemento . ' senha_c = '					.FormataCampoBanco($this->senha_c, 1, 1);
		$Sql2 .= $Complemento . ' cv_c = '						.FormataCampoBanco($this->cv_c, 1, 1);
		$Sql2 .= $Complemento . ' atual2_c = '					.FormataCampoBanco($this->atual2_c, 1, 1);
		if($foto_c != ''){$Sql2 .= $Complemento . ' foto_c = '					.FormataCampoBanco("$foto_c", 1, 1);}
		$Sql2 .= $Complemento . ' descri_necessidade_c = '		.FormataCampoBanco($this->descri_necessidade_c, 1, 1);
		$Sql2 .= $Complemento . ' nivel_outro_idioma_c = '		.FormataCampoBanco($this->nivel_outro_idioma_c, 1, 1);	

		$Sql  .= ' Where id = '				. FormataCampoBanco($this->id, 1, 0);
		$Sql2 .= ' Where id_c = '				. FormataCampoBanco($this->id, 1, 0);
		
		AlteraBanco($Sql);
		AlteraBanco($Sql2);
		//echo $Sql; 

	}
	
	function Seleciona()
	{
		$Sql = 'Select * from sab_candidato where id = "' . trim($this->id) . '"';
		$ArrSql = SelecionaBanco($Sql);

		if ($ArrSql){
			
			$this->date_entered 				= $ArrSql[0]['date_entered'];
			$this->date_modified 				= $ArrSql[0]['date_modified'];
			$this->modified_user_id				= $ArrSql[0]['modified_user_id'];
			$this->created_by					= $ArrSql[0]['created_by'];
			$this->description					= $ArrSql[0]['description']; 
			$this->deleted						= $ArrSql[0]['deleted'];
			$this->assigned_user_id				= $ArrSql[0]['assigned_user_id'];
			$this->salutation					= $ArrSql[0]['salutation']; 
			$this->first_name					= $ArrSql[0]['first_name'];
			$this->last_name					= $ArrSql[0]['last_name'];
			$this->title						= $ArrSql[0]['title']; 
			$this->department					= $ArrSql[0]['department'];
			$this->do_not_call					= $ArrSql[0]['do_not_call'];
			$this->phone_home					= $ArrSql[0]['phone_home']; 
			$this->phone_mobile					= $ArrSql[0]['phone_mobile'];
			$this->phone_work					= $ArrSql[0]['phone_work'];
			$this->phone_other					= $ArrSql[0]['phone_other'];
			$this->phone_fax					= $ArrSql[0]['phone_fax'];
			$this->primary_address_street		= $ArrSql[0]['primary_address_street'];
			$this->primary_address_city			= $ArrSql[0]['primary_address_city'];
			$this->primary_address_state		= $ArrSql[0]['primary_address_state'];
			$this->primary_address_postalcode	= $ArrSql[0]['primary_address_postalcode'];
			$this->primary_address_country		= $ArrSql[0]['primary_address_country'];
			$this->alt_address_street			= $ArrSql[0]['alt_address_street'];
			$this->alt_address_city				= $ArrSql[0]['alt_address_city'];
			$this->alt_address_postalcode		= $ArrSql[0]['alt_address_postalcode'];
			$this->alt_address_country			= $ArrSql[0]['alt_address_country'];
			$this->assistant					= $ArrSql[0]['assistant'];
			$this->assistant_phone				= $ArrSql[0]['assistant_phone'];
			$this->alt_address_city				= $ArrSql[0]['alt_address_city'];
			$this->datanasc						= $ArrSql[0]['datanasc'];
			$this->sexo							= $ArrSql[0]['sexo'];
			$this->emailpessoal					= $ArrSql[0]['emailpessoal'];
			$this->emailcomercial				= $ArrSql[0]['emailcomercial'];
			$this->complemento					= $ArrSql[0]['complemento'];
			$this->empresa						= $ArrSql[0]['empresa'];
			$this->setor						= $ArrSql[0]['setor'];
			$this->subsetor						= $ArrSql[0]['subsetor'];
			$this->cargo						= $ArrSql[0]['cargo'];
			$this->unidadenegocio				= $ArrSql[0]['unidadenegocio'];
			$this->datainicio					= $ArrSql[0]['datainicio'];
			$this->datadesligamento				= $ArrSql[0]['datadesligamento'];
			$this->salario						= $ArrSql[0]['salario'];
			$this->relacaoempresa				= $ArrSql[0]['relacaoempresa'];
			$this->empresab						= $ArrSql[0]['empresab'];
			$this->setorb						= $ArrSql[0]['setorb'];
			$this->subsetorb					= $ArrSql[0]['subsetorb'];
			$this->cargob						= $ArrSql[0]['cargob'];
			$this->unidadenegociob				= $ArrSql[0]['unidadenegociob'];
			$this->salariob						= $ArrSql[0]['salariob'];
			$this->relacaoempresab				= $ArrSql[0]['relacaoempresab'];
			$this->setorc						= $ArrSql[0]['setorc'];
			$this->subsetorc					= $ArrSql[0]['subsetorc'];
			$this->cargoc						= $ArrSql[0]['cargoc'];
			$this->ingles						= $ArrSql[0]['ingles'];
			$this->espanhol						= $ArrSql[0]['espanhol'];
			$this->outro						= $ArrSql[0]['outro'];
			$this->cpf							= $ArrSql[0]['cpf'];
			$this->datainiciob					= $ArrSql[0]['datainiciob'];
			$this->datadesligamentob			= $ArrSql[0]['datadesligamentob'];
			$this->nivelacademico				= $ArrSql[0]['nivelacademico'];
			$this->tiponecessidade				= $ArrSql[0]['tiponecessidade'];
		}
		
		$Sql = 'Select * from sab_candidato_cstm where id_c = "' . trim($this->id) . '"';
		$ArrSql = SelecionaBanco($Sql);	
		
		//echo '<pre>' ; var_dump($ArrSql); echo '</pre>';
		if ($ArrSql){
			$this->salario_c 				= $ArrSql[0]['salario_c'];
			$this->cpf2_c 					= $ArrSql[0]['cpf2_c'];
			$this->bairro_c					= $ArrSql[0]['bairro_c'];
			$this->salario2_c				= $ArrSql[0]['salario2_c'];
			$this->cidade_c					= $ArrSql[0]['cidade_c'];
			$this->estado_c					= $ArrSql[0]['estado_c'];
			$this->senha_c					= $ArrSql[0]['senha_c'];
			$this->numero_c					= $ArrSql[0]['numero_c'];
			$this->atual_c					= $ArrSql[0]['atual_c'];
			$this->email_c					= $ArrSql[0]['email_c'];
			$this->setorf_c					= $ArrSql[0]['setorf_c'];
			$this->setor_c					= $ArrSql[0]['setor_c'];
			$this->subsetor_c				= $ArrSql[0]['subsetor_c'];
			$this->cargo_c					= $ArrSql[0]['cargo_c'];
			$this->status_c					= $ArrSql[0]['status_c'];
			$this->cv_c						= $ArrSql[0]['cv_c'];
			$this->atual2_c					= $ArrSql[0]['atual2_c'];
			$this->foto_c					= $ArrSql[0]['foto_c'];
			$this->descri_necessidade_c		= $ArrSql[0]['descri_necessidade_c'];
			$this->nivel_outro_idioma_c		= $ArrSql[0]['nivel_outro_idioma_c'];
		}		
	}
	
	function Exclui()
	{
		$Sql = 'update sab_candidato set deleted = 0 where id = ' . $this->id;
	 	DeletaBanco($Sql);
	}


	

	function Lista($numeroregistros = 0, $numeropagina = 0)
	{
		$Sql = 'Select * from sab_candidato';
		if ($numeroregistros != 0)
			$Sql .= ' limit ' . $numeropagina . ', ' . $numeroregistros;
	
		$ArrSql = SelecionaBanco($Sql);
	
		if ($ArrSql)
			return $ArrSql;
		else
			return 0;
	}
	
	function Login($Email = '', $Senha = '')
	{
		if((!empty($Email)) && (!empty($Senha))){
			//$Sql = 'Select * from sab_candidato where emailpessoal = "'.trim($Email).'" order by date_entered desc';
			//$ArrSql = SelecionaBanco($Sql);
			
			$SqlSenha = 'Select * from sab_candidato_cstm as scc inner join sab_candidato as sc on scc.id_c = sc.id where	scc.email_c = "'. $Email .'" and scc.senha_c = "' . 
				$Senha . '" and sc.deleted <> 1';
			$ArrSql = SelecionaBanco($SqlSenha);

			if ($ArrSql){
				return $ArrSql;
			} else
				return 0;
		} else 
			return 0;
				
	}	
	
    // Retorna      Registro com Operador se existir
    function VerificaEmail($Pemail)
    {
        $Sql = 'Select * from sab_candidato as tb1 inner join sab_candidato_cstm as tb2 on tb1.id = tb2.id_c  where emailpessoal = \'' . $Pemail . '\'';
        $ArrSql = SelecionaBanco($Sql);

        if (!$ArrSql)
            return 0;
        else
            return $ArrSql;
    }    
    
	function EsqueciSenha($nome)
	{
		$Objemail = New email;
		$ArrEmail = $this->VerificaEmail($nome);
		if ($ArrEmail){
			$Objemail->De = SMTP_USUARIO;
			$Objemail->Para = $ArrEmail[0]['emailpessoal'];
			$Objemail->Assunto = "Esqueci Minha Senha";						
			$Objemail->Tipo = 1;	
			$Objemail->MensagemTEXTO = "

			Prezado " . $ArrEmail[0]['first_name'] . ",
			Conforme solicitação estamos enviando sua senha.
			Usuário : " . $ArrEmail[0]['emailpessoal'] . "
			Senha   : " . $ArrEmail[0]['senha_c'] . "
							
			Atenção! Tome cuidado com sua senha, não revele a ninguém. Troque-a com frequência.";
			$Objemail->Enviar();
			//return $Objemail->Enviar();
			return 3;
		}	
		else 	
			return 1;
	}	

}
?>

Aguardo ajuda,

 

Luciano Filho

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara, ai fica dificil.. oque 'significa' não entra ?

 

e que código absurdo!

 

faça assim:

var_dump( $_POST );
compare oque você tá recebendo de verdade, com oque você 'acha' que tá recebendo.

 

Ai depois verifique o banco de dados, se a coluna existe e tem o tipo certo lá.

Depois disso, habilite as mensagens de erro.

 

Depois exiba na tela, com um echo, a consulta SQL, antes de mandar executá-la, e veja se a string de INSERT/UPDATE está sendo formada corretamente.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara, ai fica dificil.. oque 'significa' não entra ?

 

nao é gravado no banco de dados...

 

e que código absurdo!

 

nao é culpa minha peguei o sistema desse jeito...

 

faça assim:

 

var_dump( $_POST );

 

compare oque você tá recebendo de verdade, com oque você 'acha' que tá recebendo.

 

Ai depois verifique o banco de dados, se a coluna existe e tem o tipo certo lá.

Depois disso, habilite as mensagens de erro.

 

Depois exiba na tela, com um echo, a consulta SQL, antes de mandar executá-la, e veja se a string de INSERT/UPDATE está sendo formada corretamente.

como pode em um servidor funcionar e em outro servidor não???

 

sendo o mesmo banco de dados e o mesmo codigo fonte

 

a tabela existe, a coluna existe, o post existe, mas não é inseriodo no mysql

Compartilhar este post


Link para o post
Compartilhar em outros sites

simples:

 

-> versões diferentes de php, mysql, apache, so

 

-> e configurações diferentes de arquivos .ini

 

 

siga as minhas instruções de debug em #2

http://forum.imasters.com.br/index.php?/topic/375800-orientacoes-para-uma-boa-participacao/

 

 

agora por exemplo:

tem várias datas no teu código. A qual delas você se refere?

você poderia ter postado apenas o trecho do insert com problemas. E não 'tudo'. Ficaria bem mais fácil de lhe ajudarmos.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.