Current Dir: /home/haciendachichisu/grupomontejo.com.mx/Pantallas/

[DIR]  alertifyjs [ delete | rename ]
[DIR]  bootstrap [ delete | rename ]
[DIR]  components123 [ delete | rename ]
[DIR]  Estilos [ delete | rename ]
[DIR]  font-awesome [ delete | rename ]
[DIR]  font-awesome-4.7.0 [ delete | rename ]
[FILE] consultagarantia.php [ edit | delete | rename ]
[FILE] consultartform.php [ edit | delete | rename ]
[FILE] consulta_fon.php [ edit | delete | rename ]
[FILE] consulta_inventario.php [ edit | delete | rename ]
[FILE] contenido_organigrama.php [ edit | delete | rename ]
[FILE] contratoh.php [ edit | delete | rename ]
[FILE] contratoh2.php [ edit | delete | rename ]
[FILE] cotizarentah.php [ edit | delete | rename ]
[FILE] ctasxbenefi.php [ edit | delete | rename ]
[FILE] delarchivos.php [ edit | delete | rename ]
[FILE] departamentos.php [ edit | delete | rename ]
[FILE] directoriotel.php [ edit | delete | rename ]
[FILE] ejemplosubmenu.php [ edit | delete | rename ]
[FILE] empresas.php [ edit | delete | rename ]
[FILE] encabezado.php [ edit | delete | rename ]
[FILE] encabezado_cal.php [ edit | delete | rename ]
[FILE] entsal_herramientas.php [ edit | delete | rename ]
[FILE] error_log [ edit | delete | rename ]
[FILE] fichaarticulo.php [ edit | delete | rename ]
[FILE] fichapersonal.php [ edit | delete | rename ]
[FILE] fichaprov.php [ edit | delete | rename ]
[FILE] filtros_rep.php [ edit | delete | rename ]
[FILE] form_encuesta.php [ edit | delete | rename ]
[FILE] genqr.php [ edit | delete | rename ]
[FILE] genresponsiva.php [ edit | delete | rename ]
[FILE] genutilitarios.php [ edit | delete | rename ]
[FILE] gen_orden.php [ edit | delete | rename ]
[FILE] gen_orden_2.php [ edit | delete | rename ]
[FILE] gen_orden_compras.php [ edit | delete | rename ]
[FILE] gp_print.php [ edit | delete | rename ]
[FILE] horario.php [ edit | delete | rename ]
[FILE] index.php [ edit | delete | rename ]
[FILE] inventacompras.php [ edit | delete | rename ]
[FILE] inventaHE.php [ edit | delete | rename ]
[FILE] inventarios.php [ edit | delete | rename ]
[FILE] jausentismo.php [ edit | delete | rename ]
[FILE] leyen.php [ edit | delete | rename ]
[FILE] listadosol.php [ edit | delete | rename ]
[FILE] marcas.php [ edit | delete | rename ]
[FILE] Menu_secundario.php [ edit | delete | rename ]
[FILE] meses.php [ edit | delete | rename ]
[FILE] mnttonc.php [ edit | delete | rename ]
[FILE] mnttotallas.php [ edit | delete | rename ]
[FILE] modelos_garex.php [ edit | delete | rename ]
[FILE] modpuestosvextra.php [ edit | delete | rename ]
[FILE] movimientopersonal.php [ edit | delete | rename ]
[FILE] multi_orden.php [ edit | delete | rename ]
[FILE] nespecial.php [ edit | delete | rename ]
[FILE] nsolicitud.php [ edit | delete | rename ]
[FILE] nuevo_articulo.php [ edit | delete | rename ]
[FILE] Operaciones.php [ edit | delete | rename ]
[FILE] organigrama_print.php [ edit | delete | rename ]
[FILE] pargextendida.php [ edit | delete | rename ]
[FILE] permisos.php [ edit | delete | rename ]
[FILE] pie_pag.php [ edit | delete | rename ]
[FILE] pprincipal.php [ edit | delete | rename ]
[FILE] pro_gastos.php [ edit | delete | rename ]
[FILE] pro_solicitud.php [ edit | delete | rename ]
[FILE] puesto.php [ edit | delete | rename ]
[FILE] repcotizaciones.php [ edit | delete | rename ]
[FILE] repcreditos.php [ edit | delete | rename ]
[FILE] repencuestas.php [ edit | delete | rename ]
[FILE] repfonde0s.php [ edit | delete | rename ]
[FILE] repgarantias.php [ edit | delete | rename ]
[FILE] repgastosxfondeo.php [ edit | delete | rename ]
[FILE] repgastos_solicit.php [ edit | delete | rename ]
[FILE] rephcontratos.php [ edit | delete | rename ]
[FILE] repherramientas.php [ edit | delete | rename ]
[FILE] repnominaes.php [ edit | delete | rename ]
[FILE] repnotascredito.php [ edit | delete | rename ]
[FILE] repordt.php [ edit | delete | rename ]
[FILE] reporteplantilla.php [ edit | delete | rename ]
[FILE] reportes.php [ edit | delete | rename ]
[FILE] reportes2.php [ edit | delete | rename ]
[FILE] reporte_es.php [ edit | delete | rename ]
[FILE] repo_alm.php [ edit | delete | rename ]
[FILE] reprh.php [ edit | delete | rename ]
[FILE] reprospeccion.php [ edit | delete | rename ]
[FILE] repvvacaciones.php [ edit | delete | rename ]
[FILE] rep_agenda.php [ edit | delete | rename ]
[FILE] rep_especial_mkt.php [ edit | delete | rename ]
[FILE] rep_ineg.php [ edit | delete | rename ]
[FILE] reqpersonal.php [ edit | delete | rename ]
[FILE] revsolicitudes.php [ edit | delete | rename ]
[FILE] sartdetalle.php [ edit | delete | rename ]
[FILE] seguicrdto.php [ edit | delete | rename ]
[FILE] selqrvar.php [ edit | delete | rename ]
[FILE] sel_reporte.php [ edit | delete | rename ]
[FILE] solbajas.php [ edit | delete | rename ]
[FILE] solcredito.php [ edit | delete | rename ]
[FILE] solstockprod.php [ edit | delete | rename ]
[FILE] stockproductos.php [ edit | delete | rename ]
[FILE] subecobros_nc.php [ edit | delete | rename ]
[FILE] subeventas.php [ edit | delete | rename ]
[FILE] subeventaspgarantias.php [ edit | delete | rename ]
[FILE] sube_cortebonifica.php [ edit | delete | rename ]
[FILE] sube_cortecaja.php [ edit | delete | rename ]
[FILE] tabcumppenet.php [ edit | delete | rename ]
[FILE] tabdrts.php [ edit | delete | rename ]
[FILE] tabfacturas.php [ edit | delete | rename ]
[FILE] tabfacturascontrol.php [ edit | delete | rename ]
[FILE] tabingeg.php [ edit | delete | rename ]
[FILE] tabla.php [ edit | delete | rename ]
[FILE] tabtomaseminuevos.php [ edit | delete | rename ]
[FILE] tabvacacionextraordinaria.php [ edit | delete | rename ]
[FILE] tab_garex.php [ edit | delete | rename ]
[FILE] tab_mod_a_garex.php [ edit | delete | rename ]
[FILE] tcomprasaproveedor.php [ edit | delete | rename ]
[FILE] udn.php [ edit | delete | rename ]
[FILE] ulogueado.php [ edit | delete | rename ]
[FILE] usuarios.php [ edit | delete | rename ]
[FILE] vacaciones.php [ edit | delete | rename ]
[FILE] vendedores.php [ edit | delete | rename ]
[FILE] ventagarantia.php [ edit | delete | rename ]
[FILE] visita.php [ edit | delete | rename ]

Viewing: /home/haciendachichisu/grupomontejo.com.mx/Pantallas/reportes.php

<?PHP
	include('../Datos/seguridad.php');
	$active=6;
  include('../Datos/anti_url.php');
$slected=$_SESSION['UDN'];
if(isset ($_POST['udn'])==NULL){$udn=0;}else{$udn=$_POST['udn']; $slected=$_POST['udn'];}
if(isset ($_POST['ano'])==NULL){$ano=date("Y");}else{$ano=$_POST['ano'];}
if(isset ($_POST['mes'])==NULL){$mes=date("m");}else{$mes=$_POST['mes'];}

$marca=$idmarcaudn;
if($udn>0)
{
     $busmarca=mysql_query("SELECT idmarca FROM cat_udn WHERE idudn='$udn'");
     if(mysql_num_rows($busmarca)>0)
     {
       while ($bm=mysql_fetch_array($busmarca))
       {
         $marca=$bm["idmarca"];
       }
     }
}
$completa=" AND idudn='".$_SESSION['UDN']."'";
if($tudnsxempresa==1)
{
   $completa=" AND idmarca='$marca' AND idempresa='$idempresauser'";
}
if($todaslasmarcasprospecta==1)
{
   $completa="";
}
?>	<!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>
<?PHP
include("../Pantallas/encabezado.php");
?>
<body>
<?PHP
include("../Pantallas/nmenu.php");
?>
<form id="form1" name="form1" method="post" action="reportes.php" class="form-inline" role="form">
<div class="container-fluid">
<div class="row-fluid">
      <div class="input-group span6" style="width:70px;">
      </div>
      <div class="input-group span6">
      <span class="input-group-addon" style="width:20px;text-align:left; font-size: 12px;">UDN</span>
              <select name="udn" id="udn" class="form-control" style="height:30px; font-size: 12px;">                
                <?php     
               $query1 = "SELECT * FROM cat_udn where status='1' ".$completa." ORDER BY idempresa, nomudn";
               $result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error());
               while ($row1 = mysql_fetch_array($result1)) 
               {
               ?>
                  <option <?php if($slected==$row1["idudn"]){ echo "selected";}?> value="<?php echo $row1["idudn"]; ?>"><?php echo $row1["nomudn"]; ?></option>
               <?php 
               }?>
              </select>
      </div>
      &nbsp;
      <div class="input-group span6">
      <span class="input-group-addon" style="width:20px;text-align:left;">Mes</span>
              <select name="mes" id="mes" class="form-control" style="height:30px; font-size: 12px;">
                <option <?php if($mes=='1'){ echo "selected";}?> value="1">ENERO</option>
                <option <?php if($mes=='2'){ echo "selected";}?> value="2">FEBRERO</option>
                <option <?php if($mes=='3'){ echo "selected";}?> value="3">MARZO</option>
                <option <?php if($mes=='4'){ echo "selected";}?> value="4">ABRIL</option>
                <option <?php if($mes=='5'){ echo "selected";}?> value="5">MAYO</option>
                <option <?php if($mes=='6'){ echo "selected";}?> value="6">JUNIO</option>
                <option <?php if($mes=='7'){ echo "selected";}?> value="7">JULIO</option>
                <option <?php if($mes=='8'){ echo "selected";}?> value="8">AGOSTO</option>
                <option <?php if($mes=='9'){ echo "selected";}?> value="9">SEPTIEMBRE</option>
                <option <?php if($mes=='10'){ echo "selected";}?> value="10">OCTUBRE</option>
                <option <?php if($mes=='11'){ echo "selected";}?> value="11">NOVIEMBRE</option>
                <option <?php if($mes=='12'){ echo "selected";}?> value="12">DICIEMBRE</option>
              </select>
      </div>
      &nbsp;
      <div class="input-group span6">
      <span class="input-group-addon" style="width:20px;text-align:left;">Año</span>
              <select name="ano" id="ano" class="form-control" style="height:30px; font-size: 12px;">
                <option <?php if($ano=='2016'){ echo "selected";}?> value="2016">2016</option>
                <option <?php if($ano=='2017'){ echo "selected";}?> value="2017">2017</option>
                <option <?php if($ano=='2018'){ echo "selected";}?> value="2018">2018</option>
                <option <?php if($ano=='2019'){ echo "selected";}?> value="2019">2019</option>
                <option <?php if($ano=='2020'){ echo "selected";}?> value="2020">2020</option>
                <option <?php if($ano=='2021'){ echo "selected";}?> value="2021">2021</option>
              </select>
      </div>
      &nbsp;
      <div class="input-group span6">
      <button name="button3" type="submit" id="button3" value="Consultar" class="btn"><span class="glyphicon glyphicon-search"></span> Consulta</button>
      </div>
      &nbsp;
      <div class="input-group span6">
      <button class="btn" type="button" name="limpiar" id="limpiar" onclick="location='../Pantallas/reportes.php';"><span class="glyphicon glyphicon-refresh"></span> Limpiar</button>
      </div>
</div>
<table width="1136" height="313" border="0" class="table formatoTablas">
  <tr>
    <td width="977" height="307">
      <table width="1156" border="0">
        <tr>
          <td><script type="text/javascript" src="../Highcharts-4.1.5/js/jquery.min.js"></script>
		<style type="text/css">
${demo.css}
		</style>
		<script type="text/javascript">
$(function () {
    $('#container').highcharts({
        title: {
            text: '<?php $query = "SELECT nomudn FROM cat_udn where idudn='$udn'"; 
	$result = mysql_query($query) or die('Consulta fallida: ' . mysql_error()); $row = mysql_fetch_array($result); echo $row["nomudn"]; ?>',
            x: -20 //center
        },
        subtitle: {
            text: 'Días',
            x: -20
        },
        xAxis: {
            categories: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]
        },
        yAxis: {
            title: {
                text: 'No de Visitas'
            },
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
        },
        tooltip: {
            valueSuffix: ' Visitas'
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: [
		
		 <?PHP 
	$query = "SELECT * FROM prospe_motivos order by idmotivo asc"; 
	$result = mysql_query($query) or die('Consulta fallida: ' . mysql_error());
	 while ($row = mysql_fetch_array($result)) {?>
	 
	

 {name: "<?php $idmotivo=$row["idmotivo"]; echo $row["descripcion"]; ?>", 
 data: 
 [
   <?PHP $sumgrafic=0;
   $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-01' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
 	<?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-02' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
 	<?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-03' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1);echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
 	<?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-04' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
 	<?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-05' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
    <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-06' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
 	<?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-07' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
 	<?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-08' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-09' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
     <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-10' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-11' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-12' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-13' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-14' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-15' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-16' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-17' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-18' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-19' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-20' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-21' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-22' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-23' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-24' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-25' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-26' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-27' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-28' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-29' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-30' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	 <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-31' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $sumgrafic=$sumgrafic+$row1[0];
	?>,
	]}, <?php }?>
       ]
    });
});
		</script>
	</head>
	<body>
<script src="../Highcharts-4.1.5/js/highcharts.js"></script>
<script src="../Highcharts-4.1.5/js/modules/exporting.js" ></script>

<div id="container" style="min-width: 310px; height: 200px; margin: 0 auto"></div>
</td>
        </tr>
      </table>
      <?PHP  $fechaini="$ano-$mes-01";  $fechafin="$ano-$mes-31";
	$query = "SELECT * FROM prospe_motivos order by idmotivo asc"; 
	$result = mysql_query($query) or die('Consulta fallida: ' . mysql_error());
	?>
      <label>
      <table width="1155" border="0">
        <tr style="background:#0F2A43">
          <td width="192"><div align="center"><span class="Estilo35 Estilo23">Motivo de visita</span></div></td>
          <td width="20"><div align="center"><span class="Estilo35 Estilo23">Total</span></div></td>
          <td width="41"><div align="center"><span class="Estilo35 Estilo23">Porcentaje</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">01</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">02</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">03</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">04</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">05</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">06</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">07</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">08</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">09</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">10</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">11</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">12</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">13</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">14</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">15</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">16</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">17</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">18</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">19</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">20</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">21</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">22</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">23</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">24</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">25</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">26</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">27</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">28</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">29</span></div></td>
          <td width="41"><div align="center"><span class="Estilo35 Estilo23">30</span></div></td>
          <td width="56"><div align="center"><span class="Estilo35 Estilo23">31</span></div></td>
        </tr>
        <tr>
          <td width="192"><div align="center" class="Estilo40">
            <div align="center">TOTAL</div>
          </div></td>
          <td width="20"><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha between '$fechaini' and '$fechafin' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $total=$row1[0];
	?>
          </div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center" class="Estilo35">100%</div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-01' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-02' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-03' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-04' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-05' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-06' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-07' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-08' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-09' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-10' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-11' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-12' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-13' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-14'and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-15' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-16' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-17' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-18' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-19' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-20' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-21' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-22' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-23' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-24' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-25' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-26' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-27' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-28' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-29' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-30' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-31' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
        </tr>
        
         <?php $i=0; while ($row = mysql_fetch_array($result)) { $i=$i+1; ?>
         
        <tr class="fila_<?php echo $i%2; ?>">
          <td><div align="left" class="Estilo35">
            <div align="justify">
              <?php $idmotivo=$row["idmotivo"]; echo $row["descripcion"]; ?>
              </div>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha between '$fechaini' and '$fechafin' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $cantidad=$row1[0];
	?>
          </div></td>
          <td><div align="center" class="Estilo35"><?php if($total!=0){$porcentaje=($cantidad/$total)*100;}else{$porcentaje='0';} echo number_format($porcentaje,2,".",",")."%"; ?></div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-01' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-02' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-03' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-04' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-05' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-06' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-07' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-08' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-09' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-10' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-11' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-12' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-13' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-14' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-15' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-16' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-17' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-18' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-19' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-20' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-21' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-22' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-23' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-24' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-25' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-26' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-27' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-28' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-29' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-30' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-31' and motivo='$idmotivo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
        </tr>
        <?php }?>
      </table>
    
      <p>&nbsp;</p>
    
  <?PHP
  
  $complemento=" WHERE idmarca='$marca' ";
  
	$query = "SELECT * FROM cat_modelos ".$complemento." order by idmodelo asc"; 
	$result = mysql_query($query) or die('Consulta fallida: ' . mysql_error());
	?>
        <label>
      <table width="1155" border="0">
        <tr style="background:#0F2A43">
          <td width="192"><div align="center"><span class="Estilo35 Estilo23">Modelos</span></div></td>
          <td width="20"><div align="center"><span class="Estilo35 Estilo23">Total</span></div></td>
          <td width="41"><div align="center"><span class="Estilo35 Estilo23">Porcentaje</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">01</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">02</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">03</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">04</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">05</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">06</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">07</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">08</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">09</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">10</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">11</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">12</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">13</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">14</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">15</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">16</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">17</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">18</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">19</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">20</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">21</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">22</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">23</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">24</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">25</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">26</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">27</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">28</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">29</span></div></td>
          <td width="41"><div align="center"><span class="Estilo35 Estilo23">30</span></div></td>
          <td width="56"><div align="center"><span class="Estilo35 Estilo23">31</span></div></td>
        </tr>
        <tr>
          <td width="192"><div align="center" class="Estilo39 Estilo35">
            <div align="center"><span class="Estilo35 ">TOTAL</span></div>
          </div></td>
          <td width="20"><div align="center" class="Estilo35"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha between '$fechaini' and '$fechafin' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $total=$row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center" class="Estilo35">100%</div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-01' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-02' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-03' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-04' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-05' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-06' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-07' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-08' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-09' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-10' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-11' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-12' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-13' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-14' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-15' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-16' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-17' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-18' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-19' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-20' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-21' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-22' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-23' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-24' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-25' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-26' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-27' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-28' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-29' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-30' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-31' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
        </tr>
        <?php $i=0; while ($row = mysql_fetch_array($result)) { $i=$i+1; ?>
        <tr class="fila_<?php echo $i%2; ?>">
          <td><div align="left" class="Estilo35">
            <div align="justify">
              <?php $idmodelo=$row["idmodelo"]; echo $row["descripcion"]; ?>
              </div>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha between '$fechaini' and '$fechafin' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $cantidad=$row1[0];
	?>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?php if($total!=0){$porcentaje=($cantidad/$total)*100;}else{$porcentaje='0';} echo number_format($porcentaje,2,".",",")."%"; ?>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-01' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-02' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-03' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-04' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </div></td>
          <td><div align="center" class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-05' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-06' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-07' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-08' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-09' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-10' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-11' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-12' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-13' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-14' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-15' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-16' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-17' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-18' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-19' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-20' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-21' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-22' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-23' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-24' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-25' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-26' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-27' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-28' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-29' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-30' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-31' and idmodelo='$idmodelo' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
        </tr>
        <?php }?>
      </table>
      <p>&nbsp;</p>
     
      <table width="1155" border="0">
        <tr style="background:#0F2A43">
          <td width="192"><div align="center"><span class="Estilo35 Estilo23">Modelos</span></div></td>
          <td width="20"><div align="center"><span class="Estilo35 Estilo23">Total</span></div></td>
          <td width="41"><div align="center"><span class="Estilo35 Estilo23">Porcentaje</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">01</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">02</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">03</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">04</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">05</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">06</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">07</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">08</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">09</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">10</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">11</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">12</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">13</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">14</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">15</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">16</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">17</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">18</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">19</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">20</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">21</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">22</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">23</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">24</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">25</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">26</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">27</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">28</span></div></td>
          <td width="23"><div align="center"><span class="Estilo35 Estilo23">29</span></div></td>
          <td width="41"><div align="center"><span class="Estilo35 Estilo23">30</span></div></td>
          <td width="56"><div align="center"><span class="Estilo35 Estilo23">31</span></div></td>
        </tr>
          <tr class="fila_<?php echo $i%2; ?>">
          <td width="192"><div align="center" class="Estilo39">
            <div align="center"><span class="Estilo35 ">TOTAL</span></div>
          </div></td>
          <td width="20"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha between '$fechaini' and '$fechafin' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $total=$row1[0];
	?>
          </span></div></td>
          <td><div align="center" class="Estilo35">100%</div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-01' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-02' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-03' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-04' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-05' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-06' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-07' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-08' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-09' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-10' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-11' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-12' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-13' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-14' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-15' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-16' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-17' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-18' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-19' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-20' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-21' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-22' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-23' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-24' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-25' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-26' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-27' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-28' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-29' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-30' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td class="fila_<?php echo $i%2; ?>"><div align="center"><span class="Estilo35">
            <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-31' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
        </tr>
          <tr class="fila_<?php echo $i%2; ?>">
          <td><div align="left" class="Estilo35">
            <div align="justify">PRIVADO</div>
          </div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha between '$fechaini' and '$fechafin' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $cantidad1=$row1[0];
	?>
          </span></div></td>
          <td><div align="center" class="Estilo35">
            <?php $porcentaje1=0; if($total!=0){$porcentaje1=($cantidad1/$total)*100;}else{$porcentaje='0';} echo number_format($porcentaje1,2,".",",")."%"; ?>
          </div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-01' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-02' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-03' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-04' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-05' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-06' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-07' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-08' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-09' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-10' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-11' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-12' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-13' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-14' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-15' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-16' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-17' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-18' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-19' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-20' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-21' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-22' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-23' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-24' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-25' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-26' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-27' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-28' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-29' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-30' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-31' and tipocliente='PRIVADO' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
        </tr>
         <tr class="fila_<?php echo $i%2; ?>">
          <td><div align="left" class="Estilo35">
            <div align="justify">EMPRESA</div>
          </div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha between '$fechaini' and '$fechafin' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $cantidad2=$row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
            <?php $porcentaje2=0; if($total!=0){$porcentaje2=($cantidad2/$total)*100;}else{$porcentaje='0';} echo number_format($porcentaje2,2,".",",")."%"; ?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-01' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-02' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-03' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-04' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-05' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-06' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-07' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-08' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-09' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-10' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-11' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-12' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-13' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-14' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-15' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-16' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-17' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-18' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-19' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-20' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-21' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-22' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-23' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-24' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-25' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-26' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-27' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-28' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-29' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-30' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
          <td><div align="center"><span class="Estilo35">
              <?PHP $query1 = "SELECT count(*) from prospe_visitas where fecha='$ano-$mes-31' and tipocliente='EMPRESA' and idudn='$udn'"; 
	$result1 = mysql_query($query1) or die('Consulta fallida: ' . mysql_error()); $row1 = mysql_fetch_array($result1); echo $row1[0];
	?>
          </span></div></td>
        </tr>
    </table></td>
  </tr>
</table>
<div class="row-fluid" style="height: 50px;">
</div>
</div>
</form>
<?PHP
include("../Pantallas/pie_pag.php");
?>
</body>
</html>

Upload File: