Blame view

script.js 30.3 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
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  
  		// [system.webServer]
  		//   [rewrite]
  		//     [rules]
  		//       [rule name="scotchApp" stopProcessing="true"]
  		//         [match url=".*" /]
  		//         [conditions logicalGrouping="MatchAll"]
  		//           [add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /]
  		//           [add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /]
  		//           [add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /]
  		//         [/conditions]
  		//         [action type="Rewrite" url="/index.html" /]
  		//       [/rule]
  		//     [/rules]
  		//   [/rewrite]
  		// [/system.webServer]
  
  		// use the HTML5 History API
          $locationProvider.html5Mode({
          	enabled: true,
          	requireBase: false
          });
         	$locationProvider.hashPrefix('!');
6ae8d3cdd   Palak Handa   add new module
29
  	    $routeProvider
dcb703070   Palak Handa   updated new form ...
30
  	    	// route for the Home page
6ae8d3cdd   Palak Handa   add new module
31
  	        .when('/', {
dcb703070   Palak Handa   updated new form ...
32
33
34
  	            templateUrl: 'pages/Home.html',
  	            controller: 'mainController'
  	        })
b96c88383   Palak Handa   amount change
35
  	        // route for the caricatures page
e856f2161   Palak Handa   new page design
36
  	        .when('/caricatures', {
b96c88383   Palak Handa   amount change
37
  	            templateUrl: 'pages/caricatures.html',
6ae8d3cdd   Palak Handa   add new module
38
39
  	            controller: 'mainController'
  	        })
317a80571   Palak Handa   city selected
40
41
42
43
44
  	        // // route for the paymentVerify page
  	        // .when('/pendingPayment/:id', {
  	        //     templateUrl: 'pages/verify.html',
  	        //     controller: 'verifyController'
  	        // })
6ae8d3cdd   Palak Handa   add new module
45

b96c88383   Palak Handa   amount change
46
  	        // route for the registration page
bab049fb9   Palak Handa   city issue solve
47
  	        .when('/registration/:city', {
b96c88383   Palak Handa   amount change
48
49
50
  	            templateUrl: 'pages/registration.html',
  	            controller: 'registrationController'
  	        })
8586ba494   Palak Handa   html5 mode
51
52
53
54
55
  	        //route for the ambassador page
  	        .when('/startupJalsaPromocode', {
  	            templateUrl: 'pages/ambassador.html',
  	            controller: 'ambassadorController'
  	        })
5348de778   Palak Handa   design updated
56
57
58
59
  
  	        // route for the confirmation page
  	        .when('/confirmation', {
  	            templateUrl: 'pages/confirmation.html',
b96c88383   Palak Handa   amount change
60
  	            controller: 'registrationController'
5348de778   Palak Handa   design updated
61
  	        })
8586ba494   Palak Handa   html5 mode
62
63
64
65
66
  	        .otherwise({ 
  	        	redirectTo: '/' 
  	        });
  
  	        
0d7cf45ec   Palak Handa   timer use
67

6ae8d3cdd   Palak Handa   add new module
68
  	});
53b83aa9e   Palak Handa   first commit
69

f263889f0   Palak Handa   analytics work
70
71
  	scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
  	   	// Add configuration code as desired
61b69ada0   Palak Handa   design updated
72
  	   	 AnalyticsProvider.setAccount('UA-106416759-1');  //UU-XXXXXXX-X should be your tracking code
f263889f0   Palak Handa   analytics work
73
74
75
76
77
78
79
80
  
  	   	// 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
81
82
  	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
83

2d6a9fbea   Palak Handa   complete bugs
84
  	// create the controller and inject Angular's $scope
f263889f0   Palak Handa   analytics work
85
  	scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) {
6ae8d3cdd   Palak Handa   add new module
86
87
88
89
  	    $scope.data = {
  	        show: true,
  	        hide: false
  	    };
0d7cf45ec   Palak Handa   timer use
90
  		var chennai = new Date("Sept 19, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
  		// 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);
0d7cf45ec   Palak Handa   timer use
113
  		var hyderabad = new Date("Sept 21, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
  		// 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);
0d7cf45ec   Palak Handa   timer use
136
  		var mumbai = new Date("Sept 25, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
  		// 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
159

0d7cf45ec   Palak Handa   timer use
160
  		var kolkata = new Date("Oct 2, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
  		// 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
183

0d7cf45ec   Palak Handa   timer use
184
  		var jaipur = new Date("Oct 4, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
  		// 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
207

0d7cf45ec   Palak Handa   timer use
208
  		var delhi = new Date("Oct 7, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
  		// 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
231

0d7cf45ec   Palak Handa   timer use
232
  		var kanpur = new Date("Oct 9, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
  		// 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
255

0d7cf45ec   Palak Handa   timer use
256
  		var ahmedabad = new Date("Oct 11, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
  		// 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
279

0d7cf45ec   Palak Handa   timer use
280
  		var bengaluru = new Date("Oct 12, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
  		// 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
303

0d7cf45ec   Palak Handa   timer use
304
  		var dharamsala = new Date("Dec 13, 2018 12:00:00").getTime();
e3d25d261   Palak Handa   delete url
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
  		// 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
327

6ae8d3cdd   Palak Handa   add new module
328
  	    $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
e847b36f8   Palak Handa   minor changes
329
  	    $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
c62079487   Palak Handa   updated design
330
  	    // $scope.Textshow = "yes"
6ae8d3cdd   Palak Handa   add new module
331
  	    $scope.max = 100;
88dd26b3d   Palak Handa   update
332
  	    $scope.formPage = false;
6ae8d3cdd   Palak Handa   add new module
333
334
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
6ae8d3cdd   Palak Handa   add new module
335
  	    $scope.data = {};
ea3c31126   Palak Handa   complete
336
  	    $scope.discountAmount = 0;
7b2bef227   Palak Handa   background image ...
337
  	    // $scope.data.quantity = "1";
6ae8d3cdd   Palak Handa   add new module
338
339
  	    $scope.check = false;
  	    $scope.numberCheck = false;
6ae8d3cdd   Palak Handa   add new module
340
  	    $scope.paymentResult = {};
6ae8d3cdd   Palak Handa   add new module
341
342
343
344
345
  	    var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  	        "status": "pending"
  	    }
53b83aa9e   Palak Handa   first commit
346

dcb703070   Palak Handa   updated new form ...
347
  	    $scope.apply = function() {
317a80571   Palak Handa   city selected
348
  	    	//Analytics.trackEvent('register', 'click', 'Registration');
e856f2161   Palak Handa   new page design
349
  			$location.path("/caricatures")
dcb703070   Palak Handa   updated new form ...
350
  		}
629cc1f8f   Palak Handa   minor changes
351

317a80571   Palak Handa   city selected
352
353
354
355
356
357
  	    $scope.data.city = '';
  	    $scope.watch =  function(value){
  	    	console.log("cllll",value)
  	    	$scope.data.city = value;
  	    	localStorage.setItem("city" ,value);
  	    	//$location.path('/registration').search({city: value});
bab049fb9   Palak Handa   city issue solve
358
  	    	$location.path('/registration/'+value+'');
317a80571   Palak Handa   city selected
359
  	    	//$state.go('registration', { 'city': value})
163c5adae   Palak Handa   minor changes
360
  	    }
e847b36f8   Palak Handa   minor changes
361

6a9f1f41e   Palak Handa   add left side but...
362
363
364
365
  	    $scope.select =  function(url){
  	    	console.log("cllll")
  	    	window.open(url)
  	    }
6ae8d3cdd   Palak Handa   add new module
366
  	    $scope.stagekeyPress = function() {
f8b43c6f8   Palak Handa   design changes
367
  	        $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
368
369
  	    }
  	    $scope.sectorkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
370
  	        $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
371
  	    }
163c5adae   Palak Handa   minor changes
372
  	    $scope.productLaunchkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
373
  	        $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
374
  	    }
163c5adae   Palak Handa   minor changes
375
  	    $scope.launchPeriodkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
376
  	        $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
377
  	    }
7b2bef227   Palak Handa   background image ...
378
379
  	    $scope.industrykeyPress = function(quantity) {
  	    	console.log("fghj",quantity)
f8b43c6f8   Palak Handa   design changes
380
  	    	$('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
381
  	    }
204302c02   Palak Handa   minor changes
382
383
384
385
386
  	    $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
387
  	            $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
204302c02   Palak Handa   minor changes
388
389
  	        }
  	    }
c62079487   Palak Handa   updated design
390
  	    $scope.amountkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
391
  	        $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
392
  	    }
2321f803a   Palak Handa   updated changes
393
394
395
  	    $scope.firstNamekeyPress = function(name) {
  	        console.log("lastName==", name);
  	        if (name == undefined) {
6ae8d3cdd   Palak Handa   add new module
396
397
  	            $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
398
  	            $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
399
400
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
401

6ae8d3cdd   Palak Handa   add new module
402
403
404
405
406
  	    $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
407
  	            $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
8ddc94e00   Palak Handa   update
408
  	        }	                
6ae8d3cdd   Palak Handa   add new module
409
  	    }
6ae8d3cdd   Palak Handa   add new module
410
411
  	    $scope.phonekeyPress = function(number) {
  	        console.log("number", number);
204302c02   Palak Handa   minor changes
412
  	        if (number == undefined || number == '') {
6ae8d3cdd   Palak Handa   add new module
413
414
  	            $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
415
  	            $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
416
417
418
419
420
421
422
423
  	        }
  	    }
  
  	    $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
424
  	            $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
425
426
  	        }
  	    }
7e3bb1018   Palak Handa   field added
427
  	    $scope.startupNamekeyPress = function(q) {
6ae8d3cdd   Palak Handa   add new module
428
429
430
  	        if (q == undefined) {
  	            $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
431
  	            $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
432
433
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
434
  	    $scope.linkedInkeyPress = function(technology) {
204302c02   Palak Handa   minor changes
435
  	        if (technology == undefined || technology == '') {
6ae8d3cdd   Palak Handa   add new module
436
437
  	            $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
438
  	            $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
439
440
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
441
  	    $scope.companykeyPress = function(problem) {
6ae8d3cdd   Palak Handa   add new module
442
443
444
  	        if (problem == undefined) {
  	            $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
445
  	            $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
446
447
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
448
  	    $scope.productNamekeyPress = function(solution) {
6ae8d3cdd   Palak Handa   add new module
449
450
451
  	        if (solution == undefined) {
  	            $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
452
  	            $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
453
454
455
  	        }
  	    }
  	    $scope.businesskeyPress = function(business) {
58efec61e   Palak Handa   color change
456
457
458
459
460
  	    	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
461
  	    }
dcb703070   Palak Handa   updated new form ...
462
  	    $scope.websitekeyPress = function(prototype) {
204302c02   Palak Handa   minor changes
463
  	        if (prototype == undefined  || prototype == '') {
6ae8d3cdd   Palak Handa   add new module
464
465
  	            $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
466
  	            $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
467
468
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
469
  	    $scope.employeekeyPress = function(market) {
204302c02   Palak Handa   minor changes
470
  	        if (market == undefined || market == '') {
6ae8d3cdd   Palak Handa   add new module
471
472
  	            $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
473
  	            $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
474
475
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
476
  	    $scope.annualkeyPress = function(risk) {
204302c02   Palak Handa   minor changes
477
  	        if (risk == undefined || risk == '') {
6ae8d3cdd   Palak Handa   add new module
478
479
  	            $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
480
  	            $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
481
482
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
483
  	    $scope.revenuekeyPress = function(team) {
81526b56d   Palak Handa   minor change
484
  	        if (team == undefined) {
6ae8d3cdd   Palak Handa   add new module
485
486
  	            $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
487
  	            $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
488
489
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
490
  	    $scope.descriptionkeyPress = function(pitch) {
6ae8d3cdd   Palak Handa   add new module
491
492
493
  	        if (pitch == undefined) {
  	            $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
494
  	            $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
495
496
  	        }
  	    }
e284785e4   Palak Handa   update new field
497
  	    $scope.discountkeyPress = function(discount) {
e284785e4   Palak Handa   update new field
498
499
500
  	        if (discount == undefined) {
  	            $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
501
  	            $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
e284785e4   Palak Handa   update new field
502
503
  	        }
  	    }
91eeb4455   Palak Handa   modify
504
505
506
507
  	    $scope.removeNooError = function() {
  	    	$('#invalidIdea').css('display', 'block');
  	        $('#noExist').css('display', 'none');
  	    };
c62079487   Palak Handa   updated design
508
  	    $scope.ideakeyPress = function(financial) {
6ae8d3cdd   Palak Handa   add new module
509
510
511
512
  	        console.log("financial", financial);
  	        if (financial == undefined) {
  	            $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
513
  	            $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
514
515
  	        }
  	    }
c62079487   Palak Handa   updated design
516
517
518
519
520
521
  
  	    $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
522
  	            $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
523
524
  	        }
  	    }
2d6a9fbea   Palak Handa   complete bugs
525
526
527
528
  	    $scope.changeReferalIconColor = function(referalToken){
  	    	if (referalToken == undefined || referalToken == '') {
  	    		$('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
  	    	}else {
f8b43c6f8   Palak Handa   design changes
529
  	            $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
2d6a9fbea   Palak Handa   complete bugs
530
531
  	        }
  	    }
6ae8d3cdd   Palak Handa   add new module
532

53b83aa9e   Palak Handa   first commit
533
  	});
b96c88383   Palak Handa   amount change
534
  	scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) {
6ae8d3cdd   Palak Handa   add new module
535
  		$scope.data = {};
8e25d825b   Palak Handa   changes the rajor...
536
537
  		$scope.check = false;
  	    $scope.numberCheck = false;
e856f2161   Palak Handa   new page design
538
539
  	    $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
540
541
542
543
  	    $scope.max = 100;
  	    $scope.formPage = false;
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
e856f2161   Palak Handa   new page design
544
545
546
547
548
549
550
551
552
553
  	    $scope.discountAmount = 0;
  	    // $scope.data.quantity = "1";
  	    $scope.check = false;
  	    $scope.numberCheck = false;
  	    $scope.paymentResult = {};
  	    var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  	        "status": "pending"
  	    }
8e25d825b   Palak Handa   changes the rajor...
554

5348de778   Palak Handa   design updated
555
556
557
558
  	    $scope.removeError = function() {
  	        $('#invalidEmail').css('display', 'none');
  	        $('#alreadyExist').css('display', 'none');
  	    };
248bd9b7c   Palak Handa   link validation
559
560
561
562
563
  		$scope.emailcheck = function(val) {
  	        if (val == undefined) {
  	            $('#invalidEmail').css('display', 'block');
  	        } else {
  	        	$('#alreadyExist').css('display', 'block');
248bd9b7c   Palak Handa   link validation
564
565
  	        }
  	    };
b678502c9   Palak Handa   update
566

dee1f7479   Palak Handa   validation use
567
568
569
570
571
572
573
574
575
576
577
578
  	    $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
579
  	 	// $scope.$on('city', function (event, value) {
9d4fa776e   Palak Handa   minor change space
580
581
  			$scope.data.city = localStorage.getItem("city");
  			console.log("HERE===",$scope.data.city );
317a80571   Palak Handa   city selected
582
  		// });
b96c88383   Palak Handa   amount change
583
584
585
586
587
588
589
  
  		$rootScope.tokenCall = function(val) {
  	        console.log('val-------->', val);
  	        if (val == undefined) {
  	            $('#invalidToken').css('display', 'block');
  	        } else {
  	        	val = val.toUpperCase();
a65d2455e   Palak Handa   minor change
590
591
592
593
  	        	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;
  	        	}
eb567dbaa   Palak Handa   minr change
594
  	        	$http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
b96c88383   Palak Handa   amount change
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
  				    .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)
  				});
  	           
  	        }
  	    };
6ae8d3cdd   Palak Handa   add new module
612
  		$scope.submit = function() {
b96c88383   Palak Handa   amount change
613
614
615
616
617
  		$scope.ticketAmnt = 500;
  		if($scope.tokencheck == false){
      		$scope.data.referalToken = null;
      	}
  		if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
e856f2161   Palak Handa   new page design
618
  			var x = document.getElementById("snackbar")
e856f2161   Palak Handa   new page design
619
  		    setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
317a80571   Palak Handa   city selected
620
  		}else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {	
e856f2161   Palak Handa   new page design
621
  			$scope.infoForm = true;
e856f2161   Palak Handa   new page design
622
623
  			$scope.detail = {};
  			$scope.data.phone = "+91"+$scope.data.number;
7cdbd289e   Palak Handa   content change
624
625
626
  			if($scope.data.referalToken == null){
              	$scope.data.referalToken = "N.A."
              }
e856f2161   Palak Handa   new page design
627
628
629
630
631
632
633
  			$http({
  	           method: 'POST',
  	           url: BASE_URL+'/applicants',
  	           data: $scope.data,
  	           headers: {}
  	           }).then(function mySuccess(result) {
  	           		console.log("=====result=====",result)
e856f2161   Palak Handa   new page design
634
635
636
  	           		$scope.detail = result;
  	               data.applicantId = result.data.id;
  	               $scope.userId = result.data.id;
b96c88383   Palak Handa   amount change
637
638
639
640
641
  	                console.log("=====data=====",data)
  	                var amount = $scope.ticketAmnt * 100
  			        if($scope.tokencheck == true){
  				        var amount = $scope.ticketAmnt
  				        console.log("====$scope.discountpercentage====",$scope.discountpercentage);
a65d2455e   Palak Handa   minor change
642
643
  			        	console.log("resultcity===",$scope.data.city)
  						if($scope.discountpercentage == "100") {
8e38c5b71   Palak Handa   integrate timer
644
645
  			        		$scope.discountpercentage = "99.8";
  			        		console.log("$scope.discountpercentage====",$scope.discountpercentage)
b96c88383   Palak Handa   amount change
646
647
648
649
650
651
652
653
654
655
656
  				        }
  				        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;
e8488da07   Palak Handa   amount regarding ...
657
  		        	console.log("====$scope.payingAmnt====",$scope.payingAmnt)
b96c88383   Palak Handa   amount change
658
  		        	$scope.payingAmnt = $scope.payingAmnt.toFixed()	                
e8488da07   Palak Handa   amount regarding ...
659
660
  	                data.amount = $scope.payingAmnt;
  	                console.log("data.amount==",data.amount)
e856f2161   Palak Handa   new page design
661
662
663
664
665
666
667
668
669
670
671
672
  	               if($scope.detail != null){
  					$http({
  					   method: 'POST',
  					   url: BASE_URL+'/payments',
  					   data: data,
  					   headers: {}
  					   }).then(function mySuccess(paymentResult) {
  					       $scope.paymentResult = paymentResult;
  					   }, function myError(error) {
  					});
  				}
  				var i = 0;
b96c88383   Palak Handa   amount change
673
  				$scope.payingAmnt =  $scope.payingAmnt * 100;
e856f2161   Palak Handa   new page design
674
  				var options = {
50e8f0737   Palak Handa   minor change
675
676
  					//"key": "rzp_test_YwHsVFiDIQ2WUQ",
  					"key": "rzp_live_mkmCb4FkstuWaS",
e856f2161   Palak Handa   new page design
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
  					"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;
e8488da07   Palak Handa   amount regarding ...
711
  					console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
e856f2161   Palak Handa   new page design
712
713
714
715
716
717
718
  					$http({
  					   method: 'PUT',
  					   url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
  					   data: $scope.paymentResponse,
  					   headers: {}
  					   }).then(function mySuccess(searchResult) {
  					   	console.log("searchResult",searchResult)
5e3b90de3   Palak Handa   add new field
719
  					   	$location.path("/confirmation")
e856f2161   Palak Handa   new page design
720
721
722
  					   }, function myError(error) {
  					});
  				}
a65d2455e   Palak Handa   minor change
723
  				//}
e856f2161   Palak Handa   new page design
724
725
  
  	           }, function myError(error) {
317a80571   Palak Handa   city selected
726

e856f2161   Palak Handa   new page design
727
  	        });
317a80571   Palak Handa   city selected
728

e856f2161   Palak Handa   new page design
729
  		}
e856f2161   Palak Handa   new page design
730

317a80571   Palak Handa   city selected
731
732
733
  	}
  	
  });
53b83aa9e   Palak Handa   first commit
734

b96c88383   Palak Handa   amount change
735
736
737
738
739
740
741
  scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) {
  		$scope.data = {};
  		$scope.check = false;
  	    $scope.numberCheck = false;
  
  		$scope.submit = function() {
  			console.log($scope.data.name)
04ffff01c   Palak Handa   minor change
742
743
744
  			var randomNumber = ""+Math.random();
  			var nameSpliced = $scope.data.name.slice(0,5);
  			var numberSpliced = randomNumber.slice(2,4);;
b96c88383   Palak Handa   amount change
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
  			$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
766
767
  	        }
  	});
96991e0c1   Palak Handa   update
768