Esempio n. 1
0
	}
}
if (file_exists('../modules/mc/class.mc.php')) {
	include '../modules/mc/class.mc.php';
	$mc = new mc;
	if (!$module->activated('mc') && $initmod) {
		$mc->init_sql();
		$mc->init_menu();
		$mc->init_deps();
		$mc->init_lang();
		$mc->init_help();
	}
}
if (file_exists('../modules/mc_report/class.mc_report.php')) {
	include '../modules/mc_report/class.mc_report.php';
	$mc_report = new mc_report;
	if (!$module->activated('mc_report') && $initmod) {
		$mc_report->init_sql();
		$mc_report->init_menu();
		$mc_report->init_deps();
		$mc_report->init_lang();
		$mc_report->init_help();
	}
}
if (file_exists('../modules/news/class.news.php')) {
	include '../modules/news/class.news.php';
	$news = new news;
	if (!$module->activated('news') && $initmod) {
		$news->init_sql();
		$news->init_menu();
		$news->init_deps();
 function _mc_report()
 {
     //
     // main API to reports
     //
     if (func_num_args() > 0) {
         $arg_list = func_get_args();
         $menu_id = $arg_list[0];
         $post_vars = $arg_list[1];
         $get_vars = $arg_list[2];
         $validuser = $arg_list[3];
         $isadmin = $arg_list[4];
         //print_r($arg_list);
     }
     // always check dependencies
     if ($exitinfo = $this->missing_dependencies('mc_report')) {
         return print $exitinfo;
     }
     print "<span class='patient'>" . FTITLE_MC_REPORTS . "</span><br/><br/>";
     $m = new mc_report();
     $g = new graph();
     $m->report_menu($menu_id, $post_vars, $get_vars);
     print "<table><tr><td>";
     // column 1
     switch ($get_vars["report_menu"]) {
         case "TCL":
             if ($post_vars["submitreport"]) {
                 $m->process_inclusive_dates($menu_id, $post_vars, $get_vars);
             }
             $m->form_inclusive_dates($menu_id, $post_vars, $get_vars);
             $m->display_tcl_inclusive_dates($menu_id, $post_vars, $get_vars);
             break;
         case "SUMMARY":
             $m->summary_menu($menu_id, $post_vars, $get_vars);
             switch ($get_vars[report]) {
                 case "CONSOLIDATION":
                     $get_vars[module] = $this->module;
                     $m->summary_inclusive_dates($menu_id, $post_vars, $get_vars);
                     if ($post_vars[submitreport]) {
                         $m->consolidation_report($menu_id, $post_vars, $get_vars);
                         $m->display_mc_consolidation_report($menu_id, $post_vars, $get_vars);
                     }
                     break;
             }
             break;
         case "GRAPHS":
             $g->graph_menu($menu_id, $post_vars, $get_vars);
             switch ($get_vars["graph"]) {
                 case "LINE":
                     $get_vars["module"] = $this->module;
                     $g->graph_line($menu_id, $post_vars, $get_vars);
                     break;
                 case "BAR":
                     $get_vars["module"] = $this->module;
                     $g->graph_bar($menu_id, $post_vars, $get_vars);
                     break;
                 case "PIE":
                     $get_vars["module"] = $this->module;
                     $g->graph_pie($menu_id, $post_vars, $get_vars);
                     break;
             }
             break;
     }
     print "</td></tr></table>";
 }