i'm coding an Excel file generator. I need to get name of Owners from database, and then for all of them a list of procedures which was done. Of course I would like to show every procedure only once with a counter which points how many times every procedure had been made. I'm trying to do this with this code:
// to get the list of owners
$this->comms = $this->warehouse->getComms();
foreach($this->comms as $key=>$comm)
{
// producer / procedure [name] [counter]
$check1[] = array('comm'=>$comm->name, 'operations'=>array('operation'=>'', 'counter'=>0));
// to get list of procedures for producer
$this->operations = $this->warehouse->getCommOperations($comm->id, $this->date_from_search, $this->date_to_search);
foreach($this->operations as $key=>$operation)
{
if(!in_array($operation->dsName, $check1[$comm->name]['operations']['operation']))
{
$check1[$comm->name]['operations']=$operation->oService;
$check1[$comm->name][$operation->oService]['counter']++;
}
else
{
$check1[$comm->id][$operation->oService]['counter']++;
}
}
}
Unfortunately I'm receiving an Undefined index: Eden warning & Warning: in_array() expects parameter 2 to be array warning at in_array check line. I would be very grateful for any help.
Regards!