$lab_config = get_lab_config_by_id($lab_config_id); $test_types = get_lab_config_test_types($lab_config_id); $report_id = $REPORT_ID_ARRAY['reports_dailyspecimens.php']; $report_config = $lab_config->getReportConfig($report_id); $margin_list = $report_config->margins; for ($i = 0; $i < count($margin_list); $i++) { $margin_list[$i] = $SCREEN_WIDTH * $margin_list[$i] / 100; } if ($ttype != 0) { # Single test type selected $test_types = array(); $test_types[] = $ttype; } else { if ($cat_code != 0) { # Fetch all tests belonging to this category (aka lab section) $cat_test_types = TestType::getByCategory($cat_code); $cat_test_ids = array(); foreach ($cat_test_types as $test_type) { $cat_test_ids[] = $test_type->testTypeId; } $matched_test_ids = array_intersect($cat_test_ids, $test_types); $test_types = array_values($matched_test_ids); } } ?> <script type='text/javascript'> function export_as_word(div_id) { var content = $('#'+div_id).html(); $('#word_data').attr("value", content); $('#word_format_form').submit();