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.
		
		
		
		
		
			
		
			
				
					
					
						
							54 lines
						
					
					
						
							1.3 KiB
						
					
					
				
			
		
		
	
	
							54 lines
						
					
					
						
							1.3 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) { | |
| 				$data['uitslag'][$subgroep['id']][$score['spelgebiedid']] = $score['score']; | |
| 				$data['uitslag'][$subgroep['id']]['total'] = $data['uitslag'][$subgroep['id']]['total'] + $score['score']; | |
| 			} | |
| 		} | |
| 		 | |
| 		// 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'); | |
| 	} | |
| 	 | |
| } |