60 lines
1.7 KiB
PHP
60 lines
1.7 KiB
PHP
<?php
|
|
class M_tipeuser extends CI_Model {
|
|
|
|
function index() {
|
|
$query = $this->db->get('master_tipeuser');
|
|
return $query->result();
|
|
}
|
|
|
|
function tipeuserstatus() {
|
|
$this->db->where('mt_status', 1);
|
|
$query = $this->db->get('master_tipeuser');
|
|
return $query->result();
|
|
}
|
|
|
|
function insert() {
|
|
$insert_tipeuser = array(
|
|
'mt_nama' => $this->input->post('namatipeuser'),
|
|
'mt_status' => $this->input->post('status'),
|
|
);
|
|
$insert = $this->db->insert('master_tipeuser', $insert_tipeuser);
|
|
}
|
|
|
|
function edit($id) {
|
|
$this->db->where('mt_id', $id);
|
|
$query = $this->db->get('master_tipeuser');
|
|
return $query;
|
|
}
|
|
|
|
function prosesedit() {
|
|
$update_tipeuser = array(
|
|
'mt_nama' => $this->input->post('namatipeuser'),
|
|
'mt_status' => $this->input->post('status'),
|
|
);
|
|
$id = $this->input->post('id');
|
|
$this->db->where('mt_id', $id);
|
|
$this->db->update('master_tipeuser', $update_tipeuser);
|
|
}
|
|
|
|
function delete($id) {
|
|
$this->db->where('mt_id', $id);
|
|
$this->db->delete('master_tipeuser');
|
|
}
|
|
|
|
function disabled($id) {
|
|
$update_data = array(
|
|
'mt_status' => 0,
|
|
);
|
|
$this->db->where('mt_id', $id);
|
|
$this->db->update('master_tipeuser', $update_data);
|
|
}
|
|
|
|
function aktif($id) {
|
|
$update_data = array(
|
|
'mt_status' => 1,
|
|
);
|
|
$this->db->where('mt_id', $id);
|
|
$this->db->update('master_tipeuser', $update_data);
|
|
}
|
|
}
|
|
?>
|