Commit c556cc81b9e05fa898f397cf56a34cbc614b77da

Authored by Palak Handa
1 parent 65f8574310
Exists in master and in 1 other branch paytm

minor changes

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
1 // create the module and name it scotchApp 1 // create the module and name it scotchApp
2 var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); 2 var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']);
3 3
4 // configure our routes 4 // configure our routes
5 scotchApp.config(function($routeProvider) { 5 scotchApp.config(function($routeProvider) {
6 $routeProvider 6 $routeProvider
7 7
8 // route for the Home page 8 // route for the Home page
9 .when('/', { 9 .when('/', {
10 templateUrl: 'pages/Home.html', 10 templateUrl: 'pages/Home.html',
11 controller: 'mainController' 11 controller: 'mainController'
12 }) 12 })
13 13
14 // route for the registration page 14 // route for the registration page
15 .when('/registration', { 15 .when('/registration', {
16 templateUrl: 'pages/registration.html', 16 templateUrl: 'pages/registration.html',
17 controller: 'mainController' 17 controller: 'mainController'
18 }) 18 })
19 19
20 // route for the paymentVerify page 20 // route for the paymentVerify page
21 .when('/pendingPayment/:id', { 21 .when('/pendingPayment/:id', {
22 templateUrl: 'pages/verify.html', 22 templateUrl: 'pages/verify.html',
23 controller: 'verifyController' 23 controller: 'verifyController'
24 }) 24 })
25 25
26 // route for the ambassador page 26 // route for the ambassador page
27 .when('/ambassador', { 27 .when('/ambassador', {
28 templateUrl: 'pages/ambassador.html', 28 templateUrl: 'pages/ambassador.html',
29 controller: 'ambassadorController' 29 controller: 'ambassadorController'
30 }) 30 })
31 31
32 // route for the confirmation page 32 // route for the confirmation page
33 .when('/confirmation', { 33 .when('/confirmation', {
34 templateUrl: 'pages/confirmation.html', 34 templateUrl: 'pages/confirmation.html',
35 controller: 'mainController' 35 controller: 'mainController'
36 }) 36 })
37 37
38 }); 38 });
39 39
40 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { 40 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
41 // Add configuration code as desired 41 // Add configuration code as desired
42 AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code 42 AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code
43 43
44 // Track all routes (default is true). 44 // Track all routes (default is true).
45 AnalyticsProvider.trackPages(true); 45 AnalyticsProvider.trackPages(true);
46 46
47 // Track all URL query params (default is false). 47 // Track all URL query params (default is false).
48 AnalyticsProvider.trackUrlParams(true); 48 AnalyticsProvider.trackUrlParams(true);
49 49
50 }]).run(['Analytics', function(Analytics) { }]); 50 }]).run(['Analytics', function(Analytics) { }]);
51 51
52 scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/api") 52 scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/api")
53 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/api") 53 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/api")
54 54
55 // create the controller and inject Angular's $scope 55 // create the controller and inject Angular's $scope
56 scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { 56 scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) {
57 $scope.data = { 57 $scope.data = {
58 show: true, 58 show: true,
59 hide: false 59 hide: false
60 }; 60 };
61 61
62 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 62 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
63 // $scope.Textshow = "yes" 63 // $scope.Textshow = "yes"
64 $scope.max = 100; 64 $scope.max = 100;
65 $scope.current = 0; 65 $scope.current = 0;
66 $scope.payingAmnt = 0; 66 $scope.payingAmnt = 0;
67 if ($scope.data.stage == 'select') { 67 if ($scope.data.stage == 'select') {
68 68
69 } 69 }
70 70
71 //$scope.author = 'Swarn Singh'; 71 //$scope.author = 'Swarn Singh';
72 $scope.data = {}; 72 $scope.data = {};
73 $scope.data.stage = 'Idea'; 73 $scope.data.stage = 'Idea';
74 $scope.discountAmount = 0; 74 $scope.discountAmount = 0;
75 $scope.check = false; 75 $scope.check = false;
76 $scope.numberCheck = false; 76 $scope.numberCheck = false;
77 $scope.paymentResult = {}; 77 $scope.paymentResult = {};
78 var data = { 78 var data = {
79 "amount": $scope.payingAmnt, 79 "amount": $scope.payingAmnt,
80 "currency": "INR", 80 "currency": "INR",
81 "status": "pending" 81 "status": "pending"
82 } 82 }
83 83
84 /*open videos in modal*/ 84 /*open videos in modal*/
85 // $scope.openyoutube16 = function(){ 85 // $scope.openyoutube16 = function(){
86 // $('#videoModel').modal('show'); 86 // $('#videoModel').modal('show');
87 // } 87 // }
88 88
89 // $scope.openyoutube17 = function(){ 89 // $scope.openyoutube17 = function(){
90 // $('#videoModels').modal('show'); 90 // $('#videoModels').modal('show');
91 // } 91 // }
92 92
93 // $scope.closeModal = function(){ 93 // $scope.closeModal = function(){
94 // var url = $('#youtubePlayer').attr('src'); 94 // var url = $('#youtubePlayer').attr('src');
95 // $('#youtubePlayer').attr('src', ''); 95 // $('#youtubePlayer').attr('src', '');
96 // $('#youtubePlayer').attr('src', url); 96 // $('#youtubePlayer').attr('src', url);
97 // } 97 // }
98 98
99 99
100 // $scope.closed = function(){ 100 // $scope.closed = function(){
101 // var url = $('#youtubePlayersss').attr('src'); 101 // var url = $('#youtubePlayersss').attr('src');
102 // $('#youtubePlayersss').attr('src', ''); 102 // $('#youtubePlayersss').attr('src', '');
103 // $('#youtubePlayersss').attr('src', url); 103 // $('#youtubePlayersss').attr('src', url);
104 // } 104 // }
105 /*open videos ends here*/ 105 /*open videos ends here*/
106 $scope.apply = function() { 106 $scope.apply = function() {
107 Analytics.trackEvent('register', 'click', 'django.mp4'); 107 Analytics.trackEvent('register', 'click', 'django.mp4');
108 $location.path("/registration") 108 $location.path("/registration")
109 } 109 }
110 110
111 $scope.removeError = function() { 111 $scope.removeError = function() {
112 $('#invalidEmail').css('display', 'none'); 112 $('#invalidEmail').css('display', 'none');
113 $('#alreadyExist').css('display', 'none'); 113 $('#alreadyExist').css('display', 'none');
114 }; 114 };
115 115
116 $scope.emailcheck = function(val) { 116 $scope.emailcheck = function(val) {
117 if (val == undefined) { 117 if (val == undefined) {
118 $('#invalidEmail').css('display', 'block'); 118 $('#invalidEmail').css('display', 'block');
119 } else { 119 } else {
120 $http({ 120 $http({
121 method: 'GET', 121 method: 'GET',
122 url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', 122 url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}',
123 headers: {} 123 headers: {}
124 }).then(function mySuccess(searchResult) { 124 }).then(function mySuccess(searchResult) {
125 console.log("searchResult1===>", searchResult) 125 console.log("searchResult1===>", searchResult)
126 if (searchResult.data.length == 0) { 126 if (searchResult.data.length == 0) {
127 $scope.check = false; 127 $scope.check = false;
128 } else { 128 } else {
129 $scope.check = true; 129 $scope.check = true;
130 $('#alreadyExist').css('display', 'block'); 130 $('#alreadyExist').css('display', 'block');
131 } 131 }
132 }, function myError(error) {}); 132 }, function myError(error) {});
133 } 133 }
134 }; 134 };
135 135
136 $scope.removeNoError = function() { 136 $scope.removeNoError = function() {
137 $('#noExist').css('display', 'none'); 137 $('#noExist').css('display', 'none');
138 }; 138 };
139 139
140 $scope.numbercheck = function(number) { 140 $scope.numbercheck = function(number) {
141 $http({ 141 $http({
142 method: 'GET', 142 method: 'GET',
143 url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}', 143 url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}',
144 data: $scope.data, 144 data: $scope.data,
145 headers: {} 145 headers: {}
146 }).then(function mySuccess(searchResult) { 146 }).then(function mySuccess(searchResult) {
147 console.log("searchResult===>", searchResult) 147 console.log("searchResult===>", searchResult)
148 if (searchResult.data.length == 0) { 148 if (searchResult.data.length == 0) {
149 $scope.numberCheck = false; 149 $scope.numberCheck = false;
150 150
151 } else { 151 } else {
152 $scope.numberCheck = true; 152 $scope.numberCheck = true;
153 $('#noExist').css('display', 'block'); 153 $('#noExist').css('display', 'block');
154 } 154 }
155 }, function myError(error) {}); 155 }, function myError(error) {});
156 }; 156 };
157 157
158 $rootScope.tokenCall = function(val) { 158 $rootScope.tokenCall = function(val) {
159 console.log('val-------->', val); 159 console.log('val-------->', val);
160 if (val == undefined) { 160 if (val == undefined) {
161 $('#invalidEmail').css('display', 'block'); 161 $('#invalidEmail').css('display', 'block');
162 } else { 162 } else {
163 val = val.toUpperCase(); 163 val = val.toUpperCase();
164 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}') 164 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}')
165 .then(function(searchResult) { 165 .then(function(searchResult) {
166 if (searchResult.data.length == 0) { 166 if (searchResult.data.length == 0) {
167 $scope.tokencheck = false; 167 $scope.tokencheck = false;
168 $scope.discountAmount = 0; 168 $scope.discountAmount = 0;
169 } else { 169 } else {
170 $scope.tokencheck = true; 170 $scope.tokencheck = true;
171 } 171 }
172 },function(err){ 172 },function(err){
173 console.log(err) 173 console.log(err)
174 }); 174 });
175 175
176 } 176 }
177 }; 177 };
178 178
179 179
180 /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ 180 /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/
181 $(document).ready( 181 $(document).ready(
182 function() { 182 function() {
183 $('input:submit').attr('disabled', true); 183 $('input:submit').attr('disabled', true);
184 $('input:file').change( 184 $('input:file').change(
185 function() { 185 function() {
186 if ($("#picture").val()) { 186 if ($("#picture").val()) {
187 $('input:submit').removeAttr('disabled'); 187 $('input:submit').removeAttr('disabled');
188 } else { 188 } else {
189 $('input:submit').attr('disabled', true); 189 $('input:submit').attr('disabled', true);
190 } 190 }
191 }); 191 });
192 }); 192 });
193 193
194 /*****THIS IS FOR STEP ONE FORM ******/ 194 /*****THIS IS FOR STEP ONE FORM ******/
195 // $scope.next = function() { 195 // $scope.next = function() {
196 // $scope.data.status = null 196 // $scope.data.status = null
197 // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { 197 // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) {
198 // var x = document.getElementById("snackbar") 198 // var x = document.getElementById("snackbar")
199 // x.className = "show"; 199 // x.className = "show";
200 // setTimeout(function() { 200 // setTimeout(function() {
201 // x.className = x.className.replace("show", ""); 201 // x.className = x.className.replace("show", "");
202 // }, 3000); 202 // }, 3000);
203 // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { 203 // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) {
204 // $scope.infoForm = true; 204 // $scope.infoForm = true;
205 // console.log("sdasdasdsa"); 205 // console.log("sdasdasdsa");
206 // $scope.data.stage = $scope.data.stage; 206 // $scope.data.stage = $scope.data.stage;
207 // $scope.detail = {}; 207 // $scope.detail = {};
208 // $scope.data.phone = "+91" + $scope.data.number; 208 // $scope.data.phone = "+91" + $scope.data.number;
209 // $http({ 209 // $http({
210 // method: 'POST', 210 // method: 'POST',
211 // url: BASE_URL + '/information', 211 // url: BASE_URL + '/information',
212 // data: $scope.data, 212 // data: $scope.data,
213 // headers: {} 213 // headers: {}
214 // }).then(function mySuccess(result) { 214 // }).then(function mySuccess(result) {
215 // Analytics.trackEvent('information', 'click', 'django.mp4'); 215 // Analytics.trackEvent('information', 'click', 'django.mp4');
216 // console.log("result", result) 216 // console.log("result", result)
217 // $scope.detail = result; 217 // $scope.detail = result;
218 // data.applicantId = result.data.id; 218 // data.applicantId = result.data.id;
219 // $scope.userId = result.data.id; 219 // $scope.userId = result.data.id;
220 220
221 // }, function myError(error) {}); 221 // }, function myError(error) {});
222 222
223 // } 223 // }
224 224
225 // } 225 // }
226 226
227 $scope.calculateAmount = function(){ 227 $scope.calculateAmount = function(){
228 if ($scope.data.stage == undefined || $scope.data.firstName == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { 228 if ($scope.data.stage == undefined || $scope.data.firstName == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) {
229 var x = document.getElementById("snackbar") 229 var x = document.getElementById("snackbar")
230 x.className = "show"; 230 x.className = "show";
231 setTimeout(function() { 231 setTimeout(function() {
232 x.className = x.className.replace("show", ""); 232 x.className = x.className.replace("show", "");
233 }, 3000); 233 }, 3000);
234 } else if ($scope.data.stage != undefined && $scope.data.firstName != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { 234 } else if ($scope.data.stage != undefined && $scope.data.firstName != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) {
235 $scope.infoForm = true; 235 $scope.infoForm = true;
236 console.log("sdasdasdsa"); 236 console.log("sdasdasdsa");
237 $scope.data.stage = $scope.data.stage; 237 $scope.data.stage = $scope.data.stage;
238 $scope.detail = {}; 238 $scope.detail = {};
239 $scope.data.phone = "+91" + $scope.data.number; 239 $scope.data.phone = "+91" + $scope.data.number;
240 $http({ 240 $http({
241 method: 'POST', 241 method: 'POST',
242 url: BASE_URL + '/applicants', 242 url: BASE_URL + '/applicants',
243 data: $scope.data, 243 data: $scope.data,
244 headers: {} 244 headers: {}
245 }).then(function mySuccess(result) { 245 }).then(function mySuccess(result) {
246 Analytics.trackEvent('applicants', 'click', 'django.mp4'); 246 Analytics.trackEvent('applicants', 'click', 'django.mp4');
247 console.log("result", result) 247 console.log("result", result)
248 $scope.detail = result; 248 $scope.detail = result;
249 data.applicantId = result.data.id; 249 data.applicantId = result.data.id;
250 //$scope.userId = result.data.id; 250 //$scope.userId = result.data.id;
251 251
252 if ($scope.data.stage == "Idea") { 252 if ($scope.data.stage == "Idea") {
253 console.log("$scope.data", $scope.data) 253 console.log("$scope.data", $scope.data)
254 $scope.ticketAmnt = 500; 254 $scope.ticketAmnt = 500;
255 } 255 }
256 256
257 if ($scope.data.stage == "Product") { 257 if ($scope.data.stage == "Product") {
258 $scope.ticketAmnt = 1000; 258 $scope.ticketAmnt = 1000;
259 } 259 }
260 260
261 if ($scope.data.stage == "Growth") { 261 if ($scope.data.stage == "Growth") {
262 $scope.ticketAmnt = 1000; 262 $scope.ticketAmnt = 1000;
263 } 263 }
264 var amount = $scope.ticketAmnt * 100 264 var amount = $scope.ticketAmnt * 100
265 if($scope.tokencheck == true){ 265 if($scope.tokencheck == true){
266 var amount = $scope.ticketAmnt 266 var amount = $scope.ticketAmnt
267 // $scope.discountAmount = (amount * 10)/100 267 // $scope.discountAmount = (amount * 10)/100
268 console.log("finalAmount====>",$scope.payingAmnt) 268 console.log("finalAmount====>",$scope.payingAmnt)
269 } 269 }
270 270
271 var taxAmount = $scope.ticketAmnt 271 var taxAmount = $scope.ticketAmnt
272 // $scope.taxTotal = (taxAmount * 18)/100 272 // $scope.taxTotal = (taxAmount * 18)/100
273 $scope.payingAmnt = taxAmount 273 $scope.payingAmnt = taxAmount
274 console.log("taxincludedamount----", $scope.payingAmnt) 274 console.log("taxincludedamount----", $scope.payingAmnt)
275 // } 275 // }
276 276
277 /*****THIS IS FOR STEP THREE FORM ******/ 277 /*****THIS IS FOR STEP THREE FORM ******/
278 // $scope.create = function() { 278 // $scope.create = function() {
279 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 279 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
280 // var x = document.getElementById("snackbar") 280 // var x = document.getElementById("snackbar")
281 // x.className = "show"; 281 // x.className = "show";
282 // setTimeout(function() { 282 // setTimeout(function() {
283 // x.className = x.className.replace("show", ""); 283 // x.className = x.className.replace("show", "");
284 // }, 3000); 284 // }, 3000);
285 // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 285 // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
286 // $scope.infoForm = true; 286 // $scope.infoForm = true;
287 // console.log("sdasdasdsa"); 287 // console.log("sdasdasdsa");
288 // $scope.data.stage = $scope.data.stage; 288 // $scope.data.stage = $scope.data.stage;
289 // $scope.detail = {}; 289 // $scope.detail = {};
290 // $scope.data.phone = "+91" + $scope.data.number; 290 // $scope.data.phone = "+91" + $scope.data.number;
291 // $http({ 291 // $http({
292 // method: 'POST', 292 // method: 'POST',
293 // url: BASE_URL + '/applicants', 293 // url: BASE_URL + '/applicants',
294 // data: $scope.data, 294 // data: $scope.data,
295 // headers: {} 295 // headers: {}
296 // }).then(function mySuccess(result) { 296 // }).then(function mySuccess(result) {
297 297
298 // console.log("=====result=====", result) 298 // console.log("=====result=====", result)
299 // $scope.detail = result; 299 // $scope.detail = result;
300 // data.applicantId = result.data.id; 300 // data.applicantId = result.data.id;
301 // $scope.userId = result.data.id; 301 // $scope.userId = result.data.id;
302 // console.log("=====data=====", data) 302 // console.log("=====data=====", data)
303 data.amount = $scope.payingAmnt; 303 data.amount = $scope.payingAmnt;
304 if ($scope.detail != null) { 304 if ($scope.detail != null) {
305 $http({ 305 $http({
306 method: 'POST', 306 method: 'POST',
307 url: BASE_URL + '/payments', 307 url: BASE_URL + '/payments',
308 data: data, 308 data: data,
309 headers: {} 309 headers: {}
310 }).then(function mySuccess(paymentResult) { 310 }).then(function mySuccess(paymentResult) {
311 Analytics.trackEvent('payments', 'click', 'django.mp4'); 311 Analytics.trackEvent('payments', 'click', 'django.mp4');
312 console.log("paymentResult",paymentResult) 312 console.log("paymentResult",paymentResult)
313 $scope.paymentResult = paymentResult; 313 $scope.paymentResult = paymentResult;
314 }, function myError(error) {}); 314 }, function myError(error) {});
315 } 315 }
316 var i = 0; 316 var i = 0;
317 $scope.payingAmnt = $scope.payingAmnt * 100; 317 $scope.payingAmnt = $scope.payingAmnt * 100;
318 var options = { 318 var options = {
319 "key": "rzp_live_mhSE1uOBlXvFyJ", 319 "key": "rzp_live_mhSE1uOBlXvFyJ",
320 "amount": $scope.payingAmnt, 320 "amount": $scope.payingAmnt,
321 321
322 "name": "Startup Jalsa", 322 "name": "Startup Jalsa",
323 "description": "amount", 323 "description": "amount",
324 "currency": "INR", 324 "currency": "INR",
325 "status": "done", 325 "status": "done",
326 326
327 "theme": { 327 "theme": {
328 "color": "#2196f3 ", 328 "color": "#2196f3 ",
329 "image_padding": "NO" 329 "image_padding": "NO"
330 }, 330 },
331 "modal": { 331 "modal": {
332 "ondismiss": function() {} 332 "ondismiss": function() {}
333 }, 333 },
334 "handler": function(response) { 334 "handler": function(response) {
335 createPayment(response); 335 createPayment(response);
336 } 336 }
337 }; 337 };
338 var rzp1 = new Razorpay(options); 338 var rzp1 = new Razorpay(options);
339 rzp1.open(); 339 rzp1.open();
340 $scope.paymentResponse = {}; 340 $scope.paymentResponse = {};
341 341
342 function createPayment(response) { 342 function createPayment(response) {
343 Analytics.trackEvent('payments', 'click', 'django.mp4'); 343 Analytics.trackEvent('payments', 'click', 'django.mp4');
344 console.log("response====from===razorpay",response) 344 console.log("response====from===razorpay",response)
345 $route.reload(); 345 $route.reload();
346 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 346 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
347 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 347 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
348 $scope.paymentResponse.amount = data.amount; 348 $scope.paymentResponse.amount = data.amount;
349 $scope.paymentResponse.currency = "INR"; 349 $scope.paymentResponse.currency = "INR";
350 $scope.paymentResponse.status = $scope.paymentResult.data.status; 350 $scope.paymentResponse.status = $scope.paymentResult.data.status;
351 $http({ 351 $http({
352 method: 'PUT', 352 method: 'PUT',
353 url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, 353 url: BASE_URL + '/payments/' + $scope.paymentResult.data.id,
354 data: $scope.paymentResponse, 354 data: $scope.paymentResponse,
355 headers: {} 355 headers: {}
356 }).then(function mySuccess(searchResult) { 356 }).then(function mySuccess(searchResult) {
357 Analytics.trackEvent('payments', 'click', 'django.mp4'); 357 Analytics.trackEvent('payments', 'click', 'django.mp4');
358 console.log("searchResult", searchResult) 358 console.log("searchResult", searchResult)
359 $location.path("/confirmation") 359 $location.path("/confirmation")
360 //$scope.showToastr() 360 //$scope.showToastr()
361 //toaster.success("Registration done successfully"); 361 //toaster.success("Registration done successfully");
362 362
363 }, function myError(error) {}); 363 }, function myError(error) {});
364 } 364 }
365 }, function myError(error) {}); 365 }, function myError(error) {});
366 } 366 }
367 367
368 } 368 }
369 369
370 //}, function myError(error) {}); 370 //}, function myError(error) {});
371 //} 371 //}
372 372
373 //} 373 //}
374 374
375 // $scope.showToastr = function() { 375 // $scope.showToastr = function() {
376 // console.log("called toast") 376 // console.log("called toast")
377 // var x = document.getElementById("snacsskbar") 377 // var x = document.getElementById("snacsskbar")
378 // x.className = "show"; 378 // x.className = "show";
379 // setTimeout(function() { 379 // setTimeout(function() {
380 // x.className = x.className.replace("show", ""); 380 // x.className = x.className.replace("show", "");
381 // }, 3000); 381 // }, 3000);
382 // } 382 // }
383 383
384 /*kk***This code for change data when click to chooses stages***/ 384 /*kk***This code for change data when click to chooses stages***/
385 $scope.proto = true; 385 $scope.proto = true;
386 $scope.businessmodel = true; 386 $scope.businessmodel = true;
387 $scope.Idea = true; 387 $scope.Idea = true;
388 $scope.current = true; 388 $scope.current = true;
389 389
390 $scope.stage = function(stage) { 390 $scope.stage = function(stage) {
391 $scope.stagekeyPress(); 391 $scope.stagekeyPress();
392 console.log("stage--2",stage) 392 console.log("stage--2",stage)
393 if (stage == 'Idea') { 393 if (stage == 'Idea') {
394 $scope.current = 10; 394 $scope.current = 10;
395 $scope.proto = true; 395 $scope.proto = true;
396 $scope.prototyp = false; 396 $scope.prototyp = false;
397 $scope.market = false; 397 $scope.market = false;
398 $scope.risks = false; 398 $scope.risks = false;
399 $scope.team = false; 399 $scope.team = false;
400 $scope.pitch = false; 400 $scope.pitch = false;
401 $scope.financials = false; 401 $scope.financials = false;
402 $scope.businessmodel = true; 402 $scope.businessmodel = true;
403 $scope.data.stage = stage; 403 $scope.data.stage = stage;
404 // for right content 404 // for right content
405 $scope.Idea = true; 405 $scope.Idea = true;
406 $scope.Product = false; 406 $scope.Product = false;
407 $scope.Growth = false; 407 $scope.Growth = false;
408 } else if (stage == 'Product') { 408 } else if (stage == 'Product') {
409 $scope.current = 10; 409 $scope.current = 10;
410 $scope.proto = true; 410 $scope.proto = true;
411 $scope.prototyp = true; 411 $scope.prototyp = true;
412 $scope.market = true; 412 $scope.market = true;
413 $scope.risks = true; 413 $scope.risks = true;
414 $scope.team = true; 414 $scope.team = true;
415 $scope.pitch = true; 415 $scope.pitch = true;
416 $scope.financials = true; 416 $scope.financials = true;
417 $scope.businessmodel = false; 417 $scope.businessmodel = false;
418 $scope.data.stage = stage; 418 $scope.data.stage = stage;
419 // for right content 419 // for right content
420 $scope.Idea = false; 420 $scope.Idea = false;
421 $scope.Product = true; 421 $scope.Product = true;
422 $scope.Growth = false; 422 $scope.Growth = false;
423 } else if (stage == 'Growth') { 423 } else if (stage == 'Growth') {
424 $scope.current = 10; 424 $scope.current = 10;
425 $scope.proto = false; 425 $scope.proto = false;
426 $scope.prototyp = true; 426 $scope.prototyp = true;
427 $scope.market = true; 427 $scope.market = true;
428 $scope.risks = true; 428 $scope.risks = true;
429 $scope.team = true; 429 $scope.team = true;
430 $scope.pitch = true; 430 $scope.pitch = true;
431 $scope.financials = true; 431 $scope.financials = true;
432 $scope.businessmodel = false; 432 $scope.businessmodel = false;
433 // for right content 433 // for right content
434 $scope.Idea = false; 434 $scope.Idea = false;
435 $scope.Product = false; 435 $scope.Product = false;
436 $scope.Growth = true; 436 $scope.Growth = true;
437 $scope.data.stage = stage; 437 $scope.data.stage = stage;
438 } 438 }
439 } 439 }
440 // $scope.enterbusiness = function(business) { 440 // $scope.enterbusiness = function(business) {
441 // console.log("business", business); 441 // console.log("business", business);
442 // if (name == undefined) { 442 // if (name == undefined) {
443 // $scope.current = false; 443 // $scope.current = false;
444 444
445 // } else if (name != undefined) { 445 // } else if (name != undefined) {
446 // $scope.current = true; 446 // $scope.current = true;
447 // } 447 // }
448 // } 448 // }
449 /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ 449 /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/
450 $scope.stagekeyPress = function() { 450 $scope.stagekeyPress = function() {
451 $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); 451 $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)');
452 } 452 }
453 $scope.sectorkeyPress = function() { 453 $scope.sectorkeyPress = function() {
454 $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); 454 $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)');
455 } 455 }
456 456
457 $scope.productLaunchkeyPress = function() { 457 $scope.productLaunchkeyPress = function() {
458 $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); 458 $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)');
459 } 459 }
460 460
461 $scope.launchPeriodkeyPress = function() { 461 $scope.launchPeriodkeyPress = function() {
462 $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)'); 462 $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)');
463 } 463 }
464 464
465 $scope.industrykeyPress = function() { 465 $scope.industrykeyPress = function() {
466 $scope.addOther = false; 466 $scope.addOther = false;
467 $scope.hideSelectBox = true; 467 $scope.hideSelectBox = true;
468 $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)'); 468 $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)');
469 var e = document.getElementById("dataIndustry"); 469 var e = document.getElementById("dataIndustry");
470 var dataIndustry = e.options[e.selectedIndex].value; 470 var dataIndustry = e.options[e.selectedIndex].value;
471 if(dataIndustry == "others") { 471 if(dataIndustry == "others") {
472 $scope.addOther = true; 472 $scope.addOther = true;
473 $scope.hideSelectBox = false; 473 $scope.hideSelectBox = false;
474 } 474 }
475 } 475 }
476 476
477 $scope.industryNamekeyPress = function(firstName) { 477 $scope.industryNamekeyPress = function(firstName) {
478 console.log("lastName==", firstName); 478 console.log("lastName==", firstName);
479 if (firstName == undefined) { 479 if (firstName == undefined) {
480 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 480 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
481 } else { 481 } else {
482 $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); 482 $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)');
483 } 483 }
484 } 484 }
485 485
486 $scope.amountkeyPress = function() { 486 $scope.amountkeyPress = function() {
487 $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)'); 487 $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)');
488 } 488 }
489 489
490 $scope.firstNamekeyPress = function(firstName) { 490 $scope.firstNamekeyPress = function(firstName) {
491 console.log("lastName==", firstName); 491 console.log("lastName==", firstName);
492 if (firstName == undefined) { 492 if (firstName == undefined) {
493 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); 493 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
494 } else { 494 } else {
495 $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); 495 $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)');
496 } 496 }
497 } 497 }
498 498
499 $scope.emailkeyPress = function(email) { 499 $scope.emailkeyPress = function(email) {
500 console.log("email", email); 500 console.log("email", email);
501 if (email == undefined) { 501 if (email == undefined) {
502 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); 502 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
503 } else { 503 } else {
504 $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); 504 $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)');
505 } 505 }
506 } 506 }
507 507
508 $scope.textCheck = function(){ 508 $scope.textCheck = function(){
509 console.log("Val1:::", $scope.textCheck); 509 console.log("Val1:::", $scope.textCheck);
510 var e = document.getElementById("fundingDiv"); 510 var e = document.getElementById("fundingDiv");
511 var funding = e.options[e.selectedIndex].value; 511 var funding = e.options[e.selectedIndex].value;
512 $scope.Textshow = "no"; 512 $scope.Textshow = "no";
513 if(funding == "yes") { 513 if(funding == "yes") {
514 $scope.Textshow = "yes"; 514 $scope.Textshow = "yes";
515 console.log("Val:::", $scope.Textshow); 515 console.log("Val:::", $scope.Textshow);
516 } 516 }
517 517
518 } 518 }
519 519
520 $scope.productCheck = function(){ 520 $scope.productCheck = function(){
521 console.log("Val2:::", $scope.productCheck); 521 console.log("Val2:::", $scope.productCheck);
522 var e = document.getElementById("productDiv"); 522 var e = document.getElementById("productDiv");
523 var product = e.options[e.selectedIndex].value; 523 var product = e.options[e.selectedIndex].value;
524 $scope.Productshow = "no"; 524 $scope.Productshow = "no";
525 if(product == "yes") { 525 if(product == "yes") {
526 $scope.Productshow = "yes"; 526 $scope.Productshow = "yes";
527 console.log("Val1:::", $scope.Productshow); 527 console.log("Val1:::", $scope.Productshow);
528 } 528 }
529 529
530 } 530 }
531 531
532 $scope.phonekeyPress = function(number) { 532 $scope.phonekeyPress = function(number) {
533 console.log("number", number); 533 console.log("number", number);
534 if (number == undefined || number == '') { 534 if (number == undefined || number == '') {
535 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); 535 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
536 } else { 536 } else {
537 $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); 537 $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)');
538 } 538 }
539 } 539 }
540 540
541 $scope.citykeyPress = function(city) { 541 $scope.citykeyPress = function(city) {
542 console.log("city", city); 542 console.log("city", city);
543 if (city == undefined) { 543 if (city == undefined) {
544 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); 544 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
545 } else { 545 } else {
546 $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); 546 $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)');
547 } 547 }
548 } 548 }
549 549
550 $scope.lastNamekeyPress = function(q) { 550 $scope.lastNamekeyPress = function(q) {
551 if (q == undefined) { 551 if (q == undefined) {
552 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); 552 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
553 } else { 553 } else {
554 $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); 554 $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)');
555 } 555 }
556 } 556 }
557 557
558 $scope.linkedInkeyPress = function(technology) { 558 $scope.linkedInkeyPress = function(technology) {
559 if (technology == undefined || technology == '') { 559 if (technology == undefined || technology == '') {
560 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); 560 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
561 } else { 561 } else {
562 $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); 562 $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)');
563 } 563 }
564 } 564 }
565 $scope.companykeyPress = function(problem) { 565 $scope.companykeyPress = function(problem) {
566 if (problem == undefined) { 566 if (problem == undefined) {
567 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); 567 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
568 } else { 568 } else {
569 $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); 569 $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)');
570 } 570 }
571 } 571 }
572 $scope.productNamekeyPress = function(solution) { 572 $scope.productNamekeyPress = function(solution) {
573 if (solution == undefined) { 573 if (solution == undefined) {
574 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); 574 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
575 } else { 575 } else {
576 $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); 576 $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)');
577 } 577 }
578 } 578 }
579 $scope.businesskeyPress = function(business) { 579 $scope.businesskeyPress = function(business) {
580 $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); 580 $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)');
581 } 581 }
582 582
583 $scope.websitekeyPress = function(prototype) { 583 $scope.websitekeyPress = function(prototype) {
584 if (prototype == undefined || prototype == '') { 584 if (prototype == undefined || prototype == '') {
585 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); 585 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
586 } else { 586 } else {
587 $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); 587 $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)');
588 } 588 }
589 } 589 }
590 590
591 $scope.employeekeyPress = function(market) { 591 $scope.employeekeyPress = function(market) {
592 if (market == undefined || market == '') { 592 if (market == undefined || market == '') {
593 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); 593 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
594 } else { 594 } else {
595 $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); 595 $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)');
596 } 596 }
597 } 597 }
598 598
599 $scope.annualkeyPress = function(risk) { 599 $scope.annualkeyPress = function(risk) {
600 if (risk == undefined || risk == '') { 600 if (risk == undefined || risk == '') {
601 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); 601 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
602 } else { 602 } else {
603 $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); 603 $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)');
604 } 604 }
605 } 605 }
606 606
607 $scope.revenuekeyPress = function(team) { 607 $scope.revenuekeyPress = function(team) {
608 if (team == undefined || team == '') { 608 if (team == undefined || team == '') {
609 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); 609 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
610 } else { 610 } else {
611 $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); 611 $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)');
612 } 612 }
613 } 613 }
614 614
615 $scope.descriptionkeyPress = function(pitch) { 615 $scope.descriptionkeyPress = function(pitch) {
616 if (pitch == undefined) { 616 if (pitch == undefined) {
617 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); 617 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
618 } else { 618 } else {
619 $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); 619 $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)');
620 } 620 }
621 } 621 }
622 622
623 $scope.removeNooError = function() { 623 $scope.removeNooError = function() {
624 $('#invalidIdea').css('display', 'block'); 624 $('#invalidIdea').css('display', 'block');
625 $('#noExist').css('display', 'none'); 625 $('#noExist').css('display', 'none');
626 }; 626 };
627 627
628 $scope.ideakeyPress = function(financial) { 628 $scope.ideakeyPress = function(financial) {
629 console.log("financial", financial); 629 console.log("financial", financial);
630 if (financial == undefined) { 630 if (financial == undefined) {
631 $('#invalidIdea').css('display', 'block'); 631 $('#invalidIdea').css('display', 'block');
632 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); 632 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
633 } else { 633 } else {
634 $('#invalidIdea').css('display', 'none'); 634 $('#invalidIdea').css('display', 'none');
635 $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); 635 $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)');
636 } 636 }
637 } 637 }
638 638
639 $scope.fundkeyPress = function(financial) { 639 $scope.fundkeyPress = function(financial) {
640 console.log("financial", financial); 640 console.log("financial", financial);
641 if (financial == undefined) { 641 if (financial == undefined) {
642 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); 642 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
643 } else { 643 } else {
644 $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)'); 644 $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)');
645 } 645 }
646 } 646 }
647 647
648 $scope.changeReferalIconColor = function(referalToken){ 648 $scope.changeReferalIconColor = function(referalToken){
649 if (referalToken == undefined || referalToken == '') { 649 if (referalToken == undefined || referalToken == '') {
650 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); 650 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
651 }else { 651 }else {
652 $('.referel-icon').css('background-color', 'rgb(66, 181, 73)'); 652 $('.referel-icon').css('background-color', 'rgb(66, 181, 73)');
653 } 653 }
654 } 654 }
655 655
656 }); 656 });
657 657
658 scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) { 658 scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) {
659 $scope.pendingPaymentId = $route.current.params.id 659 $scope.pendingPaymentId = $route.current.params.id
660 $http({ 660 $http({
661 method: "GET", 661 method: "GET",
662 url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, 662 url: BASE_URL + '/applicants/' + $scope.pendingPaymentId,
663 }).then(function mySuccess(response) { 663 }).then(function mySuccess(response) {
664 $scope.data = response.data; 664 $scope.data = response.data;
665 console.log("response-1", response); 665 console.log("response-1", response);
666 $scope.pendingPaymentId = $route.current.params.id; 666 $scope.pendingPaymentId = $route.current.params.id;
667 667
668 $http({ 668 $http({
669 method: "GET", 669 method: "GET",
670 url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', 670 url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}',
671 }).then(function mySuccess(response) { 671 }).then(function mySuccess(response) {
672 $scope.paymentRecord = response.data; 672 $scope.paymentRecord = response.data;
673 }, function myError(response) { 673 }, function myError(response) {
674 }); 674 });
675 }, function myError(response) { 675 }, function myError(response) {
676 $scope.myWelcome = response.statusText; 676 $scope.myWelcome = response.statusText;
677 }); 677 });
678 678
679 $scope.checkView = false; 679 $scope.checkView = false;
680 $scope.verifyView = false; 680 $scope.verifyView = false;
681 681
682 $scope.pendingPaymentId = ''; 682 $scope.pendingPaymentId = '';
683 683
684 $scope.update = function() { 684 $scope.update = function() {
685 685
686 $http({ 686 $http({
687 method: 'GET', 687 method: 'GET',
688 url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', 688 url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}',
689 headers: {} 689 headers: {}
690 }).then(function mySuccess(searchResult) { 690 }).then(function mySuccess(searchResult) {
691 //if (searchResult.data[0].status == "created") { 691 if (searchResult.data[0].status == "created") {
692 if (searchResult.data[0].status == "cancelled") { 692 //if (searchResult.data[0].status == "cancelled") {
693 $scope.checkView = true; 693 $scope.checkView = true;
694 $scope.verifyView = false; 694 $scope.verifyView = false;
695 $scope.amount = searchResult.data[0].amount; 695 $scope.amount = searchResult.data[0].amount;
696 $scope.searchResult = searchResult.data[0]; 696 $scope.searchResult = searchResult.data[0];
697 console.log('====searchResult===', searchResult); 697 console.log('====searchResult===', searchResult);
698 console.log("searchResult=====",searchResult.data[0].razorOrderId) 698 console.log("searchResult=====",searchResult.data[0].razorOrderId)
699 var i = 0; 699 var i = 0;
700 $scope.amount = $scope.amount * 100; 700 $scope.amount = $scope.amount * 100;
701 var options = { 701 var options = {
702 "key": "rzp_live_mhSE1uOBlXvFyJ", 702 "key": "rzp_live_mhSE1uOBlXvFyJ",
703 //"key" : "rzp_test_YwHsVFiDIQ2WUQ", 703 //"key" : "rzp_test_YwHsVFiDIQ2WUQ",
704 "amount": $scope.amount, 704 "amount": $scope.amount,
705 705
706 "name": "Startup Jalsa", 706 "name": "Startup Jalsa",
707 "description": "amount", 707 "description": "amount",
708 "currency": "INR", 708 "currency": "INR",
709 "status": "done", 709 "status": "done",
710 710
711 "theme": { 711 "theme": {
712 "color": "#2196f3 ", 712 "color": "#2196f3 ",
713 "image_padding": "NO" 713 "image_padding": "NO"
714 }, 714 },
715 "modal": { 715 "modal": {
716 "ondismiss": function() {} 716 "ondismiss": function() {}
717 }, 717 },
718 "handler": function(response) { 718 "handler": function(response) {
719 createPayment(response); 719 createPayment(response);
720 } 720 }
721 }; 721 };
722 var rzp1 = new Razorpay(options); 722 var rzp1 = new Razorpay(options);
723 rzp1.open(); 723 rzp1.open();
724 $scope.paymentResponse = {}; 724 $scope.paymentResponse = {};
725 function createPayment(response) { 725 function createPayment(response) {
726 $scope.amount = $scope.amount / 100; 726 $scope.amount = $scope.amount / 100;
727 console.log("response======retepaymen",response); 727 console.log("response======retepaymen",response);
728 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 728 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
729 $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; 729 $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId;
730 $scope.paymentResponse.amount = $scope.amount; 730 $scope.paymentResponse.amount = $scope.amount;
731 $scope.paymentResponse.currency = $scope.searchResult.currency; 731 $scope.paymentResponse.currency = $scope.searchResult.currency;
732 $scope.paymentResponse.status = $scope.searchResult.status; 732 $scope.paymentResponse.status = $scope.searchResult.status;
733 $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; 733 $scope.paymentResponse.applicantId = $scope.searchResult.applicantId;
734 console.log("$scope.paymentResponse", $scope.paymentResponse) 734 console.log("$scope.paymentResponse", $scope.paymentResponse)
735 $http({ 735 $http({
736 method: 'PUT', 736 method: 'PUT',
737 url: BASE_URL + '/payments/' + $scope.searchResult.id, 737 url: BASE_URL + '/payments/' + $scope.searchResult.id,
738 data: $scope.paymentResponse, 738 data: $scope.paymentResponse,
739 headers: {} 739 headers: {}
740 }).then(function mySuccess(searchResult) { 740 }).then(function mySuccess(searchResult) {
741 console.log("finalsearchResult",searchResult) 741 console.log("finalsearchResult",searchResult)
742 $location.path("/confirmation") 742 $location.path("/confirmation")
743 }, function myError(error) { 743 }, function myError(error) {
744 744
745 }); 745 });
746 } 746 }
747 } else { 747 } else {
748 748
749 } 749 }
750 750
751 }, function myError(error) {}); 751 }, function myError(error) {});
752 } 752 }
753 }); 753 });
754 754
755 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { 755 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) {
756 $scope.data = {}; 756 $scope.data = {};
757 $scope.check = false; 757 $scope.check = false;
758 $scope.numberCheck = false; 758 $scope.numberCheck = false;
759 759
760 /*open videos in modal*/ 760 /*open videos in modal*/
761 $scope.openyoutube16 = function(){ 761 $scope.openyoutube16 = function(){
762 $('#videoModel').modal('show'); 762 $('#videoModel').modal('show');
763 } 763 }
764 764
765 $scope.openyoutube17 = function(){ 765 $scope.openyoutube17 = function(){
766 $('#videoModels').modal('show'); 766 $('#videoModels').modal('show');
767 } 767 }
768 768
769 $scope.closeModal = function(){ 769 $scope.closeModal = function(){
770 var url = $('#youtubePlayer').attr('src'); 770 var url = $('#youtubePlayer').attr('src');
771 $('#youtubePlayer').attr('src', ''); 771 $('#youtubePlayer').attr('src', '');
772 $('#youtubePlayer').attr('src', url); 772 $('#youtubePlayer').attr('src', url);
773 } 773 }
774 /*open videos ends here*/ 774 /*open videos ends here*/
775 775
776 $scope.removeError = function() { 776 $scope.removeError = function() {
777 $('#invalidEmail').css('display', 'none'); 777 $('#invalidEmail').css('display', 'none');
778 $('#alreadyExist').css('display', 'none'); 778 $('#alreadyExist').css('display', 'none');
779 }; 779 };
780 780
781 $scope.emailcheck = function(val) { 781 $scope.emailcheck = function(val) {
782 if (val == undefined) { 782 if (val == undefined) {
783 $('#invalidEmail').css('display', 'block'); 783 $('#invalidEmail').css('display', 'block');
784 } else { 784 } else {
785 $http({ 785 $http({
786 method: 'GET', 786 method: 'GET',
787 url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', 787 url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}',
788 headers: {} 788 headers: {}
789 }).then(function mySuccess(searchResult) { 789 }).then(function mySuccess(searchResult) {
790 console.log("searchResult1===>", searchResult) 790 console.log("searchResult1===>", searchResult)
791 if (searchResult.data.length == 0) { 791 if (searchResult.data.length == 0) {
792 $scope.check = false; 792 $scope.check = false;
793 } else { 793 } else {
794 $scope.check = true; 794 $scope.check = true;
795 $('#alreadyExist').css('display', 'block'); 795 $('#alreadyExist').css('display', 'block');
796 } 796 }
797 }, function myError(error) {}); 797 }, function myError(error) {});
798 } 798 }
799 }; 799 };
800 800
801 $scope.removeNoError = function() { 801 $scope.removeNoError = function() {
802 $('#invalidNumber').css('display', 'none'); 802 $('#invalidNumber').css('display', 'none');
803 $('#noExist').css('display', 'none'); 803 $('#noExist').css('display', 'none');
804 }; 804 };
805 805
806 $scope.numbercheck = function(number) { 806 $scope.numbercheck = function(number) {
807 // if (val == undefined) { 807 // if (val == undefined) {
808 // $('#invalidNumber').css('display', 'block'); 808 // $('#invalidNumber').css('display', 'block');
809 // } else { 809 // } else {
810 $http({ 810 $http({
811 method: 'GET', 811 method: 'GET',
812 url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}', 812 url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}',
813 data: $scope.data, 813 data: $scope.data,
814 headers: {} 814 headers: {}
815 }).then(function mySuccess(searchResult) { 815 }).then(function mySuccess(searchResult) {
816 console.log("searchResult===>", searchResult) 816 console.log("searchResult===>", searchResult)
817 if (searchResult.data.length == 0) { 817 if (searchResult.data.length == 0) {
818 $scope.numberCheck = false; 818 $scope.numberCheck = false;
819 } else { 819 } else {
820 $scope.numberCheck = true; 820 $scope.numberCheck = true;
821 $('#noExist').css('display', 'block'); 821 $('#noExist').css('display', 'block');
822 } 822 }
823 }, function myError(error) {}); 823 }, function myError(error) {});
824 //} 824 //}
825 825
826 }; 826 };
827 827
828 $scope.submit = function() { 828 $scope.submit = function() {
829 console.log($scope.data.name) 829 console.log($scope.data.name)
830 var randomNumber = ""+Math.random(); 830 var randomNumber = ""+Math.random();
831 var nameSpliced = $scope.data.name.slice(0,3); 831 var nameSpliced = $scope.data.name.slice(0,3);
832 var numberSpliced = randomNumber.slice(2,5); 832 var numberSpliced = randomNumber.slice(2,5);
833 $scope.data.referalToken = nameSpliced+numberSpliced; 833 $scope.data.referalToken = nameSpliced+numberSpliced;
834 $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); 834 $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
835 835
836 $http({ 836 $http({
837 method: 'POST', 837 method: 'POST',
838 url: BASE_URL + '/ambassadors', 838 url: BASE_URL + '/ambassadors',
839 data: $scope.data, 839 data: $scope.data,
840 headers: {} 840 headers: {}
841 }).then(function mySuccess(result) { 841 }).then(function mySuccess(result) {
842 console.log("result", result) 842 console.log("result", result)
843 $scope.detail = result; 843 $scope.detail = result;
844 $('#myModal').modal('show'); 844 $('#myModal').modal('show');
845 $scope.data.name = ''; 845 $scope.data.name = '';
846 $scope.data.email = ''; 846 $scope.data.email = '';
847 $scope.data.mobile = ''; 847 $scope.data.mobile = '';
848 848
849 }, function myError(error) { 849 }, function myError(error) {
850 console.log(error) 850 console.log(error)
851 console.log(error.data.error.message) 851 console.log(error.data.error.message)
852 }); 852 });
853 console.log($scope.data) 853 console.log($scope.data)
854 } 854 }
855 }); 855 });
856 856
857 857
858 858
859 859