<? 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 leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?
?>
	<!-- NIVEL PRIMARIA -->
<table>
<tr><td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
  <p><em>NIVEL PRIMARIA</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></td>
</tr>
<?
$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='A' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll);  
$renglones = 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==''){
		$cont=$cont+1;
		echo "<td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje=$cont*100/4;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje, 2)."</font></td></tr>";
?>

</table>

  <!-- NIVEL SECUNDARIA -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
  <p><em>NIVEL SECUNDARIA</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></td>
</tr>
<?

$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='B' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll);  
$renglones2 = 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==''){
		$cont2=$cont2+1;
		echo "<td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont2."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje2=$cont2*100/95;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje2, 2)."</font></td></tr>";
?>
</table>

  <!-- NIVEL CAPACITACIÓN -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
  <p><em> NIVEL CAPACITACI&Oacute;N</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></td>
</tr>
<?

$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='C' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll); 
$renglones3 = 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==''){
		$cont3=$cont3+1;
		echo "<td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont3."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje3=$cont3*100/2;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje3, 2)."</font></td></tr>";
?>
</table>

<p>
  <!-- NIVEL TÉCNICO -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
  <p><em>NIVEL TÉCNICO</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></td>
</tr>
<?

$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='D' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll);  
$renglones4 = 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==''){
		$cont4=$cont4+1;
		echo "<td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont4."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje4=$cont4*100/15;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje4, 2)."</font></td></tr>";
?>
</table>
<p>
  <!-- NIVEL BACHILLERATO -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
  <p><em>NIVEL BACHILLERATO</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></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 style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont5."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje5=$cont5*100/105;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje5, 2)."</font></td></tr>";
?>
</table>

<p>
  <!-- NIVEL NORMAL -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
  <p><em>NIVEL NORMAL</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></td>
</tr>
<?

$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='F' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll);
$renglones6 = 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==''){
		$cont6=$cont6+1;
		echo "<td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont6."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje6=$cont6*100/9;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje6, 2)."</font></td></tr>";
?>
</table>

<p>
  <!-- NIVEL SUPERIOR -->
</p>
<p>&nbsp; </p>
<table>
<tr>
  <td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
    <p><em>NIVEL SUPERIOR</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></td>
</tr>
<?

$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='G' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll);  
$renglones7 = 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==''){
		$cont7=$cont7+1;
		echo "<td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont7."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje7=$cont7*100/63;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje7, 2)."</font></td></tr>";
?>
</table>

<p>
  <!-- NIVEL PUBLICA MUNICIPAL -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
  <p><em>PUBLICA MUNICIPAL</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></td>
</tr>
<?

$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='H' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll);  
$renglones8 = 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==''){
		$cont8=$cont8+1;
		echo "<td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont8."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje8=$cont8*100/133;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje8, 2)."</font></td></tr>";
?>
</table>

<p>
  <!-- NIVEL OTRAS -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="5" align="center"><font color="#3E5D72" face="Arial, Helvetica, sans-serif" size="+2"><strong>
  <p><em>NIVEL OTRAS</em></p></strong></font></td>
</tr>
<tr><td>&nbsp;</td><td colspan="4" align="right"><font color="#666666"><?php $hoy = date("d/m/Y, g a"); echo"Fecha: ".$hoy."."; ?></font></td></tr>
<tr>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">No.</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Clave</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Nombre</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Localidad</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Municipio</font></td>
<td bgcolor="#E6ECF0" style="padding:4px; border-bottom:solid 1px #DEDEDE; border-right:solid 1px #DEDEDE; border-left:solid 1px #DEDEDE; border-top:solid 1px #DEDEDE;"><font color="#3E5D72" face="Arial, Helvetica, sans-serif">Telefono</font></td>
</tr>
<?

$sqll = "SELECT * FROM pertenece LEFT JOIN cie_cct ON pertenece.clavecct=cie_cct.clavecct 
WHERE pertenece.nv='I' order by cie_cct.nombremun, cie_cct.clavecct";
$resultt = mysql_query($sqll); 
$renglones9 = 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==''){
		$cont9=$cont9+1;
		echo "<td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-left:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$cont9."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[clavecct]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombrect]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombreloc]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[nombremun]."</td><td style='padding:4px; border-bottom:solid 1px #E9E9E9; border-right:solid 1px #E9E9E9;'>".$row[telefono]."</td></tr>";
		$porcentaje9=$cont9*100/5;
		}
	}
	echo "<tr><td>&nbsp;</td></tr>
	<tr><td colspan=4 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje9, 2)."</td></tr><tr><td>&nbsp;</td></tr><tr><td colspan=4 align=center>PORCENTAJE TOTAL DE FALTANTES :". number_format(($cont+$cont2+$cont3+$cont4+$cont5+$cont6+$cont7+$cont8+$cont9)*100/431, 2)."</font></td></tr>";
?>
</table>

<p>


</body>
</html>
