$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) {
         $unit_id = $all["unit_id"];
         $stevilo = $all["stevilo"];
         $all_sum[$unit_id] = $stevilo;
         if ($work_count[$date][$unit_id] == 0) {
             continue;
         }
         //echo $stevilo." ALL -".$unit_id."<br>";
         //if ($unit_id==77 and $x==12)	echo "dodal bom v percentage month:". $work_count[$date][$unit_id]/$all_sum[$unit_id]. " ( ".$work_count[$unit_id]." / ". $all_sum[$unit_id].") $date <br>";
         $percentage_month[$unit_id] += $work_count[$date][$unit_id] / $all_sum[$unit_id];
         //echo "noter";
     }
 }