You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

55 lines
1.4 KiB

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Info Class
*/
class Uitslag extends CI_Controller
{
public function __construct()
{
parent::__construct();
if(! $this->session->userdata('validated')){
redirect(base_url('/login'));
}
if (! ($this->session->admin == '1' OR $this->session->superadmin == '1')) {
redirect(base_url('/dashboard'));
}
}
public function index()
{
$data['page'] = 'uitslag';
// Get data
$this->load->model('Uitslag_model');
$subgroepen = $this->Uitslag_model->get_subgroep_list();
$spelgebieden = $this->Uitslag_model->get_spelgebieden_list();
foreach ($subgroepen as $subgroep) {
$data['uitslag'][$subgroep['id']]['total'] = 0;
$scores = $this->Uitslag_model->get_subgroep_punten($subgroep['id']);
foreach ($scores as $score) {
$scoreitem = (($score['score']/$score['maxscore'])*100)*$score['gewicht'];
$data['uitslag'][$subgroep['id']][$score['spelgebiedid']] = $scoreitem;
$data['uitslag'][$subgroep['id']]['total'] = $data['uitslag'][$subgroep['id']]['total'] + $scoreitem;
}
}
// Prepare data
$data['subgroepen'] = $subgroepen;
$data['spelgebieden'] = $spelgebieden;
// Header
$this->load->view('header', $data);
// Ranking page
$this->load->view('uitslag_ranking', $data);
// Footer
$this->load->view('footer');
}
}