} else { if ($test_type_id != 0 && count($lab_config_ids) == 1) { $lab_config = get_lab_config_by_id($lab_config_id); $test_type_id = $testIds[$lab_config->id]; $labName = $lab_config->name; $namesArray[] = $labName; $stat_list = StatsLib::getTatWeeklyProgressionStats($lab_config, $test_type_id, $date_from, $date_to, $include_pending); ksort($stat_list); $stat_lists[] = $stat_list; } else { if ($test_type_id != 0 && count($lab_config_ids) > 1) { foreach ($lab_config_ids as $key) { $lab_config = LabConfig::getById($key); $test_type_id = $testIds[$lab_config->id]; $namesArray[] = $lab_config->name; $stat_list = StatsLib::getTatWeeklyProgressionStats($lab_config, $test_type_id, $date_from, $date_to, $include_pending); ksort($stat_list); $stat_lists[] = $stat_list; unset($stat_list); } } } } } } } $progressData = array(); foreach ($stat_lists as $stat_list) { foreach ($stat_list as $key => $value) { $formattedValue = round($value[0], 2); $formattedDate = bcmul($key, 1000);