BBnepal-Accounts/account/application/models/MUsers.php

33 lines
898 B
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<?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);
}
}