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