// create the module and name it scotchApp var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); // configure our routes scotchApp.config(function($routeProvider) { $routeProvider // route for the Home page .when('/', { templateUrl: 'pages/Home.html', controller: 'mainController' }) // route for the registration page .when('/registration', { templateUrl: 'pages/registration.html', controller: 'mainController' }) // route for the paymentVerify page .when('/pendingPayment/:id', { templateUrl: 'pages/verify.html', controller: 'verifyController' }) // route for the ambassador page .when('/startupJalsaPromocode', { templateUrl: 'pages/ambassador.html', controller: 'ambassadorController' }) // route for the confirmation page .when('/confirmation', { templateUrl: 'pages/confirmation.html', controller: 'mainController' }) }); scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { // Add configuration code as desired AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code // Track all routes (default is true). AnalyticsProvider.trackPages(true); // Track all URL query params (default is false). AnalyticsProvider.trackUrlParams(true); }]).run(['Analytics', function(Analytics) { }]); scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/v1") //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") // create the controller and inject Angular's $scope scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { $scope.data = { show: true, hide: false }; var maininvest = new Date("Nov 30, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = maininvest - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("maininvest").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { // $scope.extendedAmount = clearInterval(x); document.getElementById("maininvest").innerHTML = "EXPIRED"; } }, 1000); var pune = new Date("Nov 11, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = pune - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("pune").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("pune").innerHTML = "EXPIRED"; } }, 1000); var mumbai = new Date("Nov 13, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = mumbai - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("mumbai").innerHTML = "EXPIRED"; } }, 1000); var ahmedabad = new Date("Nov 13, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = ahmedabad - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("ahmedabad").innerHTML = "EXPIRED"; } }, 1000); var jaipur = new Date("Nov 15, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = jaipur - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("jaipur").innerHTML = "EXPIRED"; } }, 1000); var bangalore = new Date("Nov 21, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = bangalore - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("bangalore").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("bangalore").innerHTML = "EXPIRED"; } }, 1000); var hyderabad = new Date("Nov 19, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = hyderabad - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("hyderabad").innerHTML = "EXPIRED"; } }, 1000); var delhi = new Date("Nov 27, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = delhi - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("delhi").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("delhi").innerHTML = "EXPIRED"; } }, 1000); var chandigarh = new Date("Nov 30, 2017 12:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = chandigarh - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); $scope.timer = days + "d " + hours + "h " + minutes + "m " + seconds + "s " // Output the result in an element with id="demo" document.getElementById("chandigarh").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("chandigarh").innerHTML = "EXPIRED"; } }, 1000); $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ // $scope.Textshow = "yes" $scope.max = 100; $scope.formPage = false; $scope.current = 0; $scope.payingAmnt = 0; if ($scope.data.stage == 'select') { } //$scope.author = 'Swarn Singh'; $scope.data = {}; $scope.data.stage = 'Idea'; $scope.discountAmount = 0; $scope.check = false; $scope.numberCheck = false; $scope.paymentResult = {}; var data = { "amount": $scope.payingAmnt, "currency": "INR", "status": "pending" } /*open videos in modal*/ // $scope.openyoutube16 = function(){ // $('#videoModel').modal('show'); // } // $scope.openyoutube17 = function(){ // $('#videoModels').modal('show'); // } // $scope.closeModal = function(){ // var url = $('#youtubePlayer').attr('src'); // $('#youtubePlayer').attr('src', ''); // $('#youtubePlayer').attr('src', url); // } // $scope.closed = function(){ // var url = $('#youtubePlayersss').attr('src'); // $('#youtubePlayersss').attr('src', ''); // $('#youtubePlayersss').attr('src', url); // } /*open videos ends here*/ $scope.apply = function() { Analytics.trackEvent('register', 'click', 'Registration'); $location.path("/registration") } $scope.data.citymeetup = ''; $scope.register = function(value){ $scope.data.citymeetup = value; if (value == 'mainevent') { $scope.eventType = true; $scope.mainType = false; $scope.data.stage = null; } else{ $scope.eventType = false; $scope.mainType = true; } $('.hiddenForm').slideDown(); $('html, body').animate({ scrollTop: $('.hiddenForm').offset().top }, 1000); console.log('gdggsg', value); } $scope.removeError = function() { $('#invalidEmail').css('display', 'none'); $('#alreadyExist').css('display', 'none'); }; $scope.emailcheck = function(val) { console.log(val) $scope.space = /\s/g.test(val); console.log("space",$scope.space) if (val == undefined) { $('#invalidEmail').css('display', 'block'); } else { $http({ method: 'GET', url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', headers: {} }).then(function mySuccess(searchResult) { console.log("searchResult1===>", searchResult) if (searchResult.data.length == 0) { $scope.check = false; } else { $scope.check = true; $scope.emailId = searchResult.data[0].id $('#alreadyExist').css('display', 'block'); } console.log("$scope.data.id",searchResult.data) }, function myError(error) {}); } }; $scope.removeNoError = function() { $('#noExist').css('display', 'none'); }; $scope.numbercheck = function(number) { $http({ method: 'GET', url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}', data: $scope.data, headers: {} }).then(function mySuccess(searchResult) { console.log("searchResult===>", searchResult) if (searchResult.data.length == 0) { $scope.numberCheck = false; } else { $scope.numberCheck = true; $('#noExist').css('display', 'block'); } }, function myError(error) {}); }; $rootScope.tokenCall = function(val) { console.log('val-------->', val); if (val == undefined) { $('#invalidToken').css('display', 'block'); } else { val = val.toUpperCase(); $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}') .then(function(searchResult) { console.log("searchResult",searchResult) if (searchResult.data.length == 0) { $scope.tokencheck = false; $scope.discountAmount = 0; } else { $scope.discountpercentage = searchResult.data[0].discount; $scope.tokencheck = true; } },function(err){ console.log(err) }); } }; /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ $(document).ready( function() { $('input:submit').attr('disabled', true); $('input:file').change( function() { if ($("#picture").val()) { $('input:submit').removeAttr('disabled'); } else { $('input:submit').attr('disabled', true); } }); }); /*****THIS IS FOR STEP ONE FORM ******/ // $scope.next = function() { // $scope.data.status = null // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { // var x = document.getElementById("snackbar") // x.className = "show"; // setTimeout(function() { // x.className = x.className.replace("show", ""); // }, 3000); // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { // $scope.infoForm = true; // console.log("sdasdasdsa"); // $scope.data.stage = $scope.data.stage; // $scope.detail = {}; // $scope.data.phone = "+91" + $scope.data.number; // $http({ // method: 'POST', // url: BASE_URL + '/information', // data: $scope.data, // headers: {} // }).then(function mySuccess(result) { // Analytics.trackEvent('information', 'click', 'django.mp4'); // console.log("result", result) // $scope.detail = result; // data.applicantId = result.data.id; // $scope.userId = result.data.id; // }, function myError(error) {}); // } // } $scope.calculateAmount = function(){ if($scope.tokencheck == false){ $scope.data.referalToken = null; } if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { var x = document.getElementById("snackbar") x.className = "show"; setTimeout(function() { x.className = x.className.replace("show", ""); }, 3000); } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { $scope.infoForm = true; console.log("sdasdasdsa"); $scope.data.stage = $scope.data.stage; $scope.detail = {}; $scope.data.phone = "+91" + $scope.data.number; $http({ method: 'POST', url: BASE_URL + '/applicants', data: $scope.data, headers: {} }).then(function mySuccess(result) { Analytics.trackEvent('applicants', 'click','Users'); console.log("result", result) $scope.detail = result; data.applicantId = result.data.id; //$scope.userId = result.data.id; if($scope.data.citymeetup == "pune"){ if ($scope.data.stage == "Idea") { console.log("$scope.data", $scope.data) $scope.ticketAmnt = 700; } if ($scope.data.stage == "Product") { $scope.ticketAmnt = 1400; } if ($scope.data.stage == "Growth") { $scope.ticketAmnt = 1400; } } else if($scope.data.citymeetup == "mainevent"){ // if ($scope.data.stage == '') { console.log("$scope.data", $scope.data) $scope.ticketAmnt = 5000; // } // if ($scope.data.stage == "Product") { // $scope.ticketAmnt = 1500; // } // if ($scope.data.stage == "Growth") { // $scope.ticketAmnt = 1500; // } } else{ if ($scope.data.stage == "Idea") { console.log("$scope.data", $scope.data) $scope.ticketAmnt = 500; } if ($scope.data.stage == "Product") { $scope.ticketAmnt = 1000; } if ($scope.data.stage == "Growth") { $scope.ticketAmnt = 1000; } } // if ($scope.data.stage == "Visitor") { // $scope.ticketAmnt = 500; // } var amount = $scope.ticketAmnt * 100 if($scope.tokencheck == true){ var amount = $scope.ticketAmnt $scope.discountAmount = (amount * $scope.discountpercentage)/100 console.log("finalAmount====>",$scope.discountAmount) } var taxAmount = $scope.ticketAmnt - $scope.discountAmount console.log("$scope.taxTotal----",taxAmount) $scope.taxTotal = (taxAmount * 18)/100 $scope.payingAmnt = taxAmount + $scope.taxTotal console.log("taxincludedamount----", $scope.payingAmnt) console.log("$scope.taxTotal----", $scope.taxTotal) // } /*****THIS IS FOR STEP THREE FORM ******/ // $scope.create = function() { // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { // var x = document.getElementById("snackbar") // x.className = "show"; // setTimeout(function() { // x.className = x.className.replace("show", ""); // }, 3000); // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { // $scope.infoForm = true; // console.log("sdasdasdsa"); // $scope.data.stage = $scope.data.stage; // $scope.detail = {}; // $scope.data.phone = "+91" + $scope.data.number; // $http({ // method: 'POST', // url: BASE_URL + '/applicants', // data: $scope.data, // headers: {} // }).then(function mySuccess(result) { // console.log("=====result=====", result) // $scope.detail = result; // data.applicantId = result.data.id; // $scope.userId = result.data.id; // console.log("=====data=====", data) // data.amount = $scope.payingAmnt + $scope.taxTotal; data.amount = $scope.payingAmnt; console.log("$scope.taxTotal",data.amount) if ($scope.detail != null) { $http({ method: 'POST', url: BASE_URL + '/payments', data: data, headers: {} }).then(function mySuccess(paymentResult) { console.log("paymentResult",paymentResult) $scope.paymentResult = paymentResult; }, function myError(error) {}); } var i = 0; //$scope.payingAmnt = ($scope.payingAmnt + $scope.taxTotal) * 100; $scope.payingAmnt = $scope.payingAmnt * 100; console.log("$scope.taxTotal----", $scope.payingAmnt) var options = { "key": "rzp_live_mhSE1uOBlXvFyJ", //"key": "rzp_test_YwHsVFiDIQ2WUQ", "amount": $scope.payingAmnt , "name": "Startup Jalsa", "description": "amount", "currency": "INR", "status": "done", "theme": { "color": "#2196f3 ", "image_padding": "NO" }, "modal": { "ondismiss": function() {} }, "handler": function(response) { createPayment(response); } }; var rzp1 = new Razorpay(options); rzp1.open(); $scope.paymentResponse = {}; function createPayment(response) { console.log("response====from===razorpay",response) $route.reload(); $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; $scope.paymentResponse.amount = data.amount; $scope.paymentResponse.currency = "INR"; $scope.paymentResponse.status = $scope.paymentResult.data.status; Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount); $http({ method: 'PUT', url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, data: $scope.paymentResponse, headers: {} }).then(function mySuccess(searchResult) { // if(paymentResult.data.status == "created"){ // } console.log("searchResult", searchResult) $location.path("/confirmation") //$scope.showToastr() //toaster.success("Registration done successfully"); }, function myError(error) {}); } }, function myError(error) {}); } } //}, function myError(error) {}); //} //} // $scope.showToastr = function() { // console.log("called toast") // var x = document.getElementById("snacsskbar") // x.className = "show"; // setTimeout(function() { // x.className = x.className.replace("show", ""); // }, 3000); // } /*kk***This code for change data when click to chooses stages***/ $scope.proto = true; $scope.businessmodel = true; $scope.Idea = true; $scope.current = true; $scope.stage = function(stage) { $scope.stagekeyPress(); console.log("stage--2",stage) if (stage == 'Idea') { $scope.Productshow = "no"; $scope.current = 10; $scope.proto = true; // $scope.visitType = true; $scope.prototyp = false; $scope.protyp = false; $scope.market = false; $scope.risks = false; $scope.team = false; $scope.pitch = false; $scope.financials = false; $scope.businessmodel = true; $scope.data.stage = stage; // for right content $scope.Idea = true; $scope.Product = false; $scope.Growth = false; // $scope.Visitor = false; } else if (stage == 'Product') { $scope.Productshow = "no"; $scope.current = 10; $scope.proto = true; // $scope.visitType = true; $scope.prototyp = true; $scope.protyp = true; $scope.market = true; $scope.risks = true; $scope.team = true; $scope.pitch = true; $scope.financials = true; $scope.businessmodel = false; $scope.data.stage = stage; // for right content $scope.Idea = false; $scope.Product = true; $scope.Growth = false; // $scope.Visitor = false; } else if (stage == 'Growth') { $scope.Productshow = "yes"; $scope.current = 10; $scope.proto = false; // $scope.visitType = true; $scope.prototyp = true; $scope.protyp = false; $scope.market = true; $scope.risks = true; $scope.team = true; $scope.pitch = true; $scope.financials = true; $scope.businessmodel = false; // for right content $scope.Idea = false; $scope.Product = false; $scope.Growth = true; // $scope.Visitor = false; // } else if (stage == 'Visitor') { // $scope.Productshow = "no"; // $scope.current = 10; // $scope.proto = false; // $scope.visitType = false; // $scope.prototyp = false; // $scope.protyp = false; // $scope.market = false; // $scope.risks = false; // $scope.team = false; // $scope.pitch = false; // $scope.financials = false; // $scope.businessmodel = false; // $scope.data.stage = stage; // // for right content // $scope.Idea = false; // $scope.Product = false; // $scope.Growth = false; // $scope.Visitor = true; $scope.data.stage = stage; } } $scope.emailTest = function(s){ $scope.space = /\s/g.test(s.delegateTarget.value); console.log("space",$scope.space) } // $scope.enterbusiness = function(business) { // console.log("business", business); // if (name == undefined) { // $scope.current = false; // } else if (name != undefined) { // $scope.current = true; // } // } /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ $scope.stagekeyPress = function() { $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); } $scope.sectorkeyPress = function() { $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); } $scope.productLaunchkeyPress = function() { $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); } $scope.launchPeriodkeyPress = function() { $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)'); } $scope.industrykeyPress = function() { $scope.addOther = false; $scope.hideSelectBox = true; $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)'); var e = document.getElementById("dataIndustry"); var dataIndustry = e.options[e.selectedIndex].value; if(dataIndustry == "others") { $scope.addOther = true; $scope.hideSelectBox = false; } } $scope.industryNamekeyPress = function(firstName) { console.log("lastName==", firstName); if (firstName == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); } } $scope.amountkeyPress = function() { $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)'); } $scope.firstNamekeyPress = function(name) { console.log("lastName==", name); if (name == undefined) { $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); } } $scope.emailkeyPress = function(email) { console.log("email", email); if (email == undefined) { $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); } } $scope.textCheck = function(){ console.log("Val1:::", $scope.textCheck); var e = document.getElementById("fundingDiv"); var funding = e.options[e.selectedIndex].value; $scope.Textshow = "no"; if(funding == "yes") { $scope.Textshow = "yes"; console.log("Val:::", $scope.Textshow); } } $scope.productCheck = function(){ console.log("Val2:::", $scope.productCheck); var e = document.getElementById("productDiv"); var product = e.options[e.selectedIndex].value; $scope.Productshow = "no"; if(product == "yes") { $scope.Productshow = "yes"; console.log("Val1:::", $scope.Productshow); } } $scope.phonekeyPress = function(number) { console.log("number", number); if (number == undefined || number == '') { $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); } } $scope.citykeyPress = function(city) { console.log("city", city); if (city == undefined) { $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); } } $scope.startupNamekeyPress = function(q) { if (q == undefined) { $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); } } $scope.linkedInkeyPress = function(technology) { if (technology == undefined || technology == '') { $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); } } $scope.companykeyPress = function(problem) { if (problem == undefined) { $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); } } $scope.productNamekeyPress = function(solution) { if (solution == undefined) { $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); } } $scope.businesskeyPress = function(business) { $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); } $scope.websitekeyPress = function(prototype) { if (prototype == undefined || prototype == '') { $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); } } $scope.employeekeyPress = function(market) { if (market == undefined || market == '') { $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); } } $scope.annualkeyPress = function(risk) { if (risk == undefined || risk == '') { $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); } } $scope.revenuekeyPress = function(team) { if (team == undefined || team == '') { $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); } } $scope.descriptionkeyPress = function(pitch) { if (pitch == undefined) { $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); } } $scope.discountkeyPress = function(discount) { console.log("lastName==", name); if (discount == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); } } $scope.removeNooError = function() { $('#invalidIdea').css('display', 'block'); $('#noExist').css('display', 'none'); }; $scope.ideakeyPress = function(financial) { console.log("financial", financial); if (financial == undefined) { $('#invalidIdea').css('display', 'block'); $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); } else { $('#invalidIdea').css('display', 'none'); $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); } } $scope.fundkeyPress = function(financial) { console.log("financial", financial); if (financial == undefined) { $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)'); } } $scope.changeReferalIconColor = function(referalToken){ if (referalToken == undefined || referalToken == '') { $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); }else { $('.referel-icon').css('background-color', 'rgb(66, 181, 73)'); } } }); scotchApp.controller('verifyController', function($scope, $http, $location, $route, BASE_URL, Analytics) { $scope.pendingPaymentId = $route.current.params.id $http({ method: "GET", url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, }).then(function mySuccess(response) { $scope.data = response.data; console.log("response-1", response); $scope.pendingPaymentId = $route.current.params.id; $http({ method: "GET", url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', }).then(function mySuccess(response) { $scope.paymentRecord = response.data; }, function myError(response) { console.log("response-2", response); }); }, function myError(response) { $scope.myWelcome = response.statusText; }); $scope.checkView = false; $scope.verifyView = false; $scope.searchResult = {} $scope.pendingPaymentId = ''; $scope.update = function() { $http({ method: 'GET', url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', headers: {} }).then(function mySuccess(searchResult) { if (searchResult.data[0].status == "created") { //if (searchResult.data[0].status == "cancelled") { $scope.checkView = true; $scope.verifyView = false; $scope.amount = searchResult.data[0].amount; $scope.searchResult = searchResult.data[0]; console.log('====searchResult===', searchResult); console.log("searchResult=====",searchResult.data[0].razorOrderId) var i = 0; $scope.amount = $scope.amount * 100; var options = { "key": "rzp_live_mhSE1uOBlXvFyJ", //"key" : "rzp_test_YwHsVFiDIQ2WUQ", "amount": $scope.amount, "name": "Startup Jalsa", "description": "amount", "currency": "INR", "status": "done", "theme": { "color": "#2196f3 ", "image_padding": "NO" }, "modal": { "ondismiss": function() {} }, "handler": function(response) { createPayment(response); } }; var rzp1 = new Razorpay(options); rzp1.open(); $scope.paymentResponse = {}; function createPayment(response) { console.log("response======retepaymen",response); $scope.amount = $scope.amount/100; $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; $scope.paymentResponse.amount = $scope.amount; $scope.paymentResponse.currency = $scope.searchResult.currency; $scope.paymentResponse.status = $scope.searchResult.status; $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; console.log("$scope.paymentResponse", $scope.paymentResponse) $http({ method: 'PUT', url: BASE_URL + '/payments/' + $scope.searchResult.id, data: $scope.paymentResponse, headers: {} }).then(function mySuccess(searchResult) { console.log("searchResult--->",searchResult) // if(paymentResult.data.status == "created"){ // Analytics.trackEvent('payments', 'click', 'Thankyou'); // } console.log("finalsearchResult",searchResult) $location.path("/confirmation") Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount); }, function myError(error) { }); } } else { } }, function myError(error) {}); } }); scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { $scope.data = {}; $scope.check = false; $scope.numberCheck = false; /*open videos in modal*/ $scope.openyoutube16 = function(){ $('#videoModel').modal('show'); } $scope.openyoutube17 = function(){ $('#videoModels').modal('show'); } $scope.closeModal = function(){ var url = $('#youtubePlayer').attr('src'); $('#youtubePlayer').attr('src', ''); $('#youtubePlayer').attr('src', url); } /*open videos ends here*/ $scope.removeError = function() { console.log("doooo") $('#invalidEmail').css('display', 'none'); $('#alreadyExist').css('display', 'none'); }; // $scope.emailcheck = function(val) { // consol.log("kdsbd") // $scope.space = /\s/g.test(val); // console.log("space",$scope.space) // if (val == undefined) { // $('#invalidEmail').css('display', 'block'); // } else { // $http({ // method: 'GET', // url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', // headers: {} // }).then(function mySuccess(searchResult) { // console.log("searchResult1===>", searchResult) // if (searchResult.data.length == 0) { // $scope.check = false; // } else { // $scope.check = true; // $('#alreadyExist').css('display', 'block'); // } // }, function myError(error) {}); // } // }; // $scope.removeNoError = function() { // $('#invalidNumber').css('display', 'none'); // $('#noExist').css('display', 'none'); // }; // $scope.numbercheck = function(number) { // // if (val == undefined) { // // $('#invalidNumber').css('display', 'block'); // // } else { // $http({ // method: 'GET', // url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}', // data: $scope.data, // headers: {} // }).then(function mySuccess(searchResult) { // console.log("searchResult===>", searchResult) // if (searchResult.data.length == 0) { // $scope.numberCheck = false; // } else { // $scope.numberCheck = true; // $('#noExist').css('display', 'block'); // } // }, function myError(error) {}); // //} // }; $scope.submit = function() { console.log($scope.data.name) var randomNumber = ""+Math.random(); var nameSpliced = $scope.data.name.slice(0,3); var numberSpliced = randomNumber.slice(2,5); $scope.data.referalToken = nameSpliced+numberSpliced; $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); $http({ method: 'POST', url: BASE_URL + '/ambassadors', data: $scope.data, headers: {} }).then(function mySuccess(result) { console.log("result", result) $scope.detail = result; $('#myModal').modal('show'); $scope.data.name = ''; $scope.data.email = ''; $scope.data.mobile = ''; // $scope.data.discount = ''; }, function myError(error) { console.log(error) console.log(error.data.error.message) }); console.log($scope.data) } });