function fillData(&$where, $ljoin, &$serie, $dates) { $d =& $serie['data']; $bs = new CBloodSalvage(); $pos = end(array_keys($where)); $i = 0; foreach ($dates as $month => $date) { $where['operations.date'] = "BETWEEN '{$date['start']}' AND '{$date['end']}'"; $count = $bs->countList($where, null, $ljoin); $d[$i] = array($i, intval($count)); $i++; } unset($where[$pos]); }