<?php require_once('Connections/conn.php'); ?>
<?php
 session_start();
 
  if (!isset($_SESSION['MM_Username'])) {
      header ("Location: modulos/inicio/index.php");
	  }
  // Captura la c�dula del Docente que inici� sesi�n.	  
	$cedula=$_SESSION['CEDULA_USUARIO'];
	
	mysql_select_db($database_conn, $conn);
	 mysql_query ("SET NAMES 'utf8'");
	$query_rstDocentes = "SELECT id_docente,apellidos,nombres FROM docentes ORDER BY apellidos,nombres";
	$rstDocentes = mysql_query($query_rstDocentes, $conn) or die(mysql_error());
	$row_rstDocentes = mysql_fetch_assoc($rstDocentes);
	$totalRows_rstDocentes = mysql_num_rows($rstDocentes);
	$nro_idd=$row_rstDocentes['id_docente'];
	$docente=$row_rstDocentes['apellidos'].", ".$row_rstDocentes['nombres'];

    
 
  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>IUTA Regi�n Capital -- 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>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="jquery.min.js" type="text/javascript"></script>
</head>


<body>
<?php
    require_once('Connections/conn.php'); 
	mysql_select_db($database_conn, $conn);
	 mysql_query ("SET NAMES 'utf8'");
	$query_doc = "SELECT id_docente,apellidos,nombres FROM docentes ORDER BY apellidos,nombres";
	$rst_doc = mysql_query($query_doc, $conn) or die(mysql_error());
	$totalRows_doc = mysql_num_rows($rst_doc);  
	if($totalRows_doc >0)
	  {
		$array_doc = array();
		$array_nro_idd = array();
		$code=0;
		while($doc = mysql_fetch_assoc($rst_doc))
			{
				$array_nro_idd[$code] = $doc["id_docente"];		
				$array_doc[$code]=  $doc["apellidos"].' '.$doc["nombres"];	
				$code += 1;
			}
	}
				
?>

<table class="bd" width="100%" align="center"><tr><td class="hr"><h2>Rendimiento Acad&eacute;mico por Docente</h2></td></tr></table>

<form name="form1" method="post" action="">
  <table width="65%" border="0" align="center" id="carga" cellpadding="1" cellspacing="6" style="border:1px solid #ccc;">
    <tr>
      <td><div align="right">Docente:</div></td>
      <td><select id="id_docente" name="id_docente">
          <option value="0">SELECCIONE...</option>
          <?php
 for($i=0;$i<count($array_nro_idd);$i++) {
  echo "<option value=".$array_nro_idd[$i].">".$array_doc[$i]."</option>" ;
} 
?>
      </select></td>
    </tr>
    <tr>
      
      <td width="69"><div align="right">Corte:</div></td>
      <td><select id="corte" name="corte">
        <option value="0">SELECCIONE...</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
      </select>         
        
        <div align="left">
          <label></label>
        </div></td>
    </tr>
    
    <tr>
      <td colspan="4"><div align="center">
        <label>
        <input name="Enviar" type="button" id="Enviar" value="Procesar" onClick="cargar_rendimiento(document.form1.id_docente.value, document.form1.corte.value)">
        </label>
      </div></td>
    </tr>
  </table>
    <div align="center"></div>
  <div align="center"></div>
</form>
<p>&nbsp;</p>
</body>

<?php
mysql_free_result($rst_doc);
?>

<script type="text/javascript">
 function cargar_rendimiento(profesor,corte)
  {
  
   url="modelo/class_pdf/rendimiento.php?profesor="+profesor+"&corte="+corte;
	window.open(url);
  
    
   }
</script>