D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
alumni
/
application
/
models
/
user
/
Filename :
UserManagement.php
back
Copy
<?php /** * Description of User * * @author Softpro India Pvt. Ltd. */ class UserManagement extends CI_Model { //put your code here function getUser($userid, $password = '') { $this->db->select("*"); $this->db->from("tbl_stu_alu"); $this->db->where("userid", $userid); if ($password != '') $this->db->where("password", $password); return $this->db->get(); } function updateUser($userDetails) { $this->db->where("userid", $userDetails["userid"]); return $this->db->update("tbl_stu_alu", $userDetails); } function getUserProfileDetails($userid) { $this->db->select("*"); $this->db->from("tbl_profile"); $this->db->where("user_id", $userid); return $this->db->get(); } function updatePrimaryInfoData($primaryInfoArray, $userid) { $this->db->where("userid", $userid); return $this->db->update("tbl_stu_alu", $primaryInfoArray); } function getUsersNumRows($searchKeyword = '') { $this->db->select("*"); $this->db->from("tbl_stu_alu sa"); $this->db->join("tbl_profile p", "sa.userid=p.user_id"); $this->db->where("sa.name LIKE '%$searchKeyword%' OR sa.email LIKE '%$searchKeyword%' OR sa.mobile LIKE '%$searchKeyword%' OR sa.college_loc LIKE '%$searchKeyword%' OR sa.session LIKE '%$searchKeyword%'"); return $this->db->get(); } function getUsers($searchKeyword = '', $per_page, $offset) { $this->db->select("*"); $this->db->from("tbl_stu_alu sa"); $this->db->join("tbl_profile p", "sa.userid=p.user_id"); $this->db->join("tbl_course co", "sa.c_id=co.c_id"); $this->db->where("sa.name LIKE '%$searchKeyword%' OR sa.email LIKE '%$searchKeyword%' OR sa.user_type LIKE '%$searchKeyword%' OR sa.mobile LIKE '%$searchKeyword%' OR sa.college_loc LIKE '%$searchKeyword%' OR sa.session LIKE '%$searchKeyword%' OR sa.gender LIKE '%$searchKeyword%' OR co.c_name LIKE '%$searchKeyword%'"); if ($per_page > 0 || $offset != null || $offset != "") { $this->db->limit($per_page, $offset); } return $this->db->get(); } function getUserPersoanlAndProfileDetails($userid) { $this->db->select("*"); $this->db->from("tbl_stu_alu sa"); $this->db->join("tbl_profile p", "sa.userid = p.user_id"); $this->db->join("tbl_course co", "sa.c_id = co.c_id"); $this->db->where("sa.userid", $userid); return $this->db->get(); } }