<? 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">
<p>
  <!-- NIVEL PUBLICA MUNICIPAL -->
</p>
<p>&nbsp; </p>
<table>
<tr><td colspan="5" align="center" bgcolor="#FFFFFF"><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=5 align=center><font color='#666666'>Porcentaje de faltantes :". number_format($porcentaje8, 2)."</font></td></tr>";
?>
</table>
<p></body>
</html>
