<? header("Content-type: application/vnd.ms-excel"); ?>
<? require_once("../coneccion.php"); ?>
<?php 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sistema resumen</title>
</head>
<body>
<?
?>
<p>
  <!-- NIVEL BACHILLERATO -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="4" align="center"><FONT size="4" face="ARIAL">
  <p><em>NIVEL BACHILLERATO</em></p></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr bgcolor="#CCCCCC"><td>No.</td><td>Clave</td><td>Nombre</td><td>Localidad</td><td>Municipio</td><td>Telefono</td></tr>
<?

$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='E' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll);  
$renglones5 = mysql_num_rows($resultt);

while($row = mysql_fetch_array($resultt)){
   //$segui02 = "SELECT * FROM seguimiento where m1!='' and m3!='' and m4!='' and m5!='' and m6!='' and m7!='' and id='$row[row_id]'";
    $segui02 = "SELECT * FROM seguimiento where (folio!='' or folio is not null) and id='$row[row_id]'";
   $segui01 = mysql_query($segui02);  
   
	$segui = mysql_fetch_array($segui01);
	
	if($segui==''){
		$cont5=$cont5+1;
		echo "<td> ".$cont5."</td><td>".$row[clavecct]."</td><td>".$row[nombrect]."</td><td>".$row[nombreloc]."</td><td>".$row[nombremun]."</td><td>".$row[telefono]."</td></tr>";
		$porcentaje5=$cont5*100/104;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center>Porcentaje de faltantes :". number_format($porcentaje5, 2)."</td></tr>";
?>
</table>
<p>
</body>
</html>
