if ($praznik == $date) { $free_day = $praznik; $continue; } } if ($free_day) { //echo $date ." = " .$free_day."<br>"; // praznik// continue; //za ta datum in gremo na novga// } else { //gledama za ta dan// $number_days++; $q = new DAL(); $q2 = new DAL(); unset($res_work); $res_work = $q->get_count_persons_available_by_date($date); //if ($x==12) print_r($res_work); //var_dump($res_work); //die() foreach ($res_work as $work_c) { $unit_id = $work_c["unit_id"]; $stevilo = $work_c["stevilo"]; //if ($unit_id==77 and $x==12) echo $date." ".$stevilo." ---- ".print_r($work_c)."<br><br><hr>"; $work_count[$date][$unit_id] = $stevilo; //echo $stevilo." - u:". $unit_id." $date <br>"; } unset($res_full); $res_full = $q2->get_count_persons_registered_by_unit($date); //if ($x==12 ) print_r($res_full); // var_dump($res_full); foreach ($res_full as $all) {