commitall
This commit is contained in:
33
account/application/models/MUsers.php
Normal file
33
account/application/models/MUsers.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user