34 lines
1.0 KiB
PHP
34 lines
1.0 KiB
PHP
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
/**indicatoren_model maart 2015 */
|
|
|
|
class Indicatoren_model extends MY_Model{
|
|
|
|
protected $tablename = 'tb_indicatoren';
|
|
|
|
function __construct(){
|
|
parent::__construct();
|
|
$models = array('');
|
|
$this->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();
|
|
}
|
|
}
|