Blame view

script.js 58.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'
  	        })
b96c88383   Palak Handa   amount change
24
  	        // route for the registration page
5734bf6dc   apple   design change
25
  	        .when('/registration', {
b96c88383   Palak Handa   amount change
26
27
  	            templateUrl: 'pages/registration.html',
  	            controller: 'registrationController'
0859c95d2   Shilpi Saini   add questions
28
  			})
b96c88383   Palak Handa   amount change
29

dcf89e049   Shilpi Saini   new cities added ...
30
31
32
33
34
  			// route for the registration page
  	        .when('/registrationForm', {
  	            templateUrl: 'pages/registrationForm.html',
  	            controller: 'registrationFormController'
  			})
8586ba494   Palak Handa   html5 mode
35
  	        //route for the ambassador page
f19bac9a9   Shilpi Saini   integrate coupon ...
36
37
38
39
  	        .when('/startupJalsaPromocode', {
  	            templateUrl: 'pages/ambassador.html',
  	            controller: 'ambassadorController'
  	        })
5348de778   Palak Handa   design updated
40

63f32ea64   Shilpi Saini   new campus ambass...
41
42
43
44
45
46
47
48
49
50
51
52
  			//route for the campusAmbassador page
  	        .when('/campusAmbassador', {
  	            templateUrl: 'pages/campusAmbassador.html',
  	            controller: 'mainController'
  			})
  
  			//route for the campusAmbassador page
  	        .when('/campusAmbassadorForm', {
  	            templateUrl: 'pages/campusAmbassadorForm.html',
  	            controller: 'campusAmbassadorController'
  			})
  			
5348de778   Palak Handa   design updated
53
  	        // route for the confirmation page
63f32ea64   Shilpi Saini   new campus ambass...
54
55
56
57
58
59
  	        // .when('/confirmation', {
  	        //     templateUrl: 'pages/confirmation.html',
  	        //     controller: 'confirmationController'
  			// })
  
  			// route for the confirmation page
5348de778   Palak Handa   design updated
60
  	        .when('/confirmation', {
63f32ea64   Shilpi Saini   new campus ambass...
61
  	            templateUrl: 'pages/campusAmbassadorConfirm.html',
1ef0fae04   apple   confirmation page...
62
  	            controller: 'confirmationController'
845d2e17f   apple   add new file & ra...
63
64
65
66
67
68
  			})
  			
  			// route for the confirmation page
  	        .when('/confirm', {
  	            templateUrl: 'pages/confirm.html',
  	            controller: 'confirmationController'
dbe31ef03   Shilpi Saini   new url add
69
70
71
  			})
  			
  			// route for the paytm page
246b2c5cd   Palak Handa   icon add
72
73
  	        .when('/paytm', {
  	            templateUrl: 'pages/paytm.html',
bde1a63a4   Shilpi Saini   new paytm page in...
74
75
76
77
78
79
80
81
82
83
84
85
  	            controller: 'mainController'
  			})
  			
  			// route for the paytm page
  	        .when('/paytm/caricatures', {
  	            templateUrl: 'pages/paytmCaricatures.html',
  	            controller: 'mainController'
  			})
  
  			// route for the paytm page
  	        .when('/paytm/checkout', {
  	            templateUrl: 'pages/paytmCheckout.html',
246b2c5cd   Palak Handa   icon add
86
  	            controller: 'paytmController'
bde1a63a4   Shilpi Saini   new paytm page in...
87
88
89
90
91
92
93
  			})
  			
  			// route for the confirmation page
  	        .when('/paytm/confirm', {
  	            templateUrl: 'pages/confirmed.html',
  	            controller: 'paytmController'
  			})
5348de778   Palak Handa   design updated
94

3c4db43f3   apple   design new form
95
96
97
  	        .otherwise({ 
  	        	redirectTo: '/' 
  	        });
8586ba494   Palak Handa   html5 mode
98

6ae8d3cdd   Palak Handa   add new module
99
  	});
53b83aa9e   Palak Handa   first commit
100

f263889f0   Palak Handa   analytics work
101
102
  	scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
  	   	// Add configuration code as desired
686c78645   Shilpi Saini   google analyics add
103
  	   	 AnalyticsProvider.setAccount('UA-123583154-1');  //UU-XXXXXXX-X should be your tracking code
f263889f0   Palak Handa   analytics work
104
105
106
107
108
109
110
111
  
  	   	// Track all routes (default is true).
  	  	AnalyticsProvider.trackPages(true);
  
  	  	// Track all URL query params (default is false).
  	  	AnalyticsProvider.trackUrlParams(true);
  
  	}]).run(['Analytics', function(Analytics) { }]);
6f100185e   Shilpi Saini   minor change
112
113
  	scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1")
  	//scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1")
6ae8d3cdd   Palak Handa   add new module
114

ce1c575fe   apple   validation on upl...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
  	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
129
  	// create the controller and inject Angular's $scope
857ebc69e   Palak Handa   timer add
130
  	scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) {
6ae8d3cdd   Palak Handa   add new module
131
132
133
  	    $scope.data = {
  	        show: true,
  	        hide: false
5734bf6dc   apple   design change
134
  		};
466bf74a5   apple   minor change
135
136
137
138
139
140
141
  		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
142

0d7cf45ec   Palak Handa   timer use
143
  		var chennai = new Date("Sept 19, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
  		// 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
166
  		var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
  		// 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
189
  		var mumbai = new Date("Sept 26, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = 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
212

857ebc69e   Palak Handa   timer add
213
  		var kolkata = new Date("Oct 3, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = 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
236

857ebc69e   Palak Handa   timer add
237
  		var jaipur = new Date("Oct 5, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = 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
260

857ebc69e   Palak Handa   timer add
261
  		var delhi = new Date("Oct 8, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = 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
284

857ebc69e   Palak Handa   timer add
285
  		var kanpur = new Date("Oct 10, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
  		// Update the count down every 1 second
  		var x = setInterval(function() {
  		    // Get todays date and time
  		    var now = new Date().getTime();
  		    // Find the distance between now an the count down date
  		    var distance = 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
308

857ebc69e   Palak Handa   timer add
309
  		var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
  		// 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
332

857ebc69e   Palak Handa   timer add
333
  		var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
  		// 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
356

857ebc69e   Palak Handa   timer add
357
  		var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime();
e3d25d261   Palak Handa   delete url
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
  		// 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
380

6ae8d3cdd   Palak Handa   add new module
381
  	    $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
e847b36f8   Palak Handa   minor changes
382
  	    $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
c62079487   Palak Handa   updated design
383
  	    // $scope.Textshow = "yes"
6ae8d3cdd   Palak Handa   add new module
384
  	    $scope.max = 100;
88dd26b3d   Palak Handa   update
385
  	    $scope.formPage = false;
6ae8d3cdd   Palak Handa   add new module
386
387
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
6ae8d3cdd   Palak Handa   add new module
388
  	    $scope.data = {};
ea3c31126   Palak Handa   complete
389
  	    $scope.discountAmount = 0;
7b2bef227   Palak Handa   background image ...
390
  	    // $scope.data.quantity = "1";
6ae8d3cdd   Palak Handa   add new module
391
392
  	    $scope.check = false;
  	    $scope.numberCheck = false;
6ae8d3cdd   Palak Handa   add new module
393
  	    $scope.paymentResult = {};
6ae8d3cdd   Palak Handa   add new module
394
395
396
397
  	    var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  	        "status": "pending"
dcb703070   Palak Handa   updated new form ...
398
  		}
5734bf6dc   apple   design change
399
400
401
402
403
  		
  		$scope.showval = true;
  		$scope.hideval = false;
  		$scope.showvalue = false;
  		$scope.hidevalue = false;
e02529223   apple   minor change
404
  		localStorage.setItem("country",'INDIA');
5734bf6dc   apple   design change
405
  		$scope.isShowHide = function (value) {
1b31b20bf   apple   auto highlighted ...
406
407
  			var element = document.getElementById("defaultcountry");
  			element.classList.remove("btn-active");
845d2e17f   apple   add new file & ra...
408
  			localStorage.setItem("country",value);
5734bf6dc   apple   design change
409
410
411
412
413
414
415
416
417
418
419
420
421
422
  			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;
  			}
5734bf6dc   apple   design change
423
  			else {
971f93c26   Shilpi Saini   minor change
424
  				console.log("value2",value)
5734bf6dc   apple   design change
425
426
  				$scope.showval = false;
  				$scope.hideval = false;
39061adc5   Shilpi Saini   minor change
427
428
  				$scope.showvalue = true;
  				$scope.hidevalue = false;
5734bf6dc   apple   design change
429
430
  			}
  		}
fe142256c   apple   information page ...
431
  	    $scope.apply = function() {
16ecb0b6f   Shilpi Saini   colour changes & ...
432
433
  			$location.path("/caricatures")
  			//window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg";
f7e1e85c3   Shilpi Saini   minor change
434
435
  			
  		}
bde1a63a4   Shilpi Saini   new paytm page in...
436
437
  		$scope.applyRegister = function() {
  			$location.path("/paytm/caricatures")
16ecb0b6f   Shilpi Saini   colour changes & ...
438
  			//window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register";			
fe142256c   apple   information page ...
439
  		}
629cc1f8f   Palak Handa   minor changes
440

527754dcf   Shilpi Saini   minor change
441
442
  		$scope.applyForm = function() {
  			//console.log("palak")
63f32ea64   Shilpi Saini   new campus ambass...
443
444
445
  			$location.path("/campusAmbassadorForm")
  			//window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register";			
  		}
2d388a610   Shilpi Saini   content change
446
  		$scope.click=function(){
6ac108d15   Shilpi Saini   minor change
447
  			Analytics.trackEvent('whatsapp', 'click', 'Registration');
3c65df720   Palak Handa   minor change
448
  			let redirectUrl = "https://wa.me/919855051678";
2d388a610   Shilpi Saini   content change
449
450
  			window.open(redirectUrl,"_blank")
  		}
3c4db43f3   apple   design new form
451
  	    // $scope.data.city = '';
7b017db1c   apple   add city field
452
  	    $scope.watch =  function(value){
a006f2b11   apple   name changes
453
  			//document.getElementById("ahmedabad").src = "";
3c4db43f3   apple   design new form
454
  	    	// console.log("cllll",value)
7b017db1c   apple   add city field
455
  	    	$scope.data.city = value;
857ebc69e   Palak Handa   timer add
456
457
458
459
  	    	// if($scope.data.city == "Chennai"){
  	    	// 	console.log("cllll1",value)
  	    	// 	$window.location.href = 'http://35.154.24.158:8007';
  	    	// }else{
3c4db43f3   apple   design new form
460
  	    		// console.log("cllll2",value)
845d2e17f   apple   add new file & ra...
461
  				localStorage.setItem("city" ,value);
4bc406fe9   Shilpi Saini   baseurl change
462

857ebc69e   Palak Handa   timer add
463
  		    	//$location.path('/registration').search({city: value});
5734bf6dc   apple   design change
464
465
  				// $location.path('/registration/'+value+'');
  				$location.path('/registration');
857ebc69e   Palak Handa   timer add
466
467
  		    	//$state.go('registration', { 'city': value})
  	    	// }
dcf89e049   Shilpi Saini   new cities added ...
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
  		}
  		
  		$scope.watch1 =  function(value){
  			//document.getElementById("ahmedabad").src = "";
  	    	// console.log("cllll",value)
  	    	$scope.data.city = value;
  	    	// if($scope.data.city == "Chennai"){
  	    	// 	console.log("cllll1",value)
  	    	// 	$window.location.href = 'http://35.154.24.158:8007';
  	    	// }else{
  	    		// console.log("cllll2",value)
  				localStorage.setItem("city" ,value);
  
  		    	//$location.path('/registration').search({city: value});
  				// $location.path('/registration/'+value+'');
  				$location.path('/registrationForm');
  		    	//$state.go('registration', { 'city': value})
  	    	// }
163c5adae   Palak Handa   minor changes
486
  	    }
e847b36f8   Palak Handa   minor changes
487

dcf89e049   Shilpi Saini   new cities added ...
488
  		
bde1a63a4   Shilpi Saini   new paytm page in...
489
490
491
492
493
494
  		$scope.watchCity =  function(value){
  	    	$scope.data.city = value;
  			localStorage.setItem("city" ,value);
  			$location.path('/paytm/checkout');
  		}
  		
6a9f1f41e   Palak Handa   add left side but...
495
496
497
498
  	    $scope.select =  function(url){
  	    	console.log("cllll")
  	    	window.open(url)
  	    }
6ae8d3cdd   Palak Handa   add new module
499
  	    $scope.stagekeyPress = function() {
f8b43c6f8   Palak Handa   design changes
500
  	        $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
501
502
  	    }
  	    $scope.sectorkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
503
  	        $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
504
  	    }
163c5adae   Palak Handa   minor changes
505
  	    $scope.productLaunchkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
506
  	        $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
507
  	    }
163c5adae   Palak Handa   minor changes
508
  	    $scope.launchPeriodkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
509
  	        $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
510
  	    }
7b2bef227   Palak Handa   background image ...
511
512
  	    $scope.industrykeyPress = function(quantity) {
  	    	console.log("fghj",quantity)
f8b43c6f8   Palak Handa   design changes
513
  	    	$('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
514
  	    }
204302c02   Palak Handa   minor changes
515
516
517
518
519
  	    $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
520
  	            $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
204302c02   Palak Handa   minor changes
521
522
  	        }
  	    }
c62079487   Palak Handa   updated design
523
  	    $scope.amountkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
524
  	        $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
525
  	    }
2321f803a   Palak Handa   updated changes
526
527
528
  	    $scope.firstNamekeyPress = function(name) {
  	        console.log("lastName==", name);
  	        if (name == undefined) {
6ae8d3cdd   Palak Handa   add new module
529
530
  	            $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
531
  	            $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
532
533
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
534

6ae8d3cdd   Palak Handa   add new module
535
536
537
538
539
  	    $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
540
  	            $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
8ddc94e00   Palak Handa   update
541
  	        }	                
6ae8d3cdd   Palak Handa   add new module
542
  	    }
6ae8d3cdd   Palak Handa   add new module
543
544
  	    $scope.phonekeyPress = function(number) {
  	        console.log("number", number);
204302c02   Palak Handa   minor changes
545
  	        if (number == undefined || number == '') {
6ae8d3cdd   Palak Handa   add new module
546
547
  	            $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
548
  	            $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
549
550
551
552
553
554
555
556
  	        }
  	    }
  
  	    $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
557
  	            $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
558
559
  	        }
  	    }
7e3bb1018   Palak Handa   field added
560
  	    $scope.startupNamekeyPress = function(q) {
6ae8d3cdd   Palak Handa   add new module
561
562
563
  	        if (q == undefined) {
  	            $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
564
  	            $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
565
566
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
567
  	    $scope.linkedInkeyPress = function(technology) {
204302c02   Palak Handa   minor changes
568
  	        if (technology == undefined || technology == '') {
6ae8d3cdd   Palak Handa   add new module
569
570
  	            $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
571
  	            $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
572
573
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
574
  	    $scope.companykeyPress = function(problem) {
6ae8d3cdd   Palak Handa   add new module
575
576
577
  	        if (problem == undefined) {
  	            $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
578
  	            $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
579
580
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
581
  	    $scope.productNamekeyPress = function(solution) {
6ae8d3cdd   Palak Handa   add new module
582
583
584
  	        if (solution == undefined) {
  	            $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
585
  	            $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
586
587
588
  	        }
  	    }
  	    $scope.businesskeyPress = function(business) {
58efec61e   Palak Handa   color change
589
590
591
592
593
  	    	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
594
  	    }
dcb703070   Palak Handa   updated new form ...
595
  	    $scope.websitekeyPress = function(prototype) {
204302c02   Palak Handa   minor changes
596
  	        if (prototype == undefined  || prototype == '') {
6ae8d3cdd   Palak Handa   add new module
597
598
  	            $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
599
  	            $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
600
601
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
602
  	    $scope.employeekeyPress = function(market) {
204302c02   Palak Handa   minor changes
603
  	        if (market == undefined || market == '') {
6ae8d3cdd   Palak Handa   add new module
604
605
  	            $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
606
  	            $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
607
608
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
609
  	    $scope.annualkeyPress = function(risk) {
204302c02   Palak Handa   minor changes
610
  	        if (risk == undefined || risk == '') {
6ae8d3cdd   Palak Handa   add new module
611
612
  	            $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
613
  	            $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
614
615
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
616
  	    $scope.revenuekeyPress = function(team) {
81526b56d   Palak Handa   minor change
617
  	        if (team == undefined) {
6ae8d3cdd   Palak Handa   add new module
618
619
  	            $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
620
  	            $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
621
622
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
623
  	    $scope.descriptionkeyPress = function(pitch) {
6ae8d3cdd   Palak Handa   add new module
624
625
626
  	        if (pitch == undefined) {
  	            $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
627
  	            $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
628
629
  	        }
  	    }
e284785e4   Palak Handa   update new field
630
  	    $scope.discountkeyPress = function(discount) {
e284785e4   Palak Handa   update new field
631
632
633
  	        if (discount == undefined) {
  	            $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
634
  	            $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
e284785e4   Palak Handa   update new field
635
636
  	        }
  	    }
00af14f47   Shilpi Saini   minorchange
637

91eeb4455   Palak Handa   modify
638
639
640
641
  	    $scope.removeNooError = function() {
  	    	$('#invalidIdea').css('display', 'block');
  	        $('#noExist').css('display', 'none');
  	    };
c62079487   Palak Handa   updated design
642
  	    $scope.ideakeyPress = function(financial) {
6ae8d3cdd   Palak Handa   add new module
643
644
645
646
  	        console.log("financial", financial);
  	        if (financial == undefined) {
  	            $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
647
  	            $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
648
649
  	        }
  	    }
c62079487   Palak Handa   updated design
650
651
652
653
654
655
  
  	    $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
656
  	            $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
657
658
  	        }
  	    }
2d6a9fbea   Palak Handa   complete bugs
659
660
661
662
  	    $scope.changeReferalIconColor = function(referalToken){
  	    	if (referalToken == undefined || referalToken == '') {
  	    		$('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
  	    	}else {
f8b43c6f8   Palak Handa   design changes
663
  	            $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
2d6a9fbea   Palak Handa   complete bugs
664
665
  	        }
  	    }
6ae8d3cdd   Palak Handa   add new module
666

53b83aa9e   Palak Handa   first commit
667
  	});
686c78645   Shilpi Saini   google analyics add
668
  	scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
6ae8d3cdd   Palak Handa   add new module
669
  		$scope.data = {};
8e25d825b   Palak Handa   changes the rajor...
670
671
  		$scope.check = false;
  	    $scope.numberCheck = false;
e856f2161   Palak Handa   new page design
672
673
  	    $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
674
675
676
677
  	    $scope.max = 100;
  	    $scope.formPage = false;
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
19a2e7b14   apple   payment integrate
678
679
680
  		$scope.discountAmount = 0;
  		$scope.approvedMsg = false;
  		$scope.disApprovedMsg = false;
e856f2161   Palak Handa   new page design
681
682
683
684
  	    // $scope.data.quantity = "1";
  	    $scope.check = false;
  	    $scope.numberCheck = false;
  	    $scope.paymentResult = {};
1ef0fae04   apple   confirmation page...
685
686
687
688
689
690
691
692
693
694
  		// 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...
695

e6e8fcf6d   Shilpi Saini   razor pay integrate
696
  		$scope.click=function(){
2d5c1cbe7   Shilpi Saini   minor change
697
  			Analytics.trackEvent('whatsapp', 'click', 'Registration');
3c65df720   Palak Handa   minor change
698
  			let redirectUrl = "https://wa.me/919855051678";
e6e8fcf6d   Shilpi Saini   razor pay integrate
699
700
  			window.open(redirectUrl,"_blank")
  		}
5348de778   Palak Handa   design updated
701
702
703
704
  	    $scope.removeError = function() {
  	        $('#invalidEmail').css('display', 'none');
  	        $('#alreadyExist').css('display', 'none');
  	    };
248bd9b7c   Palak Handa   link validation
705
706
707
708
709
  		$scope.emailcheck = function(val) {
  	        if (val == undefined) {
  	            $('#invalidEmail').css('display', 'block');
  	        } else {
  	        	$('#alreadyExist').css('display', 'block');
248bd9b7c   Palak Handa   link validation
710
711
  	        }
  	    };
b678502c9   Palak Handa   update
712

dee1f7479   Palak Handa   validation use
713
714
715
716
717
718
719
720
721
722
723
724
  	    $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
725
  	 	// $scope.$on('city', function (event, value) {
7b017db1c   apple   add city field
726
  			$scope.data.city = localStorage.getItem("city");
845d2e17f   apple   add new file & ra...
727
  			$scope.data.country = localStorage.getItem("country");
317a80571   Palak Handa   city selected
728
  		// });
845d2e17f   apple   add new file & ra...
729
730
731
732
733
734
  		var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  			"status": "pending",
  			"paymentType": $scope.data.country 
  		}
ce1c575fe   apple   validation on upl...
735
  		
500aaf838   apple   add new fields & ...
736
737
738
739
740
741
742
743
744
745
  		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...
746
  				//console.log("base64textarea",$scope.base64textString)
03c9e5d63   apple   upload file
747
  				//$scope.data.uploadFile = file.name;
ce1c575fe   apple   validation on upl...
748
749
750
751
752
753
754
  				$scope.fileSelect = false;
  				if($scope.data.uploadFile == null){
  					$scope.fileSelect = true;
  				}else{
  					$scope.fileSelect = false;	
  					};
  				}
500aaf838   apple   add new fields & ...
755
756
757
758
759
760
761
  
  			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
762
763
  		$scope.ngShowhide = false;
  		$scope.GetValue = function(){
c70ffa5ac   apple   add one text field
764
765
766
767
768
769
  			if($scope.data.sector == "Other"){
  				$scope.ngShowhide = true;
  			}else{
  				$scope.ngShowhide = false;
  			}
  		}
b96c88383   Palak Handa   amount change
770

22ff22f2a   Shilpi Saini   add new type
771
772
773
774
775
776
777
778
  		$scope.ngShow = false;
  		$scope.getValue = function(){
  			if($scope.data.hear == "Other"){
  				$scope.ngShow = true;
  			}else{
  				$scope.ngShow = false;
  			}
  		}
a59958669   Shilpi Saini   add total amount
779
  		$scope.payingAmnt = 1180;
f19bac9a9   Shilpi Saini   integrate coupon ...
780
  		$rootScope.tokenCall = function(val) {
f19bac9a9   Shilpi Saini   integrate coupon ...
781
782
783
784
  	        if (val == undefined) {
  	            $('#invalidToken').css('display', 'block');
  	        } else {
  	        	val = val.toUpperCase();
e268b9a5a   Shilpi Saini   coupon code integ...
785
  	        	if(((val == "IITH99" || val == "IITH90") && $scope.data.city != "Hyderabad") || ((val == "OASIS" || val == "JALSA22") && $scope.data.city != "Jaipur") || (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 == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){
f19bac9a9   Shilpi Saini   integrate coupon ...
786
787
788
789
790
  	        		$scope.tokencheck = false;
  	        		return;
  	        	}
  	        	$http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
  				    .then(function(searchResult) {
f19bac9a9   Shilpi Saini   integrate coupon ...
791
792
  				        if (searchResult.data.length == 0) {
  	                    	$scope.tokencheck = false;
a59958669   Shilpi Saini   add total amount
793
794
  							 $scope.discountAmount = 0;
  							 
f19bac9a9   Shilpi Saini   integrate coupon ...
795
  	                	} else {
f19bac9a9   Shilpi Saini   integrate coupon ...
796
  	                    	 $scope.discountpercentage = searchResult.data[0].discount;
a59958669   Shilpi Saini   add total amount
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
  							$scope.tokencheck = true;
  						}
  						$scope.ticketAmnt = 1180;
  						var amount = $scope.ticketAmnt * 100
  						if($scope.tokencheck == true){
  							var amount = $scope.ticketAmnt
  							if($scope.discountpercentage == "100") {
  								$scope.discountpercentage = "99.9";
  							}
  							$scope.percDiscount = $scope.discountpercentage/100;
  							$scope.discountAmount = amount * $scope.percDiscount;
  						}
  						var taxAmount = $scope.ticketAmnt - $scope.discountAmount
  						$scope.payingAmnt = taxAmount;
  						$scope.payingAmnt = $scope.payingAmnt.toFixed()
f19bac9a9   Shilpi Saini   integrate coupon ...
812
813
814
  				    },function(err){
  				    	console.log(err)
  				});
b96c88383   Palak Handa   amount change
815
  	           
f19bac9a9   Shilpi Saini   integrate coupon ...
816
817
  	        }
  		};
51da4bffe   Shilpi Saini   razor pay integrate
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
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
  	// 	if($scope.data.country == "INDIA"){
  	// 		$scope.submit = function() {
  	// 			Analytics.trackEvent('register', 'click', 'Registration');
  	// 			$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 = 1180;
  	// 			$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];
  	// 			var image = BASE_URL+'/containers/images/download/'
  	// 			var imagePath = file.name;
  	// 			$scope.data.uploadFile = image + imagePath;
  	// 			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,
  	// 			headers: {}
  	// 			}).then(function mySuccess(result) {
  	// 				$scope.detail = result;
  	// 				data.applicantId = result.data.id;
  	// 				$scope.userId = result.data.id;
  	// 					var amount = $scope.ticketAmnt * 100
  	// 					if($scope.tokencheck == true){
  	// 						var amount = $scope.ticketAmnt
  	// 						console.log("resultcity===",$scope.data.city)
  	// 						if($scope.discountpercentage == "100") {
  	// 							$scope.discountpercentage = "99.9";
  	// 						}
  	// 						$scope.percDiscount = $scope.discountpercentage/100;
  	// 						$scope.discountAmount = amount * $scope.percDiscount;
  	// 					}
  	// 					var taxAmount = $scope.ticketAmnt - $scope.discountAmount
  	// 					$scope.payingAmnt = taxAmount;
  	// 					$scope.payingAmnt = $scope.payingAmnt.toFixed()	                
  	// 					data.amount = $scope.payingAmnt;
  	// 				if($scope.detail != null){
  	// 					$http({
  	// 					method: 'POST',
  	// 					url: BASE_URL+'/payments',
  	// 					data: data,
  	// 					headers: {}
  	// 					}).then(function mySuccess(paymentResult) {
  	// 						$scope.loading = false;
  	// 						//$("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){
  	// 					$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('register', 'click', 'Registration');
  	// 						   $location.path("/confirm")
  	// 					   }, function myError(error) {
  	// 					});
  	// 				}
  	// 				//}
  
  	// 			}, function myError(error) {
  
  	// 			});
  
  	// 		})
845d2e17f   apple   add new file & ra...
945
  				
51da4bffe   Shilpi Saini   razor pay integrate
946
  	// 		// })
845d2e17f   apple   add new file & ra...
947

51da4bffe   Shilpi Saini   razor pay integrate
948
  	// 		//}
b96c88383   Palak Handa   amount change
949

51da4bffe   Shilpi Saini   razor pay integrate
950
951
  	// 	}
  	// }else{
a59958669   Shilpi Saini   add total amount
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
  		// $scope.ticketAmnt = 1180;
  		// var amount = $scope.ticketAmnt * 100
  		// console.log("amount",amount)
  		// console.log("amount",$scope.tokencheck)
  		// if($scope.tokencheck == true){
  		// 	var amount = $scope.ticketAmnt
  		// 	console.log("amount",amount)
  		// 	if($scope.discountpercentage == "100") {
  		// 		$scope.discountpercentage = "99.9";
  		// 	}
  		// 	$scope.percDiscount = $scope.discountpercentage/100;
  		// 	console.log("$scope.percDiscount",$scope.percDiscount)
  		// 	$scope.discountAmount = amount * $scope.percDiscount;
  		// }
  		// console.log("$scope.discountAmount",$scope.discountAmount)
  		// var taxAmount = $scope.ticketAmnt - $scope.discountAmount
  		// console.log("taxAmount",taxAmount)
  		// $scope.payingAmnt = taxAmount;
  		// $scope.payingAmnt = $scope.payingAmnt.toFixed()	                
6ae8d3cdd   Palak Handa   add new module
971
  		$scope.submit = function() {
686c78645   Shilpi Saini   google analyics add
972
  			Analytics.trackEvent('register', 'click', 'Registration');
74db82750   apple   loader use
973
  			$scope.loading = true;
03c9e5d63   apple   upload file
974
  			$scope.data.uploadFile = $scope.base64textString;
0c48d68b6   apple   text xhange
975
  		// if($scope.tokencheck == false){
845d2e17f   apple   add new file & ra...
976
977
  		// 	$scope.data.referalToken = null;
  		// }
500aaf838   apple   add new fields & ...
978
979
980
981
  		// 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
982
  			$scope.infoForm = true;
6e44c4966   Shilpi Saini   integrate coupon ...
983
  			$scope.ticketAmnt = 1180;
e856f2161   Palak Handa   new page design
984
  			$scope.detail = {};
0ab3b2b0a   Shilpi Saini   confirmation page...
985
986
  			$scope.paymentResultt = {};
  			$rootScope.applicantResult = {};
e856f2161   Palak Handa   new page design
987
  			$scope.data.phone = "+91"+$scope.data.number;
fe142256c   apple   information page ...
988
  			if($scope.data.referalToken == null){
845d2e17f   apple   add new file & ra...
989
  				$scope.data.referalToken = "NA"
fe142256c   apple   information page ...
990
  			}
03c9e5d63   apple   upload file
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
  			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
1009
  			$http({
845d2e17f   apple   add new file & ra...
1010
1011
1012
1013
1014
  			method: 'POST',
  			url: BASE_URL+'/applicants',
  			data: $scope.data,
  			headers: {}
  			}).then(function mySuccess(result) {
f5c2a25ae   Shilpi Saini   minor change
1015
  				$scope.detail = result;
845d2e17f   apple   add new file & ra...
1016
1017
  				data.applicantId = result.data.id;
  				$scope.userId = result.data.id;
845d2e17f   apple   add new file & ra...
1018
1019
1020
  					var amount = $scope.ticketAmnt * 100
  					if($scope.tokencheck == true){
  						var amount = $scope.ticketAmnt
a65d2455e   Palak Handa   minor change
1021
  						if($scope.discountpercentage == "100") {
f19bac9a9   Shilpi Saini   integrate coupon ...
1022
  							$scope.discountpercentage = "99.9";
845d2e17f   apple   add new file & ra...
1023
  						}
845d2e17f   apple   add new file & ra...
1024
  						$scope.percDiscount = $scope.discountpercentage/100;
845d2e17f   apple   add new file & ra...
1025
  						$scope.discountAmount = amount * $scope.percDiscount;
845d2e17f   apple   add new file & ra...
1026
1027
  					}
  					var taxAmount = $scope.ticketAmnt - $scope.discountAmount
845d2e17f   apple   add new file & ra...
1028
  					$scope.payingAmnt = taxAmount;
845d2e17f   apple   add new file & ra...
1029
1030
  					$scope.payingAmnt = $scope.payingAmnt.toFixed()	                
  					data.amount = $scope.payingAmnt;
845d2e17f   apple   add new file & ra...
1031
  				if($scope.detail != null){
e856f2161   Palak Handa   new page design
1032
  					$http({
845d2e17f   apple   add new file & ra...
1033
1034
1035
1036
1037
  					method: 'POST',
  					url: BASE_URL+'/payments',
  					data: data,
  					headers: {}
  					}).then(function mySuccess(paymentResult) {
f5c2a25ae   Shilpi Saini   minor change
1038
  						$scope.loading = false;
845d2e17f   apple   add new file & ra...
1039
1040
1041
1042
1043
1044
  						$scope.paymentResult = paymentResult;
  						//$("p").html(paymentResult.data.data)
  					}, function myError(error) {
  					});
  				}
  				var i = 0;
a59958669   Shilpi Saini   add total amount
1045
  				$scope.payingAmntt =  $scope.payingAmnt * 100;
845d2e17f   apple   add new file & ra...
1046
  				var options = {
e4dd0a767   Shilpi Saini   minor change
1047
1048
  					//"key": "rzp_test_YwHsVFiDIQ2WUQ",
  					"key": "rzp_live_mkmCb4FkstuWaS",
a59958669   Shilpi Saini   add total amount
1049
  					"amount": $scope.payingAmntt,
845d2e17f   apple   add new file & ra...
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
  
  					"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){
845d2e17f   apple   add new file & ra...
1077
1078
1079
1080
1081
  					$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;
845d2e17f   apple   add new file & ra...
1082
1083
1084
1085
1086
1087
  					$http({
  					   method: 'PUT',
  					   url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
  					   data: $scope.paymentResponse,
  					   headers: {}
  					   }).then(function mySuccess(searchResult) {
0ab3b2b0a   Shilpi Saini   confirmation page...
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
  						console.log("searchResult",searchResult)
  						//$location.path("/confirm")
  						$rootScope.paymentResultt = searchResult.data;
  						$http({
  							method: 'GET',
  							url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId,
  							data: $scope.data,
  							headers: {}
  							}).then(function mySuccess(result) {
  							//console.log("result2323324434",result)
  							$rootScope.applicantResult = result.data;
  							if (result.data.city == "Chennai") {
  								$rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113",
  								$rootScope.applicantResult.date= "October 1st, 2019",
  								$rootScope.applicantResult.time= "3 PM"
  
                              } else if (result.data.city == "Hyderabad") {
  								$rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285",
  								$rootScope.applicantResult.date= "September 14th, 2019",
  								$rootScope.applicantResult.time= "3 PM"
  
                              } else if (result.data.city == "Mumbai") {
  								$rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076",
  								$rootScope.applicantResult.date= "September 4th, 2019",
  								$rootScope.applicantResult.time= "3 PM"
  
                              } else if (result.data.city == "Ahmedabad") {
  								$rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015",
  								$rootScope.applicantResult.date= "September 11th, 2019",
  								$rootScope.applicantResult.time= "3 PM"
                                  
                              } else if (result.data.city == "Jaipur") {
  								$rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur",
  								$rootScope.applicantResult.date= "September 24th, 2019",
  								$rootScope.applicantResult.time= "3 PM"
  
                              } else if (result.data.city == "Kolkata") {
  								$rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)",
  								$rootScope.applicantResult.time= "3 PM",
  								$rootScope.applicantResult.date= "September 17th, 2019"
  									
                              } else if (result.data.city == "Bengaluru") {
  								$rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076",
  								$rootScope.applicantResult.time= "3 PM",
  								$rootScope.applicantResult.date= "September 7th, 2019"
  									
                              } else if (result.data.city == "Delhi") {
  								$rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016",
  								$rootScope.applicantResult.time= "12 PM",
  								$rootScope.applicantResult.date= "October 16th, 2019"
  									
                              } else if (result.data.city == "Kanpur"){
  								$rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016",
  								$rootScope.applicantResult.time= "3 PM",
  								$rootScope.applicantResult.date= "September 28th, 2019"
  									
                              }else if (result.data.city == "Colombo") {
  								$rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka",
  								$rootScope.applicantResult.time= "3 PM", 
  								$rootScope.applicantResult.date= "October 5th, 2019"
  									
                              } else if (result.data.city == "Dhaka") {
  								$rootScope.applicantResult.location= "The Business Center, The Inspiration Hall Level 2, Lift number-2, Celebration Point, Plot: 3 & 5 (Beside Shahabuddin Medical College) Road: 113/A, Gulshan-2, Dhaka-1212",
  								$rootScope.applicantResult.date= "September 21st, 2019",
  								$rootScope.applicantResult.time= "3 PM"
  									
                              } else {
  								$rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445",
  								$rootScope.applicantResult.time= "3 PM",
  								$rootScope.applicantResult.date= "October 12th, 2019"
                              }
2d5c1cbe7   Shilpi Saini   minor change
1159
  							Analytics.trackEvent('success', 'click', 'Registration');
0ab3b2b0a   Shilpi Saini   confirmation page...
1160
1161
  							$location.path("/confirm")
  						})
e856f2161   Palak Handa   new page design
1162
1163
1164
  					   }, function myError(error) {
  					});
  				}
19a2e7b14   apple   payment integrate
1165
  				//}
845d2e17f   apple   add new file & ra...
1166
  			}, function myError(error) {
19a2e7b14   apple   payment integrate
1167
1168
1169
1170
  
  			});
  
  		})
0c48d68b6   apple   text xhange
1171
1172
  			
  		// })
317a80571   Palak Handa   city selected
1173

500aaf838   apple   add new fields & ...
1174
  		//}
19a2e7b14   apple   payment integrate
1175

845d2e17f   apple   add new file & ra...
1176
  		}
51da4bffe   Shilpi Saini   razor pay integrate
1177
  	//}
317a80571   Palak Handa   city selected
1178
1179
  	
  });
53b83aa9e   Palak Handa   first commit
1180

1ef0fae04   apple   confirmation page...
1181
1182
1183
1184
1185
  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]
1ef0fae04   apple   confirmation page...
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
  		// if(myParam){
  			if(myParam == "approved"){
  				$scope.approvedMsg = true;
  				$scope.disApprovedMsg = false;
  			}else{
  				$scope.approvedMsg = false;
  				$scope.disApprovedMsg = true;
  			}
  		// }else{
  		// 	$scope.disApprovedMsg = true;
  		// }
  
  });
bde1a63a4   Shilpi Saini   new paytm page in...
1199
  scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
246b2c5cd   Palak Handa   icon add
1200
1201
1202
1203
  	$scope.data = {};
  	$scope.data.city = localStorage.getItem("city");
  	$scope.data.country = localStorage.getItem("country");;
  	var data = {
bde1a63a4   Shilpi Saini   new paytm page in...
1204
1205
1206
  		//"amount": $scope.payingAmnt,
  		//"currency": "INR",
  		"status": "captured",
246b2c5cd   Palak Handa   icon add
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
  		"paymentType": "Manual_Paytm" 
  	}
  	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);
  			//console.log("base64textarea",$scope.base64textString)
  			//$scope.data.uploadFile = file.name;
  			$scope.fileSelect = false;
  			if($scope.data.uploadFile == null){
  				$scope.fileSelect = true;
  			}else{
  				$scope.fileSelect = false;	
  				};
  			}
  
  		reader.readAsBinaryString(file);
  		}
  	};
  	if (window.File && window.FileReader && window.FileList && window.Blob) {
  		document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
  	}
  
  	$scope.ngShowhide = false;
  	$scope.GetValue = function(){
  		if($scope.data.sector == "Other"){
  			$scope.ngShowhide = true;
  		}else{
  			$scope.ngShowhide = false;
  		}
  	}
bde1a63a4   Shilpi Saini   new paytm page in...
1244
1245
1246
1247
1248
1249
  	$scope.ngShow = false;
  	$scope.getValue = function(){
  		if($scope.data.hear == "Other"){
  			$scope.ngShow = true;
  		}else{
  			$scope.ngShow = false;
246b2c5cd   Palak Handa   icon add
1250
  		}
bde1a63a4   Shilpi Saini   new paytm page in...
1251
  	}
246b2c5cd   Palak Handa   icon add
1252

bde1a63a4   Shilpi Saini   new paytm page in...
1253
1254
  	$scope.register = function() {
  		Analytics.trackEvent('register', 'click', 'Registration');
246b2c5cd   Palak Handa   icon add
1255
1256
1257
  		$scope.loading = true;
  		$scope.data.uploadFile = $scope.base64textString;
  		$scope.infoForm = true;
bde1a63a4   Shilpi Saini   new paytm page in...
1258
  		//$scope.ticketAmnt = 1180;
246b2c5cd   Palak Handa   icon add
1259
1260
  		$scope.detail = {};
  		$scope.data.phone = "+91"+$scope.data.number;
bde1a63a4   Shilpi Saini   new paytm page in...
1261

246b2c5cd   Palak Handa   icon add
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
  		var file =document.getElementById('filePicker').files[0];
  		var image = BASE_URL+'/containers/images/download/'
  		var imagePath = file.name;
  		$scope.data.uploadFile = image + imagePath;
  		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',
bde1a63a4   Shilpi Saini   new paytm page in...
1280
  		url: BASE_URL+'/applicantIns',
246b2c5cd   Palak Handa   icon add
1281
1282
1283
1284
  		data: $scope.data,
  		headers: {}
  		}).then(function mySuccess(result) {
  			$scope.detail = result;
bde1a63a4   Shilpi Saini   new paytm page in...
1285
  			data.applicantInId = result.data.id;
246b2c5cd   Palak Handa   icon add
1286
  			$scope.userId = result.data.id;
bde1a63a4   Shilpi Saini   new paytm page in...
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
  				// var amount = $scope.ticketAmnt * 100
  				// if($scope.tokencheck == true){
  				// 	var amount = $scope.ticketAmnt
  				// 	console.log("resultcity===",$scope.data.city)
  				// 	if($scope.discountpercentage == "100") {
  				// 		$scope.discountpercentage = "99.9";
  				// 	}
  				// 	$scope.percDiscount = $scope.discountpercentage/100;
  				// 	$scope.discountAmount = amount * $scope.percDiscount;
  				// }
  				// var taxAmount = $scope.ticketAmnt - $scope.discountAmount
  				// $scope.payingAmnt = taxAmount;
  				// $scope.payingAmnt = $scope.payingAmnt.toFixed()	                
  				// data.amount = $scope.payingAmnt;
246b2c5cd   Palak Handa   icon add
1301
1302
1303
  			if($scope.detail != null){
  				$http({
  				method: 'POST',
bde1a63a4   Shilpi Saini   new paytm page in...
1304
  				url: BASE_URL+'/paymentsIns',
246b2c5cd   Palak Handa   icon add
1305
1306
1307
1308
1309
  				data: data,
  				headers: {}
  				}).then(function mySuccess(paymentResult) {
  					$scope.loading = false;
  					$scope.paymentResult = paymentResult;
bde1a63a4   Shilpi Saini   new paytm page in...
1310
  					$location.path("/paytm/confirm")
246b2c5cd   Palak Handa   icon add
1311
1312
1313
1314
1315
1316
1317
1318
1319
  				}, function myError(error) {
  				});
  			}
  
  			}, function myError(error) {
  
  			});
  
  		})
dbe31ef03   Shilpi Saini   new url add
1320
  		
246b2c5cd   Palak Handa   icon add
1321
  	}
dbe31ef03   Shilpi Saini   new url add
1322

246b2c5cd   Palak Handa   icon add
1323
  });
dbe31ef03   Shilpi Saini   new url add
1324

dcf89e049   Shilpi Saini   new cities added ...
1325
1326
1327
1328
  scotchApp.controller('registrationFormController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
  	$scope.data = {};
  	$scope.data.city = localStorage.getItem("city");
  	var data = {
51b1054e5   Shilpi Saini   coupon code gener...
1329
  		"amount": $scope.payingAmnt,
dcf89e049   Shilpi Saini   new cities added ...
1330
1331
1332
  		"currency": "INR",
  		"status": "pending"
  	}
51b1054e5   Shilpi Saini   coupon code gener...
1333
1334
1335
1336
1337
1338
  	//$scope.payingAmnt = 590;
  	$rootScope.tokenCall = function(val) {
  		if (val == undefined) {
  			$('#invalidToken').css('display', 'block');
  		} else {
  			val = val.toUpperCase();
1725e9c33   Shilpi Saini   coupon code gener...
1339
1340
1341
1342
  			if(((val == "SMVDU") && $scope.data.city != "Katra") || ((val == "LEH") && $scope.data.city != "Leh")){
  				$scope.tokencheck = false;
  					return;
  				}
51b1054e5   Shilpi Saini   coupon code gener...
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
  			$http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
  				.then(function(searchResult) {
  					if (searchResult.data.length == 0) {
  						$scope.tokencheck = false;
  						 $scope.discountAmount = 0;
  						 
  					} else {
  						 $scope.discountpercentage = searchResult.data[0].discount;
  						$scope.tokencheck = true;
  					}
  					$scope.ticketAmnt = 590;
  					var amount = $scope.ticketAmnt * 100
  					if($scope.tokencheck == true){
  						var amount = $scope.ticketAmnt
  						if($scope.discountpercentage == "100") {
  							$scope.discountpercentage = "99.9";
  						}
  						//console.log($scope.ticketAmnt)
  						$scope.percDiscount = $scope.discountpercentage/100;
  						//console.log($scope.percDiscount)
  						$scope.discountAmount = amount * $scope.percDiscount;
  						//console.log($scope.discountAmount)
  					}
  					var taxAmount = $scope.ticketAmnt - $scope.discountAmount
  					//console.log(taxAmount)
  					$scope.payingAmnt = taxAmount;
  					$scope.payingAmnt = $scope.payingAmnt.toFixed()
  					//console.log($scope.payingAmnt)
  				},function(err){
  					console.log(err)
  			});
  		   
  		}
  	};
dcf89e049   Shilpi Saini   new cities added ...
1377
1378
1379
1380
  
  	$scope.formRegister = function() {
  		//Analytics.trackEvent('register', 'click', 'Registration');
  		$scope.loading = true;
dcf89e049   Shilpi Saini   new cities added ...
1381
1382
1383
  		$scope.detail = {};
  		$scope.data.phone = "+91"+$scope.data.number;
  		console.log($scope.data.register)
51b1054e5   Shilpi Saini   coupon code gener...
1384
1385
1386
1387
1388
1389
1390
1391
  		if($scope.data.referalToken == null){
  			$scope.data.referalToken = "NA"
  		}
  		if($scope.data.register == "Pitch"){
  			$scope.ticketAmnt = 590;
  		}else {
  			$scope.ticketAmnt = 118;
  		}
dcf89e049   Shilpi Saini   new cities added ...
1392
1393
1394
1395
1396
1397
1398
1399
  		$http({
  		method: 'POST',
  		url: BASE_URL+'/applicantIndia',
  		data: $scope.data,
  		headers: {}
  		}).then(function mySuccess(result) {
  			$scope.detail = result;
  			data.applicantIndiaId = result.data.id;
dcf89e049   Shilpi Saini   new cities added ...
1400
  			var amount = $scope.ticketAmnt * 100
51b1054e5   Shilpi Saini   coupon code gener...
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
  			if($scope.tokencheck == true){
  				//console.log("test")
  				var amount = $scope.ticketAmnt
  				//console.log("test",$scope.ticketAmnt)
  				if($scope.discountpercentage == "100") {
  					$scope.discountpercentage = "99.9";
  				}
  				$scope.percDiscount = $scope.discountpercentage/100;
  				//console.log($scope.percDiscount)
  				$scope.discountAmount = amount * $scope.percDiscount;
  				//console.log($scope.discountAmount)
  			}
  			var taxAmount = $scope.ticketAmnt - $scope.discountAmount
  			$scope.payingAmnt = taxAmount;
  			$scope.payingAmnt = $scope.payingAmnt.toFixed()	
  			//console.log($scope.payingAmnt)                
  			data.amount = $scope.payingAmnt;
  			//var amount = $scope.ticketAmnt * 100
dcf89e049   Shilpi Saini   new cities added ...
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
  			if($scope.detail != null){
  				$http({
  				method: 'POST',
  				url: BASE_URL+'/paymentsIndia',
  				data: data,
  				headers: {}
  				}).then(function mySuccess(paymentResult) {
  					console.log(paymentResult)
  					$scope.loading = false;
  					//$scope.ambassadorId = paymentResult.data.ambassadorId
  					$scope.paymentResult = paymentResult;
  					//$location.path("/paytm/confirm")
  				}, function myError(error) {
  				});
  			}
  
  			var i = 0;
51b1054e5   Shilpi Saini   coupon code gener...
1436
1437
  				$scope.payingAmntt =  $scope.payingAmnt * 100;
  				//console.log($scope.payingAmntt)
dcf89e049   Shilpi Saini   new cities added ...
1438
  				var options = {
6f100185e   Shilpi Saini   minor change
1439
1440
  					//"key": "rzp_test_YwHsVFiDIQ2WUQ",
  					"key": "rzp_live_mkmCb4FkstuWaS",
dcf89e049   Shilpi Saini   new cities added ...
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
  					"amount": $scope.payingAmntt,
  
  					"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("response",response)
  					console.log($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;
  					$http({
  					   method: 'PUT',
  					   url: BASE_URL+'/paymentsIndia/'+$scope.paymentResult.data.id,
  					   data: $scope.paymentResponse,
  					   headers: {}
  					   }).then(function mySuccess(searchResult) {
  						console.log("searchResult",searchResult)
  						$location.path("/confirm")
  					   }, function myError(error) {
  					});
  				}
  				//}
  
  			}, function myError(error) {
  
  			});
  
  		//})
  		
  	}
  
  });
63f32ea64   Shilpi Saini   new campus ambass...
1498
1499
1500
1501
1502
  scotchApp.controller('campusAmbassadorController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
  	$scope.data = {};
  	var data = {
  		"amount": $scope.ticketAmnt,
  		"currency": "INR",
064278f76   Shilpi Saini   add token
1503
  		"status": "pending"
63f32ea64   Shilpi Saini   new campus ambass...
1504
  	}
63f32ea64   Shilpi Saini   new campus ambass...
1505
1506
1507
  	$scope.formRegister = function() {
  		//Analytics.trackEvent('register', 'click', 'Registration');
  		$scope.loading = true;
01df29c15   Shilpi Saini   minor change
1508
  		$scope.ticketAmnt = 500;
63f32ea64   Shilpi Saini   new campus ambass...
1509
1510
  		$scope.detail = {};
  		$scope.data.phone = "+91"+$scope.data.number;
064278f76   Shilpi Saini   add token
1511
1512
1513
1514
1515
1516
1517
1518
1519
  		var randomNumber = ""+Math.random();
  		var nameSpliced = $scope.data.name.slice(0,3);
  		var numberSpliced = randomNumber.slice(2,4);
  		//var numberSpliced = "90";
  		$scope.data.referalToken = nameSpliced+numberSpliced;
  		//$scope.data.referalToken = nameSpliced;
  		$scope.data.referalToken = $scope.data.referalToken.toUpperCase();
  		var ambassDorpayload = {"name":$scope.data.name,"email":$scope.data.email,"mobile":$scope.data.phone,"discount":10,"referalToken":$scope.data.referalToken}
  		
63f32ea64   Shilpi Saini   new campus ambass...
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
  		$http({
  		method: 'POST',
  		url: BASE_URL+'/campusAmbassadors',
  		data: $scope.data,
  		headers: {}
  		}).then(function mySuccess(result) {
  			$scope.detail = result;
  			data.campusAmbassadorId = result.data.id;
  			$scope.userId = result.data.id;
  			var amount = $scope.ticketAmnt * 100
064278f76   Shilpi Saini   add token
1530
  			$scope.ambassCall(ambassDorpayload);
63f32ea64   Shilpi Saini   new campus ambass...
1531
1532
1533
1534
1535
1536
1537
1538
1539
  			if($scope.detail != null){
  				$http({
  				method: 'POST',
  				url: BASE_URL+'/ambassadorPayments',
  				data: data,
  				headers: {}
  				}).then(function mySuccess(paymentResult) {
  					console.log(paymentResult)
  					$scope.loading = false;
064278f76   Shilpi Saini   add token
1540
  					//$scope.ambassadorId = paymentResult.data.ambassadorId
63f32ea64   Shilpi Saini   new campus ambass...
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
  					$scope.paymentResult = paymentResult;
  					//$location.path("/paytm/confirm")
  				}, function myError(error) {
  				});
  			}
  
  			var i = 0;
  				$scope.payingAmntt =  $scope.ticketAmnt * 100;
  				data.amount = $scope.ticketAmnt;
  				var options = {
  					//"key": "rzp_test_YwHsVFiDIQ2WUQ",
  					"key": "rzp_live_mkmCb4FkstuWaS",
  					"amount": $scope.payingAmntt,
  
  					"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("response",response)
  					console.log($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;
  					$http({
  					   method: 'PUT',
  					   url: BASE_URL+'/ambassadorPayments/'+$scope.paymentResult.data.id,
  					   data: $scope.paymentResponse,
  					   headers: {}
  					   }).then(function mySuccess(searchResult) {
  						console.log("searchResult",searchResult)
  						$location.path("/confirmation")
  						//$scope.paymentResultt = searchResult.data;
  						// $http({
  						// 	method: 'GET',
  						// 	url: BASE_URL+'/campusAmbassadors/'+$rootScope.paymentResultt.campusAmbassadorId,
  						// 	data: $scope.data,
  						// 	headers: {}
  						// 	}).then(function mySuccess(result) {
  						// 	//console.log("result2323324434",result)
  						// 	//Analytics.trackEvent('success', 'click', 'Registration');
  						// 	$location.path("/confirm")
  						// })
  					   }, function myError(error) {
  					});
  				}
  				//}
  
  			}, function myError(error) {
  
  			});
064278f76   Shilpi Saini   add token
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
  			$scope.ambassCall = function(data){
  				$http({
  					method: 'POST',
  					url: BASE_URL+'/ambassadors',
  					data: data,
  					headers: {}
  					}).then(function mySuccess(result) {
  						console.log(result)
  					});
  			}
63f32ea64   Shilpi Saini   new campus ambass...
1625
1626
1627
1628
1629
  		//})
  		
  	}
  
  });
19a2e7b14   apple   payment integrate
1630
  scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) {
b96c88383   Palak Handa   amount change
1631
1632
1633
1634
1635
  		$scope.data = {};
  		$scope.check = false;
  	    $scope.numberCheck = false;
  
  		$scope.submit = function() {
e268b9a5a   Shilpi Saini   coupon code integ...
1636
1637
1638
  			//var randomNumber = ""+Math.random();
  			var nameSpliced = $scope.data.name.slice(0,5);
  			//var numberSpliced = randomNumber.slice(2,4);
51b1054e5   Shilpi Saini   coupon code gener...
1639
1640
1641
  			//var numberSpliced = "22";
  			//$scope.data.referalToken = nameSpliced+numberSpliced;
  			$scope.data.referalToken = nameSpliced;
b96c88383   Palak Handa   amount change
1642
  			$scope.data.referalToken = $scope.data.referalToken.toUpperCase();
bde1a63a4   Shilpi Saini   new paytm page in...
1643
  			//$scope.data.referalToken = $scope.data.referalToken.toString();
b96c88383   Palak Handa   amount change
1644
1645
1646
1647
1648
1649
  	         $http({
  	                method: 'POST',
  	                url: BASE_URL + '/ambassadors',
  	                data: $scope.data,
  	                headers: {}
  	            }).then(function mySuccess(result) {
b96c88383   Palak Handa   amount change
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
  	                $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
1661
1662
  	        }
  	});
96991e0c1   Palak Handa   update
1663