62 lines
1.7 KiB
PHP
62 lines
1.7 KiB
PHP
<?php
|
|
class M_spesialis extends CI_Model {
|
|
|
|
function index() {
|
|
$query = $this->db->get('master_spesialis');
|
|
return $query->result();
|
|
}
|
|
|
|
function status() {
|
|
$this->db->where('ms_status', 1);
|
|
$query = $this->db->get('master_spesialis');
|
|
return $query->result();
|
|
}
|
|
|
|
function insert() {
|
|
$insert = array(
|
|
'ms_nama' => $this->input->post('nama'),
|
|
'ms_kode' => $this->input->post('kode'),
|
|
'ms_status' => $this->input->post('status'),
|
|
);
|
|
$insert = $this->db->insert('master_spesialis', $insert);
|
|
}
|
|
|
|
function edit($id) {
|
|
$this->db->where('ms_id', $id);
|
|
$query = $this->db->get('master_spesialis');
|
|
return $query;
|
|
}
|
|
|
|
function prosesedit() {
|
|
$update = array(
|
|
'ms_nama' => $this->input->post('nama'),
|
|
'ms_kode' => $this->input->post('kode'),
|
|
'ms_status' => $this->input->post('status'),
|
|
);
|
|
$id = $this->input->post('id');
|
|
$this->db->where('ms_id', $id);
|
|
$this->db->update('master_spesialis', $update);
|
|
}
|
|
|
|
function delete($id) {
|
|
$this->db->where('ms_id', $id);
|
|
$this->db->delete('master_spesialis');
|
|
}
|
|
|
|
function disabled($id) {
|
|
$update_data = array(
|
|
'ms_status' => 0,
|
|
);
|
|
$this->db->where('ms_id', $id);
|
|
$this->db->update('master_spesialis', $update_data);
|
|
}
|
|
|
|
function aktif($id) {
|
|
$update_data = array(
|
|
'ms_status' => 1,
|
|
);
|
|
$this->db->where('ms_id', $id);
|
|
$this->db->update('master_spesialis', $update_data);
|
|
}
|
|
}
|
|
?>
|