<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Dashboard extends CI_Controller
{

	public function __construct()
	{
		parent::__construct();

		$this->load->model('Main_modal', 'MM');
		$this->load->model('Model_dashboard', 'MD');
	}
	public function index()
	{
		if ($this->session->userdata('name')) {
			$data['counts'] = $this->MD->get_counts();
			$data['phlebitis'] = $this->MD->get_hai_graph('Phlebitis');
			$data['clabsi'] = $this->MD->get_hai_graph('Central Line Associated Bloodstream Infection');
			$data['cauti'] = $this->MD->get_hai_graph('Urinary Tract Infection');
			$data['hap'] = $this->MD->get_hai_graph('Hospital Acquired Pneumonia');
			$data['vap'] = $this->MD->get_hai_graph('Ventilator Associated Pneumonia');
			$data['ssi'] = $this->MD->get_hai_graph('Surgical Site Infection');
			$data['mdro'] = $this->MD->get_mdro_graph();
			$data['mom_mdro'] = $this->MD->get_mom_mdr_graph();
			$data['mom_hai'] = $this->MD->get_mom_hai_graph();
			$this->load->view('main_header');
			$this->load->view('sidebar');
			$this->load->view('infection_dashboard', $data);
			$this->load->view('footer');
		} else {
			redirect('login');
		}
	}

	public function dashboard()
	{
		$this->load->model('Main_modal');
		$data['view'] = $this->MM->GetUsers();
		$this->load->view('dashboard', $data);
	}

	public function Policy()
	{
		$this->load->view('main_header');
		$this->load->view('sidebar');
		$this->load->view('policy');
		$this->load->view('footer');
	}
}
