| Server IP : 68.178.202.69 / Your IP : 216.73.216.122 Web Server : Apache System : Linux 69.202.178.68.host.secureserver.net 3.10.0-1160.139.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Nov 3 13:30:41 UTC 2025 x86_64 User : ikioworld ( 1005) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/ikioworld/www/application/models/ |
Upload File : |
<?php
class Loginmodel extends CI_Model {
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function check_is_valid_user($module_name = '')
{
//echo $this->session->userdata('sess_admin_id');
if($this->session->userdata('sess_admin_id') == '')
{
redirect('admin');
}
}
function check_is_valid_user_front($module_name = '')
{
//echo $this->session->userdata('sess_admin_id');
if($this->session->userdata('user_id') == '')
{
//redirect('register');
redirect('register?act=login');
}
}
function checklogin()
{
$conditions = array(
'username' => trim($this->input->post('username')),
'password' => trim(md5($this->input->post('password'))),
);
$query = $this->db->get_where('admins', $conditions);
return $query->row();
}
function checkuserlogin()
{
$conditions = array(
'username' => trim($this->input->post('username')),
'password' => trim(md5($this->input->post('password'))),
);
$query = $this->db->get_where('k_users', $conditions);
return $query->row();
}
function update_last_login_date(){
$data = array(
'last_login' => date('Y-m-d H:i:s'),
);
$this->db->where('id', $this->session->userdata('sess_admin_id'));
$this->db->update('admins', $data);
}
function getProducts()
{
$this->db->where("status='active'");
$query = $this->db->get('product');
return $query->result();
}
function getContact()
{
$this->db->where("status='active'");
$query = $this->db->get('contact');
return $query->result();
}
function getBlogs()
{
$this->db->where("status='active'");
$query = $this->db->get('blog');
return $query->result();
}
function getNews()
{
$this->db->where("status='active'");
$query = $this->db->get('news');
return $query->result();
}
function getCategory()
{
$this->db->where("status='active'");
$query = $this->db->get('category');
return $query->result();
}
function getSubCategory()
{
$this->db->where("status='active'");
$query = $this->db->get('subcategory');
return $query->result();
}
function getEvents()
{
$this->db->where("status='active'");
$query = $this->db->get('event');
return $query->result();
}
function getPhotometric()
{
$this->db->where("status='inactive'");
$query = $this->db->get('photometric');
return $query->result();
}
function getEnquiry()
{
$this->db->where("status='active'");
$query = $this->db->get('enquiry');
return $query->result();
}
function getReview()
{
$this->db->where("status='active'");
$query = $this->db->get('review');
return $query->result();
}
function getCareers()
{
$this->db->where("status='active'");
$query = $this->db->get('careers');
return $query->result();
}
function getProject()
{
$this->db->where("status='active'");
$query = $this->db->get('project');
return $query->result();
}
}
?>