comactsops valtonderorgs
This commit is contained in:
@@ -57,17 +57,27 @@ class Compactsop extends MY_Controller{
|
||||
echo json_encode($soort);
|
||||
}
|
||||
|
||||
|
||||
function getSchooljaren(){
|
||||
if (!$this->userid) die;
|
||||
$schooljaren = $this->Schooljaren_model->getschooljaren();
|
||||
|
||||
echo json_encode($schooljaren);
|
||||
}
|
||||
|
||||
function getSchooljarenEnOrgs(){
|
||||
if (!$this->userid) die;
|
||||
$schooljaren = $this->Schooljaren_model->getschooljaren();
|
||||
// $orgs = $this->
|
||||
echo json_encode($schooljaren);
|
||||
$orgs = $this->Organisaties_model->get_alle_onderliggende_orgs($this->globorgid);
|
||||
|
||||
echo json_encode(['schooljaren'=>$schooljaren,
|
||||
'organisaties'=>$orgs ]);
|
||||
}
|
||||
|
||||
function getCompactSop(){
|
||||
if (!$this->userid) die;
|
||||
$orgid = $this->globorgid;
|
||||
$schooljaar = $this->uri->segment(4);
|
||||
$orgid = $this->clean_input("orgID");
|
||||
$schooljaar = $this->clean_input("schooljaarID");
|
||||
$compactsopID = $this->Compactsop_model->get_fieldvalue(['organisatie_id'=>$orgid, 'schooljaarnummer'=>$schooljaar], 'id');
|
||||
echo json_encode($compactsopID);
|
||||
}
|
||||
@@ -79,9 +89,10 @@ class Compactsop extends MY_Controller{
|
||||
|
||||
function getOnderdelenEnVersies(){
|
||||
if (!$this->userid) die;
|
||||
$schooljaar = $this->uri->segment(4);
|
||||
$orgsoort = $this->uri->segment(5);
|
||||
$compacteversies = new Compacteversies($schooljaar, $orgsoort);
|
||||
$schooljaar = $this->clean_input('schooljaarID');
|
||||
$orgsoort = $this->clean_input('orgsoort');
|
||||
$orgid = $this->clean_input('orgID');
|
||||
$compacteversies = new Compacteversies($schooljaar, $orgid, $orgsoort);
|
||||
$onderdelen = $compacteversies->getOnderdelen();
|
||||
|
||||
echo json_encode($onderdelen);
|
||||
@@ -89,9 +100,10 @@ class Compactsop extends MY_Controller{
|
||||
|
||||
function getOrganisatiegegevens(){
|
||||
if (!$this->userid) die;
|
||||
$school = $this->Schooldetails_model->getschool($this->globorgid);
|
||||
$orgid = $this->uri->segment(4);
|
||||
$school = $this->Schooldetails_model->getschool($orgid);
|
||||
if(!$school){
|
||||
$school = $this->Organisaties_model->get_record_by_id($this->globorgid);
|
||||
$school = $this->Organisaties_model->get_record_by_id($orgid);
|
||||
}
|
||||
echo json_encode($school);
|
||||
}
|
||||
@@ -99,7 +111,6 @@ class Compactsop extends MY_Controller{
|
||||
function saveSchool(){
|
||||
if (!$this->userid) die;
|
||||
$id = $this->clean_input('id');
|
||||
if($id != $this->globorgid) return;
|
||||
$straat = strip_slashes($this->clean_input('straat'));
|
||||
$plaats = strip_slashes($this->clean_input('plaats'));
|
||||
$foon = strip_slashes($this->clean_input('telefoon'));
|
||||
@@ -131,13 +142,14 @@ class Compactsop extends MY_Controller{
|
||||
function maakPDF(){
|
||||
if (!$this->userid) die;
|
||||
$schooljaarnr = $this->clean_input('schooljaarnr');
|
||||
$orgid = $this->clean_input('orgID');
|
||||
$onderdelen = $this->input->post('onderdelen');
|
||||
$omvangjaren = $this->clean_input('jaren');
|
||||
$paginas = $this->clean_input('paginas');
|
||||
|
||||
$compact = new Compacteonderdelen($schooljaarnr, $onderdelen, $omvangjaren);
|
||||
$compact = new Compacteonderdelen($schooljaarnr, $onderdelen, $omvangjaren, $orgid);
|
||||
$compacteonderdelen = $compact->getCompacteOnderdelen();
|
||||
$schoolID = $this->globorgid;
|
||||
$schoolID = $orgid;
|
||||
$html = (new Compactepaginas($compacteonderdelen, $paginas))->getHtml();
|
||||
$padnaam = $schoolID . $schooljaarnr;
|
||||
file_put_contents(MYROOTPATH.'public/tmp/temp'.$schoolID.$schooljaarnr.'.html', $html);
|
||||
|
||||
@@ -34,11 +34,12 @@ class Compacteonderdelen
|
||||
private $onderdelenNew;
|
||||
private $compacteonderdelen;
|
||||
|
||||
public function __construct($schooljaarnr, $onderdelen, $omvangjaren){
|
||||
public function __construct($schooljaarnr, $onderdelen, $omvangjaren, $orgid){
|
||||
$this->CI = &get_instance();
|
||||
$this->schooljaarnr = $schooljaarnr;
|
||||
$this->onderdelen = $onderdelen;
|
||||
$this->omvangjaren = $omvangjaren;
|
||||
$this->orgid = $orgid;
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
@@ -75,7 +76,7 @@ class Compacteonderdelen
|
||||
}
|
||||
|
||||
private function setOrganisatie(){
|
||||
$this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->CI->globorgid);
|
||||
$this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
}
|
||||
private function setOrgSoort(){
|
||||
switch($this->organisatie->soort){
|
||||
@@ -91,7 +92,7 @@ class Compacteonderdelen
|
||||
}
|
||||
|
||||
private function setOrgdetails(){
|
||||
$this->details = $this->CI->Schooldetails_model->get_details($this->CI->globorgid);
|
||||
$this->details = $this->CI->Schooldetails_model->get_details($this->orgid);
|
||||
}
|
||||
|
||||
private function setOrgGegevens(){
|
||||
@@ -124,7 +125,7 @@ class Compacteonderdelen
|
||||
|
||||
private function setOrglist(){
|
||||
$lijst = [];
|
||||
$orglist = $this->CI->Organisaties_model->getlistrecursief($this->organisatie->id, $lijst);
|
||||
$orglist = $this->CI->Organisaties_model->getlistrecursief($this->orgid, $lijst);
|
||||
$orglist = implode('","', $orglist);
|
||||
$this->orglist = '"'. $orglist .'"';
|
||||
|
||||
@@ -132,7 +133,6 @@ class Compacteonderdelen
|
||||
|
||||
private function setKleuren()
|
||||
{
|
||||
// $this->kleuren = $this->kleurcodes->getKleurcodesOrg(0, $this->swvid);
|
||||
if (!$this->kleuren || $this->kleuren == " ") {
|
||||
$this->kleuren = new stdClass();
|
||||
$this->kleuren->cluster_id = 0;
|
||||
@@ -140,10 +140,6 @@ class Compacteonderdelen
|
||||
$this->kleuren->grens2 = '80';
|
||||
$this->kleuren->grens3 = '90';
|
||||
$this->kleuren->grens4 = '100';
|
||||
// $this->kleuren->kleur1 = '#fe2219';
|
||||
// $this->kleuren->kleur2 = '#fea719';
|
||||
// $this->kleuren->kleur3 = '#15d029';
|
||||
// $this->kleuren->kleur4 = '#1558d0';
|
||||
$this->kleuren->kleur1 = '#e08885';
|
||||
$this->kleuren->kleur2 = '#ffcc80';
|
||||
$this->kleuren->kleur3 = '#9fdf9f';
|
||||
@@ -189,7 +185,7 @@ class Compacteonderdelen
|
||||
|
||||
private function setDiversiteit()
|
||||
{
|
||||
$divcompact = New Diversiteit($this->schooljaarnr, $this->CI->globorgid, $this->onderdeel['modulenr']);
|
||||
$divcompact = New Diversiteit($this->schooljaarnr, $this->orgid, $this->onderdeel['modulenr']);
|
||||
$divdata = $divcompact->getDiversiteit();
|
||||
$divafbeelding = New Diversiteitafbeeldingen($divdata, $this->onderdeel['modulenr'], $this->schooljaarnr);
|
||||
$this->diversiteit = $divafbeelding->getDiversiteitafbeeldingen();
|
||||
@@ -213,7 +209,7 @@ class Compacteonderdelen
|
||||
|
||||
|
||||
if($this->organisatie->soort == 4) {
|
||||
$arrs = $this->CI->Arrangementen_model->getArrangementnamenSop($jaren, $this->CI->globorgid);
|
||||
$arrs = $this->CI->Arrangementen_model->getArrangementnamenSop($jaren, $this->orgid);
|
||||
if ($arrs) {
|
||||
$kleuren = ['#ffcc80', '#ffb84d', '#ffa31a', '#e68a00', '#b36b00', '#804d00', '#4d2e00', '#ffe0b3', '#fff5e6'];
|
||||
$index = 0;
|
||||
@@ -284,7 +280,7 @@ class Compacteonderdelen
|
||||
private function setUitgavetypen()
|
||||
{
|
||||
$this->jaarnummer = $this->CI->Kalenderjaren_model->get_fieldvalue(['naam' => $this->onderdeel['orgversieid']], 'jaarnr');
|
||||
$this->uitgavetypen = $this->CI->Finbestemmingen_model->getUitgavenPerType($this->CI->globorgid, $this->jaarnummer);
|
||||
$this->uitgavetypen = $this->CI->Finbestemmingen_model->getUitgavenPerType($this->orgid, $this->jaarnummer);
|
||||
}
|
||||
|
||||
private function loopUitgavetypen()
|
||||
@@ -320,12 +316,12 @@ class Compacteonderdelen
|
||||
}
|
||||
|
||||
private function setTypeSom(){
|
||||
$this->typesom = $this->CI->Finbestemmingen_model->getTotaalSchoolBestedingen($this->CI->globorgid, $this->jaarnummer);
|
||||
$this->typesom = $this->CI->Finbestemmingen_model->getTotaalSchoolBestedingen($this->orgid, $this->jaarnummer);
|
||||
$this->typesom = number_format(($this->typesom / 100), 0,',','.');
|
||||
}
|
||||
|
||||
private function setSubsoorten(){
|
||||
$this->subsoorten = $this->CI->Finbestemmingen_model->getUitgavenPerSubsoortSchool($this->CI->globorgid, $this->jaarnummer);
|
||||
$this->subsoorten = $this->CI->Finbestemmingen_model->getUitgavenPerSubsoortSchool($this->orgid, $this->jaarnummer);
|
||||
}
|
||||
|
||||
private function loopSubsoorten(){
|
||||
@@ -405,13 +401,13 @@ class Compacteonderdelen
|
||||
|
||||
private function setLijsten(){
|
||||
$this->ijkpunten = "";
|
||||
$lijsten = new Lijsten($this->CI->globorgid, $this->selecties);
|
||||
$lijsten = new Lijsten($this->orgid, $this->selecties);
|
||||
$this->ijkpunten = $lijsten->getSopInfo();
|
||||
}
|
||||
|
||||
|
||||
private function setIJkpuntenGegevens(){
|
||||
$this->data= "";
|
||||
|
||||
$this->data = $this->ijkpunten;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,10 +29,11 @@ class Compacteversies
|
||||
}
|
||||
|
||||
|
||||
public function __construct( $schooljaarnr, $orgsoort)
|
||||
public function __construct( $schooljaarnr, $orgid, $orgsoort)
|
||||
{
|
||||
$this->CI =& get_instance();
|
||||
$this->schooljaarnr = $schooljaarnr;
|
||||
$this->orgid = $orgid;
|
||||
$this->orgsoortnr = $orgsoort;
|
||||
$this->handle();
|
||||
}
|
||||
@@ -63,40 +64,39 @@ class Compacteversies
|
||||
|
||||
private function setOrglist(){
|
||||
$lijst = [];
|
||||
$orglist = $this->CI->Organisaties_model->getlistrecursief($this->CI->globorgid, $lijst);
|
||||
$orglist = $this->CI->Organisaties_model->getlistrecursief($this->orgid, $lijst);
|
||||
$orglist = implode('","', $orglist);
|
||||
$this->orglist = '"'. $orglist .'"';
|
||||
|
||||
}
|
||||
|
||||
private function setSWVID(){
|
||||
$this->organisatie =$this->CI->Organisaties_model->get_record_by_id($this->CI->globorgid);
|
||||
if ($this->organisatie) {
|
||||
switch ($this->organisatie->soort) {
|
||||
|
||||
switch ($this->orgsoortnr) {
|
||||
case "1":
|
||||
$this->swvID = $this->organisatie->id;
|
||||
$this->swvID = $this->orgid;
|
||||
break;
|
||||
case "2":
|
||||
$this->swvID = $this->organisatie->valtonder_id;
|
||||
$kamer = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
$this->swvID = $kamer->valtonder_id;
|
||||
break;
|
||||
case "3" :
|
||||
$kamer = $this->CI->Organisaties_model->get_record_by_id($this->organisatie->valtonder_id);
|
||||
$bg = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
$kamer = $this->CI->Organisaties_model->get_record_by_id($bg->valtonder_id);
|
||||
$this->swvID = $kamer->valtonder_id;
|
||||
break;
|
||||
case "4":
|
||||
$kamer = $this->CI->Organisaties_model->get_record_by_id($this->organisatie->valtonder_id);
|
||||
$bestuur = $this->CI->Organisaties_model->get_record_by_id($kamer->valtonder_id);
|
||||
$this->swvID = $bestuur->valtonder_id;
|
||||
$school = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
$bg = $this->CI->Organisaties_model->get_record_by_id($school->valtonder_id);
|
||||
$kamer = $this->CI->Organisaties_model->get_record_by_id($bg->valtonder_id);
|
||||
$this->swvID = $kamer->valtonder_id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$this->swvID = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function setCompactSopOnderdelen(){
|
||||
$this->onderdelen = $this->CI->Compactsoponderdelen_model->getOnderdelen( $this->organisatie->id, $this->organisatie->soort);
|
||||
$this->onderdelen = $this->CI->Compactsoponderdelen_model->getOnderdelen( $this->orgid);
|
||||
}
|
||||
|
||||
private function loopCompactSop(){
|
||||
|
||||
@@ -30,7 +30,7 @@ class compactsoponderdelen_model extends MY_Model{
|
||||
// return $this->get_query_result();
|
||||
// }
|
||||
|
||||
function getOnderdelen($orgid, $soort){
|
||||
function getOnderdelen($orgid){
|
||||
$this->sql =" SELECT M.sysnr as modulenr, M.naam AS instrument, M.instrument_type AS type, COALESCE(C.naam, 'geen') AS cluster,
|
||||
COALESCE(C.naam, 'aaaa') AS ordening, SOP.id,
|
||||
SOP.sopnaam AS naam, SOP.blokjesnaam AS naamkort
|
||||
|
||||
@@ -42,6 +42,39 @@ class Organisaties_model extends MY_Model{
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
function get_onderliggende_orgs($orgid)
|
||||
{
|
||||
$this->sql = " SELECT O.id, O.brin, O.naamkort, valtonder_id, soort
|
||||
FROM tb_organisaties O
|
||||
WHERE O.valtonder_id = {$orgid}
|
||||
AND actief= 1
|
||||
AND O.id <> {$orgid} ";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
function get_alle_onderliggende_orgs($orgid){
|
||||
$this->sql=" SELECT O.id, O.brin, O.naamkort, O.valtonder_id, O.soort
|
||||
FROM tb_organisaties O
|
||||
WHERE O.actief= 1
|
||||
AND (O.id = {$orgid} OR O.valtonder_id = {$orgid})
|
||||
UNION
|
||||
SELECT O2.id, O2.brin, O2.naamkort, O2.valtonder_id, O2.soort
|
||||
FROM tb_organisaties O
|
||||
LEFT JOIN tb_organisaties O2 ON O.id = O2.valtonder_id
|
||||
WHERE O2.actief= 1
|
||||
AND O.valtonder_id = {$orgid}
|
||||
UNION
|
||||
SELECT O3.id, O3.brin, O3.naamkort, O3.valtonder_id, O3.soort
|
||||
FROM tb_organisaties O
|
||||
LEFT JOIN tb_organisaties O2 ON O.id = O2.valtonder_id
|
||||
LEFT JOIN tb_organisaties O3 ON O2.id = O3.valtonder_id
|
||||
WHERE O3.actief = 1
|
||||
AND O.valtonder_id = {$orgid}
|
||||
|
||||
ORDER BY naamkort ";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
function getScholen($bgID){
|
||||
$this->sql ="SELECT O.id, brin, naam, naamkort, plaats,
|
||||
(SELECT count(OU.id) FROM tb_orgusers OU WHERE OU.organisatie_id = O.id ) AS aantal,
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
event: {change: fGetCompactSop}" >
|
||||
</select>
|
||||
</td>
|
||||
<!--ko if: orgsoortnummer < 4 -->
|
||||
<td style="padding-left: 30px;">
|
||||
<p>Selecteer een organisatie:</p>
|
||||
<select data-bind=" options: schooljaren,
|
||||
optionsText: 'naam',
|
||||
value: $root.selectedSchooljaar,
|
||||
|
||||
<td style="padding-left: 30px;" data-bind="visible: toporgnr() != 4 ">
|
||||
<p>Organisatie:</p>
|
||||
<select data-bind=" options: organisaties,
|
||||
optionsText: 'naamkort',
|
||||
value: $root.selectedOrganisatie,
|
||||
event: {change: fGetCompactSop}" >
|
||||
</select>
|
||||
</td>
|
||||
<!--/ko -->
|
||||
|
||||
|
||||
<td style="vertical-align: bottom; ">
|
||||
<button class="buttonCompact"
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<table style="width: 90%;" data-bind="foreach: $root.school">
|
||||
<table style="width: 90%;" data-bind="with: $root.schoolasobsject">
|
||||
<tr >
|
||||
<td style="width: 20%" data-bind="text: $root.orgsoort() "></td>
|
||||
<td style="width: 20%" data-bind="text: $root.orgsoort "></td>
|
||||
<td style="width: 30%" data-bind="text: naam"></td>
|
||||
<td style="width: 20%" >Adres</td>
|
||||
<td style="width: 30%">
|
||||
|
||||
Reference in New Issue
Block a user