changed bugs, added password change

This commit is contained in:
resicovenba 2017-11-24 12:19:04 +05:30
parent d12ce07730
commit b431d01507
14 changed files with 45 additions and 41 deletions

View File

@ -63,10 +63,10 @@ class Login_Controller extends REST_Controller {
$oldPassword = $this->post('oldPassword');
$newPassword = $this->post('newPassword');
$userId = $this->post('UserId');
echo $oldPassword;
echo $newPassword;
echo $userId;
exit();
// echo $oldPassword;
// echo $newPassword;
// echo $userId;
// exit();
$date = date('Y-m-d H:i:s');
$updateOn = $date;
$changePassword = $this->login_model->change_Password( $userId, $newPassword, $oldPassword, $updateOn);// Check if the users data store contains users (in case the database result returns NULL)

View File

@ -33,6 +33,7 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com
.state('login', {
url: '/login',
template: '<div ui-view class="fade-in-right-big smooth"></div>',
resolve: loadSequence('modernizr', 'moment', 'angularMoment', 'uiSwitch', 'perfect-scrollbar-plugin', 'toaster', 'ngAside', 'vAccordion', 'sweet-alert', 'chartjs', 'tc.chartjs', 'oitozero.ngSweetAlert', 'chatCtrl'),
abstract: true
}).state('login.signin', {
url: '/signin',

View File

@ -3,7 +3,7 @@
app.controller('changePasswordCtrl', ["$scope", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', function ($scope, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie) {
$scope.myModel = {
curr: "",
password1: "",
password: "",
password2: ""
};
@ -41,30 +41,31 @@ app.controller('changePasswordCtrl', ["$scope", "$filter", "ngTableParams", "API
headers: {
'Content-Type': 'application/json'
},
params: {
data: {
oldPassword: md5.createHash($scope.myModel.curr || ''),
newPassword: md5.createHash($scope.myModel.password1 || '') ,
reqUserID: localDetails.localUserID,
newPassword: md5.createHash($scope.myModel.password || '') ,
UserId: localDetails.localUserID,
}
};
$http(req).then(function (response) {
if (response.data.status == true) {
if (response.data.changePassStatus == true) {
// SweetAlert.swal("Hello!", "Password changed Succesfully");
// $state.go($state.current, {}, { reload: true });
swal("Success!", response.data.message, "success");
form.$setPristine(true);
$scope.myModel = {
curr: "",
password1: "",
password2: ""
};
} else {
SweetAlert.swal("password Not Changed", "Please check the current password", "error");
swal("Warning!", response.data.message, "warning");
// $state.go($state.current, {}, { reload: true });
}
}, function (error) {
//error function
});
}
},
reset: function () {
}

View File

@ -52,6 +52,7 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
// load when html page load
$scope.init = function () {
if (localDetail != null) {
$scope.currentDate = new Date();
// $scope.currentPage = 1;
$scope.getEmployeeList();
$scope.getRoleList();
@ -427,9 +428,8 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
var checkDOB = $filter('date')(new Date(p.DOB), formate);
var checkDOJ = $filter('date')(new Date(p.DOJ), formate);
p.IsActive = p.IsActive === true ? 1 : 0;
p.DOB = checkDOB === "NaN-NaN-0NaN" ? p.DOB : $filter('date')(new Date(p.DOB), formate);
p.DOJ = checkDOJ === "NaN-NaN-0NaN" ? p.DOJ : $filter('date')(new Date(p.DOJ), formate);
p.DOB = checkDOB == "NaN-NaN-0NaN" ? p.DOB : $filter('date')(new Date(p.DOB), formate);
p.DOJ = checkDOJ == "NaN-NaN-0NaN" ? p.DOJ : $filter('date')(new Date(p.DOJ), formate);
var req = {
method: 'POST',
url: apiPoint.url + 'updateEmpExistDetail/',

View File

@ -4,7 +4,7 @@
* Simple table with sorting and filtering on AngularJS
*/
app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', function ($scope, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie) {
app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', "SweetAlert", function ($scope, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, SweetAlert) {
/**
* login details capture
* by : kdk
@ -66,7 +66,8 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc
localStorage.setItem('localObj', JSON.stringify($scope.localStore));
$state.go('app.dashboard');
} else {
alert(response.data.message);
// alert(response.data.message);
swal("Warning!", response.data.message, "warning");
$scope.show = true;
$(".alert").delay(200).addClass("in").fadeOut(3500);
}

View File

@ -58,7 +58,7 @@
</tr>
</thead>
<tbody dir-paginate="p in activityInfo|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:5">
<tbody dir-paginate="p in activityInfo|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.ListCode}}</td>
<td>{{p.ListName}}</td>
@ -77,7 +77,7 @@
</tbody>
</table>
<dir-pagination-controls max-size="5" direction-links="true" boundary-links="true">
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>
</div>

View File

@ -86,7 +86,7 @@
</th>
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:5">
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.BranchCode}}</td>
<td>{{p.BranchName}}</td>
@ -110,7 +110,7 @@
</table>
</fieldset>
<dir-pagination-controls max-size="5" direction-links="true" boundary-links="true">
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>

View File

@ -130,7 +130,7 @@
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|filter:search2:strict|itemsPerPage:5">
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|filter:search2:strict|itemsPerPage:10">
<tr>
<td><a href="#" class="text-orange" ng-click="setEditId(p);">{{p.TrackingID}}</a></td>
<td>{{p.followupDetails }}</td>
@ -140,9 +140,9 @@
<td>{{p.CourseName }}</td>
<td>{{p.ListName}}</td>
<td>{{p.Firstname}}</td>
<td ng-if="p.StatusCode=='S001'"><a href="#" class="text-orange" ng-click="setEditId(p);"><b class="fa fa-hover fa-phone " aria-hidden="true"></b>
<td ng-if="p.StatusCode=='S001'"><a href="#" class="text-orange" ng-click="setEditId(p);" title="Open"><b class="fa fa-hover fa-phone " aria-hidden="true"></b>
</a></td>
<td ng-if="p.StatusCode!='S001'"><a href="#" class="text-green" ng-click="setEditId(p);"><b class="fa fa-hover fa-phone " style="display: inline-block;
<td ng-if="p.StatusCode!='S001'"><a href="#" class="text-green" ng-click="setEditId(p);" title="Close"><b class="fa fa-hover fa-phone " style="display: inline-block;
border-radius: 60px;
box-shadow: 0px 0px 2px green;
padding: 0.5em 0.6em;" aria-hidden="true"></b>
@ -152,7 +152,7 @@
</tbody>
</table>
<dir-pagination-controls max-size="5" direction-links="true" boundary-links="true">
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</fieldset>

View File

@ -41,7 +41,7 @@
<label class="control-label">
Current Password <span class="symbol required"></span>
</label>
<input type="password" placeholder="Enter a Password" class="form-control" name="passwords" ng-model="myModel.curr" ng-min-length="8"
<input type="password" placeholder="Enter a Current Password" class="form-control" name="passwords" ng-model="myModel.curr" ng-min-length="8"
required/>
<span class="error text-small block" ng-if="Form.passwords.$dirty && Form.passwords.$error.required">Password is required.</span>
<span class="error text-small block" ng-if="Form.password.$error.minlength">Enter at least 8 characters</span>

View File

@ -75,7 +75,7 @@
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:5">
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.CourseID}}</td>
<td>{{p.CourseName}}</td>
@ -100,7 +100,7 @@
</tbody>
</table>
<dir-pagination-controls max-size="5" direction-links="true" boundary-links="true">
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</fieldset>
</div>

View File

@ -249,7 +249,7 @@
<input type="text" tabindex="9" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="p.DOB"
is-open="startOpen" ng-init="startOpen = false" name="dateofbirth" datepicker-options="dateOptions"
placeholder="Select Date of Birth" close-text="Close" required="required"
ng-change="getMaxEndDate(myModel.startDate)" />
ng-change="getMaxEndDate(myModel.startDate)" max-date="currentDate"/>
<span class="error text-small block" ng-if="Form.dateofbirth.$dirty && Form.dateofbirth.$invalid" ng-hide="Form.dateofbirth.$error.maxlength">Date of Birth is required.</span>
@ -261,7 +261,7 @@
<div class="row">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.gender.$dirty && Form.gender.$invalid , 'has-success':Form.gender.$valid}">
<label class="block">
Gender
Gender <span class="symbol required"></span>
</label>
<div class="clip-radio radio-primary">
<input type="radio" id="female" name="gender" value="female" ng-model="p.Gender" required>
@ -325,10 +325,10 @@
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.address1.$dirty && Form.address1.$invalid}">
<label>
Permenent Address
Permanent Address
</label>
<textarea placeholder="Enter Permenent Address" tabindex="15" class="form-control textdsc" name="address1" ng-model="p.PermanentAddress"></textarea>
<span class="error text-small block" ng-if="Form.address1.$dirty && Form.address1.$invalid">Permenent Address is required</span>
<span class="error text-small block" ng-if="Form.address1.$dirty && Form.address1.$invalid">Permanent Address is required</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.address2.$dirty && Form.address2.$invalid}">
<label>

View File

@ -96,7 +96,7 @@
</th>
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:5">
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.StaffID}}</td>
<td>{{p.Firstname}}</td>
@ -118,7 +118,7 @@
</tbody>
</table>
<dir-pagination-controls max-size="5" direction-links="true" boundary-links="true">
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>
@ -265,7 +265,8 @@
<input type="text" tabindex="9" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofbirth"
is-open="startOpen" ng-init="startOpen = true" name="dateofbirth" datepicker-options="dateOptions"
placeholder="Select Date of Birth" close-text="Close" required="required"
ng-change="getMaxEndDate(myModel.startDate)" />
ng-change="getMaxEndDate(myModel.startDate)" max-date="currentDate" />
<span class="error text-small block" ng-if="Form.dateofbirth.$dirty && Form.dateofbirth.$invalid" ng-hide="Form.dateofbirth.$error.maxlength">Date of Birth is required.</span>
<span class="error text-small block" ng-if="Form.dateofbirth.$error.maxlength">Enter a Valid Date of Birth</span>
@ -276,7 +277,7 @@
<div class="row">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.gender.$dirty && Form.gender.$invalid , 'has-success':Form.gender.$valid}">
<label class="block">
Gender
Gender <span class="symbol required"></span>
</label>
<div class="clip-radio radio-primary">
<input type="radio" tabindex="10" id="female" name="gender" value="female" ng-model="myModel.gender" required>
@ -340,10 +341,10 @@
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.address1.$dirty && Form.address1.$invalid}">
<label>
Permenent Address
Permanent Address
</label>
<textarea placeholder="Enter Permenent Address" tabindex="15" class="form-control textdsc" name="address1" ng-model="myModel.address1"></textarea>
<span class="error text-small block" ng-if="Form.address1.$dirty && Form.address1.$invalid">Permenent Address is required</span>
<span class="error text-small block" ng-if="Form.address1.$dirty && Form.address1.$invalid">Permanent Address is required</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.address2.$dirty && Form.address2.$invalid}">
<label>

View File

@ -167,11 +167,11 @@
My Messages (3)
</a>
</li>-->
<!--<li>
<li>
<a ui-sref="app.changePassword" translate="topbar.user.CHANGEPASSWORD">
Change Password
</a>
</li>-->
</li>
<li>
<a ng-click="logOut()" translate="topbar.user.LOGOUT">
Log Out

View File

@ -60,7 +60,7 @@
</th>
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:5">
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.UniversityID}}</td>
<td>{{p.UniversityShortName}}</td>
@ -77,7 +77,7 @@
</tbody>
</table>
<dir-pagination-controls max-size="5" direction-links="true" boundary-links="true">
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>