<?php require_once('Connections/cn.php'); ?>
<!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=utf8" />
<title>sadce-recupera contraseña</title>


<style type="text/css">
  body {
    background-color: #FFFFFF;
    color: #004080;
    font-family: Arial;
    font-size: 12px;
  }
  .bd {
    background-color: #FFFFFF;
    color: #004080;
    font-family: Arial;
    font-size: 12px;
  }
  .tbl {
    background-color: #FFFFFF;
  }
  a:link { 
    color: #FF0000;
    font-family: Arial;
    font-size: 12px;
  }
  a:active { 
    color: #0000FF;
    font-family: Arial;
    font-size: 12px;
  }
  a:visited { 
    color: #800080;
    font-family: Arial;
    font-size: 12px;
  }
  .hr {
    background-color: #336699;
    color: #FFFFFF;
    font-family: Arial;
    font-size: 12px;
  }
  .hr1 {
    background-color: #336699;
    color: #FFFFFF;
    font-family: Arial;
    font-size: 18px; 
	height:40px;
  }
  a.hr:link {
    color: #FFFFFF;
    font-family: Arial;
    font-size: 12px;
  }
  a.hr:active {
    color: #FFFFFF;
    font-family: Arial;
    font-size: 12px;
  }
  a.hr:visited {
    color: #FFFFFF;
    font-family: Arial;
    font-size: 12px;
  }
  .dr {
    background-color: #FFFFFF;
    color: #000000;
    font-family: Arial;
    font-size: 12px;
  }
  .sr {
    background-color: #FFFFCF;
    color: #000000;
    font-family: Arial;
    font-size: 12px;
  }
.style1 {font-size: 12px}
.style5 {font-size: 16px; }
#tablaLogin{
  margin-right:auto;
  margin-left:auto;
  border:2px solid #ccc;
  margin-top:50px;
}
.style9 {background-color: #336699; color: #FFFFFF; font-family: Arial; font-size: 16px; font-weight: bold; }
</style>
</head>
<script src="jquery.min.js" type="text/javascript"></script>


<script>
$(document).ready(function(){
	$("#cedula").change(function(){
		$.post("carga_tipo_usuario.php",{ id:$(this).val() },function(data){$("#tipo_usuario").html(data);})
	});	
})

</script>

<body>

<form name ="form1" id ="form1" action="" method="post"  onsubmit="return validar_recupera()">
<table width="50%" border="0" align="center" cellpadding="0" cellspacing="1" class="bd" id="tablaLogin">
  <tr><td colspan="2" align="center" valign="middle" class="hr1">Recuperaci&oacute;n de Contrase&ntilde;a</td>
  </tr>
  

  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td><div align="right" class="style5">C&eacute;dula:</div>
        <div align="center"></div></td>
    <td>&nbsp;&nbsp;<input name="cedula" type="text" id="cedula" size="10" maxlength="10" onblur="verificar_usuario(this.value)" /></td>
  </tr>
  <tr>
    <td width="35%"><div align="right" class="style5">Tipo de Usuario:</div>
        <div align="center"></div></td>
    <td width="65%">&nbsp;&nbsp;<select name="tipo_usuario" id="tipo_usuario" style="width:210px">
	 <option value="0">Seleccione...</option>
    </select></td>
  </tr>
  
  
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  
  <tr>
    <td colspan="2"><iframe name="frameUser" id="frameUser" with="0" height="0" frameborder="0" ></iframe></td>
  </tr>
  <tr>
    <td colspan="2"><div align="center">
	<input name="Enviar" type="button" id="Enviar" value="Recuperar" onClick="validar_recupera()" >
     
    </div></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
</form>

</body>
</html>


<script type="text/javascript">
	var nav4 = window.Event ? true : false;
	function soloNum(evt)
	{	
	// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57, ','= 44, '.'= 46
		var key = nav4 ? evt.which : evt.keyCode;	
		//var str=obj.value;
		return (key == 8 || key == 13 || (key >= 48 && key <= 57));
	}
</script>	
	 
<script type="text/javascript">
	
function validar_recupera()
{
  if(document.form1.cedula.value==""){
	alert("El campo <<Cédula>> es obligatorio");
	document.form1.cedula.focus();
	return false;
	}
  if(document.form1.tipo_usuario.value==0){
	alert("El campo <<Tipo de Usuario>> es obligatorio");
	document.form1.tipo_usuario.focus();
	return false;
	}
	url="responder.php?a=responder"+"&id_usuario="+document.form1.cedula.value+"&tipo_usuario="+document.form1.tipo_usuario.value;
	 window.open(url,'contenido');

}
</script>
	
<script type="text/javascript">	

function verificar_usuario(cedula)
{
  if (cedula!="") {
	  url="validar_usuario_siga.php?cedula="+cedula;
	  frameUser.location=url;
  }
}
</script>



