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


mysql_select_db($database_conn, $conn);
 mysql_query ("SET NAMES 'utf8'");
 
$query_rstPeriodos = "SELECT  periodos.id_periodo, periodos.codigo, periodos.tipo FROM periodos where id_periodo>=70 ORDER BY periodos.id_periodo desc";
$rstPeriodos = mysql_query($query_rstPeriodos, $conn) or die(mysql_error());
$row_rstPeriodos = mysql_fetch_assoc($rstPeriodos);
$totalRows_rstPeriodos = mysql_num_rows($rstPeriodos);



$query_rstCarreras = "SELECT id_carrera, nombre_carrera FROM carreras order by nombre_carrera";
$rstCarreras = mysql_query($query_rstCarreras, $conn) or die(mysql_error());
$row_rstCarreras = mysql_fetch_assoc($rstCarreras);
$totalRows_rstCarreras = mysql_num_rows($rstCarreras);



 session_start();

?>

<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;
  }
  .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>

<body>
<?php
// Cargo los datos de las Carreras.

mysql_select_db($database_conn, $conn);
 mysql_query ("SET NAMES 'utf8'");
$query_carreras = "SELECT id_carrera,nombre_carrera FROM carreras ORDER BY nombre_carrera";
$rst_carreras = mysql_query($query_carreras, $conn) or die(mysql_error());

$totalRows_carreras = mysql_num_rows($rst_carreras);  

if($totalRows_carreras >0)
{
    $array_areas = array();
	 $array_carreras = array();
	$code=0;
	while($carrera = mysql_fetch_assoc($rst_carreras))
		{
			$array_carreras[$code] = $carrera["id_carrera"];		
			$array_areas[$code]=  $carrera["nombre_carrera"];	
			$code += 1;
		}
}
			
?>
<table class="bd" width="100%" align="center"><tr><td class="hr"><h2 align="left">Descarga de Inscripciones </h2></td></tr></table>
<form name="form1" method="post" action="">
  <table width="99%" border="0" align="center" id="carga" cellpadding="1" cellspacing="10" style="border:1px solid #ccc;">
    <tr>
      <td width="59">Lapso:</td>
      <td width="134"><select name="periodo" id="periodo">
       <option selected value="0">SELECCIONE...</option>
          <?php
do {  
?>
          <option value="<?php echo $row_rstPeriodos['id_periodo']?>"><?php echo $row_rstPeriodos['codigo']?>&nbsp;(<?php echo $row_rstPeriodos['tipo']?>)</option>
          <?php
} while ($row_rstPeriodos = mysql_fetch_assoc($rstPeriodos));
  $rows = mysql_num_rows($rstPeriodos);
  if($rows > 0) {
      mysql_data_seek($rstPeriodos, 0);
	  $row_rstPeriodos = mysql_fetch_assoc($rstPeriodos);
  }
?>
        </select>      </td>
      <td width="137"><div align="right"></div></td>
      <td width="164"><div align="left"></div></td>
      <td width="54">&nbsp;</td>
      <td width="260">&nbsp;</td>
    </tr>
    
    <tr>
      <td>Carrera:</td>
      <td colspan="5"><select name="id_carrera" id="id_carrera" style="width:580px">
        <option selected value="LCF">LICENCIATURA EN CIENCIAS FISCALES</option>
      </select></td>
    </tr>


    <tr>
      <td height="34" colspan="6"><div align="center">
        <label>
        <input name="Enviar" type="button" id="Enviar" value="Descargar" onClick="imprimir()" >
        </label>
      </div></td>
    </tr>
  </table>
    <div align="center"></div>
  <div align="center"></div>
</form>
<p>&nbsp;</p>
</body>

 <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 validar_datos()
	{
	 	
		
			return true;
	}
	
</script>
 <?php
mysql_free_result($rstDocentes);
mysql_free_result($rstSede);
mysql_free_result($rstPeriodos);
mysql_free_result($rstMaterias);
mysql_free_result($rstSecciones);
mysql_free_result($rstCarreras);
?>

<script type="text/javascript">
 function imprimir()
 {

 
 	if(document.form1.periodo.value==0){
			alert("El campo <<Período>> es obligatorio");
			document.form1.periodo.focus();
			return false;
			}
 	url="imprimir_estadisticas_aprobados_reprobados.php?periodo="+document.form1.periodo.value+"&carrera="+document.form1.id_carrera.value;
	//window.open(url);
	var strFeatures = "dialogTop="+((screen.height - 100) / 2)+"; dialogLeft=" + ((screen.width - 250) / 2) +"; dialogWidth=250px;" +
			"dialogHeight=100px; unadorned=0; status=0;  center=yes; help=no; font-family:Arial;" +
			"font-size:12px";
			showModalDialog (url, "",strFeatures);
 }
</script>
