Blame view

script.js 39.6 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
  
  	// configure our routes
0d7cf45ec   Palak Handa   timer use
5
  	scotchApp.config(function($routeProvider,$locationProvider) {
8586ba494   Palak Handa   html5 mode
6

8586ba494   Palak Handa   html5 mode
7
  		// use the HTML5 History API
6a702f93c   apple   country & citynam...
8
9
10
11
          // $locationProvider.html5Mode({
          // 	enabled: true,
          // 	requireBase: false
          // });
3c4db43f3   apple   design new form
12
         	//$locationProvider.hashPrefix('!');
6ae8d3cdd   Palak Handa   add new module
13
  	    $routeProvider
dcb703070   Palak Handa   updated new form ...
14
  	    	// route for the Home page
6ae8d3cdd   Palak Handa   add new module
15
  	        .when('/', {
dcb703070   Palak Handa   updated new form ...
16
17
18
  	            templateUrl: 'pages/Home.html',
  	            controller: 'mainController'
  	        })
b96c88383   Palak Handa   amount change
19
  	        // route for the caricatures page
e856f2161   Palak Handa   new page design
20
  	        .when('/caricatures', {
b96c88383   Palak Handa   amount change
21
  	            templateUrl: 'pages/caricatures.html',
6ae8d3cdd   Palak Handa   add new module
22
23
  	            controller: 'mainController'
  	        })
857ebc69e   Palak Handa   timer add
24
25
26
27
28
  	        // route for the paymentVerify page
  	        .when('/pendingPayment/:id', {
  	            templateUrl: 'pages/verify.html',
  	            controller: 'verifyController'
  	        })
6ae8d3cdd   Palak Handa   add new module
29

b96c88383   Palak Handa   amount change
30
  	        // route for the registration page
5734bf6dc   apple   design change
31
  	        .when('/registration', {
b96c88383   Palak Handa   amount change
32
33
34
  	            templateUrl: 'pages/registration.html',
  	            controller: 'registrationController'
  	        })
8586ba494   Palak Handa   html5 mode
35
  	        //route for the ambassador page
2aba79170   Palak Handa   minor change
36
37
38
39
  	        // .when('/startupJalsaPromocode', {
  	        //     templateUrl: 'pages/ambassador.html',
  	        //     controller: 'ambassadorController'
  	        // })
5348de778   Palak Handa   design updated
40
41
42
43
  
  	        // route for the confirmation page
  	        .when('/confirmation', {
  	            templateUrl: 'pages/confirmation.html',
1ef0fae04   apple   confirmation page...
44
  	            controller: 'confirmationController'
845d2e17f   apple   add new file & ra...
45
46
47
48
49
50
  			})
  			
  			// route for the confirmation page
  	        .when('/confirm', {
  	            templateUrl: 'pages/confirm.html',
  	            controller: 'confirmationController'
5348de778   Palak Handa   design updated
51
  	        })
3c4db43f3   apple   design new form
52
53
54
  	        .otherwise({ 
  	        	redirectTo: '/' 
  	        });
8586ba494   Palak Handa   html5 mode
55

6ae8d3cdd   Palak Handa   add new module
56
  	});
53b83aa9e   Palak Handa   first commit
57

f263889f0   Palak Handa   analytics work
58
59
  	scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
  	   	// Add configuration code as desired
61b69ada0   Palak Handa   design updated
60
  	   	 AnalyticsProvider.setAccount('UA-106416759-1');  //UU-XXXXXXX-X should be your tracking code
f263889f0   Palak Handa   analytics work
61
62
63
64
65
66
67
68
  
  	   	// Track all routes (default is true).
  	  	AnalyticsProvider.trackPages(true);
  
  	  	// Track all URL query params (default is false).
  	  	AnalyticsProvider.trackUrlParams(true);
  
  	}]).run(['Analytics', function(Analytics) { }]);
124f7528f   Palak Handa   minor change
69
70
  	scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1")
  	//scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1")
6ae8d3cdd   Palak Handa   add new module
71

ce1c575fe   apple   validation on upl...
72
73
74
75
76
77
78
79
80
81
82
83
84
85
  	scotchApp.directive('validFile',function(){
  		return {
  		  require:'ngModel',
  		  link:function(scope,el,attrs,ngModel){
  			//change event is fired when file is selected
  			el.bind('change',function(){
  			  scope.$apply(function(){
  				ngModel.$setViewValue(el.val());
  				ngModel.$render();
  			  })
  			})
  		  }
  		}
  	  })
2d6a9fbea   Palak Handa   complete bugs
86
  	// create the controller and inject Angular's $scope
857ebc69e   Palak Handa   timer add
87
  	scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) {
6ae8d3cdd   Palak Handa   add new module
88
89
90
  	    $scope.data = {
  	        show: true,
  	        hide: false
5734bf6dc   apple   design change
91
  		};
466bf74a5   apple   minor change
92
93
94
95
96
97
98
  		jQuery('#defaultcountry').addClass('btn-active')
  		// window.onload = function(){
  		// 	// var element = document.getElementById("defaultcountry");
  		// 	//    element.classList.add("btn-active");
  		// 	   jQuery('#defaultcountry').addClass('btn-active')
  		// 	   //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png";
  		// }
6ae8d3cdd   Palak Handa   add new module
99

0d7cf45ec   Palak Handa   timer use
100
  		var chennai = new Date("Sept 19, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = chennai - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("chennai").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("chennai").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
857ebc69e   Palak Handa   timer add
123
  		var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = hyderabad - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("hyderabad").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
857ebc69e   Palak Handa   timer add
146
  		var mumbai = new Date("Sept 26, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = mumbai - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("mumbai").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("mumbai").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
50e8f0737   Palak Handa   minor change
169

857ebc69e   Palak Handa   timer add
170
  		var kolkata = new Date("Oct 3, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = kolkata - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("kolkata").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("kolkata").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
50e8f0737   Palak Handa   minor change
193

857ebc69e   Palak Handa   timer add
194
  		var jaipur = new Date("Oct 5, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = jaipur - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("jaipur").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("jaipur").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
50e8f0737   Palak Handa   minor change
217

857ebc69e   Palak Handa   timer add
218
  		var delhi = new Date("Oct 8, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = delhi - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("delhi").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("delhi").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
50e8f0737   Palak Handa   minor change
241

857ebc69e   Palak Handa   timer add
242
  		var kanpur = new Date("Oct 10, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = kanpur - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("kanpur").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("kanpur").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
50e8f0737   Palak Handa   minor change
265

857ebc69e   Palak Handa   timer add
266
  		var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = ahmedabad - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("ahmedabad").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
50e8f0737   Palak Handa   minor change
289

857ebc69e   Palak Handa   timer add
290
  		var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = bengaluru - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("bengaluru").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
50e8f0737   Palak Handa   minor change
313

857ebc69e   Palak Handa   timer add
314
  		var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = dharamsala - now;
  		    // Time calculations for days, hours, minutes and seconds
  		    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  		    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  		    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  		    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  		    $scope.timer = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s "
  		    // Output the result in an element with id="demo"
  		    document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h "
  		    + minutes + "m " + seconds + "s ";
  		    // If the count down is over, write some text 
  		    if (distance < 0) {
  		        clearInterval(x);
  		        document.getElementById("dharamsala").innerHTML = "EXPIRED";
  		    }
  		}, 1000);
50e8f0737   Palak Handa   minor change
337

6ae8d3cdd   Palak Handa   add new module
338
  	    $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
e847b36f8   Palak Handa   minor changes
339
  	    $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
c62079487   Palak Handa   updated design
340
  	    // $scope.Textshow = "yes"
6ae8d3cdd   Palak Handa   add new module
341
  	    $scope.max = 100;
88dd26b3d   Palak Handa   update
342
  	    $scope.formPage = false;
6ae8d3cdd   Palak Handa   add new module
343
344
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
6ae8d3cdd   Palak Handa   add new module
345
  	    $scope.data = {};
ea3c31126   Palak Handa   complete
346
  	    $scope.discountAmount = 0;
7b2bef227   Palak Handa   background image ...
347
  	    // $scope.data.quantity = "1";
6ae8d3cdd   Palak Handa   add new module
348
349
  	    $scope.check = false;
  	    $scope.numberCheck = false;
6ae8d3cdd   Palak Handa   add new module
350
  	    $scope.paymentResult = {};
6ae8d3cdd   Palak Handa   add new module
351
352
353
354
  	    var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  	        "status": "pending"
dcb703070   Palak Handa   updated new form ...
355
  		}
5734bf6dc   apple   design change
356
357
358
359
360
361
362
  		
  		$scope.showval = true;
  		$scope.hideval = false;
  		$scope.showvalue = false;
  		$scope.hidevalue = false;
  		$scope.isShowHide = function (value) {
  			console.log(value)
1b31b20bf   apple   auto highlighted ...
363
364
  			var element = document.getElementById("defaultcountry");
  			element.classList.remove("btn-active");
845d2e17f   apple   add new file & ra...
365
  			localStorage.setItem("country",value);
5734bf6dc   apple   design change
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
  			if (value == "INDIA") {
  				console.log("value",value)
  				$scope.showval = true;
  				$scope.hideval = false;
  				$scope.showvalue = false;
  				$scope.hidevalue = false;
  			}
  			else if (value == "SRI LANKA") {
  				console.log("value1",value)
  				$scope.showval = false;
  				$scope.hideval = true;
  				$scope.showvalue = false;
  				$scope.hidevalue = false;
  			}
  			else if (value == "BANGLADESH") {
  				console.log("value2",value)
  				$scope.showval = false;
  				$scope.hideval = false;
  				$scope.showvalue = true;
  				$scope.hidevalue = false;
  			}
  			else {
  				console.log("value3",value)
  				$scope.showval = false;
  				$scope.hideval = false;
  				$scope.showvalue = false;
  				$scope.hidevalue = true;
  			}
  		}
fe142256c   apple   information page ...
395
396
397
  	    $scope.apply = function() {
  	    	//Analytics.trackEvent('register', 'click', 'Registration');
  			$location.path("/caricatures")
466bf74a5   apple   minor change
398
  			
fe142256c   apple   information page ...
399
  		}
629cc1f8f   Palak Handa   minor changes
400

3c4db43f3   apple   design new form
401
  	    // $scope.data.city = '';
7b017db1c   apple   add city field
402
403
  	    $scope.watch =  function(value){
  			console.log(value)
a006f2b11   apple   name changes
404
  			//document.getElementById("ahmedabad").src = "";
3c4db43f3   apple   design new form
405
  	    	// console.log("cllll",value)
7b017db1c   apple   add city field
406
  	    	$scope.data.city = value;
857ebc69e   Palak Handa   timer add
407
408
409
410
  	    	// if($scope.data.city == "Chennai"){
  	    	// 	console.log("cllll1",value)
  	    	// 	$window.location.href = 'http://35.154.24.158:8007';
  	    	// }else{
3c4db43f3   apple   design new form
411
  	    		// console.log("cllll2",value)
845d2e17f   apple   add new file & ra...
412
  				localStorage.setItem("city" ,value);
857ebc69e   Palak Handa   timer add
413
  		    	//$location.path('/registration').search({city: value});
5734bf6dc   apple   design change
414
415
  				// $location.path('/registration/'+value+'');
  				$location.path('/registration');
857ebc69e   Palak Handa   timer add
416
417
  		    	//$state.go('registration', { 'city': value})
  	    	// }
163c5adae   Palak Handa   minor changes
418
  	    }
e847b36f8   Palak Handa   minor changes
419

6a9f1f41e   Palak Handa   add left side but...
420
421
422
423
  	    $scope.select =  function(url){
  	    	console.log("cllll")
  	    	window.open(url)
  	    }
6ae8d3cdd   Palak Handa   add new module
424
  	    $scope.stagekeyPress = function() {
f8b43c6f8   Palak Handa   design changes
425
  	        $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
426
427
  	    }
  	    $scope.sectorkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
428
  	        $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
429
  	    }
163c5adae   Palak Handa   minor changes
430
  	    $scope.productLaunchkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
431
  	        $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
432
  	    }
163c5adae   Palak Handa   minor changes
433
  	    $scope.launchPeriodkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
434
  	        $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
435
  	    }
7b2bef227   Palak Handa   background image ...
436
437
  	    $scope.industrykeyPress = function(quantity) {
  	    	console.log("fghj",quantity)
f8b43c6f8   Palak Handa   design changes
438
  	    	$('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
439
  	    }
204302c02   Palak Handa   minor changes
440
441
442
443
444
  	    $scope.industryNamekeyPress = function(firstName) {
  	        console.log("lastName==", firstName);
  	        if (firstName == undefined) {
  	            $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
445
  	            $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
204302c02   Palak Handa   minor changes
446
447
  	        }
  	    }
c62079487   Palak Handa   updated design
448
  	    $scope.amountkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
449
  	        $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
450
  	    }
2321f803a   Palak Handa   updated changes
451
452
453
  	    $scope.firstNamekeyPress = function(name) {
  	        console.log("lastName==", name);
  	        if (name == undefined) {
6ae8d3cdd   Palak Handa   add new module
454
455
  	            $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
456
  	            $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
457
458
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
459

6ae8d3cdd   Palak Handa   add new module
460
461
462
463
464
  	    $scope.emailkeyPress = function(email) {
  	        console.log("email", email);
  	        if (email == undefined) {
  	            $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
465
  	            $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
8ddc94e00   Palak Handa   update
466
  	        }	                
6ae8d3cdd   Palak Handa   add new module
467
  	    }
6ae8d3cdd   Palak Handa   add new module
468
469
  	    $scope.phonekeyPress = function(number) {
  	        console.log("number", number);
204302c02   Palak Handa   minor changes
470
  	        if (number == undefined || number == '') {
6ae8d3cdd   Palak Handa   add new module
471
472
  	            $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
473
  	            $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
474
475
476
477
478
479
480
481
  	        }
  	    }
  
  	    $scope.citykeyPress = function(city) {
  	        console.log("city", city);
  	        if (city == undefined) {
  	            $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
482
  	            $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
483
484
  	        }
  	    }
7e3bb1018   Palak Handa   field added
485
  	    $scope.startupNamekeyPress = function(q) {
6ae8d3cdd   Palak Handa   add new module
486
487
488
  	        if (q == undefined) {
  	            $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
489
  	            $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
490
491
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
492
  	    $scope.linkedInkeyPress = function(technology) {
204302c02   Palak Handa   minor changes
493
  	        if (technology == undefined || technology == '') {
6ae8d3cdd   Palak Handa   add new module
494
495
  	            $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
496
  	            $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
497
498
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
499
  	    $scope.companykeyPress = function(problem) {
6ae8d3cdd   Palak Handa   add new module
500
501
502
  	        if (problem == undefined) {
  	            $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
503
  	            $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
504
505
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
506
  	    $scope.productNamekeyPress = function(solution) {
6ae8d3cdd   Palak Handa   add new module
507
508
509
  	        if (solution == undefined) {
  	            $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
510
  	            $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
511
512
513
  	        }
  	    }
  	    $scope.businesskeyPress = function(business) {
58efec61e   Palak Handa   color change
514
515
516
517
518
  	    	if (business == undefined) {
  	        	$('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)');
  	        }
6ae8d3cdd   Palak Handa   add new module
519
  	    }
dcb703070   Palak Handa   updated new form ...
520
  	    $scope.websitekeyPress = function(prototype) {
204302c02   Palak Handa   minor changes
521
  	        if (prototype == undefined  || prototype == '') {
6ae8d3cdd   Palak Handa   add new module
522
523
  	            $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
524
  	            $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
525
526
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
527
  	    $scope.employeekeyPress = function(market) {
204302c02   Palak Handa   minor changes
528
  	        if (market == undefined || market == '') {
6ae8d3cdd   Palak Handa   add new module
529
530
  	            $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
531
  	            $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
532
533
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
534
  	    $scope.annualkeyPress = function(risk) {
204302c02   Palak Handa   minor changes
535
  	        if (risk == undefined || risk == '') {
6ae8d3cdd   Palak Handa   add new module
536
537
  	            $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
538
  	            $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
539
540
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
541
  	    $scope.revenuekeyPress = function(team) {
81526b56d   Palak Handa   minor change
542
  	        if (team == undefined) {
6ae8d3cdd   Palak Handa   add new module
543
544
  	            $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
545
  	            $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
546
547
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
548
  	    $scope.descriptionkeyPress = function(pitch) {
6ae8d3cdd   Palak Handa   add new module
549
550
551
  	        if (pitch == undefined) {
  	            $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
552
  	            $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
553
554
  	        }
  	    }
e284785e4   Palak Handa   update new field
555
  	    $scope.discountkeyPress = function(discount) {
e284785e4   Palak Handa   update new field
556
557
558
  	        if (discount == undefined) {
  	            $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
559
  	            $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
e284785e4   Palak Handa   update new field
560
561
  	        }
  	    }
91eeb4455   Palak Handa   modify
562
563
564
565
  	    $scope.removeNooError = function() {
  	    	$('#invalidIdea').css('display', 'block');
  	        $('#noExist').css('display', 'none');
  	    };
c62079487   Palak Handa   updated design
566
  	    $scope.ideakeyPress = function(financial) {
6ae8d3cdd   Palak Handa   add new module
567
568
569
570
  	        console.log("financial", financial);
  	        if (financial == undefined) {
  	            $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
571
  	            $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
572
573
  	        }
  	    }
c62079487   Palak Handa   updated design
574
575
576
577
578
579
  
  	    $scope.fundkeyPress = function(financial) {
  	        console.log("financial", financial);
  	        if (financial == undefined) {
  	            $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
580
  	            $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
581
582
  	        }
  	    }
2d6a9fbea   Palak Handa   complete bugs
583
584
585
586
  	    $scope.changeReferalIconColor = function(referalToken){
  	    	if (referalToken == undefined || referalToken == '') {
  	    		$('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
  	    	}else {
f8b43c6f8   Palak Handa   design changes
587
  	            $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
2d6a9fbea   Palak Handa   complete bugs
588
589
  	        }
  	    }
6ae8d3cdd   Palak Handa   add new module
590

53b83aa9e   Palak Handa   first commit
591
  	});
1b31b20bf   apple   auto highlighted ...
592
  	scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL) {
6ae8d3cdd   Palak Handa   add new module
593
  		$scope.data = {};
8e25d825b   Palak Handa   changes the rajor...
594
595
  		$scope.check = false;
  	    $scope.numberCheck = false;
e856f2161   Palak Handa   new page design
596
597
  	    $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
  	    $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
e856f2161   Palak Handa   new page design
598
599
600
601
  	    $scope.max = 100;
  	    $scope.formPage = false;
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
19a2e7b14   apple   payment integrate
602
603
604
  		$scope.discountAmount = 0;
  		$scope.approvedMsg = false;
  		$scope.disApprovedMsg = false;
e856f2161   Palak Handa   new page design
605
606
607
608
  	    // $scope.data.quantity = "1";
  	    $scope.check = false;
  	    $scope.numberCheck = false;
  	    $scope.paymentResult = {};
1ef0fae04   apple   confirmation page...
609
610
611
612
613
614
615
616
617
618
  		// var myParam =  window.location.href.split('status=').splice(1).join('').split('&')[0]
  		// if(myParam){
  		// 	if(myParam == "approved"){
  		// 		$scope.showResponse = true;
  		// 	}else{
  		// 		$scope.disApprovedMsg = true;
  		// 	}
  		// }else{
  		// 	$scope.disApprovedMsg = true;
  		// }
8e25d825b   Palak Handa   changes the rajor...
619

5348de778   Palak Handa   design updated
620
621
622
623
  	    $scope.removeError = function() {
  	        $('#invalidEmail').css('display', 'none');
  	        $('#alreadyExist').css('display', 'none');
  	    };
248bd9b7c   Palak Handa   link validation
624
625
626
627
628
  		$scope.emailcheck = function(val) {
  	        if (val == undefined) {
  	            $('#invalidEmail').css('display', 'block');
  	        } else {
  	        	$('#alreadyExist').css('display', 'block');
248bd9b7c   Palak Handa   link validation
629
630
  	        }
  	    };
b678502c9   Palak Handa   update
631

dee1f7479   Palak Handa   validation use
632
633
634
635
636
637
638
639
640
641
642
643
  	    $scope.removeNoError = function() {
  	        $('#invalidNumber').css('display', 'none');
  	        $('#alreadyExist').css('display', 'none');
  	    };
  
  		$scope.numbercheck = function(val) {
  	        if (val == undefined) {
  	            $('#invalidNumber').css('display', 'block');
  	        } else {
  	        	$('#alreadyExist').css('display', 'block');
  	        }
  	    };
317a80571   Palak Handa   city selected
644
  	 	// $scope.$on('city', function (event, value) {
7b017db1c   apple   add city field
645
  			$scope.data.city = localStorage.getItem("city");
845d2e17f   apple   add new file & ra...
646
647
  			$scope.data.country = localStorage.getItem("country");
  			 //console.log("HERE===",$scope.data.country );
317a80571   Palak Handa   city selected
648
  		// });
845d2e17f   apple   add new file & ra...
649
650
651
652
653
654
  		var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  			"status": "pending",
  			"paymentType": $scope.data.country 
  		}
ce1c575fe   apple   validation on upl...
655
  		
500aaf838   apple   add new fields & ...
656
657
658
659
660
661
662
663
664
665
  		var handleFileSelect = function(evt) {
  			var files = evt.target.files;
  			var file = files[0];
  
  			if (files && file) {
  			var reader = new FileReader();
  
  			reader.onload = function(readerEvt) {
  				var binaryString = readerEvt.target.result;
  				$scope.base64textString = btoa(binaryString);
e01ea6e45   apple   validation requir...
666
  				//console.log("base64textarea",$scope.base64textString)
03c9e5d63   apple   upload file
667
  				//$scope.data.uploadFile = file.name;
ce1c575fe   apple   validation on upl...
668
669
670
671
672
673
674
  				$scope.fileSelect = false;
  				if($scope.data.uploadFile == null){
  					$scope.fileSelect = true;
  				}else{
  					$scope.fileSelect = false;	
  					};
  				}
500aaf838   apple   add new fields & ...
675
676
677
678
679
680
681
  
  			reader.readAsBinaryString(file);
  			}
  		};
  		if (window.File && window.FileReader && window.FileList && window.Blob) {
  			document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
  		}
c70ffa5ac   apple   add one text field
682
683
684
685
686
687
688
689
690
  		$scope.ngShowhide = false;
  		$scope.GetValue = function(){
  			console.log("====$scope.value===",$scope.data.sector)
  			if($scope.data.sector == "Other"){
  				$scope.ngShowhide = true;
  			}else{
  				$scope.ngShowhide = false;
  			}
  		}
b96c88383   Palak Handa   amount change
691

0c48d68b6   apple   text xhange
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
  		// $rootScope.tokenCall = function(val) {
  	    //     console.log('val-------->', val);
  	    //     if (val == undefined) {
  	    //         $('#invalidToken').css('display', 'block');
  	    //     } else {
  	    //     	val = val.toUpperCase();
  	    //     	if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMA99" && $scope.data.city != "Ahmedabad") || (val == "JAI40" && $scope.data.city != "Jaipur")){
  	    //     		$scope.tokencheck = false;
  	    //     		return;
  	    //     	}
  	    //     	$http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
  		// 		    .then(function(searchResult) {
  		// 		    	console.log("searchResult",searchResult)
  		// 		        if (searchResult.data.length == 0) {
  	    //                 	$scope.tokencheck = false;
  	    //                 	 $scope.discountAmount = 0;
  	    //             	} else {
  	    //             		console.log("===searchResult.data[0].discount===",searchResult.data[0].discount);
  	    //                 	 $scope.discountpercentage = searchResult.data[0].discount;
  	    //                 	 console.log("===searchResultdiscountpercentage===",$scope.discountpercentage);
  	    //                 	$scope.tokencheck = true;
  	    //             	}
  		// 		    },function(err){
  		// 		    	console.log(err)
  		// 		});
b96c88383   Palak Handa   amount change
717
  	           
0c48d68b6   apple   text xhange
718
  	    //     }
7b017db1c   apple   add city field
719
  		// };
845d2e17f   apple   add new file & ra...
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
  		
  		if($scope.data.country == "INDIA"){
  			$scope.submit = function() {
  				$scope.loading = true;
  				$scope.data.uploadFile = $scope.base64textString;
  				console.log($scope.data.uploadFile)
  			// if($scope.tokencheck == false){
  			// 	$scope.data.referalToken = null;
  			// }
  			// if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
  			// 	var x = document.getElementById("snackbar")
  			//     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;
  				$scope.ticketAmnt = 1;
  				$scope.detail = {};
  				$scope.data.phone = "+91"+$scope.data.number;
  				if($scope.data.referalToken == null){
  					$scope.data.referalToken = "NA"
  				}
  				var file =document.getElementById('filePicker').files[0];
  				//console.log("file",filePicker)
  				var image = BASE_URL+'/containers/images/download/'
  				var imagePath = file.name;
  				$scope.data.uploadFile = image + imagePath;
  				//console.log($scope.data.uploadFile)
  				var fd = new FormData()
  				fd.append('filePicker',file);	
  				var deferred = $q.defer();
  				$http({
  					method:'POST',
  					url: BASE_URL+'/containers/images/upload',
  					data:fd,
  					transformRequest:angular.identity,
  					headers:{'Content-Type':undefined}
  				})
  				.success(function(result){
  					deferred.resolve(result);
  				$http({
  				method: 'POST',
  				url: BASE_URL+'/applicants',
  				data: $scope.data,
7b017db1c   apple   add city field
762
  				headers: {}
845d2e17f   apple   add new file & ra...
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
  				}).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)
  						var amount = $scope.ticketAmnt * 100
  						if($scope.tokencheck == true){
  							var amount = $scope.ticketAmnt
  							console.log("====$scope.discountpercentage====",$scope.discountpercentage);
  							console.log("resultcity===",$scope.data.city)
  							if($scope.discountpercentage == "100") {
  								$scope.discountpercentage = "99.8";
  								console.log("$scope.discountpercentage====",$scope.discountpercentage)
  							}
  							console.log("====$scope.discountpercentage====",$scope.discountpercentage);
  							$scope.percDiscount = $scope.discountpercentage/100;
  							console.log("====$scope.percDiscount====",$scope.percDiscount);
  							console.log("====amount=====",amount);
  							$scope.discountAmount = amount * $scope.percDiscount;
  							console.log("finalAmount====>",$scope.discountAmount)
  						}
  						var taxAmount = $scope.ticketAmnt - $scope.discountAmount
  						console.log("$scope.taxTotal----",taxAmount)
  						$scope.payingAmnt = taxAmount;
  						console.log("====$scope.payingAmnt====",$scope.payingAmnt)
  						$scope.payingAmnt = $scope.payingAmnt.toFixed()	                
  						data.amount = $scope.payingAmnt;
  						console.log("data.amount==",data.amount)
  					if($scope.detail != null){
  						$http({
  						method: 'POST',
  						url: BASE_URL+'/payments',
  						data: data,
  						headers: {}
  						}).then(function mySuccess(paymentResult) {
  								$scope.loading = false;
  							console.log("paymentResult",paymentResult.data.data)
  							$("p").html(paymentResult.data.data)
  						}, function myError(error) {
  						});
  					}
  					// var i = 0;
  					// $scope.payingAmnt =  $scope.payingAmnt * 100;
  					// var options = {
  					// 	//"key": "rzp_test_YwHsVFiDIQ2WUQ",
  					// 	"key": "rzp_live_mkmCb4FkstuWaS",
  					// 	"amount": $scope.payingAmnt,
  
  					// 	"name": "Startup Jalsa",
  					// 	"description":"amount",
  					// 	"currency": "INR",
  					// 	"status": "done",
  
  					// 	"prefill": {
  					// 		"email": $scope.detail.email,
  					// 		"contact": $scope.detail.phone
  					// 	},
  
  					// 	"theme": {
  					// 		"color": "#2196f3 ",
  					// 		"image_padding":"NO"
  					// 	},
  					// 	"modal": {
  					// 		"ondismiss": function(){
  					// 		}
  					// 	},
  					// 	"handler": function (response){
  					// 		createPayment(response);
  					// 	}
  					// };
  					// var rzp1 = new Razorpay(options);
  					// rzp1.open();
  					// $scope.paymentResponse = {};
  					// function createPayment(response){
  					// 	console.log("response12333333",response)
  					// 	$scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
  					// 	$scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
  					// 	$scope.paymentResponse.amount = data.amount;
  					// 	$scope.paymentResponse.currency = "INR";
  					// 	$scope.paymentResponse.status = $scope.paymentResult.data.status;
  					// 	console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
  					// 	$http({
  					// 	   method: 'PUT',
  					// 	   url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
  					// 	   data: $scope.paymentResponse,
  					// 	   headers: {}
  					// 	   }).then(function mySuccess(searchResult) {
  					// 	   	console.log("searchResult",searchResult)
  					// 	   	$location.path("/confirmation")
  					// 	   }, function myError(error) {
  					// 	});
  					// }
  					//}
  
  				}, function myError(error) {
  
  				});
  
  			})
  				
  			// })
  
  			//}
b96c88383   Palak Handa   amount change
867

845d2e17f   apple   add new file & ra...
868
869
  		}
  	}else{
6ae8d3cdd   Palak Handa   add new module
870
  		$scope.submit = function() {
74db82750   apple   loader use
871
  			$scope.loading = true;
03c9e5d63   apple   upload file
872
873
  			$scope.data.uploadFile = $scope.base64textString;
  			console.log($scope.data.uploadFile)
0c48d68b6   apple   text xhange
874
  		// if($scope.tokencheck == false){
845d2e17f   apple   add new file & ra...
875
876
  		// 	$scope.data.referalToken = null;
  		// }
500aaf838   apple   add new fields & ...
877
878
879
880
  		// if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
  		// 	var x = document.getElementById("snackbar")
  		//     setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
  		// }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {	
e856f2161   Palak Handa   new page design
881
  			$scope.infoForm = true;
466bf74a5   apple   minor change
882
  			$scope.ticketAmnt = 1;
e856f2161   Palak Handa   new page design
883
884
  			$scope.detail = {};
  			$scope.data.phone = "+91"+$scope.data.number;
fe142256c   apple   information page ...
885
  			if($scope.data.referalToken == null){
845d2e17f   apple   add new file & ra...
886
  				$scope.data.referalToken = "NA"
fe142256c   apple   information page ...
887
  			}
03c9e5d63   apple   upload file
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
  			var file =document.getElementById('filePicker').files[0];
  			//console.log("file",filePicker)
  			var image = BASE_URL+'/containers/images/download/'
  			var imagePath = file.name;
  			$scope.data.uploadFile = image + imagePath;
  			//console.log($scope.data.uploadFile)
  			var fd = new FormData()
  			fd.append('filePicker',file);	
  			var deferred = $q.defer();
  			$http({
  				method:'POST',
  				url: BASE_URL+'/containers/images/upload',
  				data:fd,
  				transformRequest:angular.identity,
  				headers:{'Content-Type':undefined}
  			})
  			.success(function(result){
  				deferred.resolve(result);
e856f2161   Palak Handa   new page design
906
  			$http({
845d2e17f   apple   add new file & ra...
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
  			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)
  					var amount = $scope.ticketAmnt * 100
  					if($scope.tokencheck == true){
  						var amount = $scope.ticketAmnt
  						console.log("====$scope.discountpercentage====",$scope.discountpercentage);
  						console.log("resultcity===",$scope.data.city)
a65d2455e   Palak Handa   minor change
922
  						if($scope.discountpercentage == "100") {
845d2e17f   apple   add new file & ra...
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
  							$scope.discountpercentage = "99.8";
  							console.log("$scope.discountpercentage====",$scope.discountpercentage)
  						}
  						console.log("====$scope.discountpercentage====",$scope.discountpercentage);
  						$scope.percDiscount = $scope.discountpercentage/100;
  						console.log("====$scope.percDiscount====",$scope.percDiscount);
  						console.log("====amount=====",amount);
  						$scope.discountAmount = amount * $scope.percDiscount;
  						console.log("finalAmount====>",$scope.discountAmount)
  					}
  					var taxAmount = $scope.ticketAmnt - $scope.discountAmount
  					console.log("$scope.taxTotal----",taxAmount)
  					$scope.payingAmnt = taxAmount;
  					console.log("====$scope.payingAmnt====",$scope.payingAmnt)
  					$scope.payingAmnt = $scope.payingAmnt.toFixed()	                
  					data.amount = $scope.payingAmnt;
  					console.log("data.amount==",data.amount)
  				if($scope.detail != null){
e856f2161   Palak Handa   new page design
941
  					$http({
845d2e17f   apple   add new file & ra...
942
943
944
945
946
  					method: 'POST',
  					url: BASE_URL+'/payments',
  					data: data,
  					headers: {}
  					}).then(function mySuccess(paymentResult) {
74db82750   apple   loader use
947
  							$scope.loading = false;
845d2e17f   apple   add new file & ra...
948
949
950
951
952
953
954
955
956
  						console.log("paymentResult",paymentResult)
  						$scope.paymentResult = paymentResult;
  						//$("p").html(paymentResult.data.data)
  					}, function myError(error) {
  					});
  				}
  				var i = 0;
  				$scope.payingAmnt =  $scope.payingAmnt * 100;
  				var options = {
466bf74a5   apple   minor change
957
958
  					//"key": "rzp_test_YwHsVFiDIQ2WUQ",
  					"key": "rzp_live_mkmCb4FkstuWaS",
845d2e17f   apple   add new file & ra...
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
  					"amount": $scope.payingAmnt,
  
  					"name": "Startup Jalsa",
  					"description":"amount",
  					"currency": "INR",
  					"status": "done",
  
  					"prefill": {
  						"email": $scope.detail.email,
  						"contact": $scope.detail.phone
  					},
  
  					"theme": {
  						"color": "#2196f3 ",
  						"image_padding":"NO"
  					},
  					"modal": {
  						"ondismiss": function(){
  						}
  					},
  					"handler": function (response){
  						createPayment(response);
  					}
  				};
  				var rzp1 = new Razorpay(options);
  				rzp1.open();
  				$scope.paymentResponse = {};
  				function createPayment(response){
  					console.log("response12333333",response)
  					console.log("$scope.paymentResult",$scope.paymentResult)
  					$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;
  					console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
  					$http({
  					   method: 'PUT',
  					   url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
  					   data: $scope.paymentResponse,
  					   headers: {}
  					   }).then(function mySuccess(searchResult) {
  					   	console.log("searchResult",searchResult)
  					   	$location.path("/confirm")
e856f2161   Palak Handa   new page design
1003
1004
1005
  					   }, function myError(error) {
  					});
  				}
19a2e7b14   apple   payment integrate
1006
  				//}
845d2e17f   apple   add new file & ra...
1007
  			}, function myError(error) {
19a2e7b14   apple   payment integrate
1008
1009
1010
1011
  
  			});
  
  		})
0c48d68b6   apple   text xhange
1012
1013
  			
  		// })
317a80571   Palak Handa   city selected
1014

500aaf838   apple   add new fields & ...
1015
  		//}
19a2e7b14   apple   payment integrate
1016

845d2e17f   apple   add new file & ra...
1017
  		}
317a80571   Palak Handa   city selected
1018
1019
1020
  	}
  	
  });
53b83aa9e   Palak Handa   first commit
1021

1ef0fae04   apple   confirmation page...
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
  scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) {
  	$scope.approvedMsg = false;
  	$scope.disApprovedMsg = false;
  
  	var myParam =  window.location.href.split('status=').splice(1).join('').split('&')[0]
  	console.log(myParam)
  		// if(myParam){
  			if(myParam == "approved"){
  				$scope.approvedMsg = true;
  				$scope.disApprovedMsg = false;
  			}else{
  				$scope.approvedMsg = false;
  				$scope.disApprovedMsg = true;
  			}
  		// }else{
  		// 	$scope.disApprovedMsg = true;
  		// }
  
  });
19a2e7b14   apple   payment integrate
1041
  scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) {
b96c88383   Palak Handa   amount change
1042
1043
1044
1045
1046
1047
  		$scope.data = {};
  		$scope.check = false;
  	    $scope.numberCheck = false;
  
  		$scope.submit = function() {
  			console.log($scope.data.name)
04ffff01c   Palak Handa   minor change
1048
1049
1050
  			var randomNumber = ""+Math.random();
  			var nameSpliced = $scope.data.name.slice(0,5);
  			var numberSpliced = randomNumber.slice(2,4);;
b96c88383   Palak Handa   amount change
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
  			$scope.data.referalToken = nameSpliced+numberSpliced;
  			$scope.data.referalToken = $scope.data.referalToken.toUpperCase();
  			console.log("dsdfs",numberSpliced);
  	         $http({
  	                method: 'POST',
  	                url: BASE_URL + '/ambassadors',
  	                data: $scope.data,
  	                headers: {}
  	            }).then(function mySuccess(result) {
  	                console.log("result", result)
  	                $scope.detail = result;
  	                $('#myModal').modal('show');
  	              	$scope.data.name = '';
  	                $scope.data.email = '';
  	                $scope.data.mobile = '';
  	                //$scope.data.discount = '';
  	            
  	            }, function myError(error) {
  	            	console.log(error)
  	            	console.log(error.data.error.message)
  	            });
b96c88383   Palak Handa   amount change
1072
1073
  	        }
  	});
96991e0c1   Palak Handa   update
1074