student login restriction by super admin : kdk

This commit is contained in:
dineshkumarkannan 2018-04-06 16:58:51 +05:30
parent d5df8bff81
commit 7e0d5d730b
4 changed files with 28 additions and 5 deletions

View File

@ -435,6 +435,7 @@ class Student_Controller extends REST_Controller {
$req['DeactiveComments'] = $data['IsActive'] == 1 ? '': $data['DeactiveComments'];
$req['IsActive'] = $data['IsActive'];
$req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0";
$req['UpdatedBy'] = $updatedBy;
$date = date('Y-m-d H:i:s');
@ -495,8 +496,10 @@ class Student_Controller extends REST_Controller {
$req['ProfilePicPath'] = $data['ProfilePicPath'];
$req['Comments'] = $data['Comments'];
$req['DeactiveComments'] = $data['IsActive'] == 1 ? '': $data['DeactiveComments'];
$req['IsActive'] = $data['IsActive'] == 1 ? "1" : "0";
$req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0";
$req['UpdatedBy'] = $updatedBy;
$date = date('Y-m-d H:i:s');

View File

@ -79,21 +79,26 @@ class Login_model extends CI_Model
}
}
else if($loginDetails->ListCode == STUDENT){
$this->db->select('LO.MobileNumber, LO.ListCode, LO.ID,ST.BranchCode');
$this->db->select('LO.MobileNumber, LO.ListCode, LO.ID,ST.BranchCode, ST.LoginAccess');
$this->db->from('' . LOGIN . ' as LO');
$this->db->join('' . STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID');
$this->db->where('LO.MobileNumber', $mobile);
$this->db->where('ST.IsActive', 1);
$responseDetails = $this->db->get()->first_row();
if($responseDetails){
$result['loginStatus'] = true;
$result['details'] = $responseDetails;
if($responseDetails->LoginAccess == 1){
$result['loginStatus'] = true;
$result['details'] = $responseDetails;
} else {
$result['loginStatus'] = false;
$result['message'] = "Your login is de-activated.";
}
}
else{
$result['loginStatus'] = false;
$result['message'] = "Your login is de-activated.";
}
}
else{
$result['loginStatus'] = false;

View File

@ -2884,10 +2884,11 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl
} else {
// alert(p.DOB);
var idProof = $scope.filesEdit[0];
$scope.editSaveButtonDisable = true;
$scope.editSaveButtonDisable = true;
var formate = "dd-MM-yyyy";
var checkDOB = $filter('date')(new Date(p.DOB), formate);
p.IsActive = p.IsActive === true ? 1 : 0;
p.LoginAccess = p.LoginAccess === true ? 1 : 0;
p.DOB = p.DOB == hidedob ? p.DOB : $filter('date')(new Date(p.DOB), formate);
if (idProof == undefined) {

View File

@ -412,6 +412,20 @@
<span class="error text-small block" ng-if="Form.DeactiveComments.$dirty && Form.DeactiveComments.$invalid">De-Active Comments is required</span>
</div>
</div>
<div class="row" ng-if="localUserType == 'R004'">
<div class="col-md-4 form-group">
<label>
Login Access Status
</label>
<div ng-if="p.LoginAccess==1">
<switch ng-model="p.LoginAccess" ng-init="p.LoginAccess = true" class="green"></switch>
</div>
<div ng-if="p.LoginAccess==0">
<switch ng-model="p.LoginAccess" ng-init="p.LoginAccess = false" class="green"></switch>
</div>
<!--<span ng-if="myModel.finaceModuleAccess" class="success text-small block"></span>-->
</div>
</div>
<!--<pre>{{ p | json}}</pre>-->
<input type="hidden" ng-init="hidden_DOB=p.DOB" ng-model="hidden_DOB">
<div class="row">