From 4d09990c9c79b1ff41872cdbf7e69b4a198bc94b Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Thu, 10 Jan 2019 11:40:46 +0530 Subject: [PATCH] alert check --- Apollo/assets/js/controllers/loginCtrl.js | 30 ++++++++++++++++++----- Apollo/assets/views/login_login.html | 12 +++------ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Apollo/assets/js/controllers/loginCtrl.js b/Apollo/assets/js/controllers/loginCtrl.js index a850c1c2..df45ba94 100755 --- a/Apollo/assets/js/controllers/loginCtrl.js +++ b/Apollo/assets/js/controllers/loginCtrl.js @@ -26,7 +26,8 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc $scope.form = { submit: function (form) { - // alert('in'); + // alert($scope.Empcheck); + var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -94,9 +95,13 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc } else { // alert(response.data.message); + if($scope.Empcheck == false) + { + swal("Warning!", response.data.message, "warning"); + } $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.OTP_or_PWD = 0; $scope.checkMobileNumber = function (MobileNumber) { //alert($scope.myModel.userMobile); // var studentNumber = $scope.myModel.userMobile; + // alert(MobileNumber); + + $scope.OTP_or_PWD = MobileNumber; + var otpcheck= MobileNumber; if($scope.myModel.userMobile !=''){ // 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} }; $http(req).then(function(response){ - //console.log(response); - swal.close(); + //alert(otpcheck); + +//console.log(response) + if(otpcheck == undefined) + { + swal.close(); + } if((response.data.loginstudent ==true)||(response.data.loginemployee ==true)){ - console.log('if'); + //console.log('if'); if(response.data.checkstudent == true) { $scope.typeInput = 'text'; @@ -182,9 +197,12 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc else { + if(otpcheck != undefined) + { swal("Warning!", response.data.message, "warning"); $scope.show = true; - // $(".alert").delay(200).addClass("in").fadeOut(3500); + $(".alert").delay(200).addClass("in").fadeOut(3500); + } } }else{ $scope.typeInput = 'password'; diff --git a/Apollo/assets/views/login_login.html b/Apollo/assets/views/login_login.html index 48e20d42..4a37cc7f 100755 --- a/Apollo/assets/views/login_login.html +++ b/Apollo/assets/views/login_login.html @@ -219,7 +219,7 @@ /*overflow:visible !important;*/ } .bgheight{ - height: 300px; + height: 370px; background: rgba(15, 19, 162, 0.51);; /*background: -webkit-linear-gradient(to left, #00ff80 , #FFFF00); background: linear-gradient(to left, #00ff80 , #FFFF00); */ @@ -336,7 +336,7 @@