Blame view
script.js
29.9 KB
53b83aa9e
|
1 |
// create the module and name it scotchApp |
f263889f0
|
2 |
var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); |
53b83aa9e
|
3 4 |
// configure our routes |
0d7cf45ec
|
5 |
scotchApp.config(function($routeProvider,$locationProvider) { |
8586ba494
|
6 |
|
8586ba494
|
7 8 9 10 11 12 |
// use the HTML5 History API $locationProvider.html5Mode({ enabled: true, requireBase: false }); $locationProvider.hashPrefix('!'); |
6ae8d3cdd
|
13 |
$routeProvider |
dcb703070
|
14 |
// route for the Home page |
6ae8d3cdd
|
15 |
.when('/', { |
dcb703070
|
16 17 18 |
templateUrl: 'pages/Home.html', controller: 'mainController' }) |
b96c88383
|
19 |
// route for the caricatures page |
e856f2161
|
20 |
.when('/caricatures', { |
b96c88383
|
21 |
templateUrl: 'pages/caricatures.html', |
6ae8d3cdd
|
22 23 |
controller: 'mainController' }) |
857ebc69e
|
24 25 26 27 28 |
// route for the paymentVerify page .when('/pendingPayment/:id', { templateUrl: 'pages/verify.html', controller: 'verifyController' }) |
6ae8d3cdd
|
29 |
|
b96c88383
|
30 |
// route for the registration page |
bab049fb9
|
31 |
.when('/registration/:city', { |
b96c88383
|
32 33 34 |
templateUrl: 'pages/registration.html', controller: 'registrationController' }) |
8586ba494
|
35 |
//route for the ambassador page |
2aba79170
|
36 37 38 39 |
// .when('/startupJalsaPromocode', { // templateUrl: 'pages/ambassador.html', // controller: 'ambassadorController' // }) |
5348de778
|
40 41 42 43 |
// route for the confirmation page .when('/confirmation', { templateUrl: 'pages/confirmation.html', |
b96c88383
|
44 |
controller: 'registrationController' |
5348de778
|
45 |
}) |
8586ba494
|
46 47 48 |
.otherwise({ redirectTo: '/' }); |
6ae8d3cdd
|
49 |
}); |
53b83aa9e
|
50 |
|
f263889f0
|
51 52 |
scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { // Add configuration code as desired |
61b69ada0
|
53 |
AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code |
f263889f0
|
54 55 56 57 58 59 60 61 |
// Track all routes (default is true). AnalyticsProvider.trackPages(true); // Track all URL query params (default is false). AnalyticsProvider.trackUrlParams(true); }]).run(['Analytics', function(Analytics) { }]); |
124f7528f
|
62 63 |
scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") |
6ae8d3cdd
|
64 |
|
2d6a9fbea
|
65 |
// create the controller and inject Angular's $scope |
857ebc69e
|
66 |
scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) { |
6ae8d3cdd
|
67 68 69 70 |
$scope.data = { show: true, hide: false }; |
0d7cf45ec
|
71 |
var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); |
e3d25d261
|
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
// 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 = chennai - 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("chennai").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("chennai").innerHTML = "EXPIRED"; } }, 1000); |
857ebc69e
|
94 |
var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime(); |
e3d25d261
|
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
// 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); |
857ebc69e
|
117 |
var mumbai = new Date("Sept 26, 2018 14:00:00").getTime(); |
e3d25d261
|
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
// 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); |
50e8f0737
|
140 |
|
857ebc69e
|
141 |
var kolkata = new Date("Oct 3, 2018 14:00:00").getTime(); |
e3d25d261
|
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
// 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 = kolkata - 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("kolkata").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("kolkata").innerHTML = "EXPIRED"; } }, 1000); |
50e8f0737
|
164 |
|
857ebc69e
|
165 |
var jaipur = new Date("Oct 5, 2018 14:00:00").getTime(); |
e3d25d261
|
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
// 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); |
50e8f0737
|
188 |
|
857ebc69e
|
189 |
var delhi = new Date("Oct 8, 2018 14:00:00").getTime(); |
e3d25d261
|
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
// 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); |
50e8f0737
|
212 |
|
857ebc69e
|
213 |
var kanpur = new Date("Oct 10, 2018 14:00:00").getTime(); |
e3d25d261
|
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
// 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 = kanpur - 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("kanpur").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("kanpur").innerHTML = "EXPIRED"; } }, 1000); |
50e8f0737
|
236 |
|
857ebc69e
|
237 |
var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime(); |
e3d25d261
|
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
// 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); |
50e8f0737
|
260 |
|
857ebc69e
|
261 |
var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime(); |
e3d25d261
|
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
// 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 = bengaluru - 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("bengaluru").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("bengaluru").innerHTML = "EXPIRED"; } }, 1000); |
50e8f0737
|
284 |
|
857ebc69e
|
285 |
var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime(); |
e3d25d261
|
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
// 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 = dharamsala - 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("dharamsala").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("dharamsala").innerHTML = "EXPIRED"; } }, 1000); |
50e8f0737
|
308 |
|
6ae8d3cdd
|
309 |
$scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
e847b36f8
|
310 |
$scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
c62079487
|
311 |
// $scope.Textshow = "yes" |
6ae8d3cdd
|
312 |
$scope.max = 100; |
88dd26b3d
|
313 |
$scope.formPage = false; |
6ae8d3cdd
|
314 315 |
$scope.current = 0; $scope.payingAmnt = 0; |
6ae8d3cdd
|
316 |
$scope.data = {}; |
ea3c31126
|
317 |
$scope.discountAmount = 0; |
7b2bef227
|
318 |
// $scope.data.quantity = "1"; |
6ae8d3cdd
|
319 320 |
$scope.check = false; $scope.numberCheck = false; |
6ae8d3cdd
|
321 |
$scope.paymentResult = {}; |
6ae8d3cdd
|
322 323 324 325 326 |
var data = { "amount": $scope.payingAmnt, "currency": "INR", "status": "pending" } |
53b83aa9e
|
327 |
|
dcb703070
|
328 |
$scope.apply = function() { |
317a80571
|
329 |
//Analytics.trackEvent('register', 'click', 'Registration'); |
e856f2161
|
330 |
$location.path("/caricatures") |
dcb703070
|
331 |
} |
629cc1f8f
|
332 |
|
317a80571
|
333 334 335 336 |
$scope.data.city = ''; $scope.watch = function(value){ console.log("cllll",value) $scope.data.city = value; |
857ebc69e
|
337 338 339 340 341 342 343 344 345 346 |
// if($scope.data.city == "Chennai"){ // console.log("cllll1",value) // $window.location.href = 'http://35.154.24.158:8007'; // }else{ console.log("cllll2",value) localStorage.setItem("city" ,value); //$location.path('/registration').search({city: value}); $location.path('/registration/'+value+''); //$state.go('registration', { 'city': value}) // } |
163c5adae
|
347 |
} |
e847b36f8
|
348 |
|
6a9f1f41e
|
349 350 351 352 |
$scope.select = function(url){ console.log("cllll") window.open(url) } |
6ae8d3cdd
|
353 |
$scope.stagekeyPress = function() { |
f8b43c6f8
|
354 |
$('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
355 356 |
} $scope.sectorkeyPress = function() { |
f8b43c6f8
|
357 |
$('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
358 |
} |
163c5adae
|
359 |
$scope.productLaunchkeyPress = function() { |
f8b43c6f8
|
360 |
$('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
361 |
} |
163c5adae
|
362 |
$scope.launchPeriodkeyPress = function() { |
f8b43c6f8
|
363 |
$('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
364 |
} |
7b2bef227
|
365 366 |
$scope.industrykeyPress = function(quantity) { console.log("fghj",quantity) |
f8b43c6f8
|
367 |
$('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
368 |
} |
204302c02
|
369 370 371 372 373 |
$scope.industryNamekeyPress = function(firstName) { console.log("lastName==", firstName); if (firstName == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
374 |
$('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
204302c02
|
375 376 |
} } |
c62079487
|
377 |
$scope.amountkeyPress = function() { |
f8b43c6f8
|
378 |
$('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
379 |
} |
2321f803a
|
380 381 382 |
$scope.firstNamekeyPress = function(name) { console.log("lastName==", name); if (name == undefined) { |
6ae8d3cdd
|
383 384 |
$('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
385 |
$('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
386 387 |
} } |
dcb703070
|
388 |
|
6ae8d3cdd
|
389 390 391 392 393 |
$scope.emailkeyPress = function(email) { console.log("email", email); if (email == undefined) { $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
394 |
$('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); |
8ddc94e00
|
395 |
} |
6ae8d3cdd
|
396 |
} |
6ae8d3cdd
|
397 398 |
$scope.phonekeyPress = function(number) { console.log("number", number); |
204302c02
|
399 |
if (number == undefined || number == '') { |
6ae8d3cdd
|
400 401 |
$('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
402 |
$('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
403 404 405 406 407 408 409 410 |
} } $scope.citykeyPress = function(city) { console.log("city", city); if (city == undefined) { $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
411 |
$('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
412 413 |
} } |
7e3bb1018
|
414 |
$scope.startupNamekeyPress = function(q) { |
6ae8d3cdd
|
415 416 417 |
if (q == undefined) { $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
418 |
$('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
419 420 |
} } |
dcb703070
|
421 |
$scope.linkedInkeyPress = function(technology) { |
204302c02
|
422 |
if (technology == undefined || technology == '') { |
6ae8d3cdd
|
423 424 |
$('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
425 |
$('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
426 427 |
} } |
dcb703070
|
428 |
$scope.companykeyPress = function(problem) { |
6ae8d3cdd
|
429 430 431 |
if (problem == undefined) { $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
432 |
$('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
433 434 |
} } |
dcb703070
|
435 |
$scope.productNamekeyPress = function(solution) { |
6ae8d3cdd
|
436 437 438 |
if (solution == undefined) { $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
439 |
$('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
440 441 442 |
} } $scope.businesskeyPress = function(business) { |
58efec61e
|
443 444 445 446 447 |
if (business == undefined) { $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); } |
6ae8d3cdd
|
448 |
} |
dcb703070
|
449 |
$scope.websitekeyPress = function(prototype) { |
204302c02
|
450 |
if (prototype == undefined || prototype == '') { |
6ae8d3cdd
|
451 452 |
$('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
453 |
$('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
454 455 |
} } |
dcb703070
|
456 |
$scope.employeekeyPress = function(market) { |
204302c02
|
457 |
if (market == undefined || market == '') { |
6ae8d3cdd
|
458 459 |
$('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
460 |
$('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
461 462 |
} } |
dcb703070
|
463 |
$scope.annualkeyPress = function(risk) { |
204302c02
|
464 |
if (risk == undefined || risk == '') { |
6ae8d3cdd
|
465 466 |
$('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
467 |
$('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
468 469 |
} } |
dcb703070
|
470 |
$scope.revenuekeyPress = function(team) { |
81526b56d
|
471 |
if (team == undefined) { |
6ae8d3cdd
|
472 473 |
$('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
474 |
$('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
475 476 |
} } |
dcb703070
|
477 |
$scope.descriptionkeyPress = function(pitch) { |
6ae8d3cdd
|
478 479 480 |
if (pitch == undefined) { $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
481 |
$('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
482 483 |
} } |
e284785e4
|
484 |
$scope.discountkeyPress = function(discount) { |
e284785e4
|
485 486 487 |
if (discount == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
488 |
$('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
e284785e4
|
489 490 |
} } |
91eeb4455
|
491 492 493 494 |
$scope.removeNooError = function() { $('#invalidIdea').css('display', 'block'); $('#noExist').css('display', 'none'); }; |
c62079487
|
495 |
$scope.ideakeyPress = function(financial) { |
6ae8d3cdd
|
496 497 498 499 |
console.log("financial", financial); if (financial == undefined) { $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
500 |
$('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
501 502 |
} } |
c62079487
|
503 504 505 506 507 508 |
$scope.fundkeyPress = function(financial) { console.log("financial", financial); if (financial == undefined) { $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
509 |
$('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
510 511 |
} } |
2d6a9fbea
|
512 513 514 515 |
$scope.changeReferalIconColor = function(referalToken){ if (referalToken == undefined || referalToken == '') { $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); }else { |
f8b43c6f8
|
516 |
$('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); |
2d6a9fbea
|
517 518 |
} } |
6ae8d3cdd
|
519 |
|
53b83aa9e
|
520 |
}); |
b96c88383
|
521 |
scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) { |
6ae8d3cdd
|
522 |
$scope.data = {}; |
8e25d825b
|
523 524 |
$scope.check = false; $scope.numberCheck = false; |
e856f2161
|
525 526 |
$scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
e856f2161
|
527 528 529 530 |
$scope.max = 100; $scope.formPage = false; $scope.current = 0; $scope.payingAmnt = 0; |
e856f2161
|
531 532 533 534 535 536 537 538 539 540 |
$scope.discountAmount = 0; // $scope.data.quantity = "1"; $scope.check = false; $scope.numberCheck = false; $scope.paymentResult = {}; var data = { "amount": $scope.payingAmnt, "currency": "INR", "status": "pending" } |
8e25d825b
|
541 |
|
5348de778
|
542 543 544 545 |
$scope.removeError = function() { $('#invalidEmail').css('display', 'none'); $('#alreadyExist').css('display', 'none'); }; |
248bd9b7c
|
546 547 548 549 550 |
$scope.emailcheck = function(val) { if (val == undefined) { $('#invalidEmail').css('display', 'block'); } else { $('#alreadyExist').css('display', 'block'); |
248bd9b7c
|
551 552 |
} }; |
b678502c9
|
553 |
|
dee1f7479
|
554 555 556 557 558 559 560 561 562 563 564 565 |
$scope.removeNoError = function() { $('#invalidNumber').css('display', 'none'); $('#alreadyExist').css('display', 'none'); }; $scope.numbercheck = function(val) { if (val == undefined) { $('#invalidNumber').css('display', 'block'); } else { $('#alreadyExist').css('display', 'block'); } }; |
317a80571
|
566 |
// $scope.$on('city', function (event, value) { |
9d4fa776e
|
567 568 |
$scope.data.city = localStorage.getItem("city"); console.log("HERE===",$scope.data.city ); |
317a80571
|
569 |
// }); |
b96c88383
|
570 571 572 573 574 575 576 |
$rootScope.tokenCall = function(val) { console.log('val-------->', val); if (val == undefined) { $('#invalidToken').css('display', 'block'); } else { val = val.toUpperCase(); |
a65d2455e
|
577 578 579 580 |
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; } |
eb567dbaa
|
581 |
$http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') |
b96c88383
|
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 |
.then(function(searchResult) { console.log("searchResult",searchResult) if (searchResult.data.length == 0) { $scope.tokencheck = false; $scope.discountAmount = 0; } else { console.log("===searchResult.data[0].discount===",searchResult.data[0].discount); $scope.discountpercentage = searchResult.data[0].discount; console.log("===searchResultdiscountpercentage===",$scope.discountpercentage); $scope.tokencheck = true; } },function(err){ console.log(err) }); } }; |
6ae8d3cdd
|
599 |
$scope.submit = function() { |
b96c88383
|
600 601 602 603 604 |
$scope.ticketAmnt = 500; if($scope.tokencheck == false){ $scope.data.referalToken = null; } if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
e856f2161
|
605 |
var x = document.getElementById("snackbar") |
e856f2161
|
606 |
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
317a80571
|
607 |
}else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
e856f2161
|
608 |
$scope.infoForm = true; |
e856f2161
|
609 610 |
$scope.detail = {}; $scope.data.phone = "+91"+$scope.data.number; |
7cdbd289e
|
611 612 613 |
if($scope.data.referalToken == null){ $scope.data.referalToken = "N.A." } |
e856f2161
|
614 615 616 617 618 619 620 |
$http({ method: 'POST', url: BASE_URL+'/applicants', data: $scope.data, headers: {} }).then(function mySuccess(result) { console.log("=====result=====",result) |
e856f2161
|
621 622 623 |
$scope.detail = result; data.applicantId = result.data.id; $scope.userId = result.data.id; |
b96c88383
|
624 625 626 627 628 |
console.log("=====data=====",data) var amount = $scope.ticketAmnt * 100 if($scope.tokencheck == true){ var amount = $scope.ticketAmnt console.log("====$scope.discountpercentage====",$scope.discountpercentage); |
a65d2455e
|
629 630 |
console.log("resultcity===",$scope.data.city) if($scope.discountpercentage == "100") { |
8e38c5b71
|
631 632 |
$scope.discountpercentage = "99.8"; console.log("$scope.discountpercentage====",$scope.discountpercentage) |
b96c88383
|
633 634 635 636 637 638 639 640 641 642 643 |
} console.log("====$scope.discountpercentage====",$scope.discountpercentage); $scope.percDiscount = $scope.discountpercentage/100; console.log("====$scope.percDiscount====",$scope.percDiscount); console.log("====amount=====",amount); $scope.discountAmount = amount * $scope.percDiscount; console.log("finalAmount====>",$scope.discountAmount) } var taxAmount = $scope.ticketAmnt - $scope.discountAmount console.log("$scope.taxTotal----",taxAmount) $scope.payingAmnt = taxAmount; |
e8488da07
|
644 |
console.log("====$scope.payingAmnt====",$scope.payingAmnt) |
b96c88383
|
645 |
$scope.payingAmnt = $scope.payingAmnt.toFixed() |
e8488da07
|
646 647 |
data.amount = $scope.payingAmnt; console.log("data.amount==",data.amount) |
e856f2161
|
648 649 650 651 652 653 654 655 656 657 658 659 |
if($scope.detail != null){ $http({ method: 'POST', url: BASE_URL+'/payments', data: data, headers: {} }).then(function mySuccess(paymentResult) { $scope.paymentResult = paymentResult; }, function myError(error) { }); } var i = 0; |
b96c88383
|
660 |
$scope.payingAmnt = $scope.payingAmnt * 100; |
e856f2161
|
661 |
var options = { |
50e8f0737
|
662 663 |
//"key": "rzp_test_YwHsVFiDIQ2WUQ", "key": "rzp_live_mkmCb4FkstuWaS", |
e856f2161
|
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
"amount": $scope.payingAmnt, "name": "Startup Jalsa", "description":"amount", "currency": "INR", "status": "done", "prefill": { "email": $scope.detail.email, "contact": $scope.detail.phone }, "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("response12333333",response) $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; |
e8488da07
|
698 |
console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) |
e856f2161
|
699 700 701 702 703 704 705 |
$http({ method: 'PUT', url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, data: $scope.paymentResponse, headers: {} }).then(function mySuccess(searchResult) { console.log("searchResult",searchResult) |
5e3b90de3
|
706 |
$location.path("/confirmation") |
e856f2161
|
707 708 709 |
}, function myError(error) { }); } |
a65d2455e
|
710 |
//} |
e856f2161
|
711 712 |
}, function myError(error) { |
317a80571
|
713 |
|
e856f2161
|
714 |
}); |
317a80571
|
715 |
|
e856f2161
|
716 |
} |
e856f2161
|
717 |
|
317a80571
|
718 719 720 |
} }); |
53b83aa9e
|
721 |
|
b96c88383
|
722 723 724 725 726 727 728 |
scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { $scope.data = {}; $scope.check = false; $scope.numberCheck = false; $scope.submit = function() { console.log($scope.data.name) |
04ffff01c
|
729 730 731 |
var randomNumber = ""+Math.random(); var nameSpliced = $scope.data.name.slice(0,5); var numberSpliced = randomNumber.slice(2,4);; |
b96c88383
|
732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
$scope.data.referalToken = nameSpliced+numberSpliced; $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); console.log("dsdfs",numberSpliced); $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) }); |
b96c88383
|
753 754 |
} }); |
96991e0c1
|
755 |