|  |  |  | @ -46,9 +46,7 @@ class Uitslag_model extends CI_Model@@ -46,9 +46,7 @@ class Uitslag_model extends CI_Model | 
			
		
	
		
			
				
					|  |  |  |  | 	public function get_subgroep_punten($subgroepid) | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->select('SUM('.$this->db->dbprefix('resultaat').'.score/'.$this->db->dbprefix('lijst').'.ronde) AS score, | 
			
		
	
		
			
				
					|  |  |  |  | 			SUM('.$this->db->dbprefix('vragen').'.score) AS maxscore, | 
			
		
	
		
			
				
					|  |  |  |  | 			spelgebied.id AS spelgebiedid, | 
			
		
	
		
			
				
					|  |  |  |  | 			spelgebied.gewicht AS gewicht, | 
			
		
	
		
			
				
					|  |  |  |  | 			'); | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->from('resultaat'); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
	
		
			
				
					|  |  |  | @ -70,4 +68,27 @@ class Uitslag_model extends CI_Model@@ -70,4 +68,27 @@ class Uitslag_model extends CI_Model | 
			
		
	
		
			
				
					|  |  |  |  | 		return $query->result_array(); | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	public function get_max_punten() | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->select('SUM('.$this->db->dbprefix('vragen').'.score) AS maxscore,  | 
			
		
	
		
			
				
					|  |  |  |  | 			spelgebied.naam AS naam, | 
			
		
	
		
			
				
					|  |  |  |  | 			spelgebied.id AS spelgebiedid, | 
			
		
	
		
			
				
					|  |  |  |  | 			spelgebied.gewicht AS gewicht'); | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->from('vragen'); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->where('vragen.regioid', $this->session->regio); | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->where('vragen.jaar', date('Y')); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->join('onderdeel', 'vragen.onderdeelid=onderdeel.id', 'left'); | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->join('spelgebied', 'onderdeel.spelgebiedid=spelgebied.id', 'left'); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->group_by('spelgebied.naam'); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->db->order_by('spelgebied.id', 'ASC'); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		$query = $this->db->get(); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		return $query->result_array(); | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | } |