50 lines
859 B
PHP
50 lines
859 B
PHP
<?php
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
class ModelUser extends CI_Model
|
|
{
|
|
|
|
|
|
/**
|
|
|
|
* @author Fendrik Nurul Jadid <fendrik1311@gmail.com>
|
|
|
|
* @since v.1.0
|
|
|
|
**/
|
|
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
//Codeigniter : Write Less Do More
|
|
}
|
|
|
|
public function get_data()
|
|
{
|
|
return $this->db->get_where("user", array("jabatan" => "Admin"));
|
|
}
|
|
|
|
public function get_alldata()
|
|
{
|
|
return $this->db->get_where("user")->result();
|
|
}
|
|
|
|
public function count_user()
|
|
{
|
|
return $this->db->count_all("user");
|
|
}
|
|
|
|
public function get_data2()
|
|
{
|
|
$this->db->where('jabatan !=', 'Admin');
|
|
return $this->db->get('user')->result();
|
|
}
|
|
|
|
public function get_data_edit($id)
|
|
{
|
|
return $this->db
|
|
->get_where("user", array("id_user" => $id))->row_array();
|
|
}
|
|
}
|