function getWeeklyStats($lab_config, $test_type_id, $date_from, $date_to) { global $xAxisGraph; global $progressTrendsData; $stats = StatsLib::getDiscreteInfectionStatsWeekly($lab_config, $test_type_id, $date_from, $date_to); foreach ($stats as $key => $value) { $formattedDate = bcmul($key, 1000); if ($value[0] != 0) { $progressData[] = array($formattedDate, 100 - round($value[1] / $value[0] * 100, 2)); } else { $progressData[] = array($formattedDate, 0); } } $progressTrendsData[] = $progressData; }
function getWeeklyStats($lab_config, $test_type_id, $date_from, $date_to, $test_name = null) { global $xAxisGraph; global $progressGraphData; if ($test_name != null) { } $stats = StatsLib::getDiscreteInfectionStatsWeekly($lab_config, $test_type_id, $date_from, $date_to); foreach ($stats as $key => $value) { $xAxisGraph[] = date('Y, n, j', $key); if ($value[0] != 0) { $progressData[] = round($value[1] / $value[0] * 100, 2); } else { $progressData[] = 0; } } $progressGraphData[] = $progressData; }
include "../includes/db_lib.php"; include "../includes/stats_lib.php"; include "../includes/page_elems.php"; LangUtil::setPageId("reports"); $page_elems = new PageElems(); $test_type_id = $_REQUEST['tt']; $date_from = $_REQUEST['df']; $date_to = $_REQUEST['dt']; $lab_config_id = $_REQUEST['l']; $date_from_js = str_replace("-", "/", $date_from); $date_to_js = str_replace("-", "/", $date_to); $lab_config = get_lab_config_by_id($lab_config_id); $gender = $_REQUEST['gender']; $age_s = $_REQUEST['age_s']; $age_e = $_REQUEST['age_e']; $stat_list = StatsLib::getDiscreteInfectionStatsWeekly($lab_config, $test_type_id, $date_from, $date_to, $gender); ksort($stat_list); # Build chart with time series $div_id = "placeholder_" . $test_type_id; $ylabel_id = "ylabel_" . $test_type_id; $legend_id = "legend_" . $test_type_id; ?> <script id="source" language="javascript" type="text/javascript"> $(function () { <?php $count = 0; echo "var d = [];"; foreach ($stat_list as $key => $value) { $x_val = $key;