university changes done
This commit is contained in:
parent
1b6eecf99b
commit
8906845bf0
@ -19,8 +19,9 @@ class University_model extends CI_Model
|
||||
*/
|
||||
|
||||
// get university list
|
||||
public function get_university_list() {
|
||||
public function get_university_list($loginUserBranchId=null) {
|
||||
$this->db->select('*');
|
||||
$this->db->where('BranchCode',$loginUserBranchId);
|
||||
$this->db->order_by('CreatedOn', 'DESC');
|
||||
$this->db->from(UNIVERSITY);
|
||||
$univDetails = $this->db->get();
|
||||
@ -50,11 +51,12 @@ class University_model extends CI_Model
|
||||
}
|
||||
|
||||
// check exist details
|
||||
public function check_Univ_Exist($data, $check) {
|
||||
// check update for mobile number
|
||||
public function check_Univ_Exist($data, $check,$branchCode) {
|
||||
// check univ with branch code
|
||||
$this->db->select('*');
|
||||
$this->db->from(UNIVERSITY);
|
||||
$this->db->where('UniversityID', $data);
|
||||
$this->db->where('BranchCode', $branchCode);
|
||||
if ($this->db->get()->first_row()) {
|
||||
$result['existUniv'] = true;
|
||||
$result['message'] = "This University Id is already exist!";
|
||||
@ -66,15 +68,25 @@ class University_model extends CI_Model
|
||||
|
||||
// add university details
|
||||
public function insert_Univ($arr) {
|
||||
$this->db->insert(UNIVERSITY, $arr);
|
||||
if ($this->db->affected_rows() == '1') {
|
||||
$result['addUniv'] = true;
|
||||
$result['message'] = "Successfully University details added";
|
||||
} else {
|
||||
$result['addUniv'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
return $result;
|
||||
$this->db->select('*');
|
||||
$this->db->from(UNIVERSITY);
|
||||
$this->db->where('UniversityID', $arr['UniversityID']);
|
||||
$this->db->where('BranchCode', $arr['BranchCode']);
|
||||
if ($this->db->get()->first_row()) {
|
||||
$result['addUniv'] = false;
|
||||
$result['message'] = "This University Id is already exist!";
|
||||
} else {
|
||||
$this->db->insert(UNIVERSITY, $arr);
|
||||
if ($this->db->affected_rows() == '1') {
|
||||
$result['addUniv'] = true;
|
||||
$result['message'] = "Successfully University details added";
|
||||
} else {
|
||||
$result['addUniv'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function addActivity($arrayDetails=null,$jsonData=null)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user