42 lines
777 B
PHP
42 lines
777 B
PHP
<?php
|
|
class M_jenis_pelayanan extends CI_Model
|
|
{
|
|
function list_data()
|
|
{
|
|
$this->db->select('id, nama, created_at, updated_at');
|
|
$this->db->from('jenis_pelayanan');
|
|
$this->db->order_by("created_at", "desc");
|
|
return $this->db->get();
|
|
}
|
|
|
|
function get_all()
|
|
{
|
|
$this->db->select('id, nama');
|
|
$this->db->from('jenis_pelayanan');
|
|
$this->db->order_by("nama", "asc");
|
|
return $this->db->get();
|
|
}
|
|
|
|
function insert($data, $table)
|
|
{
|
|
$this->db->insert($table, $data);
|
|
}
|
|
|
|
function delete($where, $table)
|
|
{
|
|
$this->db->where($where);
|
|
$this->db->delete($table);
|
|
}
|
|
|
|
function edit($where, $table)
|
|
{
|
|
return $this->db->get_where($table, $where);
|
|
}
|
|
|
|
function update($where, $data, $table)
|
|
{
|
|
$this->db->where($where);
|
|
$this->db->update($table, $data);
|
|
}
|
|
}
|