|
|
|
@ -35,12 +35,18 @@ class Dashboard extends CI_Controller
@@ -35,12 +35,18 @@ class Dashboard extends CI_Controller
|
|
|
|
|
$vragen = $this->Dashboard_model->get_total_vragen(); |
|
|
|
|
$antwoorden = $this->Dashboard_model->get_total_gedaan(); |
|
|
|
|
|
|
|
|
|
if ($vragen == 0) { |
|
|
|
|
$data['gedaan'] = 0; |
|
|
|
|
} else { |
|
|
|
|
$data['gedaan'] = round(($antwoorden/$vragen)*100); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Per lijst |
|
|
|
|
$subgroepen = $this->Dashboard_model->get_subgroepen(); |
|
|
|
|
$lijsten = $this->Dashboard_model->get_lijsten(); |
|
|
|
|
|
|
|
|
|
$bardata = array(); |
|
|
|
|
|
|
|
|
|
foreach ($lijsten as $lijst) |
|
|
|
|
{ |
|
|
|
|
$beantwoord = 0; |
|
|
|
@ -51,8 +57,12 @@ class Dashboard extends CI_Controller
@@ -51,8 +57,12 @@ class Dashboard extends CI_Controller
|
|
|
|
|
$aantal = $this->Dashboard_model->get_antwoorden($vraag['id']); |
|
|
|
|
$beantwoord = $beantwoord + $aantal; |
|
|
|
|
} |
|
|
|
|
if (($subgroepen*count($vragen)) == 0) { |
|
|
|
|
$bardata[$lijst['id']]['percentage'] = 0; |
|
|
|
|
} else { |
|
|
|
|
$bardata[$lijst['id']]['percentage'] = (($beantwoord)/($subgroepen*count($vragen)))*100; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$data['bardata'] = $bardata; |
|
|
|
|
|
|
|
|
@ -71,9 +81,15 @@ class Dashboard extends CI_Controller
@@ -71,9 +81,15 @@ class Dashboard extends CI_Controller
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (($barok + $barnok + $barbezig) == 0) { |
|
|
|
|
$data['bar']['gedaan'] = 0; |
|
|
|
|
$data['bar']['bezig'] = 0; |
|
|
|
|
$data['bar']['doen'] = 100; |
|
|
|
|
} else { |
|
|
|
|
$data['bar']['gedaan'] = round(($barok/($barok + $barnok + $barbezig))*100); |
|
|
|
|
$data['bar']['bezig'] = round(($barbezig/($barok + $barnok + $barbezig))*100); |
|
|
|
|
$data['bar']['doen'] = 100-$data['bar']['gedaan']-$data['bar']['bezig']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Header |
|
|
|
|
$this->load->view('header', $data); |
|
|
|
|