<?php
include_once('../class/class.mysql.php');
include_once('class.usuario.php');
include_once('../include/utilitarios.php');

extract($_POST);
if($ax == 'Novo'){
	echo '<input name="btnOpcaoSalvar" id="btnOpcaoSalvar" type="hidden" value="novo" />';
	$admissao = date('Y/m/d');
}

if($ax == 'configurar'){
	$mysqlCom = new MysqlConnect();
	$usuario = new Usuario();
	echo '<input name="btnOpcaoSalvar" id="btnOpcaoSalvar" type="hidden" value="configurar" />';
	$usuario->SelectUsuario($id);
	while($row = mysqli_fetch_object($usuario->qry)){
		$id_usuario	   	= $row->id_usuario;
		$cpf          	= $row->cpf;
		$nome 	   		= $row->nome;
		$login		   	= $row->login;
		$rg 			= $row->rg;
		$endereco 	   	= $row->endereco;
		$cidade		   	= $row->cidade;
		$bairro		   	= $row->bairro;
		$cep		   	= $row->cep;
		$telefone	   	= $row->telefone;
		$email		   	= $row->email;
		$celular		= $row->celular;
		$senha		   	= $row->senha;
		$funcao	   		= $row->funcao;
		$admissao		= $row->admissao;
	}

}


?>
<script>
(function($){ $(function(){$('input:text').setMask();}); })(jQuery);
</script>
<form id="formConfigurar">
<table width="700" border="0">
  <tr class="dados">
    <th width="195">Campos</th>
    <th width="495">Dados</th>
  </tr>
  <tr>
    <td class="descricao">Nome Completo</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="EdtNome" type="text" id="EdtNome" value="<?php echo $nome?>" size="50" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Login</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtLogin" onblur="VerificarDupliciade($(this).val(),'spDupLogin','<?php echo $login?>', 'login')" type="text" id="edtLogin" value="<?php echo $login?>" size="30" />
      <span id="spDupLogin" style="color:#F00; font-size:10px; "> <input type="hidden" class="edtDuplicidade" value="nDupli" /></span>
     
    </div></td>
  </tr>
  <tr>
    <td class="descricao">CPF</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtCPF" type="text" onblur="VerificarDupliciade($(this).val(),'spDupCPF','<?php echo $cpf?>', 'cpf')"  alt="cpf" id="edtCPF" value="<?php echo $cpf?>" size="30" />
      <span id="spDupCPF" style="color:#F00; font-size:10px;"><input type="hidden" class="edtDuplicidade" value="nDupli" /></span>
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Identidade RG</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtRG" type="text" id="edtRG"  value="<?php echo $rg?>" size="30" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Endereço</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtEndereco" type="text" id="edtEndereco" value="<?php echo $endereco?>" size="50" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Bairro</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtBairro" type="text" id="edtBairro" value="<?php echo $bairro?>" size="50" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Cidade</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtCidade" type="text" id="edtCidade" value="<?php echo $cidade?>" size="50" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">CEP</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtCep" type="text" id="edtCep" alt="cep" value="<?php echo $cep?>" size="25" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">E-Mail</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtEmail" type="text" id="edtEmail" value="<?php echo $email?>" size="50" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Telefone</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="EdtTelefone" type="text" id="EdtTelefone" alt="phone" value="<?php echo $telefone?>" size="25" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Celular</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtCelular" type="text" id="edtCelular" alt="phone" value="<?php echo $celular?>" size="25" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Admissão</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtAdmissao" type="text" alt="date"  id="edtAdmissao" value="<?php echo InverterData($admissao)?>" size="25" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Senha</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtSenha" type="password" id="edtSenha" value="<?php echo $senha?>" size="20" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Rediginte a Senha</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtSenha2" type="password" id="edtSenha2" value="<?php echo $senha?>" size="20" />
    </div></td>
  </tr>
  <tr>
    <td class="descricao">Função</td>
    <td class="dados"><div align="left" style="margin-left:5px">
      <input name="edtFuncao" type="text" id="edtFuncao" value="<?php echo $funcao?>" size="50" />
    </div></td>
  </tr>
</table>
</form>


<!--    /*Script para mudar cor da linha de cada tabela*/-->
<script type="text/javascript" src="js/table.js"></script>
<input type="hidden" name="id" id="id" value="<?php echo $id_usuario?>" /> 
