<?php require_once('Connections/cn.php'); ?>
<?php
session_start();

mysql_select_db($database_cn, $cn);
mysql_query ("SET NAMES 'utf8'");

// Datos de los periodos CIU abiertos.	
	$query_rsperiodos = "SELECT id_periodo, codigo, tipo FROM periodos WHERE status='ABIERTO' and tipo='CIU' order by id_periodo desc";
	$rsperiodos = mysql_query($query_rsperiodos, $cn) or die(mysql_error());
	$row_rsperiodos = mysql_fetch_assoc($rsperiodos);
	$totalRows_rsperiodos = mysql_num_rows($rsperiodos);

//Evita que se cargue la p�gina desde el navegador.

//Captura el tipo de usuario que se quiere registrar.  

?>	

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" http-equiv="content-type" content="text/html">
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>sadce-registro de usuarios</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;
}
</style>
</head>

<body>
<form action="alumnos_ciu.php?a=edit" method="post" name ="form1" id ="form1" onSubmit="return validar_registro()">
  <table width="44%" border="0" align="center" cellpadding="0" cellspacing="0" class="bd" id="tablaLogin">
  <tr>
    <td colspan="2" align="left" valign="middle" class="hr1">&nbsp;&iexcl;Bienvenido a la ENAHP-IUT CIU 2024-II
  
  <tr>
    <td class="style5">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="55%" class="style5"><div align="right">C&eacute;dula de Identidad:&nbsp;&nbsp;  </div></td>
    <td width="45%"><span class="style1">
      <input name="cedula" type="text" id="cedula" size="12" maxlength="12" >
    </span></td><iframe name="frame1" id="frame1" with="0" height="0" frameborder="0" ></iframe>
  </tr>
  <tr>
    <td colspan="2"></td>
  </tr>
  
  <tr>
    <td height="36" class="style5"><div align="right">Lapso Académico 2024-II:&nbsp;&nbsp; </div></td>
    <td><span class="style1">
      <label>
      <select name="periodo" id="periodo">
        <?php
do {  
?>
        <option value="<?php echo $row_rsperiodos['id_periodo']?>"><?php echo $row_rsperiodos['codigo'].' ('.$row_rsperiodos['tipo'].')' ?></option>
        <?php
} while ($row_rsperiodos = mysql_fetch_assoc($rsperiodos));
  $rows = mysql_num_rows($rsperiodos);
  if($rows > 0) {
      mysql_data_seek($rsperiodos, 0);
	  $row_rsperiodos = mysql_fetch_assoc($rsperiodos);
  }
?>
      </select>
      </label>
    </span></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
    </tr>
  <tr>
    <td colspan="2"><div align="center">
<input type="submit" name="action" value="Actualizar Datos" />
    </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_registro()
{
  if(document.form1.cedula.value==""){
	alert("El campo <<Cédula>> es obligatorio");
	document.form1.cedula.focus();
	return false;
	}
  else{
	  url="validar_usuario_ciu.php?cedula="+document.form1.cedula.value;
	  frame1.location=url;
	  return;
  }
}
</script>


