diff --git a/script.js b/script.js index c730bf5..08b5fb0 100644 --- a/script.js +++ b/script.js @@ -589,6 +589,10 @@ $('#invalidToken').css('display', 'block'); } else { val = val.toUpperCase(); + if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMA99" && $scope.data.city != "Ahmedabad") || (val == "JAI40" && $scope.data.city != "Jaipur")){ + $scope.tokencheck = false; + return; + } $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') .then(function(searchResult) { console.log("searchResult",searchResult) @@ -638,9 +642,10 @@ if($scope.tokencheck == true){ var amount = $scope.ticketAmnt console.log("====$scope.discountpercentage====",$scope.discountpercentage); - if($scope.discountpercentage == "100") { - $scope.discountpercentage = "99.8"; - console.log("$scope.discountpercentage====",$scope.discountpercentage) + console.log("resultcity===",$scope.data.city) + if($scope.discountpercentage == "100") { + $scope.discountpercentage = "99.8"; + console.log("$scope.discountpercentage====",$scope.discountpercentage) } console.log("====$scope.discountpercentage====",$scope.discountpercentage); $scope.percDiscount = $scope.discountpercentage/100; @@ -718,6 +723,7 @@ }, function myError(error) { }); } + //} }, function myError(error) {