/** * Displays Surveillance * @param string $from, string $to, array() $testTypeIds * As of now surveillance works only with alphanumeric measures */ public function surveillance() { /*surveillance diseases*/ // Fetch form filters $date = date('Y-m-d'); $from = Input::get('start'); if (!$from) { $from = date('Y-m-01'); } $to = Input::get('end'); if (!$to) { $to = $date; } $accredited = array(); $surveillance = Test::getSurveillanceData($from, $to . ' 23:59:59'); $accredited = array(); $tests = array(); if (Input::has('word')) { $fileName = "surveillance_" . $date . ".doc"; $headers = array("Content-type" => "text/html", "Content-Disposition" => "attachment;Filename=" . $fileName); $content = view('reports.surveillance.exportSurveillance')->with('surveillance', $surveillance)->with('tests', $tests)->with('accredited', $accredited)->withInput(Input::all()); return Response::make($content, 200, $headers); } else { return view('reports.surveillance.index')->with('accredited', $accredited)->with('tests', $tests)->with('surveillance', $surveillance)->with('accredited', $accredited)->withInput(Input::all()); } }