| 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 Usermodel extends CI_Model
{
function __construct()
{
parent::__construct();
$this->load->database();
$this->table_name = 'user';
}
function addUser($data){
if(!empty($data)){
// print_r($data);exit;
unset($data['sbt']);
if(isset($data['referred_code'])){
$data['referred_code']= $this->input->post('referred_code');
$data['password']=md5($this->input->post("password"));
$data['confirm_password']=md5($this->input->post("confirm_password"));
$data['created']=date('Y-m-d H:i:s');
$data['updated']=date('Y-m-d H:i:s');
$data['status']="Active";
}else{
unset($data['referred_code']);
$data['password']=md5($this->input->post("password"));
$data['confirm_password']=md5($this->input->post("confirm_password"));
$data['created']=date('Y-m-d H:i:s');
$data['updated']=date('Y-m-d H:i:s');
$data['status']="Active";
}
$this->db->insert($this->table_name,$data);
$insert_id = $this->db->insert_id();
return $insert_id;
// echo $this->db->last_query(); die;
}
}
function updateUser($email,$data){
if(!empty($data) && $email!=''){
// print_r($data);exit;
unset($data['sbt']);
unset($data['user']);
$data['first_name'] = $this->input->post("first_name");
$data['last_name'] = $this->input->post("last_name");
$data['pincode'] = $this->input->post("pincode");
$data['address_1'] = $this->input->post("address_1");
$data['address_2'] = $this->input->post("address_2");
$data['state'] = $this->input->post("state");
$data['city'] = $this->input->post("city");
$data['created']=date('Y-m-d H:i:s');
$data['updated']=date('Y-m-d H:i:s');
$data['status']="Active";
}
$this->db->where('email',$email);
return $this->db->update($this->table_name,$data);
}
function check_is_valid_user($module_name = '')
{
//echo $this->session->userdata('sess_admin_id');
if($this->session->userdata('sess_user_email') == '')
{
redirect('home');
}
}
function check_is_valid_user_front($module_name = '')
{
//echo $this->session->userdata('sess_admin_id');
if($this->session->userdata('sess_user_email') == '')
{
//redirect('register');
redirect('register?act=login');
}
}
function checklogin($email,$password)
{
// unset($data['sbt']);
$sha_password = md5($password);
// print_r($email);
// print_r($sha_password);exit;
$this->db->select('*');
$this->db->from('user');
$this->db->group_start();
$this->db->where('email', $email)->or_where('mobile', $email);
$this->db->group_end();
$this->db->where('password', $sha_password);
$query = $this->db->get();
return $query->row();
}
function checkuserlogin()
{
$conditions = array(
'email' => trim($this->input->post('email')),
'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_user_id'));
$this->db->update('user', $data);
}
function fetch_pass($session_email)
{
unset($_POST['sbt']);
$fetch_pass=$this->db->query("select * from user where email='$session_email'");
$res=$fetch_pass->result();
}
function change_pass($session_email,$new_pass)
{
unset($_POST['sbt']);
// $sql="UPDATE user set password='$new_pass' where email='$session_email'";
// echo $sql;exit;
$update_pass=$this->db->query("UPDATE user set password='$new_pass' where email='$session_email'");
}
function reset_pass($session_email,$new_pass)
{
$update_pass=$this->db->query("UPDATE user set password='$new_pass' where email='$session_email'");
}
function checkEmail($email)
{
$this->db->select('*');
$this->db->from('user');
$this->db->where('email', $email);
$query = $this->db->get();
return $query->result_array();
}
function checkMobile($mobile){
$this->db->select('*');
$this->db->from('user');
$this->db->where('mobile', $mobile);
$query = $this->db->get();
return $query->result_array();
}
function get_user($email){
$this->db->select('*');
$this->db->from('user');
$this->db->where('email', $email);
$query = $this->db->get();
return $query->result_array();
}
function checkCode($code){
$this->db->select('referral_code');
$this->db->from('user');
$this->db->where('referral_code', $code);
$query = $this->db->get();
return $query->result_array();
}
function getPrice()
{
$query = $this->db->get('price_table');
return $query->result();
}
function get_Wallet($id)
{
$this->db->select('*');
$this->db->from('wallet');
$this->db->where('user_id', $id);
$query = $this->db->get();
return $query->result_array();
}
function get_Slider()
{
$this->db->select('*');
$this->db->from('slider');
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function get_Icon()
{
$this->db->select('*');
$this->db->from('icon');
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function get_Videos()
{
$this->db->select('*');
$this->db->from('video');
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function get_Video($value)
{
$this->db->select('*');
$this->db->from('video');
$this->db->where('id',$value);
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function get_Scorer()
{
$this->db->select('*');
$this->db->from('top_scorers');
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function get_Testimonials()
{
$this->db->select('*');
$this->db->from('testimonial');
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function get_About()
{
$this->db->select('*');
$this->db->from('about');
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function get_Address()
{
$this->db->select('*');
$this->db->from('address');
$this->db->where('status','active');
// $this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function get_Url()
{
$this->db->select('*');
$this->db->from('url');
$this->db->where('status','active');
// $this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
}