call tracking access

This commit is contained in:
venbatechnologies@gmail.com 2019-01-04 17:06:43 +05:30
parent d19263b556
commit ee2eb5ef3d

View File

@ -651,7 +651,7 @@ class Employee_model extends CI_Model
// update employee branch details
public function upate_employee_branch($updateFor, $req)
{
// print_r($req);
// print_r($req);die();
// echo $updateFor;exit();
$staffID = $req['StaffID'];
$BranchCode = $req['BranchCode'];
@ -661,11 +661,13 @@ class Employee_model extends CI_Model
$this->db->where_not_in('BranchCode', $BranchCode);
$roleDetails = $this->db->get()->first_row();
// print_r($roleDetails);exit();
//print_r($this->db->last_query());die();
if(count($roleDetails) > 0) {
$result['updateEmpbranchStatus'] = false;
$result['message'] = "Already Employee Exist for this Branch.";
} else {
if($req['HomeBranch'] == 1) {
} else {
if($req['HomeBranch'] == 1) {
$this->db->where('ID', $updateFor);
$this->db->update( STAFF_BRANCH , $req);
if ($this->db->affected_rows() == '1') {
@ -678,8 +680,8 @@ class Employee_model extends CI_Model
if ($this->db->query($sql) == '1') {
// $sql1 = "UPDATE ".STAFF." SET BranchCode='$branchCode', JobResponsibility='$roleResponsibility', FinanceModuleAccess= '$FinanceModuleAccess' WHERE StaffID='$empFor'";
// if ($this->db->query($sql1) == '1') {
// $result['updateEmpbranchStatus'] = true;
// $result['message'] = "Successfully employee branch details Updated";
$result['updateEmpbranchStatus'] = true;
$result['message'] = "Successfully employee branch details Updated";
// } else {
// $result['updateEmpbranchStatus'] = false;
// $result['message'] = "Something Went Wrong.";
@ -692,7 +694,7 @@ class Employee_model extends CI_Model
$result['updateEmpbranchStatus'] = false;
$result['message'] = "Something Went Wrong.";
}
} else {
} else {
$this->db->where('ID', $updateFor);
$this->db->update( STAFF_BRANCH , $req);
if ($this->db->affected_rows() == '1') {
@ -703,7 +705,12 @@ class Employee_model extends CI_Model
$result['message'] = "Something Went Wrong.";
}
}
}
//print_r($result);die();
return $result;
// $this->db->where('StaffID', $empFor);
// $this->db->update($req['StaffID'] , $req);