alert check

This commit is contained in:
venbatechnologies@gmail.com 2019-01-10 11:40:46 +05:30
parent b73c6674f7
commit 4d09990c9c
2 changed files with 27 additions and 15 deletions

View File

@ -26,7 +26,8 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc
$scope.form = { $scope.form = {
submit: function (form) { submit: function (form) {
// alert('in'); // alert($scope.Empcheck);
var firstError = null; var firstError = null;
if (form.$invalid) { if (form.$invalid) {
var field = null, firstError = null; var field = null, firstError = null;
@ -94,9 +95,13 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc
} else { } else {
// alert(response.data.message); // alert(response.data.message);
if($scope.Empcheck == false)
{
swal("Warning!", response.data.message, "warning"); swal("Warning!", response.data.message, "warning");
}
$scope.show = true; $scope.show = true;
//$(".alert").delay(200).addClass("in").fadeOut(3500); $(".alert").delay(200).addClass("in").fadeOut(3500);
} }
}); });
} }
@ -137,10 +142,15 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc
*/ */
$scope.Empcheck = false; $scope.Empcheck = false;
$scope.OTP_or_PWD = 0;
$scope.checkMobileNumber = function (MobileNumber) { $scope.checkMobileNumber = function (MobileNumber) {
//alert($scope.myModel.userMobile); //alert($scope.myModel.userMobile);
// var studentNumber = $scope.myModel.userMobile; // var studentNumber = $scope.myModel.userMobile;
// alert(MobileNumber);
$scope.OTP_or_PWD = MobileNumber;
var otpcheck= MobileNumber; var otpcheck= MobileNumber;
if($scope.myModel.userMobile !=''){ if($scope.myModel.userMobile !=''){
// swal({ // swal({
@ -156,11 +166,16 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc
data:{mobilenum:$scope.myModel.userMobile,otpcheck:otpcheck,pwd:$scope.myModel.passwordemp} data:{mobilenum:$scope.myModel.userMobile,otpcheck:otpcheck,pwd:$scope.myModel.passwordemp}
}; };
$http(req).then(function(response){ $http(req).then(function(response){
//console.log(response); //alert(otpcheck);
swal.close();
//console.log(response)
if(otpcheck == undefined)
{
swal.close();
}
if((response.data.loginstudent ==true)||(response.data.loginemployee ==true)){ if((response.data.loginstudent ==true)||(response.data.loginemployee ==true)){
console.log('if'); //console.log('if');
if(response.data.checkstudent == true) if(response.data.checkstudent == true)
{ {
$scope.typeInput = 'text'; $scope.typeInput = 'text';
@ -182,9 +197,12 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc
else else
{ {
if(otpcheck != undefined)
{
swal("Warning!", response.data.message, "warning"); swal("Warning!", response.data.message, "warning");
$scope.show = true; $scope.show = true;
// $(".alert").delay(200).addClass("in").fadeOut(3500); $(".alert").delay(200).addClass("in").fadeOut(3500);
}
} }
}else{ }else{
$scope.typeInput = 'password'; $scope.typeInput = 'password';

View File

@ -219,7 +219,7 @@
/*overflow:visible !important;*/ /*overflow:visible !important;*/
} }
.bgheight{ .bgheight{
height: 300px; height: 370px;
background: rgba(15, 19, 162, 0.51);; background: rgba(15, 19, 162, 0.51);;
/*background: -webkit-linear-gradient(to left, #00ff80 , #FFFF00); /*background: -webkit-linear-gradient(to left, #00ff80 , #FFFF00);
background: linear-gradient(to left, #00ff80 , #FFFF00); */ background: linear-gradient(to left, #00ff80 , #FFFF00); */
@ -336,7 +336,7 @@
<div class="row" id="home"> <div class="row" id="home">
<!-- Start: View Of Announcement --> <!-- Start: View Of Announcement -->
<div class="main-login col-xs-11 col-sm-9 col-md-8"> <div class="main-login col-xs-11 col-sm-9 col-md-8">
<div class="container-fluid container-fullw bglogin" style="height:300px;" data-ng-init="init()"> <div class="container-fluid container-fullw bglogin" style="height:370px;" data-ng-init="init()">
<div class="row"> <div class="row">
<div class="col-sm-12 col-xs-12" style="margin-top: -17px;"> <div class="col-sm-12 col-xs-12" style="margin-top: -17px;">
<carousel interval="myInterval"> <carousel interval="myInterval">
@ -393,7 +393,7 @@
<div class="form-group" ng-if="Empcheck"> <div class="form-group" ng-if="Empcheck">
<button class="btn btn-success btn" ng-click="checkMobileNumber(1);" tabindex="8"> <button class="btn btn-success" ng-click="checkMobileNumber(1);" tabindex="8">
Generate OTP Generate OTP
</button> </button>
</div> </div>
@ -401,12 +401,6 @@
<div class="form-group" ng-class="{'has-error':Form.password.$dirty && Form.password.$invalid, 'has-success':Form.password.$valid}"> <div class="form-group" ng-class="{'has-error':Form.password.$dirty && Form.password.$invalid, 'has-success':Form.password.$valid}">
<span class="input-icon"> <span class="input-icon">