diff --git a/Apollo/api/application/controllers/Employee_Controller.php b/Apollo/api/application/controllers/Employee_Controller.php index c96b8bf6..a2e66f63 100755 --- a/Apollo/api/application/controllers/Employee_Controller.php +++ b/Apollo/api/application/controllers/Employee_Controller.php @@ -174,6 +174,7 @@ class Employee_Controller extends REST_Controller { // add employee without image public function addEmployee_post() { $data = $this->post('data'); + $createdBy = $this->post('createdBy'); $imagename = ''; @@ -199,7 +200,8 @@ class Employee_Controller extends REST_Controller { $req['Qualification'] = $data['qualificaion']; $req['BranchCode'] = $data['homeBranch']; $req['IsActive'] = $data['switchsetting']; - $req['DOJ'] = $data['dateofjoining']; + $req['DOJ'] = $data['dateofjoining']; + $req['JobResponsibility'] = $data['jobResponsibility']; // $req['DOJ'] = $data['dateofjoining']; $req['ListCode'] = $data['role']; $req['CreatedBy'] = $createdBy; @@ -254,6 +256,7 @@ class Employee_Controller extends REST_Controller { $req['BranchCode'] = $temp['homeBranch']; $req['IsActive'] = $temp['switchsetting']; $req['DOJ'] = $temp['dateofjoining']; + $req['JobResponsibility'] = $data['jobResponsibility']; // $req['DOJ'] = $data['dateofjoining']; $req['ListCode'] = $temp['role']; $req['CreatedBy'] = $createdBy; @@ -328,6 +331,7 @@ class Employee_Controller extends REST_Controller { $req['OtherID'] = $data['OtherID']; $req['OtherIDDetails'] = $data['OtherIDDetails']; $req['Qualification'] = $data['Qualification']; + $req['JobResponsibility'] = $data['JobResponsibility']; // $req['ProfilePicPath'] = $data['ProfilePicPath']; // $req['BranchCode'] = $data['BranchCode']; $req['IsActive'] = $data['IsActive']; @@ -382,6 +386,7 @@ class Employee_Controller extends REST_Controller { $req['OtherIDDetails'] = $data['OtherIDDetails']; $req['Qualification'] = $data['Qualification']; $req['ProfilePicPath'] = $data['ProfilePicPath']; + $req['JobResponsibility'] = $data['JobResponsibility']; // $req['BranchCode'] = $data['BranchCode']; $req['IsActive'] = $data['IsActive']; // $req['DOJ'] = date('d-m-Y', strtotime($data['DOJ']) ); @@ -435,11 +440,12 @@ class Employee_Controller extends REST_Controller { $empFor = $this->post('empFor'); $reqBanch['BranchCode'] = $this->post('updateBranch'); $req['ListCode'] = $this->post('updateRole'); + $reqJOBRES['JobResponsibility'] = $this->post('JobResponsibility'); $req['UpdatedBy'] = $this->post('updateBy'); $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; - $updateBranch = $this->employee_model->upate_employee_branch( $empFor, $reqBanch, $req, $req['UpdatedBy'], $req['UpdatedOn'] );// Check if the employee exist + $updateBranch = $this->employee_model->upate_employee_branch( $empFor, $reqBanch, $req, $req['UpdatedBy'], $req['UpdatedOn'], $reqJOBRES );// Check if the employee exist if ($updateBranch) { $updateBranch['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/models/DayBook_model.php b/Apollo/api/application/models/DayBook_model.php index 49119bd8..fbfa0ff1 100644 --- a/Apollo/api/application/models/DayBook_model.php +++ b/Apollo/api/application/models/DayBook_model.php @@ -87,7 +87,7 @@ class DayBook_model extends CI_Model $this->db->update(DAYBOOKMASTER, $Arr); if ($this->db->affected_rows() == '1') { $result['updateDetailsStatus'] = true; - $result['message'] = "Successfully details Updated"; + $result['message'] = "Successfully Details Updated"; } else { $result['updateDetailsStatus'] = false; $result['message'] = "Something went wrong.please try again"; @@ -101,7 +101,7 @@ class DayBook_model extends CI_Model $this->db->insert(DAYBOOKMASTER, $Arr); if ($this->db->affected_rows() == '1') { $result['addDayBookStatus'] = true; - $result['message'] = "Successfully DayBook details added"; + $result['message'] = "Successfully DayBook Details Added"; } else { $result['addDayBookStatus'] = false; diff --git a/Apollo/api/application/models/DaybookMaster_model.php b/Apollo/api/application/models/DaybookMaster_model.php index 998d79a1..5f178166 100644 --- a/Apollo/api/application/models/DaybookMaster_model.php +++ b/Apollo/api/application/models/DaybookMaster_model.php @@ -26,7 +26,7 @@ class DaybookMaster_model extends CI_Model { $this->db->insert(INCOMEOUTCOMEMASTER, $arrayDetails); if($this->db->affected_rows() == '1'){ $result['addStatus'] = true; - $result['message'] = "Successfully day book details is added"; + $result['message'] = "Successfully Day Book Master Details Added"; } else { $result['addStatus'] = false; @@ -100,7 +100,7 @@ class DaybookMaster_model extends CI_Model { $this->db->update(INCOMEOUTCOMEMASTER, $arrayDetails); if($this->db->affected_rows() == '1'){ $result['updateStatus'] = true; - $result['message'] = "Successfully day book details is updated"; + $result['message'] = "Successfully Day Book Details Updated"; } else { $result['updateStatus'] = false; @@ -109,8 +109,6 @@ class DaybookMaster_model extends CI_Model { } - - return $result; } diff --git a/Apollo/api/application/models/Employee_model.php b/Apollo/api/application/models/Employee_model.php index 9ae08bc7..c68b1bbd 100755 --- a/Apollo/api/application/models/Employee_model.php +++ b/Apollo/api/application/models/Employee_model.php @@ -332,6 +332,7 @@ class Employee_model extends CI_Model // add employee public function add_employee($empArr, $createdBy, $imageName, $imageSource, $imageSize) { + // print_r($empArr);exit(); if( $imageSource == '') { // add employee without image $imageNameDb = 'default.jpeg'; $empArr['ProfilePicPath'] = "employee/".$imageNameDb; @@ -513,7 +514,7 @@ class Employee_model extends CI_Model // get employee branch details public function get_employee_branch($staffId) { - $this->db->select('t3.ListCode, t3.ListName'); + $this->db->select('t3.ListCode, t3.ListName, t4.JobResponsibility'); $this->db->from('' . PICK_LIST_DETAILS . ' as t3'); $this->db->join('' . STAFF . ' as t4', 't4.ListCode = t3.ListCode', 'LEFT'); $this->db->where('t4.StaffID', $staffId); @@ -552,7 +553,7 @@ class Employee_model extends CI_Model } // update employee branch details - public function upate_employee_branch($empFor, $reqBanch, $req, $createby, $createon) + public function upate_employee_branch($empFor, $reqBanch, $req, $createby, $createon, $reqJOBRES) { // print_r( count($reqBanch['BranchCode']));exit(); if( count($reqBanch['BranchCode']) > 1) { @@ -567,7 +568,8 @@ class Employee_model extends CI_Model if ($this->db->affected_rows() == '1') { // $branchCode = $this->get_branch_code($reqBanch['BranchCode'][0]); $branchCode = $reqBanch['BranchCode'][0]; - $sql = "UPDATE ".STAFF." SET BranchCode='$branchCode' WHERE StaffID='$empFor'"; + $roleResponsibility = $reqJOBRES['JobResponsibility']; + $sql = "UPDATE ".STAFF." SET BranchCode='$branchCode', JobResponsibility='$roleResponsibility' WHERE StaffID='$empFor'"; // update branch to staff table if ($this->db->query($sql) == '1') { $this->db->where('StaffID', $empFor); @@ -612,7 +614,8 @@ class Employee_model extends CI_Model if ($this->db->affected_rows() == '1') { // $branchCode = $this->get_branch_code($reqBanch['BranchCode'][0]); $branchCode = $reqBanch['BranchCode'][0]; - $sql = "UPDATE ".STAFF." SET BranchCode='$branchCode' WHERE StaffID='$empFor'"; + $roleResponsibility = $reqJOBRES['JobResponsibility']; + $sql = "UPDATE ".STAFF." SET BranchCode='$branchCode', JobResponsibility='$roleResponsibility' WHERE StaffID='$empFor'"; // update branch to staff table if ($this->db->query($sql) == '1') { $this->db->where('StaffID', $empFor); diff --git a/Apollo/assets/js/controllers/employeeCtrl.js b/Apollo/assets/js/controllers/employeeCtrl.js index bd0ff24a..0986dd99 100755 --- a/Apollo/assets/js/controllers/employeeCtrl.js +++ b/Apollo/assets/js/controllers/employeeCtrl.js @@ -43,6 +43,7 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$ 'dateofjoining': '', 'dateofjoining': '', 'role': '', + 'jobResponsibility': '', 'switchsetting': true, }; var data = ''; @@ -442,6 +443,7 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$ 'dateofjoining': '', 'dateofjoining': '', 'role': '', + 'jobResponsibility': '', 'switchsetting': true, }; } @@ -605,6 +607,7 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$ $scope.sendBranchData = { 'empFor': p.StaffID, 'updateRole': empRole.ListCode, + 'JobResponsibility': empRole.JobResponsibility, 'updateBranch': $scope.arr1, 'updateBy': localDetails.localUserID } diff --git a/Apollo/assets/views/editEmployeeBranchDetails.html b/Apollo/assets/views/editEmployeeBranchDetails.html index 889e15a8..7903b3f3 100755 --- a/Apollo/assets/views/editEmployeeBranchDetails.html +++ b/Apollo/assets/views/editEmployeeBranchDetails.html @@ -416,6 +416,13 @@ Role is required +