File size: 833 Bytes
971eb1e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/* 

 * Author		= Dian Hermanto

 * Create Date	= 22 Maret 2017

 * File Name	= M_progress_indicator.php

 * Location		= -

*/
?>
<?php
class M_progress_indicator extends CI_Model

{
	function count_all_num_rows() // OK

	{
		return $this->db->count_all('tbl_indikator ');
	}
	
	function get_last_ten_indic() // OK

	{		
		$sql = "SELECT * FROM tbl_indikator 

				ORDER BY IK_DESC";
		return $this->db->query($sql);
	}
	
	function add($indic) // OK

	{
		$this->db->insert('tbl_indikator', $indic);
	}
	
	function get_indic_by_code($IK_CODE) // OK

	{
		$sql = "SELECT * FROM tbl_indikator  WHERE IK_CODE = '$IK_CODE'";
		return $this->db->query($sql);
	}
	
	function update($IK_CODE, $indic) // OK

	{
		$this->db->where('IK_CODE', $IK_CODE);
		$this->db->update('tbl_indikator ', $indic);
	}
}
?>