tussenopslag
This commit is contained in:
@@ -103,11 +103,11 @@ class Ambities_model extends MY_Model{
|
||||
return $ambitie;
|
||||
}
|
||||
|
||||
function mh_get_ambitie($moduleid, $ambitieorgs, $toporgs){
|
||||
function mh_get_ambitie($moduleid, $ambitieorgs, $toporgs, $aantalY){
|
||||
$this->sql = " SELECT COALESCE(A.id, 0) AS ambitieID,
|
||||
COALESCE(A.gem_score, 80) AS gemscore,
|
||||
COUNT(Y.id) AS aantalY,
|
||||
COALESCE(A.x_ijkpunten, ROUND(COUNT(Y.id) * 0.8)) AS xijkpunten,
|
||||
COALESCE(A.x_ijkpunten, ROUND({$aantalY} * 0.8)) AS xijkpunten,
|
||||
{$aantalY} AS aantalY,
|
||||
COALESCE(A.z_procent, 60) AS zprocent,
|
||||
OV.id AS orgversie_id,
|
||||
DATE_FORMAT( OV.geldigvanaf, '%d-%m-%Y') as geldigvanaf,
|
||||
@@ -129,17 +129,15 @@ function mh_get_ambitie($moduleid, $ambitieorgs, $toporgs){
|
||||
|
||||
FROM tb_orgversies OV
|
||||
JOIN tb_versies V ON OV.versie_id = V.id
|
||||
JOIN tb_ijkpunten Y ON V.id = Y.versie_id
|
||||
LEFT JOIN tb_ambities A ON A.orgversie_id = OV.id
|
||||
LEFT JOIN tb_organisaties O ON A.organisatie_id = O.id
|
||||
WHERE (A.organisatie_id IN ({$ambitieorgs}) OR A.id IS NULL)
|
||||
AND OV.organisatie_id IN ({$toporgs})
|
||||
AND V.modulenr = {$moduleid}
|
||||
AND OV.actief = 1
|
||||
AND Y.disabled = 'F'
|
||||
ORDER BY soort DESC
|
||||
LIMIT 1 ";
|
||||
return $this->get_query_result();
|
||||
return $this->get_query_row();
|
||||
}
|
||||
|
||||
function mh_get_ambitie_orgversie($orgversieid, $ambitieorgs, $toporgs){
|
||||
@@ -148,21 +146,8 @@ function mh_get_ambitie_orgversie($orgversieid, $ambitieorgs, $toporgs){
|
||||
COUNT(Y.id) AS aantalY,
|
||||
COALESCE(A.x_ijkpunten, ROUND(COUNT(Y.id) * 0.8)) AS xijkpunten,
|
||||
COALESCE(A.z_procent, 60) AS zprocent,
|
||||
OV.id AS orgversie_id,
|
||||
COALESCE(O.soort, 0) AS soort,
|
||||
O.id AS orgID,
|
||||
CASE WHEN O.soort IS NULL THEN
|
||||
'standaard'
|
||||
WHEN O.soort = 1 THEN
|
||||
'swv'
|
||||
WHEN O.soort = 2 THEN
|
||||
'regio'
|
||||
WHEN O.soort = 3 THEN
|
||||
'bestuur'
|
||||
WHEN O.soort = 4 THEN
|
||||
'school'
|
||||
END AS ambitievan
|
||||
|
||||
COALESCE(O.naam, 'standaard') AS ambitievan
|
||||
|
||||
FROM tb_orgversies OV
|
||||
JOIN tb_versies V ON OV.versie_id = V.id
|
||||
JOIN tb_ijkpunten Y ON V.id = Y.versie_id
|
||||
@@ -173,9 +158,9 @@ function mh_get_ambitie_orgversie($orgversieid, $ambitieorgs, $toporgs){
|
||||
AND OV.id = {$orgversieid}
|
||||
AND OV.actief = 1
|
||||
AND Y.disabled = 'F'
|
||||
ORDER BY soort DESC
|
||||
ORDER BY soort
|
||||
LIMIT 1 ";
|
||||
return $this->get_query_result();
|
||||
return $this->get_query_row();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,18 @@ class Ijkpunten_model extends MY_Model{
|
||||
return $this->get_query_row('aantalY');
|
||||
}
|
||||
|
||||
function telijkpunten_bij_orgs($toporgs, $modulenr){
|
||||
$this->sql=" SELECT COUNT(DISTINCT(Y.id)) AS aantalY
|
||||
FROM tb_ijkpunten Y
|
||||
JOIN tb_orgversies OV ON OV.versie_id = Y.versie_id
|
||||
JOIN tb_versies V ON v.id = OV.versie_id
|
||||
WHERE OV.organisatie_id IN({$toporgs})
|
||||
AND V.modulenr = {$modulenr}
|
||||
AND OV.actief = 1
|
||||
AND Y.disabled = 'F' ";
|
||||
return $this->get_query_row('aantalY');
|
||||
}
|
||||
|
||||
function getijkpunten1($versieid){
|
||||
$this->sql="SELECT Y.id, Y.nummer,Y.omschrijving,Y.toelichting, Y.disabled
|
||||
FROM tb_ijkpunten Y
|
||||
|
||||
@@ -26,7 +26,7 @@ class Scores_model extends MY_Model{
|
||||
return $this->get_query_result();
|
||||
}
|
||||
function calculateindividualscores($orgversieid, $orgid, $userid){
|
||||
$this->sql="SELECT SC.id, filledversion_id, SC.ijkpunt_id, scoretype, score, Y.disabled,
|
||||
$this->sql="SELECT SC.id, filledversion_id, SC.ijkpunt_id, scoretype, score, score AS gem, Y.disabled,
|
||||
SUM(CASE WHEN Y.disabled = 'T' THEN 0
|
||||
WHEN Y.disabled = 'F' THEN
|
||||
CASE
|
||||
|
||||
Reference in New Issue
Block a user