[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
smk
/
application
/
models
/
sms
/
[
Home
]
File: Grup_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Grup_model extends CI_Model{ private $database = 'dusms'; private $table = 'grup'; function save($data){ $this->db->insert($this->database.'.'.$this->table, $data); } function delete($id){ $this->db->where('id', $id) ->delete($this->database.'.'.$this->table); } function update($data, $id){ $this->db->where('id', $id) ->update($this->database.'.'.$this->table, $data); } function cek_grup($grup){ $this->db->select('COUNT(*) AS hasil') ->where('grup', $grup) ->from($this->database.'.'.$this->table); return $this->db->get(); } function get_all(){ $this->db->from($this->database.'.'.$this->table) ->order_by('grup', 'ASC'); return $this->db->get(); } function get_grup_by_id($id){ $this->db->where('id', $id) ->from($this->database.'.'.$this->table) ->limit(1); return $this->db->get(); } function get_grup_by_grup($grup){ $this->db->where('grup', $grup) ->from($this->database.'.'.$this->table) ->limit(1); return $this->db->get(); } function get_all_grup($start, $rows, $search){ $this->db->like('grup', $search) ->from($this->database.'.'.$this->table) ->limit($rows, $start); return $this->db->get(); } function get_all_grup_count($search){ $this->db->select('COUNT(*) AS hasil') ->like('grup', $search) ->from($this->database.'.'.$this->table); return $this->db->get(); } }