initial commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of Orgusers_model
|
||||
*
|
||||
* @author Theo Weijmer
|
||||
* @date april 26, 2013 12:00 PM
|
||||
*
|
||||
*/
|
||||
|
||||
class Nivoprofielen_model extends MY_Model{
|
||||
|
||||
protected $tablename = 'tbNivoProfielen';
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$models = array('');
|
||||
$this->load->model($models);
|
||||
}
|
||||
function get_profielen_niveaus($versieID){
|
||||
$this->sql ="SELECT *
|
||||
FROM tbNiveaus
|
||||
WHERE fw_versie = {$versieID}
|
||||
ORDER BY nummer";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
function get_profielen_profiel ($niveauID){
|
||||
$this->sql = "SELECT pro.niveauID,
|
||||
pro.waarde,
|
||||
pro.id as profielID,
|
||||
p.id as pijlerID,
|
||||
p.naam
|
||||
FROM tbPijlers p
|
||||
LEFT OUTER JOIN tbNivoProfielen pro
|
||||
ON p.id = pro.pijlerID
|
||||
WHERE pro.niveauID = {$niveauID}
|
||||
ORDER BY p.volgorde";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
function get_last_profielen($pijlerID){
|
||||
$this->sql="SELECT niveauID, waarde
|
||||
FROM tbNivoProfielen
|
||||
WHERE pijlerID = {$pijlerID}";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
function update_niveau($oudID, $nieuwID,$minPijlerID){
|
||||
$this->sql = "UPDATE tbNivoProfielen
|
||||
SET niveauID = {$nieuwID}
|
||||
WHERE niveauID={$oudID}
|
||||
AND pijlerID >= {$minPijlerID}";
|
||||
$this->db->query($this->sql);
|
||||
}
|
||||
} // einde class definitie
|
||||
Reference in New Issue
Block a user