31 lines
600 B
PHP
31 lines
600 B
PHP
<?php
|
|
class Admin_model extends CI_model
|
|
{
|
|
|
|
function login_valid($username,$password)
|
|
{
|
|
$this->db->from('tbl_usermaster');
|
|
$this->db->where('user_name',$username);
|
|
$this->db->where('user_password',$password);
|
|
$this->db->where('user_status','active');
|
|
if($query=$this->db->get())
|
|
{
|
|
return $query->row_array();
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public function totalrows($tablename='',$fields='')
|
|
{
|
|
$this->db->select($fields);
|
|
$this->db->from($tablename);
|
|
$query = $this->db->get();
|
|
$responce = $query->num_rows();
|
|
return $responce;
|
|
}
|
|
}
|
|
?>
|