|
|
@ -52,14 +52,28 @@ class Uitslag extends CI_Controller |
|
|
|
foreach ($scores as $score) { |
|
|
|
foreach ($scores as $score) { |
|
|
|
$scoremaxsg = $this->Uitslag_model->get_max_punten_detail($score['spelgebiedid']); |
|
|
|
$scoremaxsg = $this->Uitslag_model->get_max_punten_detail($score['spelgebiedid']); |
|
|
|
$scoreitem = ($score['score']/$scoremaxsg['maxscore']) * $totaalpsg * $scoremaxsg['gewicht']; |
|
|
|
$scoreitem = ($score['score']/$scoremaxsg['maxscore']) * $totaalpsg * $scoremaxsg['gewicht']; |
|
|
|
$data['uitslag'][$subgroep['id']][$score['spelgebiedid']] = $scoreitem; |
|
|
|
$uitslagr[$subgroep['id']][$score['spelgebiedid']] = $scoreitem; |
|
|
|
$data['uitslag'][$subgroep['id']]['total'] = $data['uitslag'][$subgroep['id']]['total'] + $scoreitem; |
|
|
|
$uitslagr[$subgroep['id']]['total'] = $data['uitslag'][$subgroep['id']]['total'] + $scoreitem; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$uitslagorder = array(); |
|
|
|
|
|
|
|
foreach ($uitslagr as $key=>$val) { |
|
|
|
|
|
|
|
$uitslagorder[$key] = $val['total']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arsort($uitslagorder); |
|
|
|
|
|
|
|
$i = 1; |
|
|
|
|
|
|
|
foreach ($uitslagorder as $key=>$val) { |
|
|
|
|
|
|
|
$uitslag[$key] = $uitslagr[$key]; |
|
|
|
|
|
|
|
$uitslag[$key]['rang'] = $i; |
|
|
|
|
|
|
|
$i++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Prepare data |
|
|
|
// Prepare data |
|
|
|
$data['subgroepen'] = $subgroepen; |
|
|
|
$data['subgroepen'] = $subgroepen; |
|
|
|
$data['spelgebieden'] = $spelgebieden; |
|
|
|
$data['spelgebieden'] = $spelgebieden; |
|
|
|
|
|
|
|
$data['uitslag'] = $uitslag; |
|
|
|
|
|
|
|
|
|
|
|
// Header |
|
|
|
// Header |
|
|
|
$this->load->view('header', $data); |
|
|
|
$this->load->view('header', $data); |
|
|
|