Blame view

script.js 33.1 KB
53b83aa9e   Palak Handa   first commit
1
  	// create the module and name it scotchApp
f263889f0   Palak Handa   analytics work
2
  	var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']);
53b83aa9e   Palak Handa   first commit
3
4
5
  
  	// configure our routes
  	scotchApp.config(function($routeProvider) {
6ae8d3cdd   Palak Handa   add new module
6
  	    $routeProvider
dcb703070   Palak Handa   updated new form ...
7
  	    	// route for the Home page
6ae8d3cdd   Palak Handa   add new module
8
  	        .when('/', {
dcb703070   Palak Handa   updated new form ...
9
10
11
12
13
14
15
  	            templateUrl: 'pages/Home.html',
  	            controller: 'mainController'
  	        })
  
  	        // route for the registration page
  	        .when('/registration', {
  	            templateUrl: 'pages/registration.html',
6ae8d3cdd   Palak Handa   add new module
16
17
  	            controller: 'mainController'
  	        })
2d6a9fbea   Palak Handa   complete bugs
18
  	        // route for the paymentVerify page
4de569579   Palak Handa   design update
19
  	        .when('/pendingPayment/:id', {
6ae8d3cdd   Palak Handa   add new module
20
21
22
23
24
25
26
27
28
  	            templateUrl: 'pages/verify.html',
  	            controller: 'verifyController'
  	        })
  
  	        // route for the ambassador page
  	        .when('/ambassador', {
  	            templateUrl: 'pages/ambassador.html',
  	            controller: 'ambassadorController'
  	        })
5348de778   Palak Handa   design updated
29
30
31
32
33
34
  
  	        // route for the confirmation page
  	        .when('/confirmation', {
  	            templateUrl: 'pages/confirmation.html',
  	            controller: 'mainController'
  	        })
6ae8d3cdd   Palak Handa   add new module
35
  	});
53b83aa9e   Palak Handa   first commit
36

f263889f0   Palak Handa   analytics work
37
38
  	scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
  	   	// Add configuration code as desired
61b69ada0   Palak Handa   design updated
39
  	   	 AnalyticsProvider.setAccount('UA-106416759-1');  //UU-XXXXXXX-X should be your tracking code
f263889f0   Palak Handa   analytics work
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) { }]);
c98129dd2   Palak Handa   baseurl change
48
  	scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/api")
c62079487   Palak Handa   updated design
49
  	//scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/api")
6ae8d3cdd   Palak Handa   add new module
50

2d6a9fbea   Palak Handa   complete bugs
51
  	// create the controller and inject Angular's $scope
f263889f0   Palak Handa   analytics work
52
  	scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) {
6ae8d3cdd   Palak Handa   add new module
53
54
55
56
  	    $scope.data = {
  	        show: true,
  	        hide: false
  	    };
2f9a20645   Palak Handa   add timer
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  
  	    var countDownDate = new Date("Nov 9, 2017 00: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 = countDownDate - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("chennai").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("chennai").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
6ae8d3cdd   Palak Handa   add new module
81
  	    $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
e847b36f8   Palak Handa   minor changes
82
  	    $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
c62079487   Palak Handa   updated design
83
  	    // $scope.Textshow = "yes"
6ae8d3cdd   Palak Handa   add new module
84
  	    $scope.max = 100;
88dd26b3d   Palak Handa   update
85
  	    $scope.formPage = false;
6ae8d3cdd   Palak Handa   add new module
86
87
88
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
  	    if ($scope.data.stage == 'select') {
6ae8d3cdd   Palak Handa   add new module
89

53b83aa9e   Palak Handa   first commit
90
  	    }
439352ca6   Palak Handa   base url changes
91
  	    //$scope.author = 'Swarn Singh';
6ae8d3cdd   Palak Handa   add new module
92
93
  	    $scope.data = {};
  	    $scope.data.stage = 'Idea';
ea3c31126   Palak Handa   complete
94
  	    $scope.discountAmount = 0;
6ae8d3cdd   Palak Handa   add new module
95
96
  	    $scope.check = false;
  	    $scope.numberCheck = false;
6ae8d3cdd   Palak Handa   add new module
97
  	    $scope.paymentResult = {};
6ae8d3cdd   Palak Handa   add new module
98
99
100
101
102
  	    var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  	        "status": "pending"
  	    }
53b83aa9e   Palak Handa   first commit
103

5259a7d0e   Digvijay Singh   video links added
104
  	    /*open videos in modal*/
b8938eb77   Palak Handa   add content
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
  	  //   $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   Digvijay Singh   video links added
125
  	    /*open videos ends here*/
dcb703070   Palak Handa   updated new form ...
126
  	    $scope.apply = function() {
ba3b9219e   Palak Handa   minor changes
127
  	    	Analytics.trackEvent('register', 'click', 'django.mp4');
dcb703070   Palak Handa   updated new form ...
128
129
  			$location.path("/registration")
  		}
88dd26b3d   Palak Handa   update
130
131
132
133
134
135
136
137
138
  		$scope.data.citymeetup = '';
  		$scope.register = function(value){
  			$scope.data.citymeetup = value;
  			$('.hiddenForm').slideDown();
  			$('html, body').animate({
  		        scrollTop: $('.hiddenForm').offset().top
  		    }, 1000);
  			console.log('gdggsg', value);
  		}
5259a7d0e   Digvijay Singh   video links added
139

5348de778   Palak Handa   design updated
140
141
142
143
  	    $scope.removeError = function() {
  	        $('#invalidEmail').css('display', 'none');
  	        $('#alreadyExist').css('display', 'none');
  	    };
6ae8d3cdd   Palak Handa   add new module
144
  	    $scope.emailcheck = function(val) {
e847b36f8   Palak Handa   minor changes
145
146
147
  	    	console.log(val)
  			$scope.space = /\s/g.test(val);
      		console.log("space",$scope.space)
6ae8d3cdd   Palak Handa   add new module
148
149
150
151
152
153
  	        if (val == undefined) {
  	            $('#invalidEmail').css('display', 'block');
  	        } else {
  	            $http({
  	                method: 'GET',
  	                url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}',
6ae8d3cdd   Palak Handa   add new module
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
  	                headers: {}
  	            }).then(function mySuccess(searchResult) {
  	                console.log("searchResult1===>", searchResult)
  	                if (searchResult.data.length == 0) {
  	                    $scope.check = false;
  	                } else {
  	                    $scope.check = true;
  	                    $('#alreadyExist').css('display', 'block');
  	                }
  	            }, function myError(error) {});
  	        }
  	    };
  
  	    $scope.removeNoError = function() {
  	        $('#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;
ea3c31126   Palak Handa   complete
181

6ae8d3cdd   Palak Handa   add new module
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
  	            } else {
  	                $scope.numberCheck = true;
  	                $('#noExist').css('display', 'block');
  	            }
  	        }, function myError(error) {});
  	    };
  
  	    $rootScope.tokenCall = function(val) {
  	        console.log('val-------->', val);
  	        if (val == undefined) {
  	            $('#invalidEmail').css('display', 'block');
  	        } else {
  	        	val = val.toUpperCase();
  	        	$http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}')
  				    .then(function(searchResult) {
  				        if (searchResult.data.length == 0) {
  	                    	$scope.tokencheck = false;
ea3c31126   Palak Handa   complete
199
  	                    	 $scope.discountAmount = 0;
6ae8d3cdd   Palak Handa   add new module
200
  	                	} else {
6ae8d3cdd   Palak Handa   add new module
201
  	                    	$scope.tokencheck = true;
6ae8d3cdd   Palak Handa   add new module
202
203
204
205
  	                	}
  				    },function(err){
  				    	console.log(err)
  				});
53b83aa9e   Palak Handa   first commit
206
  	           
6ae8d3cdd   Palak Handa   add new module
207
208
  	        }
  	    };
e847b36f8   Palak Handa   minor changes
209
  	    
c62079487   Palak Handa   updated design
210

6ae8d3cdd   Palak Handa   add new module
211
212
213
214
215
216
217
218
219
220
221
222
  	    /*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);
  	                    }
  	                });
53b83aa9e   Palak Handa   first commit
223
  	        });
6ae8d3cdd   Palak Handa   add new module
224
225
  
  	    /*****THIS IS FOR STEP ONE FORM ******/
dcb703070   Palak Handa   updated new form ...
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
  	    // $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   Palak Handa   analytics work
255

dcb703070   Palak Handa   updated new form ...
256
  	    // }
6ae8d3cdd   Palak Handa   add new module
257

ea3c31126   Palak Handa   complete
258
  	    $scope.calculateAmount =  function(){
dcb703070   Palak Handa   updated new form ...
259
  	        if ($scope.data.stage == undefined || $scope.data.firstName == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) {
9842ccd27   Palak Handa   changes api call
260
261
262
263
264
  	            var x = document.getElementById("snackbar")
  	            x.className = "show";
  	            setTimeout(function() {
  	                x.className = x.className.replace("show", "");
  	            }, 3000);
dcb703070   Palak Handa   updated new form ...
265
  	        } else if ($scope.data.stage != undefined && $scope.data.firstName != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) {
9842ccd27   Palak Handa   changes api call
266
267
268
269
270
271
272
273
274
275
276
  	            $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) {
9ad22ae22   Palak Handa   work on google an...
277
  	            	Analytics.trackEvent('applicants', 'click', 'django.mp4');
9842ccd27   Palak Handa   changes api call
278
279
280
  	                console.log("result", result)
  	                $scope.detail = result;
  	                data.applicantId = result.data.id;
d122fec29   Palak Handa   modify
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
  	                //$scope.userId = result.data.id;
  
  		    	if ($scope.data.stage == "Idea") {
  		            console.log("$scope.data", $scope.data)
  		            $scope.ticketAmnt = 500;
  		        }
  
  		        if ($scope.data.stage == "Product") {
  		            $scope.ticketAmnt = 1000;
  		        }
  
  		        if ($scope.data.stage == "Growth") {
  		            $scope.ticketAmnt = 1000;
  		        }
  		        var amount = $scope.ticketAmnt * 100
  		        if($scope.tokencheck == true){
  			        var amount = $scope.ticketAmnt
  				    // $scope.discountAmount = (amount * 10)/100
  				    console.log("finalAmount====>",$scope.payingAmnt)
  		        }
  
  		        var taxAmount = $scope.ticketAmnt
  	            // $scope.taxTotal = (taxAmount * 18)/100
  	            $scope.payingAmnt = taxAmount 
  	            console.log("taxincludedamount----", $scope.payingAmnt)
  		    // }
  
  		    /*****THIS IS FOR STEP THREE FORM ******/
  		    // $scope.create = function() {
  		        // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
  		        //     var x = document.getElementById("snackbar")
  		        //     x.className = "show";
  		        //     setTimeout(function() {
  		        //         x.className = x.className.replace("show", "");
  		        //     }, 3000);
  		        // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
  		        //     $scope.infoForm = true;
  		        //     console.log("sdasdasdsa");
  		        //     $scope.data.stage = $scope.data.stage;
  		        //     $scope.detail = {};
  		        //     $scope.data.phone = "+91" + $scope.data.number;
  		        //     $http({
  		        //         method: 'POST',
  		        //         url: BASE_URL + '/applicants',
  		        //         data: $scope.data,
  		        //         headers: {}
  		        //     }).then(function mySuccess(result) {
  
  		        //         console.log("=====result=====", result)
  		        //         $scope.detail = result;
  		        //         data.applicantId = result.data.id;
  		        //         $scope.userId = result.data.id;
  		        //         console.log("=====data=====", data)
  		                data.amount = $scope.payingAmnt;
  		                if ($scope.detail != null) {
  		                    $http({
  		                        method: 'POST',
  		                        url: BASE_URL + '/payments',
  		                        data: data,
  		                        headers: {}
  		                    }).then(function mySuccess(paymentResult) {
  		    					Analytics.trackEvent('payments', 'click', 'django.mp4');
  		                    	console.log("paymentResult",paymentResult)
  		                        $scope.paymentResult = paymentResult;
  		                    }, function myError(error) {});
  		                }
  		                var i = 0;
  		                 $scope.payingAmnt =  $scope.payingAmnt * 100;
  		                var options = {
f57ff334e   Palak Handa   update the code
350
  		                    "key": "rzp_live_mhSE1uOBlXvFyJ",
d122fec29   Palak Handa   modify
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
  		                    "amount": $scope.payingAmnt,
  
  		                    "name": "Startup Jalsa",
  		                    "description": "amount",
  		                    "currency": "INR",
  		                    "status": "done",
  
  		                    "theme": {
  		                        "color": "#2196f3 ",
  		                        "image_padding": "NO"
  		                    },
  		                    "modal": {
  		                        "ondismiss": function() {}
  		                    },
  		                    "handler": function(response) {
  		                        createPayment(response);
  		                    }
  		                };
  		                var rzp1 = new Razorpay(options);
  		                rzp1.open();
  		                $scope.paymentResponse = {};
  
  		                function createPayment(response) {
  		                	Analytics.trackEvent('payments', 'click', 'django.mp4');
  		                	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;
  		                    $http({
  		                        method: 'PUT',
  		                        url: BASE_URL + '/payments/' + $scope.paymentResult.data.id,
  		                        data: $scope.paymentResponse,
  		                        headers: {}
  		                    }).then(function mySuccess(searchResult) {
  		                    	Analytics.trackEvent('payments', 'click', 'django.mp4');
  		                        console.log("searchResult", searchResult)
  		                        $location.path("/confirmation")
  		                        //$scope.showToastr()
  		                        //toaster.success("Registration done successfully");
  
  		                    }, function myError(error) {});
  		                }
  		            }, function myError(error) {});
  		        }
  
  	    	}
dcb703070   Palak Handa   updated new form ...
400

9842ccd27   Palak Handa   changes api call
401
402
  	            //}, function myError(error) {});
  	        //}
6ae8d3cdd   Palak Handa   add new module
403

dcb703070   Palak Handa   updated new form ...
404
  	    //}
6ae8d3cdd   Palak Handa   add new module
405

5348de778   Palak Handa   design updated
406
407
408
409
410
411
412
413
  	    // $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   Palak Handa   add new module
414

6ae8d3cdd   Palak Handa   add new module
415
  	    /*kk***This code for change data when click to chooses stages***/
163c5adae   Palak Handa   minor changes
416
417
418
419
420
421
422
423
  	    $scope.proto = true;
  	    $scope.businessmodel = true;
  	    $scope.Idea = true;
  	    $scope.current = true;
  
  	    $scope.stage = function(stage) {
  	    $scope.stagekeyPress();
  	    console.log("stage--2",stage)
e847b36f8   Palak Handa   minor changes
424

163c5adae   Palak Handa   minor changes
425
  	        if (stage == 'Idea') {
e847b36f8   Palak Handa   minor changes
426
  	        	$scope.Productshow = "no";
163c5adae   Palak Handa   minor changes
427
428
429
  	            $scope.current = 10;
  	            $scope.proto = true;
  	            $scope.prototyp = false;
713fd1603   Palak Handa   minor changes
430
  	            $scope.protyp = false;
163c5adae   Palak Handa   minor changes
431
432
433
434
435
436
437
438
439
440
441
442
  	            $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;
  	        } else if (stage == 'Product') {
e847b36f8   Palak Handa   minor changes
443
  	        	$scope.Productshow = "no";
163c5adae   Palak Handa   minor changes
444
445
446
  	            $scope.current = 10;
  	            $scope.proto = true;
  	            $scope.prototyp = true;
713fd1603   Palak Handa   minor changes
447
  	            $scope.protyp = true;
163c5adae   Palak Handa   minor changes
448
449
450
451
452
453
454
455
456
457
458
459
  	            $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;
  	        } else if (stage == 'Growth') {
e847b36f8   Palak Handa   minor changes
460
  	        	$scope.Productshow = "yes";
163c5adae   Palak Handa   minor changes
461
462
  	            $scope.current = 10;
  	            $scope.proto = false;
e847b36f8   Palak Handa   minor changes
463
464
  	            $scope.prototyp = true;
  	            $scope.protyp = false;
163c5adae   Palak Handa   minor changes
465
466
467
468
469
470
471
472
473
474
475
476
477
  	            $scope.market = true;
  	            $scope.risks = true;
  	            $scope.team = true;
  	            $scope.pitch = true;
  	            $scope.financials = true;
  	            $scope.businessmodel = false;
  	            // for right content
  	            $scope.Idea = false;
  	            $scope.Product = false;
  	            $scope.Growth = true;
  	            $scope.data.stage = stage;
  	        }
  	    }
e847b36f8   Palak Handa   minor changes
478
479
480
481
482
483
  
  	    $scope.emailTest = function(s){
      		$scope.space = /\s/g.test(s.delegateTarget.value);
      		console.log("space",$scope.space)
  
  		}	
c62079487   Palak Handa   updated design
484
485
486
487
  	    // $scope.enterbusiness = function(business) {
  	    //     console.log("business", business);
  	    //     if (name == undefined) {
  	    //         $scope.current = false;
2d6a9fbea   Palak Handa   complete bugs
488

c62079487   Palak Handa   updated design
489
490
491
492
  	    //     } else if (name != undefined) {
  	    //         $scope.current = true;
  	    //     }
  	    // }
6ae8d3cdd   Palak Handa   add new module
493
494
495
496
497
498
499
  	    /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/
  	    $scope.stagekeyPress = function() {
  	        $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)');
  	    }
  	    $scope.sectorkeyPress = function() {
  	        $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)');
  	    }
163c5adae   Palak Handa   minor changes
500
  	    $scope.productLaunchkeyPress = function() {
6ae8d3cdd   Palak Handa   add new module
501
502
  	        $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)');
  	    }
163c5adae   Palak Handa   minor changes
503
  	    $scope.launchPeriodkeyPress = function() {
c62079487   Palak Handa   updated design
504
505
506
507
  	        $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)');
  	    }
  
  	    $scope.industrykeyPress = function() {
204302c02   Palak Handa   minor changes
508
509
  	    	$scope.addOther = false;
  			$scope.hideSelectBox = true;
c62079487   Palak Handa   updated design
510
  	        $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)');
4697da41f   Palak Handa   updated code
511
512
513
514
515
516
  	        var e = document.getElementById("dataIndustry");
  			var dataIndustry = e.options[e.selectedIndex].value;
  			if(dataIndustry == "others") {
  				$scope.addOther = true;
  				$scope.hideSelectBox = false;
  			}
c62079487   Palak Handa   updated design
517
  	    }
204302c02   Palak Handa   minor changes
518
519
520
521
522
523
524
525
  	    $scope.industryNamekeyPress = function(firstName) {
  	        console.log("lastName==", firstName);
  	        if (firstName == undefined) {
  	            $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
c62079487   Palak Handa   updated design
526
527
528
  	    $scope.amountkeyPress = function() {
  	        $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)');
  	    }
dcb703070   Palak Handa   updated new form ...
529
530
531
  	    $scope.firstNamekeyPress = function(firstName) {
  	        console.log("lastName==", firstName);
  	        if (firstName == undefined) {
6ae8d3cdd   Palak Handa   add new module
532
533
534
535
536
  	            $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
537

6ae8d3cdd   Palak Handa   add new module
538
539
540
541
542
543
544
545
  	    $scope.emailkeyPress = function(email) {
  	        console.log("email", email);
  	        if (email == undefined) {
  	            $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
163c5adae   Palak Handa   minor changes
546
  	    $scope.textCheck = function(){
4697da41f   Palak Handa   updated code
547
  	    	console.log("Val1:::", $scope.textCheck);
163c5adae   Palak Handa   minor changes
548
549
  	    	var e = document.getElementById("fundingDiv");
  			var funding = e.options[e.selectedIndex].value;
204302c02   Palak Handa   minor changes
550
  			$scope.Textshow = "no";
163c5adae   Palak Handa   minor changes
551
  			if(funding == "yes") {
204302c02   Palak Handa   minor changes
552
  				$scope.Textshow = "yes";
163c5adae   Palak Handa   minor changes
553
554
555
  	    	 	console.log("Val:::", $scope.Textshow);
  			}
  	    	
c62079487   Palak Handa   updated design
556
  	    }
4697da41f   Palak Handa   updated code
557
558
559
560
561
562
563
564
565
566
567
  	    $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   Palak Handa   add new module
568
569
570
  
  	    $scope.phonekeyPress = function(number) {
  	        console.log("number", number);
204302c02   Palak Handa   minor changes
571
  	        if (number == undefined || number == '') {
6ae8d3cdd   Palak Handa   add new module
572
573
574
575
576
577
578
579
580
581
582
583
584
585
  	            $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
  
  	    $scope.citykeyPress = function(city) {
  	        console.log("city", city);
  	        if (city == undefined) {
  	            $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
586
  	    $scope.lastNamekeyPress = function(q) {
6ae8d3cdd   Palak Handa   add new module
587
588
589
590
591
592
  	        if (q == undefined) {
  	            $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
593
  	    $scope.linkedInkeyPress = function(technology) {
204302c02   Palak Handa   minor changes
594
  	        if (technology == undefined || technology == '') {
6ae8d3cdd   Palak Handa   add new module
595
596
597
598
599
  	            $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
600
  	    $scope.companykeyPress = function(problem) {
6ae8d3cdd   Palak Handa   add new module
601
602
603
604
605
606
  	        if (problem == undefined) {
  	            $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
607
  	    $scope.productNamekeyPress = function(solution) {
6ae8d3cdd   Palak Handa   add new module
608
609
610
611
612
613
614
615
616
  	        if (solution == undefined) {
  	            $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
  	    $scope.businesskeyPress = function(business) {
  	        $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)');
  	    }
dcb703070   Palak Handa   updated new form ...
617
  	    $scope.websitekeyPress = function(prototype) {
204302c02   Palak Handa   minor changes
618
  	        if (prototype == undefined  || prototype == '') {
6ae8d3cdd   Palak Handa   add new module
619
620
621
622
623
  	            $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
624
  	    $scope.employeekeyPress = function(market) {
204302c02   Palak Handa   minor changes
625
  	        if (market == undefined || market == '') {
6ae8d3cdd   Palak Handa   add new module
626
627
628
629
630
  	            $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
631
  	    $scope.annualkeyPress = function(risk) {
204302c02   Palak Handa   minor changes
632
  	        if (risk == undefined || risk == '') {
6ae8d3cdd   Palak Handa   add new module
633
634
635
636
637
  	            $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
638
  	    $scope.revenuekeyPress = function(team) {
204302c02   Palak Handa   minor changes
639
  	        if (team == undefined || team == '') {
6ae8d3cdd   Palak Handa   add new module
640
641
642
643
644
  	            $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
645
  	    $scope.descriptionkeyPress = function(pitch) {
6ae8d3cdd   Palak Handa   add new module
646
647
648
649
650
651
  	        if (pitch == undefined) {
  	            $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
91eeb4455   Palak Handa   modify
652
653
654
655
  	    $scope.removeNooError = function() {
  	    	$('#invalidIdea').css('display', 'block');
  	        $('#noExist').css('display', 'none');
  	    };
c62079487   Palak Handa   updated design
656
  	    $scope.ideakeyPress = function(financial) {
6ae8d3cdd   Palak Handa   add new module
657
658
  	        console.log("financial", financial);
  	        if (financial == undefined) {
91eeb4455   Palak Handa   modify
659
  	        	$('#invalidIdea').css('display', 'block');
6ae8d3cdd   Palak Handa   add new module
660
661
  	            $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
91eeb4455   Palak Handa   modify
662
  	        	$('#invalidIdea').css('display', 'none');
6ae8d3cdd   Palak Handa   add new module
663
664
665
  	            $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
c62079487   Palak Handa   updated design
666
667
668
669
670
671
672
673
674
  
  	    $scope.fundkeyPress = function(financial) {
  	        console.log("financial", financial);
  	        if (financial == undefined) {
  	            $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
2d6a9fbea   Palak Handa   complete bugs
675
676
677
678
679
680
681
  	    $scope.changeReferalIconColor = function(referalToken){
  	    	if (referalToken == undefined || referalToken == '') {
  	    		$('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
  	    	}else {
  	            $('.referel-icon').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
6ae8d3cdd   Palak Handa   add new module
682

53b83aa9e   Palak Handa   first commit
683
  	});
2d6a9fbea   Palak Handa   complete bugs
684
  	scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) {
d8feb0ddb   Palak Handa   design updated
685
  	    $scope.pendingPaymentId = $route.current.params.id
6ae8d3cdd   Palak Handa   add new module
686
687
688
689
690
691
  	    $http({
  	        method: "GET",
  	        url: BASE_URL + '/applicants/' + $scope.pendingPaymentId,
  	    }).then(function mySuccess(response) {
  	        $scope.data = response.data;
  	        console.log("response-1", response);
d8feb0ddb   Palak Handa   design updated
692
693
  	        $scope.pendingPaymentId = $route.current.params.id;
  	        
6ae8d3cdd   Palak Handa   add new module
694
695
696
697
698
699
  	        $http({
  	            method: "GET",
  	            url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}',
  	        }).then(function mySuccess(response) {
  	            $scope.paymentRecord = response.data;
  	        }, function myError(response) {
6ae8d3cdd   Palak Handa   add new module
700
701
702
703
704
705
706
707
708
  	        });
  	    }, function myError(response) {
  	        $scope.myWelcome = response.statusText;
  	    });
  
  	    $scope.checkView = false;
  	    $scope.verifyView = false;
  
  	    $scope.pendingPaymentId = '';
6ae8d3cdd   Palak Handa   add new module
709
710
711
712
713
  	    $scope.update = function() {
  
  	        $http({
  	            method: 'GET',
  	            url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}',
6ae8d3cdd   Palak Handa   add new module
714
715
  	            headers: {}
  	        }).then(function mySuccess(searchResult) {
c556cc81b   Palak Handa   minor changes
716
717
  	            if (searchResult.data[0].status == "created") {
  	            //if (searchResult.data[0].status == "cancelled") {
6ae8d3cdd   Palak Handa   add new module
718
719
  	                $scope.checkView = true;
  	                $scope.verifyView = false;
ced66f2dc   Palak Handa   minor changes
720
721
722
723
  	                $scope.amount = searchResult.data[0].amount;
  	                $scope.searchResult = searchResult.data[0];
  	                console.log('====searchResult===', searchResult);
  	        		console.log("searchResult=====",searchResult.data[0].razorOrderId)
6ae8d3cdd   Palak Handa   add new module
724
  	                var i = 0;
ced66f2dc   Palak Handa   minor changes
725
  	                $scope.amount =  $scope.amount * 100;
6ae8d3cdd   Palak Handa   add new module
726
  	                var options = {
f2142e490   Palak Handa   rajorpay key updated
727
728
  	                    "key": "rzp_live_mhSE1uOBlXvFyJ",
  	                    //"key" : "rzp_test_YwHsVFiDIQ2WUQ",
6ae8d3cdd   Palak Handa   add new module
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
  	                    "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   Palak Handa   add new module
750
  	                function createPayment(response) {
ced66f2dc   Palak Handa   minor changes
751
752
  	                	$scope.amount =  $scope.amount / 100;
  	                	console.log("response======retepaymen",response);
6ae8d3cdd   Palak Handa   add new module
753
  	                    $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
ced66f2dc   Palak Handa   minor changes
754
  	                    $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId;
6ae8d3cdd   Palak Handa   add new module
755
  	                    $scope.paymentResponse.amount = $scope.amount;
ced66f2dc   Palak Handa   minor changes
756
757
758
  	                    $scope.paymentResponse.currency = $scope.searchResult.currency;
  	                    $scope.paymentResponse.status = $scope.searchResult.status;
  	                    $scope.paymentResponse.applicantId = $scope.searchResult.applicantId;
6ae8d3cdd   Palak Handa   add new module
759
760
761
  	                    console.log("$scope.paymentResponse", $scope.paymentResponse)
  	                    $http({
  	                        method: 'PUT',
ced66f2dc   Palak Handa   minor changes
762
  	                        url: BASE_URL + '/payments/' + $scope.searchResult.id,
6ae8d3cdd   Palak Handa   add new module
763
764
765
  	                        data: $scope.paymentResponse,
  	                        headers: {}
  	                    }).then(function mySuccess(searchResult) {
8e25d825b   Palak Handa   changes the rajor...
766
  	                    	console.log("finalsearchResult",searchResult)
ced66f2dc   Palak Handa   minor changes
767
  	                    	$location.path("/confirmation")
6ae8d3cdd   Palak Handa   add new module
768
769
770
771
772
773
774
775
776
777
778
  	                    }, function myError(error) {
  
  	                    });
  	                }
  	            } else {
  
  	            }
  
  	        }, function myError(error) {});
  	    }
  	});
53b83aa9e   Palak Handa   first commit
779

2d6a9fbea   Palak Handa   complete bugs
780
  	scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) {
6ae8d3cdd   Palak Handa   add new module
781
  		$scope.data = {};
8e25d825b   Palak Handa   changes the rajor...
782
783
  		$scope.check = false;
  	    $scope.numberCheck = false;
5348de778   Palak Handa   design updated
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
  	    /*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() {
e847b36f8   Palak Handa   minor changes
801
  	    	console.log("doooo")
5348de778   Palak Handa   design updated
802
803
804
  	        $('#invalidEmail').css('display', 'none');
  	        $('#alreadyExist').css('display', 'none');
  	    };
8e25d825b   Palak Handa   changes the rajor...
805
  		$scope.emailcheck = function(val) {
e847b36f8   Palak Handa   minor changes
806
807
808
  			consol.log("kdsbd")
  			$scope.space = /\s/g.test(val);
      		console.log("space",$scope.space)
8e25d825b   Palak Handa   changes the rajor...
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
  	        if (val == undefined) {
  	            $('#invalidEmail').css('display', 'block');
  	        } else {
  	            $http({
  	                method: 'GET',
  	                url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}',
  	                headers: {}
  	            }).then(function mySuccess(searchResult) {
  	                console.log("searchResult1===>", searchResult)
  	                if (searchResult.data.length == 0) {
  	                    $scope.check = false;
  	                } else {
  	                    $scope.check = true;
  	                    $('#alreadyExist').css('display', 'block');
  	                }
  	            }, function myError(error) {});
  	        }
  	    };
6db0109b5   Palak Handa   minor changes
827
828
829
830
  	    $scope.removeNoError = function() {
  	    	$('#invalidNumber').css('display', 'none');
  	        $('#noExist').css('display', 'none');
  	    };
8e25d825b   Palak Handa   changes the rajor...
831
832
  
  	    $scope.numbercheck = function(number) {
5348de778   Palak Handa   design updated
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
  	    	// 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   Palak Handa   changes the rajor...
851

8e25d825b   Palak Handa   changes the rajor...
852
  	    };
6ae8d3cdd   Palak Handa   add new module
853
854
855
856
857
858
859
  		$scope.submit = function() {
  			console.log($scope.data.name)
  			var randomNumber = ""+Math.random();
  			var nameSpliced = $scope.data.name.slice(0,3);
  			var numberSpliced = randomNumber.slice(2,5);
  			$scope.data.referalToken = nameSpliced+numberSpliced;
  			$scope.data.referalToken = $scope.data.referalToken.toUpperCase();
2d6a9fbea   Palak Handa   complete bugs
860

6ae8d3cdd   Palak Handa   add new module
861
862
863
864
865
866
867
868
  	         $http({
  	                method: 'POST',
  	                url: BASE_URL + '/ambassadors',
  	                data: $scope.data,
  	                headers: {}
  	            }).then(function mySuccess(result) {
  	                console.log("result", result)
  	                $scope.detail = result;
2d6a9fbea   Palak Handa   complete bugs
869
870
871
872
873
  	                $('#myModal').modal('show');
  	              	 $scope.data.name = '';
  	                $scope.data.email = '';
  	                $scope.data.mobile = '';
  	            
6db0109b5   Palak Handa   minor changes
874
875
876
877
  	            }, function myError(error) {
  	            	console.log(error)
  	            	console.log(error.data.error.message)
  	            });
2d6a9fbea   Palak Handa   complete bugs
878
  	        console.log($scope.data)
6ae8d3cdd   Palak Handa   add new module
879
880
  	        }
  	});
53b83aa9e   Palak Handa   first commit
881

96991e0c1   Palak Handa   update
882