load->model($models); } function getindicatoren($ijkpuntid){ $this->sql="SELECT I.id, nummer, omschrijving1, omschrijving2, inspectie, REPLACE(gewicht,'.',',') AS gewicht, IF (count(SC.id) = 0, TRUE,FALSE) AS deleteok FROM tb_indicatoren I LEFT JOIN tb_scores SC ON SC.indicator_id = I.id WHERE I.ijkpunt_id = {$ijkpuntid} GROUP BY I.id ORDER BY nummer"; return $this->get_query_result(); } function getindicator($id){ $this->sql="SELECT I.id, nummer, omschrijving1, omschrijving2, inspectie, REPLACE(gewicht,'.',',') AS gewicht, IF (count(SC.id) = 0, TRUE,FALSE) AS deleteok FROM tb_indicatoren I LEFT JOIN tb_scores SC ON SC.indicator_id = I.id WHERE I.id = {$id}"; return $this->get_query_row(); } }