Ver Mensaje Individual
  #3 (permalink)  
Antiguo 07/05/2010, 10:03
Carolaine
 
Fecha de Ingreso: mayo-2010
Mensajes: 5
Antigüedad: 13 años, 11 meses
Puntos: 0
Respuesta: Conocer personas que visitaron una unidad (CakePHP)

ESTE ES EL CODIGO DE LA VISTA

DESEO HACER UNA CONSULTA EN SQL DONDE ME APAREZCA LA INFORMACION QUE SE REPITE EN UNA SOLA LINEA Y CON LA FUNCION COUNT M DIGA CUANTAS PERSONAS VISITARON DICHO DEPARTAMENTO

<table cellpadding="0" cellspacing="0">
<tr>

<th><?php echo $paginator->sort('departamento_id');?></th>
<th><?php echo $paginator->sort('Persona Visitada','Persona.nombre_completo');?></th>
<th> <?php echo $paginator->sort('persona_id');?> </th>
<th> <?php echo "Visitas por Unidad ";?> </th>

</tr>
<?php
$i = 0;
foreach ($visitas as $visita):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>

<td>
<?php echo $visita['Departamento']['nombre'];

?>
</td>
<td>
<?php echo $visita['Persona']['nombre_completo']; ?>
</td>
<td>
<?php echo $visita['Visitante']['id']?>
</td>
<td>
<?php echo $paginator->counter(array(
'format' => __('%current%', true)
));
?></td>
</td>
</tr>


<?php endforeach; ?>
</table>