<?php require_once('Connections/conn.php'); ?>
<?php
session_start();
$cedula_usuario=$_SESSION['CEDULA_USUARIO'];
$SEDE_USUARIO=$_SESSION['SEDE_USUARIO'];




mysql_select_db($database_conn, $conn);
 mysql_query ("SET NAMES 'utf8'");
$query_rstAlumnos = "SELECT id_alumno,cedula,apellidos,nombres FROM alumnos ORDER BY apellidos,nombres";
$rstAlumnos = mysql_query($query_rstAlumnos, $conn) or die(mysql_error());
$totalRows_rstAlumnos = mysql_num_rows($rstAlumnos);

if($totalRows_rstAlumnos >0)
{
    $array_id = array();
	$array_alumno = array();
	$code=0;
	while($alumno = mysql_fetch_assoc($rstAlumnos))
		{
			$array_id[$code] = $alumno["id_alumno"];		
			$array_alumno[$code]=  $alumno["apellidos"].', '.$alumno["nombres"];	
			$code += 1;
		}
}
			
// Datos de las Carreras.

 session_start();
  if (isset($_GET["order"])) $order = @$_GET["order"];
  if (isset($_GET["type"])) $ordtype = @$_GET["type"];

  if (isset($_POST["filter"])) $filter = @$_POST["filter"];
  if (isset($_POST["filter_field"])) $filterfield = @$_POST["filter_field"];
  $wholeonly = false;
  if (isset($_POST["wholeonly"])) $wholeonly = @$_POST["wholeonly"];

  if (!isset($order) && isset($_SESSION["order"])) $order = $_SESSION["order"];
  if (!isset($ordtype) && isset($_SESSION["type"])) $ordtype = $_SESSION["type"];
  if (!isset($filter) && isset($_SESSION["filter"])) $filter = $_SESSION["filter"];
  if (!isset($filterfield) && isset($_SESSION["filter_field"])) $filterfield = $_SESSION["filter_field"];

?>

<html>
<head>
<title>sadce -- carga de calificaciones</title>
<meta name="generator" http-equiv="content-type" content="text/html">
<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;
  }
  .bd1 {
    background-color: #FFFFFF;
    color: #000000;
    font-family: Arial;
    font-size: 16px;
  }
  .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;
  }
  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;
  }
</style>
<script src="jquery.min.js" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<script>
$(document).ready(function(){
	$("#cedula").change(function(){
		$.post("carga_carreras_alumno1.php",{ id:$(this).val() },function(data){$("#id_carrera").html(data);})
	});
})
</script>
<body>
<table class="bd" width="100%" align="center"><tr><td class="hr"><h2 align="left">Situaci&oacute;n Administrativa</h2></td></tr></table>
<form name="form1" id="form1" method="post" action="">
  <table width="40%" border="0" align="center" id="carga" cellpadding="1" cellspacing="10" style="border:1px solid #ccc;">
    
    <tr>
      <td width="88"><div align="right">Cédula:</div></td>
      <td colspan="5"><label>
        <input class="bd1" name="cedula" id="cedula"  type="text" size="12" maxlength="20" onBlur="verificar_alumno(this.value,'<?php echo $SEDE_USUARIO ?>')" onKeyPress="return soloNum(event)"><iframe name="frameNuevo" id="frameNuevo" with="0" height="0" frameborder="0" ></iframe>
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Apellidos:</div></td>
      <td colspan="5"><label>
        <input  name="apellidos" type="text" id="apellidos" size="35" maxlength="50">
      </label>
      &nbsp;&nbsp;&nbsp;&nbsp;Nombres:&nbsp;&nbsp;
      <label>
      <input name="nombres" type="text" id="nombres" size="35" maxlength="50">
      </label></td>
    </tr>
    <tr>
      <td width="59"><div align="right">Programa:</div></td>
      <td width="548" colspan="5"><label>
        <select name="id_carrera" id="id_carrera" style="width:580px">
		  <option value="0">Seleccione...</option>
        </select>
      </label></td>
    </tr>
    
    <tr>
      <td height="34" colspan="6"><div align="center">
        <label>
        <input name="Enviar" type="button" id="Enviar" value="Consultar" onClick="imprimir_situacion()" >
        </label>
      </div></td>
    </tr>
  </table>
    <div align="center"></div>
  <div align="center"></div>
</form>
<p>&nbsp;</p>
<?php
?>
</body>
</html>

<script type="text/javascript">
 function imprimir_situacion()
 {  
    if(document.form1.cedula.value==""){
			alert("El campo <<Cédula>> es obligatorio");
			document.form1.cedula.focus();
			return false;
			}
	if(document.form1.id_carrera.value==0){
			alert("El campo <<Programa>> es obligatorio");
			document.form1.programa.focus();
			return false;
			}
 	url="modelo/class_pdf/situacion_admin.php?carrera="+document.form1.id_carrera.value+"&cedula="+document.form1.cedula.value;
	window.open(url);

	//window.location=url;
 }
</script>

<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));
	}
	
	
	function verificar_alumno(cedula,sede)
    {
 	if (cedula!="")
	 {
	 url="validar_alumno_pago_regular.php?cedula="+cedula+"&sede="+sede;;
	 frameNuevo.location=url;
	 }
}
</script>

