employee brach access status : kdk

This commit is contained in:
dineshkumarkannan 2018-04-06 11:07:03 +05:30
parent b5aea1a69e
commit d5df8bff81
4 changed files with 47 additions and 9 deletions

View File

@ -476,6 +476,7 @@ class Employee_Controller extends REST_Controller {
$req['HomeBranch'] = $this->post('HomeBranch');
$req['FinanceModuleAccess'] = $this->post('FinanceModuleAccess') == 1 ? '1' : '0';
$req['IsActive'] = $this->post('IsActive') == 1 ? '1' : '0';
// echo $req['FinanceModuleAccess'];exit();
$req['UpdatedBy'] = $this->post('updateBy');
$date = date('Y-m-d H:i:s');

View File

@ -34,7 +34,7 @@ class Login_model extends CI_Model
if ($mobile == $loginDetails->MobileNumber) {
if ($password == $loginDetails->Password) {
if($loginDetails->ListCode !=STUDENT){
if($loginDetails->ListCode == SUPER_ADMIN){
//print_r($loginDetails);exit();
$this->db->select('t1.MobileNumber, t1.ListCode, t1.ID, t2.BranchCode, t2.FinanceModuleAccess');
$this->db->from('' . LOGIN . ' as t1');
@ -57,7 +57,26 @@ class Login_model extends CI_Model
$result['loginStatus'] = false;
$result['message'] = "Your login is de-activated.";
}
} else if ($loginDetails->ListCode == ADMIN || $loginDetails->ListCode == EMPLOYEE) {
//print_r($loginDetails);exit();
$this->db->select('t1.MobileNumber, t3.ListCode, t1.ID, t3.BranchCode, t3.FinanceModuleAccess');
$this->db->from('' . LOGIN . ' as t1');
$this->db->join('' . STAFF . ' as t2', 't1.StaffID = t2.StaffID', 'LEFT');
$this->db->join('' . STAFF_BRANCH . ' as t3', 't3.StaffID = t2.StaffID', 'LEFT');
$this->db->where('t1.MobileNumber', $mobile);
$this->db->where('t2.IsActive', 1);
$this->db->where('t3.IsActive', 1);
$this->db->order_by('t3.CreatedOn', 'ASC');
$this->db->group_by('t3.StaffID');
$responseDetails = $this->db->get()->first_row();
if($responseDetails){
$result['loginStatus'] = true;
$result['details'] = $responseDetails;
}
else{
$result['loginStatus'] = false;
$result['message'] = "Your login is de-activated.";
}
}
else if($loginDetails->ListCode == STUDENT){
$this->db->select('LO.MobileNumber, LO.ListCode, LO.ID,ST.BranchCode');
@ -80,9 +99,6 @@ class Login_model extends CI_Model
$result['loginStatus'] = false;
$result['message'] = "Your login is de-activated or don't have login.";
}
} else {
$result['loginStatus'] = false;
$result['message'] = "Please Enter Valid Password !!";

View File

@ -234,7 +234,8 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
'JobResponsibility': '',
'IsActive': '',
'FinanceModuleAccess': '',
'HomeBranch': ''
'HomeBranch': '',
'IsActive': ''
}
$scope.getEmpEditBranchDetails = function(p) {
@ -249,6 +250,7 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
$scope.empEditBranchDetails.JobResponsibility = p.JobResponsibility;
$scope.empEditBranchDetails.FinanceModuleAccess = p.FinanceModuleAccess == 1 ? true : false;
$scope.empEditBranchDetails.HomeBranch = p.HomeBranch;
$scope.empEditBranchDetails.IsActive = p.IsActive == 1 ? true : false ;
}
$scope.getEmpEditBranchDetailsCancel = function() {
@ -264,7 +266,8 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
'JobResponsibility': '',
'IsActive': '',
'FinanceModuleAccess': '',
'HomeBranch': ''
'HomeBranch': '',
'IsActive': ''
}
}
@ -300,7 +303,8 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
'updateBranch': $scope.empEditBranchDetails.BranchCode,
'updateBy': localDetails.localUserID,
'FinanceModuleAccess': $scope.empEditBranchDetails.FinanceModuleAccess == true ? 1 : 0,
'HomeBranch': $scope.empEditBranchDetails.HomeBranch
'HomeBranch': $scope.empEditBranchDetails.HomeBranch,
'IsActive': $scope.empEditBranchDetails.IsActive == true ? 1 : 0
}
// p.IsActive = p.IsActive === true ? 1 : 0;
var req = {
@ -327,7 +331,8 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
'JobResponsibility': '',
'IsActive': '',
'FinanceModuleAccess': '',
'HomeBranch': ''
'HomeBranch': '',
'IsActive': ''
};
} else {
// $scope.ldloading1[loading.replace('-', '_')] = false;

View File

@ -20,6 +20,8 @@
</th>
<th>FinanceModule Access
</th>
<th>Status
</th>
<th>
</th>
</tr>
@ -31,6 +33,8 @@
<td>{{s.JobResponsibility}}</td>
<td><span ng-if="s.FinanceModuleAccess == 1">Active</span>
<span ng-if="s.FinanceModuleAccess == 0">In-Active</span></td>
<td><span ng-if="s.IsActive == 1" style="color: green">Active</span>
<span ng-if="s.IsActive == 0" style="color: red">In-Active</span></td>
<td ng-click="getEmpEditBranchDetails(s)" ng-hide = "localUserListCode == 'R003' && s.ListCode == 'R003'" >
<i class="fa fa-edit" ></i>
</td>
@ -101,6 +105,18 @@
</div>
<span ng-if="myModel.finaceModuleAccess" class="success text-small block"></span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.activeStatus.$dirty && Form.activeStatus.$invalid, 'has-success':Form.activeStatus.$valid && empRoleDetail.activeStatus == true}">
<label>
Status
</label>
<div class="checkbox clip-check check-primary">
<input type="checkbox" id="checkbox7" name="activeStatus" ng-model="empEditBranchDetails.IsActive">
<label for="checkbox7">
Active Status
</label>
</div>
<!--<span ng-if="myModel.finaceModuleAccess" class="success text-small block"></span>-->
</div>
</div>
<div class="row">
<div class="col-md-12">