sorry if I don't ask correctly.
This is part of my table:
In daoExcel.php
I have this function:
public function selectInconsistencias(){
$aObjects=array();
$dbconn = new DBconnection();
$db = $dbconn->bdConnection();
$stmt = $db->prepare("SELECT rco_rut,rco_nombre,rco_marc, rco_estado FROM act_relcontrol");
$stmt->execute();
$stmt->setFetchMode(PDO::FETCH_ASSOC);
$result = $stmt->fetchAll();
foreach ($result as $row) {
$fecha = date("d/m/Y", strtotime(str_replace("/","-",$row['rco_marc']), mktime(0, 0, 0)));
$aTransfer = new DaoTransferExcel();
$aTransfer->setRut($row['rco_rut']);
$aTransfer->setNombre($row['rco_nombre']);
$aTransfer->setFecha($fecha);
$aTransfer->setEstado($row['rco_estado']);
$aObjects[]=$aTransfer;
}
return $aObjects;
}
Then I return the results to controllerExcel.pho
and I use the data in this function:
private function setDatosInconsistencias($datos){
foreach($datos as $sKey=>$oValue){
$list[] = array('rut' => $oValue->getRut(),
'nombre' => $oValue->getNombre(),
'fecha' => $oValue->getFecha(),
'estado' => $oValue->getEstado(),
'count_ent' => '0',
'count_sal' => '0'
);
}
print_r($list);
exit();
}
print_r($list);
Prints all the data from data base of this way:
Well, I need this:
Example 1:
I have this:
But I need only this:
Example 2:
I have this:
And I need only this:
Example 3:
I have this:
And I need only this:
So, I need count the 'M/Ent' and 'M/Sal' by day and I don't need [estado]
.
Some advice of how do this?
Sorry by my english.