Rogier Neeleman
9 years ago
3 changed files with 200 additions and 3 deletions
@ -0,0 +1,100 @@
@@ -0,0 +1,100 @@
|
||||
<?php |
||||
defined('BASEPATH') OR exit('No direct script access allowed'); |
||||
|
||||
/** |
||||
* Regio model |
||||
*/ |
||||
class Dashboard_model extends CI_Model |
||||
{ |
||||
|
||||
public function __construct() |
||||
{ |
||||
parent::__construct(); |
||||
} |
||||
|
||||
public function get_total_vragen() |
||||
{ |
||||
$this->db->select('COUNT(*) as antwoord'); |
||||
$this->db->from('vragen'); |
||||
$this->db->where('regioid', $this->session->regio); |
||||
$this->db->where('jaar', date('Y')); |
||||
|
||||
$query = $this->db->get(); |
||||
|
||||
$vragen = $query->row()->antwoord; |
||||
|
||||
$this->db->select('COUNT(*) as antwoord'); |
||||
$this->db->from('subgroep'); |
||||
$this->db->where('regioid', $this->session->regio); |
||||
$this->db->where('jaar', date('Y')); |
||||
|
||||
$query = $this->db->get(); |
||||
|
||||
$subgroepen = $query->row()->antwoord; |
||||
|
||||
return $vragen*$subgroepen; |
||||
} |
||||
|
||||
public function get_total_gedaan() |
||||
{ |
||||
$this->db->select('COUNT(*) as antwoord'); |
||||
$this->db->from('resultaat'); |
||||
$this->db->where('regioid', $this->session->regio); |
||||
//$this->db->where('jaar', date('Y')); |
||||
|
||||
$query = $this->db->get(); |
||||
|
||||
return $query->row()->antwoord; |
||||
} |
||||
|
||||
public function get_subgroepen() |
||||
{ |
||||
$this->db->select('COUNT(*) as antwoord'); |
||||
$this->db->from('subgroep'); |
||||
$this->db->where('regioid', $this->session->regio); |
||||
$this->db->where('jaar', date('Y')); |
||||
|
||||
$query = $this->db->get(); |
||||
|
||||
return $query->row()->antwoord; |
||||
} |
||||
|
||||
public function get_lijsten() |
||||
{ |
||||
$this->db->select('id, naam'); |
||||
$this->db->from('lijst'); |
||||
$this->db->where('jaar', date('Y')); |
||||
$this->db->where('regioid', $this->session->regio); |
||||
$this->db->order_by('naam', 'ASC'); |
||||
|
||||
$query = $this->db->get(); |
||||
|
||||
return $query->result_array(); |
||||
} |
||||
|
||||
public function get_vragen($lijstid) |
||||
{ |
||||
$this->db->select('id'); |
||||
$this->db->from('vragen'); |
||||
$this->db->where('regioid', $this->session->regio); |
||||
$this->db->where('jaar', date('Y')); |
||||
$this->db->where('lijstid', $lijstid); |
||||
|
||||
$query = $this->db->get(); |
||||
|
||||
return $query->result_array(); |
||||
} |
||||
|
||||
public function get_antwoorden($vraagid) |
||||
{ |
||||
$this->db->select('COUNT(*) as antwoord'); |
||||
$this->db->from('resultaat'); |
||||
$this->db->where('regioid', $this->session->regio); |
||||
//$this->db->where('jaar', date('Y')); |
||||
$this->db->where('vraagid', $vraagid); |
||||
|
||||
$query = $this->db->get(); |
||||
|
||||
return $query->row()->antwoord; |
||||
} |
||||
} |
@ -1,5 +1,48 @@
@@ -1,5 +1,48 @@
|
||||
<div class="container"> |
||||
<hr> |
||||
Welkom bij het score systeem. Maak een keuze. |
||||
<p><b>Totalen</b><br> |
||||
Er is op dit moment <?php echo $gedaan; ?>% van de beoordelingen beantwoord.</p>
|
||||
<div class="progress"> |
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo $gedaan; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $gedaan; ?>%">
|
||||
<span class="sr-only"><?php echo $gedaan; ?>% Gedaan</span>
|
||||
</div> |
||||
</div> |
||||
|
||||
Er is op dit moment van de lijsten <?php echo $bar['gedaan']; ?>% helemaal gedaan,
|
||||
<?php echo $bar['bezig']; ?>% is gedeeltelijk gedaan en
|
||||
<?php echo $bar['doen']; ?>% moet nog gedaan worden.</p>
|
||||
<div class="progress"> |
||||
<div class="progress-bar progress-bar-success" style="width: <?php echo $bar['gedaan']; ?>%">
|
||||
<span class="sr-only"><?php echo $bar['gedaan']; ?>% Gedaan</span>
|
||||
</div> |
||||
<div class="progress-bar progress-bar-warning" style="width: <?php echo $bar['bezig']; ?>%">
|
||||
<span class="sr-only"><?php echo $bar['bezig']; ?>% Nog bezig</span>
|
||||
</div> |
||||
<div class="progress-bar progress-bar-danger" style="width: <?php echo $bar['doen']; ?>%">
|
||||
<span class="sr-only"><?php echo $bar['doen']; ?>% Te doen</span>
|
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<p><b>Per onderdeel</b> |
||||
<?php foreach ($bardata as $bar) { ?> |
||||
|
||||
<p><?php echo $bar['naam']; ?> |
||||
<?php if ($bar['percentage'] == 100) {?> |
||||
<div class="progress"> |
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo $bar['percentage']; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $bar['percentage']; ?>%">
|
||||
<span class="sr-only"><?php echo $bar['percentage']; ?>% Complete</span>
|
||||
</div> |
||||
</div> |
||||
<?php } else { ?> |
||||
<div class="progress"> |
||||
<div class="progress-bar" role="progressbar" aria-valuenow="<?php echo $bar['percentage']; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $bar['percentage']; ?>%">
|
||||
<span class="sr-only"><?php echo $bar['percentage']; ?>% Complete</span>
|
||||
</div> |
||||
</div> |
||||
<?php } ?> |
||||
</p> |
||||
<?php } ?> |
||||
</p> |
||||
|
||||
</div> |
Loading…
Reference in new issue