BBnepal-Accounts/account/application/models/MUsers.php
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

33 lines
898 B
PHP

<?php
class MUsers extends CI_Model{
function addUser($input){
$this->db->insert('tbl_users',$input);
}
function updateUser($input,$id){
$this->db->where('user_id',$id);
$this->db->update('tbl_users',$input);
}
function getUsers($id=''){
if ($id!=''){
$this->db->where('user_id',$id);
}
$this->db->where('status', 1);
$this->db->or_where('status', 2);
$result=$this->db->get('tbl_users');
if ($id!=''){
return $result->row();
}
return $result->result();
}
function getUserById($id){
$this->db->where('user_id',$id);
return $this->db->get('tbl_users')->row();
}
function deleteuser($id){
$table="tbl_users";
$this->db->where('user_id',$id);
$input['status']=0;
$this->db->update($table,$input);
}
}