Blame view
script.js
52.4 KB
53b83aa9e
|
1 |
// create the module and name it scotchApp |
f263889f0
|
2 |
var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); |
53b83aa9e
|
3 4 5 |
// configure our routes scotchApp.config(function($routeProvider) { |
6ae8d3cdd
|
6 |
$routeProvider |
dcb703070
|
7 |
// route for the Home page |
6ae8d3cdd
|
8 |
.when('/', { |
dcb703070
|
9 10 11 12 13 |
templateUrl: 'pages/Home.html', controller: 'mainController' }) // route for the registration page |
e856f2161
|
14 |
.when('/caricatures', { |
dcb703070
|
15 |
templateUrl: 'pages/registration.html', |
6ae8d3cdd
|
16 17 |
controller: 'mainController' }) |
2d6a9fbea
|
18 |
// route for the paymentVerify page |
4de569579
|
19 |
.when('/pendingPayment/:id', { |
6ae8d3cdd
|
20 21 22 23 24 |
templateUrl: 'pages/verify.html', controller: 'verifyController' }) // route for the ambassador page |
e856f2161
|
25 |
.when('/registration', { |
6ae8d3cdd
|
26 27 28 |
templateUrl: 'pages/ambassador.html', controller: 'ambassadorController' }) |
5348de778
|
29 30 31 32 |
// route for the confirmation page .when('/confirmation', { templateUrl: 'pages/confirmation.html', |
5e3b90de3
|
33 |
controller: 'ambassadorController' |
5348de778
|
34 |
}) |
6ae8d3cdd
|
35 |
}); |
53b83aa9e
|
36 |
|
f263889f0
|
37 38 |
scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { // Add configuration code as desired |
61b69ada0
|
39 |
AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code |
f263889f0
|
40 41 42 43 44 45 46 47 |
// 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
|
48 49 |
scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") |
6ae8d3cdd
|
50 |
|
2d6a9fbea
|
51 |
// create the controller and inject Angular's $scope |
f263889f0
|
52 |
scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { |
6ae8d3cdd
|
53 54 55 56 |
$scope.data = { show: true, hide: false }; |
e83ab8628
|
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
// var maininvest = new Date("Dec 16, 2017 06: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 16: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 15, 2017 16: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 17, 2017 16: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 22, 2017 16: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 21, 2017 16: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); |
edb834825
|
273 |
|
6ae8d3cdd
|
274 |
$scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
e847b36f8
|
275 |
$scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
c62079487
|
276 |
// $scope.Textshow = "yes" |
6ae8d3cdd
|
277 |
$scope.max = 100; |
88dd26b3d
|
278 |
$scope.formPage = false; |
6ae8d3cdd
|
279 280 |
$scope.current = 0; $scope.payingAmnt = 0; |
e83ab8628
|
281 |
// if ($scope.data.stage == 'select') { |
6ae8d3cdd
|
282 |
|
e83ab8628
|
283 |
// } |
53b83aa9e
|
284 |
|
439352ca6
|
285 |
//$scope.author = 'Swarn Singh'; |
6ae8d3cdd
|
286 |
$scope.data = {}; |
e83ab8628
|
287 288 |
// $scope.data.stage = 'Pitch your Business plan'; // $scope.data.networkDinner = "true"; |
ea3c31126
|
289 |
$scope.discountAmount = 0; |
7b2bef227
|
290 |
// $scope.data.quantity = "1"; |
6ae8d3cdd
|
291 292 |
$scope.check = false; $scope.numberCheck = false; |
6ae8d3cdd
|
293 |
$scope.paymentResult = {}; |
6ae8d3cdd
|
294 295 296 297 298 |
var data = { "amount": $scope.payingAmnt, "currency": "INR", "status": "pending" } |
53b83aa9e
|
299 |
|
5259a7d0e
|
300 |
/*open videos in modal*/ |
b8938eb77
|
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
// $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); // } |
5259a7d0e
|
321 |
/*open videos ends here*/ |
dcb703070
|
322 |
$scope.apply = function() { |
20db60d9c
|
323 |
Analytics.trackEvent('register', 'click', 'Registration'); |
e856f2161
|
324 |
$location.path("/caricatures") |
dcb703070
|
325 |
} |
e83ab8628
|
326 |
// $scope.data.citymeetup = ''; |
88dd26b3d
|
327 |
$scope.register = function(value){ |
e83ab8628
|
328 |
// $scope.data.citymeetup = value; |
2ddd928f5
|
329 330 331 332 333 334 335 336 337 |
// if (value == 'mainevent') { // $scope.eventType = true; // $scope.mainType = false; // $scope.data.stage = null; // } // else{ // $scope.eventType = false; // $scope.mainType = true; // } |
88dd26b3d
|
338 339 340 341 342 343 |
$('.hiddenForm').slideDown(); $('html, body').animate({ scrollTop: $('.hiddenForm').offset().top }, 1000); console.log('gdggsg', value); } |
5259a7d0e
|
344 |
|
45141d246
|
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
// $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) {}); // } // }; |
6ae8d3cdd
|
375 |
|
e83ab8628
|
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 |
// $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) // }); |
53b83aa9e
|
417 |
|
e83ab8628
|
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
// } // }; // $scope.IfDinnerCheck = function(value){ // $scope.data.networkDinner = value; // console.log("value",value) // } // /*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); // } // }); // }); |
6ae8d3cdd
|
439 440 |
/*****THIS IS FOR STEP ONE FORM ******/ |
dcb703070
|
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
// $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) {}); // } |
f263889f0
|
470 |
|
dcb703070
|
471 |
// } |
e856f2161
|
472 |
$scope.watch = function(){ |
a5b95be91
|
473 |
console.log("cllll") |
e856f2161
|
474 475 |
// window.open(url) $location.path("/registration") |
a5b95be91
|
476 |
} |
6ae8d3cdd
|
477 |
|
ea3c31126
|
478 |
$scope.calculateAmount = function(){ |
e9d943391
|
479 480 481 |
if($scope.tokencheck == false){ $scope.data.referalToken = null; } |
d0714b854
|
482 |
if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
9842ccd27
|
483 484 485 486 487 |
var x = document.getElementById("snackbar") x.className = "show"; setTimeout(function() { x.className = x.className.replace("show", ""); }, 3000); |
d0714b854
|
488 |
} else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
9842ccd27
|
489 490 491 492 493 494 495 496 497 498 499 |
$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) { |
89fe83f92
|
500 |
Analytics.trackEvent('applicants', 'click','Users'); |
9842ccd27
|
501 502 503 |
console.log("result", result) $scope.detail = result; data.applicantId = result.data.id; |
d122fec29
|
504 |
//$scope.userId = result.data.id; |
ef36be44d
|
505 |
|
326f3857f
|
506 |
if($scope.data.networkDinner == "true"){ |
100de8860
|
507 |
if($scope.data.citymeetup == "chandigarh"){ |
9cb631be0
|
508 |
if ($scope.data.stage == "Pitch your Business plan") { |
100de8860
|
509 |
console.log("$scope.data", $scope.data) |
ddcc98caf
|
510 |
$scope.ticketAmnt = 3500; |
7b2bef227
|
511 |
$scope.ticketAmnt = parseInt($scope.data.quantity)*$scope.ticketAmnt; |
100de8860
|
512 513 514 |
} if ($scope.data.stage == "Pitch your Startup") { |
ddcc98caf
|
515 |
$scope.ticketAmnt = 4250; |
7b2bef227
|
516 |
$scope.ticketAmnt = parseInt($scope.data.quantity)*$scope.ticketAmnt; |
100de8860
|
517 518 519 520 521 |
} // if ($scope.data.stage == "Growth") { // $scope.ticketAmnt = 1400; // } |
d3523e113
|
522 |
} |
100de8860
|
523 524 525 526 |
} else{ if($scope.data.citymeetup == "chandigarh"){ |
9cb631be0
|
527 |
if ($scope.data.stage == "Pitch your Business plan") { |
100de8860
|
528 |
console.log("$scope.data", $scope.data) |
9bbbd7ab2
|
529 |
/*add 25%*/ |
ddcc98caf
|
530 |
$scope.ticketAmnt = 1500 ; |
7b2bef227
|
531 |
$scope.ticketAmnt = parseInt($scope.data.quantity)*$scope.ticketAmnt; |
100de8860
|
532 533 534 |
} if ($scope.data.stage == "Pitch your Startup") { |
ddcc98caf
|
535 |
$scope.ticketAmnt = 2250; |
7b2bef227
|
536 |
$scope.ticketAmnt = parseInt($scope.data.quantity)*$scope.ticketAmnt; |
100de8860
|
537 538 539 540 541 |
} // if ($scope.data.stage == "Growth") { // $scope.ticketAmnt = 1400; // } |
d3523e113
|
542 |
} |
100de8860
|
543 |
} |
2ddd928f5
|
544 |
|
100de8860
|
545 546 547 548 549 550 551 552 553 554 555 556 557 558 |
// else{ // if ($scope.data.stage == "Pitch your Idea") { // console.log("$scope.data", $scope.data) // $scope.ticketAmnt = 500; // } // if ($scope.data.stage == "Pitch your Startup") { // $scope.ticketAmnt = 1000; // } // // if ($scope.data.stage == "Growth") { // // $scope.ticketAmnt = 1000; // // } // } |
629cc1f8f
|
559 560 561 |
// if ($scope.data.stage == "Visitor") { // $scope.ticketAmnt = 500; // } |
d122fec29
|
562 563 564 |
var amount = $scope.ticketAmnt * 100 if($scope.tokencheck == true){ var amount = $scope.ticketAmnt |
e284785e4
|
565 566 |
$scope.discountAmount = (amount * $scope.discountpercentage)/100 console.log("finalAmount====>",$scope.discountAmount) |
d122fec29
|
567 |
} |
e284785e4
|
568 |
var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
515649dae
|
569 |
console.log("$scope.taxTotal----",taxAmount) |
bcefa53b8
|
570 |
$scope.taxTotal = (taxAmount * 18)/100 |
e284785e4
|
571 |
$scope.payingAmnt = taxAmount + $scope.taxTotal |
ef36be44d
|
572 |
$scope.payingAmnt = $scope.payingAmnt.toFixed() |
d122fec29
|
573 |
console.log("taxincludedamount----", $scope.payingAmnt) |
bcefa53b8
|
574 |
console.log("$scope.taxTotal----", $scope.taxTotal) |
d122fec29
|
575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 |
// } /*****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) |
e284785e4
|
603 604 |
// data.amount = $scope.payingAmnt + $scope.taxTotal; data.amount = $scope.payingAmnt; |
bcefa53b8
|
605 |
console.log("$scope.taxTotal",data.amount) |
d122fec29
|
606 607 608 609 610 611 612 |
if ($scope.detail != null) { $http({ method: 'POST', url: BASE_URL + '/payments', data: data, headers: {} }).then(function mySuccess(paymentResult) { |
d122fec29
|
613 614 615 616 617 |
console.log("paymentResult",paymentResult) $scope.paymentResult = paymentResult; }, function myError(error) {}); } var i = 0; |
e284785e4
|
618 619 620 |
//$scope.payingAmnt = ($scope.payingAmnt + $scope.taxTotal) * 100; $scope.payingAmnt = $scope.payingAmnt * 100; |
ef36be44d
|
621 |
|
515649dae
|
622 |
console.log("$scope.taxTotal----", $scope.payingAmnt) |
d122fec29
|
623 |
var options = { |
13085559a
|
624 625 |
"key": "rzp_live_mkmCb4FkstuWaS", //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
bcefa53b8
|
626 627 |
"amount": $scope.payingAmnt , |
d122fec29
|
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 |
"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) { |
d122fec29
|
649 650 651 652 653 654 655 |
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; |
89fe83f92
|
656 |
Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount); |
d122fec29
|
657 658 659 660 661 662 |
$http({ method: 'PUT', url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, data: $scope.paymentResponse, headers: {} }).then(function mySuccess(searchResult) { |
f6d172552
|
663 |
// if(paymentResult.data.status == "created"){ |
9babf5dba
|
664 |
|
f6d172552
|
665 |
// } |
d122fec29
|
666 667 668 669 670 671 672 |
console.log("searchResult", searchResult) $location.path("/confirmation") //$scope.showToastr() //toaster.success("Registration done successfully"); }, function myError(error) {}); } |
0c83501f4
|
673 674 |
}, function myError(error) { console.log("error",error) |
45141d246
|
675 676 677 |
// $scope.emailId = error.data.error.message; // $scope.id = error.data.error.id; // $('#myModal').modal('show'); |
0c83501f4
|
678 |
}); |
d122fec29
|
679 680 681 |
} } |
dcb703070
|
682 |
|
9842ccd27
|
683 684 |
//}, function myError(error) {}); //} |
6ae8d3cdd
|
685 |
|
dcb703070
|
686 |
//} |
6ae8d3cdd
|
687 |
|
5348de778
|
688 689 690 691 692 693 694 695 |
// $scope.showToastr = function() { // console.log("called toast") // var x = document.getElementById("snacsskbar") // x.className = "show"; // setTimeout(function() { // x.className = x.className.replace("show", ""); // }, 3000); // } |
6ae8d3cdd
|
696 |
|
6ae8d3cdd
|
697 |
/*kk***This code for change data when click to chooses stages***/ |
163c5adae
|
698 699 700 701 702 703 704 705 |
$scope.proto = true; $scope.businessmodel = true; $scope.Idea = true; $scope.current = true; $scope.stage = function(stage) { $scope.stagekeyPress(); console.log("stage--2",stage) |
e847b36f8
|
706 |
|
9cb631be0
|
707 |
if (stage == 'Pitch your Business plan') { |
e847b36f8
|
708 |
$scope.Productshow = "no"; |
163c5adae
|
709 710 |
$scope.current = 10; $scope.proto = true; |
629cc1f8f
|
711 |
// $scope.visitType = true; |
163c5adae
|
712 |
$scope.prototyp = false; |
713fd1603
|
713 |
$scope.protyp = false; |
163c5adae
|
714 715 716 717 718 719 720 721 722 723 724 |
$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; |
629cc1f8f
|
725 |
// $scope.Visitor = false; |
5dc669c2c
|
726 |
} else if (stage == 'Pitch your Startup') { |
e847b36f8
|
727 |
$scope.Productshow = "no"; |
163c5adae
|
728 729 |
$scope.current = 10; $scope.proto = true; |
629cc1f8f
|
730 |
// $scope.visitType = true; |
163c5adae
|
731 |
$scope.prototyp = true; |
713fd1603
|
732 |
$scope.protyp = true; |
163c5adae
|
733 734 735 736 737 738 739 740 741 742 743 |
$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; |
629cc1f8f
|
744 |
// $scope.Visitor = false; |
163c5adae
|
745 |
} else if (stage == 'Growth') { |
e847b36f8
|
746 |
$scope.Productshow = "yes"; |
163c5adae
|
747 748 |
$scope.current = 10; $scope.proto = false; |
629cc1f8f
|
749 |
// $scope.visitType = true; |
e847b36f8
|
750 751 |
$scope.prototyp = true; $scope.protyp = false; |
163c5adae
|
752 753 754 755 756 757 758 759 760 761 |
$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; |
629cc1f8f
|
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 |
// $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; |
163c5adae
|
782 783 |
$scope.data.stage = stage; } |
629cc1f8f
|
784 |
|
163c5adae
|
785 |
} |
e847b36f8
|
786 |
|
45141d246
|
787 788 789 |
// $scope.emailTest = function(s){ // $scope.space = /\s/g.test(s.delegateTarget.value); // console.log("space",$scope.space) |
e847b36f8
|
790 |
|
45141d246
|
791 |
// } |
c62079487
|
792 793 794 795 |
// $scope.enterbusiness = function(business) { // console.log("business", business); // if (name == undefined) { // $scope.current = false; |
2d6a9fbea
|
796 |
|
c62079487
|
797 798 799 800 |
// } else if (name != undefined) { // $scope.current = true; // } // } |
6ae8d3cdd
|
801 802 |
/*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ $scope.stagekeyPress = function() { |
f8b43c6f8
|
803 |
$('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
804 805 |
} $scope.sectorkeyPress = function() { |
f8b43c6f8
|
806 |
$('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
807 |
} |
163c5adae
|
808 |
$scope.productLaunchkeyPress = function() { |
f8b43c6f8
|
809 |
$('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
810 |
} |
163c5adae
|
811 |
$scope.launchPeriodkeyPress = function() { |
f8b43c6f8
|
812 |
$('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
813 |
} |
7b2bef227
|
814 815 |
$scope.industrykeyPress = function(quantity) { console.log("fghj",quantity) |
f8b43c6f8
|
816 |
$('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); |
7b2bef227
|
817 818 819 820 821 822 823 824 825 |
// $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; // } |
c62079487
|
826 |
} |
204302c02
|
827 828 829 830 831 |
$scope.industryNamekeyPress = function(firstName) { console.log("lastName==", firstName); if (firstName == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
832 |
$('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
204302c02
|
833 834 |
} } |
c62079487
|
835 |
$scope.amountkeyPress = function() { |
f8b43c6f8
|
836 |
$('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
837 |
} |
2321f803a
|
838 839 840 |
$scope.firstNamekeyPress = function(name) { console.log("lastName==", name); if (name == undefined) { |
6ae8d3cdd
|
841 842 |
$('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
843 |
$('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
844 845 |
} } |
dcb703070
|
846 |
|
6ae8d3cdd
|
847 848 849 850 851 |
$scope.emailkeyPress = function(email) { console.log("email", email); if (email == undefined) { $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
852 |
$('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); |
8ddc94e00
|
853 |
} |
6ae8d3cdd
|
854 |
} |
163c5adae
|
855 |
$scope.textCheck = function(){ |
4697da41f
|
856 |
console.log("Val1:::", $scope.textCheck); |
163c5adae
|
857 858 |
var e = document.getElementById("fundingDiv"); var funding = e.options[e.selectedIndex].value; |
204302c02
|
859 |
$scope.Textshow = "no"; |
163c5adae
|
860 |
if(funding == "yes") { |
204302c02
|
861 |
$scope.Textshow = "yes"; |
163c5adae
|
862 863 864 |
console.log("Val:::", $scope.Textshow); } |
c62079487
|
865 |
} |
4697da41f
|
866 867 868 869 870 871 872 873 874 875 876 |
$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); } } |
6ae8d3cdd
|
877 878 879 |
$scope.phonekeyPress = function(number) { console.log("number", number); |
204302c02
|
880 |
if (number == undefined || number == '') { |
6ae8d3cdd
|
881 882 |
$('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
883 |
$('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
884 885 886 887 888 889 890 891 |
} } $scope.citykeyPress = function(city) { console.log("city", city); if (city == undefined) { $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
892 |
$('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
893 894 |
} } |
7e3bb1018
|
895 |
$scope.startupNamekeyPress = function(q) { |
6ae8d3cdd
|
896 897 898 |
if (q == undefined) { $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
899 |
$('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
900 901 |
} } |
dcb703070
|
902 |
$scope.linkedInkeyPress = function(technology) { |
204302c02
|
903 |
if (technology == undefined || technology == '') { |
6ae8d3cdd
|
904 905 |
$('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
906 |
$('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
907 908 |
} } |
dcb703070
|
909 |
$scope.companykeyPress = function(problem) { |
6ae8d3cdd
|
910 911 912 |
if (problem == undefined) { $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
913 |
$('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
914 915 |
} } |
dcb703070
|
916 |
$scope.productNamekeyPress = function(solution) { |
6ae8d3cdd
|
917 918 919 |
if (solution == undefined) { $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
920 |
$('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
921 922 923 |
} } $scope.businesskeyPress = function(business) { |
f8b43c6f8
|
924 |
$('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
925 |
} |
dcb703070
|
926 |
$scope.websitekeyPress = function(prototype) { |
204302c02
|
927 |
if (prototype == undefined || prototype == '') { |
6ae8d3cdd
|
928 929 |
$('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
930 |
$('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
931 932 |
} } |
dcb703070
|
933 |
$scope.employeekeyPress = function(market) { |
204302c02
|
934 |
if (market == undefined || market == '') { |
6ae8d3cdd
|
935 936 |
$('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
937 |
$('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
938 939 |
} } |
dcb703070
|
940 |
$scope.annualkeyPress = function(risk) { |
204302c02
|
941 |
if (risk == undefined || risk == '') { |
6ae8d3cdd
|
942 943 |
$('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
944 |
$('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
945 946 |
} } |
dcb703070
|
947 |
$scope.revenuekeyPress = function(team) { |
204302c02
|
948 |
if (team == undefined || team == '') { |
6ae8d3cdd
|
949 950 |
$('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
951 |
$('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
952 953 |
} } |
dcb703070
|
954 |
$scope.descriptionkeyPress = function(pitch) { |
6ae8d3cdd
|
955 956 957 |
if (pitch == undefined) { $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
958 |
$('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
959 960 |
} } |
e284785e4
|
961 |
$scope.discountkeyPress = function(discount) { |
e284785e4
|
962 963 964 |
if (discount == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
965 |
$('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
e284785e4
|
966 967 |
} } |
91eeb4455
|
968 969 970 971 |
$scope.removeNooError = function() { $('#invalidIdea').css('display', 'block'); $('#noExist').css('display', 'none'); }; |
c62079487
|
972 |
$scope.ideakeyPress = function(financial) { |
6ae8d3cdd
|
973 974 975 976 |
console.log("financial", financial); if (financial == undefined) { $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
977 |
$('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
978 979 |
} } |
c62079487
|
980 981 982 983 984 985 |
$scope.fundkeyPress = function(financial) { console.log("financial", financial); if (financial == undefined) { $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
986 |
$('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
987 988 |
} } |
2d6a9fbea
|
989 990 991 992 |
$scope.changeReferalIconColor = function(referalToken){ if (referalToken == undefined || referalToken == '') { $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); }else { |
f8b43c6f8
|
993 |
$('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); |
2d6a9fbea
|
994 995 |
} } |
6ae8d3cdd
|
996 |
|
53b83aa9e
|
997 |
}); |
8ecb55ed6
|
998 |
scotchApp.controller('verifyController', function($scope, $http, $location, $route, BASE_URL, Analytics) { |
be44091b5
|
999 |
|
d8feb0ddb
|
1000 |
$scope.pendingPaymentId = $route.current.params.id |
6ae8d3cdd
|
1001 1002 1003 1004 1005 1006 |
$http({ method: "GET", url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, }).then(function mySuccess(response) { $scope.data = response.data; console.log("response-1", response); |
d8feb0ddb
|
1007 1008 |
$scope.pendingPaymentId = $route.current.params.id; |
6ae8d3cdd
|
1009 1010 1011 1012 1013 1014 |
$http({ method: "GET", url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', }).then(function mySuccess(response) { $scope.paymentRecord = response.data; }, function myError(response) { |
be44091b5
|
1015 |
console.log("response-2", response); |
6ae8d3cdd
|
1016 1017 1018 1019 1020 1021 1022 |
}); }, function myError(response) { $scope.myWelcome = response.statusText; }); $scope.checkView = false; $scope.verifyView = false; |
be44091b5
|
1023 |
$scope.searchResult = {} |
6ae8d3cdd
|
1024 |
$scope.pendingPaymentId = ''; |
6ae8d3cdd
|
1025 1026 1027 1028 1029 |
$scope.update = function() { $http({ method: 'GET', url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', |
6ae8d3cdd
|
1030 1031 |
headers: {} }).then(function mySuccess(searchResult) { |
c556cc81b
|
1032 1033 |
if (searchResult.data[0].status == "created") { //if (searchResult.data[0].status == "cancelled") { |
6ae8d3cdd
|
1034 1035 |
$scope.checkView = true; $scope.verifyView = false; |
ced66f2dc
|
1036 1037 1038 1039 |
$scope.amount = searchResult.data[0].amount; $scope.searchResult = searchResult.data[0]; console.log('====searchResult===', searchResult); console.log("searchResult=====",searchResult.data[0].razorOrderId) |
6ae8d3cdd
|
1040 |
var i = 0; |
ced66f2dc
|
1041 |
$scope.amount = $scope.amount * 100; |
6ae8d3cdd
|
1042 |
var options = { |
f2142e490
|
1043 1044 |
"key": "rzp_live_mhSE1uOBlXvFyJ", //"key" : "rzp_test_YwHsVFiDIQ2WUQ", |
6ae8d3cdd
|
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 |
"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 = {}; |
6ae8d3cdd
|
1066 |
function createPayment(response) { |
ced66f2dc
|
1067 |
console.log("response======retepaymen",response); |
be44091b5
|
1068 1069 |
$scope.amount = $scope.amount/100; |
6ae8d3cdd
|
1070 |
$scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
ced66f2dc
|
1071 |
$scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; |
6ae8d3cdd
|
1072 |
$scope.paymentResponse.amount = $scope.amount; |
ced66f2dc
|
1073 1074 1075 |
$scope.paymentResponse.currency = $scope.searchResult.currency; $scope.paymentResponse.status = $scope.searchResult.status; $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; |
6ae8d3cdd
|
1076 1077 1078 |
console.log("$scope.paymentResponse", $scope.paymentResponse) $http({ method: 'PUT', |
ced66f2dc
|
1079 |
url: BASE_URL + '/payments/' + $scope.searchResult.id, |
6ae8d3cdd
|
1080 1081 1082 |
data: $scope.paymentResponse, headers: {} }).then(function mySuccess(searchResult) { |
9babf5dba
|
1083 |
console.log("searchResult--->",searchResult) |
f6d172552
|
1084 |
// if(paymentResult.data.status == "created"){ |
9babf5dba
|
1085 |
// Analytics.trackEvent('payments', 'click', 'Thankyou'); |
f6d172552
|
1086 |
// } |
8e25d825b
|
1087 |
console.log("finalsearchResult",searchResult) |
ced66f2dc
|
1088 |
$location.path("/confirmation") |
8ecb55ed6
|
1089 |
Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount); |
6ae8d3cdd
|
1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 |
}, function myError(error) { }); } } else { } }, function myError(error) {}); } }); |
53b83aa9e
|
1101 |
|
2d6a9fbea
|
1102 |
scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { |
6ae8d3cdd
|
1103 |
$scope.data = {}; |
8e25d825b
|
1104 1105 |
$scope.check = false; $scope.numberCheck = false; |
e856f2161
|
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 |
$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 = 'Pitch your Business plan'; // $scope.data.networkDinner = "true"; $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
|
1131 |
|
5348de778
|
1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 |
/*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() { $('#invalidEmail').css('display', 'none'); $('#alreadyExist').css('display', 'none'); }; |
248bd9b7c
|
1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 |
$scope.emailcheck = function(val) { if (val == undefined) { $('#invalidEmail').css('display', 'block'); } else { $('#alreadyExist').css('display', 'block'); // $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) {}); } }; |
b678502c9
|
1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 |
// $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) {}); // //} // }; |
8e25d825b
|
1199 |
|
6ae8d3cdd
|
1200 |
$scope.submit = function() { |
70b1fd33b
|
1201 |
$scope.payingAmnt = 100; |
e856f2161
|
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 |
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) { // if($scope.data.identity == "a"){ // var image = BASE_URL+'/container1s/proof/download/' // var image = document.getElementById('picture').files[0]; // var imagePath = image.name; // $scope.NewIamge = image + imagePath; // $scope.data.pic = $scope.NewIamge; // var fd = new FormData() // fd.append('file',image); // $http({ // method:'POST', // url: BASE_URL+'/container1s/proof/upload', // data:fd, // transformRequest:angular.identity, // headers:{'Content-Type':undefined} // }).then(function mySuccess(sucessResponse) { // }, function myError(error) { // }); // } $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) |
e856f2161
|
1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 |
$scope.detail = result; data.applicantId = result.data.id; $scope.userId = result.data.id; console.log("=====data=====",data) data.amount = $scope.payingAmnt /100; 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; var options = { |
70b1fd33b
|
1263 1264 |
//"key": "rzp_test_YwHsVFiDIQ2WUQ", "key": "rzp_live_mkmCb4FkstuWaS", |
e856f2161
|
1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 |
"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; $http({ method: 'PUT', url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, data: $scope.paymentResponse, headers: {} }).then(function mySuccess(searchResult) { console.log("searchResult",searchResult) |
5e3b90de3
|
1306 |
$location.path("/confirmation") |
e856f2161
|
1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 |
}, function myError(error) { }); } }, function myError(error) { }); } // 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 = ''; |
2d6a9fbea
|
1334 |
|
e856f2161
|
1335 1336 1337 1338 1339 |
// }, function myError(error) { // console.log(error) // console.log(error.data.error.message) // }); // console.log($scope.data) |
6ae8d3cdd
|
1340 1341 |
} }); |
53b83aa9e
|
1342 |
|
96991e0c1
|
1343 |