diff --git a/application/controllers/shared/Organisaties.php b/application/controllers/shared/Organisaties.php index 61659ae..26dd0d7 100644 --- a/application/controllers/shared/Organisaties.php +++ b/application/controllers/shared/Organisaties.php @@ -28,7 +28,7 @@ class Organisaties extends MY_Controller{ function getorgsperlevel(){ $soort = $this->uri->segment(4); $toporgid = $this->input->post("toporgid"); - $orgs = $this->Organisaties_model->getorgsdetails($soort,$toporgid); + $orgs = $this->Organisaties_model->getorgsdetails_metarchief($soort,$toporgid); echo json_encode($orgs); } diff --git a/application/models/shared/Organisaties_model.php b/application/models/shared/Organisaties_model.php index a5509f2..ef17bc0 100644 --- a/application/models/shared/Organisaties_model.php +++ b/application/models/shared/Organisaties_model.php @@ -282,13 +282,29 @@ class Organisaties_model extends MY_Model{ O.bijlagefile, SD.email1 FROM tb_organisaties O LEFT JOIN tb_schooldetails SD ON O.id = SD.organisatie_id - WHERE O.soort = {$soort} "; + WHERE O.soort = {$soort} + AND actief = 1 "; if ($valtonder) { $this->sql .=" AND O.valtonder_id = {$valtonder} "; } - $this->sql .=" ORDER BY O.actief DESC, O.id ASC "; + return $this->get_query_result(); } + + function getorgsdetails_metarchief($soort, $valtonder){ + $this->sql="SELECT O.id, O.soort, O.brin, O.naamkort, O.naam, + O.plaats, O.valtonder_id, O.actief, O.monbas, O.mondiv, + O.bijlagefile, SD.email1 + FROM tb_organisaties O + LEFT JOIN tb_schooldetails SD ON O.id = SD.organisatie_id + WHERE O.soort = {$soort} "; + if ($valtonder) { + $this->sql .=" AND O.valtonder_id = {$valtonder} "; + } + $this->sql .=" ORDER BY O.actief DESC, O.id ASC "; + return $this->get_query_result(); + } + function getorgdetails($id){ $this->sql="SELECT id, soort, brin, naamkort, naam, plaats,valtonder_id, actief,monbas, mondiv FROM tb_organisaties diff --git a/application/views/monpas/pages/organisaties.php b/application/views/monpas/pages/organisaties.php index 3fac7e2..af5a865 100644 --- a/application/views/monpas/pages/organisaties.php +++ b/application/views/monpas/pages/organisaties.php @@ -1,7 +1,6 @@