<?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_rstCarreras = "SELECT * FROM coordinaciones ORDER BY nombre_coordinacion";
$rstCarreras = mysql_query($query_rstCarreras, $conn) or die(mysql_error());
$row_rstCarreras = mysql_fetch_assoc($rstCarreras);
$totalRows_rstCarreras = mysql_num_rows($rstCarreras);



 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;
  }
  .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(){
	$("#nivel").change(function(){
		$.post("cargar_semestres.php",{ id:$(this).val() },function(data){$("#semestre").html(data);})
	});
})
</script>
<body>

<table class="bd" width="100%" align="center"><tr><td class="hr"><h2 align="left">Docentes ENAHP  </h2></td></tr></table>
<form name="form1" method="post" action="">
  <table width="56%" border="0" align="center" id="carga" cellpadding="1" cellspacing="10" style="border:1px solid #ccc;">
    <tr>
      <td><div align="right">Tipo:</div></td>
      <td colspan="5"><select name="tipo" id="tipo">
        <option value="0">SELECCIONE...</option>
        <option value="1">DOCENTES ACTIVOS</option>
        <option value="2">TODOS LOS DOCENTES</option>
      </select></td>
    </tr>
    <tr>
      <td width="139"><div align="right"> Menci&oacute;n o &Aacute;rea:</div></td>
      <td width="677" colspan="5"><select name="adscripcion" id="adscripcion">
	    <option value="0">TODAS...</option>
          <?php
do {  
?>
            <option value="<?php echo $row_rstCarreras['nombre_coordinacion']?>"><?php echo $row_rstCarreras['nombre_coordinacion']?></option>
            <?php
} while ($row_rstCarreras = mysql_fetch_assoc($rstCarreras));
  $rows = mysql_num_rows($rstCarreras);
  if($rows > 0) {
      mysql_data_seek($rstCarreras, 0);
	  $row_rstCarreras = mysql_fetch_assoc($rstCarreras);
  }
?>
      </select></td>
    </tr>
    

    
    

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

 <?php

mysql_free_result($rstCarreras);
?>


<script type="text/javascript">
 function imprimirExcel()
 {
     if(document.form1.tipo.value==0){
			alert("El campo <<Tipo>> es obligatorio");
			document.form1.tipo.focus();
			return false;
	}
	url="modelo/class_pdf/docentes_excel.php?adscripcion="+document.form1.adscripcion.value+"&tipo="+document.form1.tipo.value;
	// alert(url);
	   window.open(url);
	
 }
</script>
