Blame view

script.js 27.2 KB
53b83aa9e   Palak Handa   first commit
1
  	// create the module and name it scotchApp
f263889f0   Palak Handa   analytics work
2
  	var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']);
53b83aa9e   Palak Handa   first commit
3
4
5
  
  	// configure our routes
  	scotchApp.config(function($routeProvider) {
6ae8d3cdd   Palak Handa   add new module
6
  	    $routeProvider
dcb703070   Palak Handa   updated new form ...
7
  	    	// route for the Home page
6ae8d3cdd   Palak Handa   add new module
8
  	        .when('/', {
dcb703070   Palak Handa   updated new form ...
9
10
11
  	            templateUrl: 'pages/Home.html',
  	            controller: 'mainController'
  	        })
b96c88383   Palak Handa   amount change
12
  	        // route for the caricatures page
e856f2161   Palak Handa   new page design
13
  	        .when('/caricatures', {
b96c88383   Palak Handa   amount change
14
  	            templateUrl: 'pages/caricatures.html',
6ae8d3cdd   Palak Handa   add new module
15
16
  	            controller: 'mainController'
  	        })
317a80571   Palak Handa   city selected
17
18
19
20
21
  	        // // route for the paymentVerify page
  	        // .when('/pendingPayment/:id', {
  	        //     templateUrl: 'pages/verify.html',
  	        //     controller: 'verifyController'
  	        // })
6ae8d3cdd   Palak Handa   add new module
22

b96c88383   Palak Handa   amount change
23
  	        // route for the registration page
bab049fb9   Palak Handa   city issue solve
24
  	        .when('/registration/:city', {
b96c88383   Palak Handa   amount change
25
26
27
28
29
30
  	            templateUrl: 'pages/registration.html',
  	            controller: 'registrationController'
  	        })
  
  	        // route for the ambassador page
  	        .when('/startupJalsaPromocode', {
6ae8d3cdd   Palak Handa   add new module
31
32
33
  	            templateUrl: 'pages/ambassador.html',
  	            controller: 'ambassadorController'
  	        })
5348de778   Palak Handa   design updated
34
35
36
37
  
  	        // route for the confirmation page
  	        .when('/confirmation', {
  	            templateUrl: 'pages/confirmation.html',
b96c88383   Palak Handa   amount change
38
  	            controller: 'registrationController'
5348de778   Palak Handa   design updated
39
  	        })
6ae8d3cdd   Palak Handa   add new module
40
  	});
53b83aa9e   Palak Handa   first commit
41

f263889f0   Palak Handa   analytics work
42
43
  	scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
  	   	// Add configuration code as desired
61b69ada0   Palak Handa   design updated
44
  	   	 AnalyticsProvider.setAccount('UA-106416759-1');  //UU-XXXXXXX-X should be your tracking code
f263889f0   Palak Handa   analytics work
45
46
47
48
49
50
51
52
  
  	   	// 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
53
54
  	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
55

2d6a9fbea   Palak Handa   complete bugs
56
  	// create the controller and inject Angular's $scope
f263889f0   Palak Handa   analytics work
57
  	scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) {
6ae8d3cdd   Palak Handa   add new module
58
59
60
61
  	    $scope.data = {
  	        show: true,
  	        hide: false
  	    };
50e8f0737   Palak Handa   minor change
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
  		// var pune = new Date("Nov 11, 2017 12:00:00").getTime();
  		// // Update the count down every 1 second
  		// var x = setInterval(function() {
  		//     // Get todays date and time
  		//     var now = new Date().getTime();
  		//     // Find the distance between now an the count down date
  		//     var distance = pune - 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("pune").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("pune").innerHTML = "EXPIRED";
  		//     }
  		// }, 1000);
  
  		// var mumbai = new Date("Nov 13, 2017 16:00:00").getTime();
  		// // Update the count down every 1 second
  		// var x = setInterval(function() {
  		//     // Get todays date and time
  		//     var now = new Date().getTime();
  		//     // Find the distance between now an the count down date
  		//     var distance = 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);
  
  		// var ahmedabad = new Date("Nov 15, 2017 16:00:00").getTime();
  		// // Update the count down every 1 second
  		// var x = setInterval(function() {
  		//     // Get todays date and time
  		//     var now = new Date().getTime();
  		//     // Find the distance between now an the count down date
  		//     var distance = 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);
  
  		// var jaipur = new Date("Nov 17, 2017 16:00:00").getTime();
  		// // Update the count down every 1 second
  		// var x = setInterval(function() {
  		//     // Get todays date and time
  		//     var now = new Date().getTime();
  		//     // Find the distance between now an the count down date
  		//     var distance = 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);
  
  		// var bangalore = new Date("Nov 22, 2017 16:00:00").getTime();
  		// // Update the count down every 1 second
  		// var x = setInterval(function() {
  		//     // Get todays date and time
  		//     var now = new Date().getTime();
  		//     // Find the distance between now an the count down date
  		//     var distance = bangalore - 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("bangalore").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("bangalore").innerHTML = "EXPIRED";
  		//     }
  		// }, 1000);
  
  		// var hyderabad = new Date("Nov 21, 2017 16:00:00").getTime();
  		// // Update the count down every 1 second
  		// var x = setInterval(function() {
  		//     // Get todays date and time
  		//     var now = new Date().getTime();
  		//     // Find the distance between now an the count down date
  		//     var distance = 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);
  
  		// var delhi = new Date("Nov 27, 2017 12:00:00").getTime();
  		// // Update the count down every 1 second
  		// var x = setInterval(function() {
  		//     // Get todays date and time
  		//     var now = new Date().getTime();
  		//     // Find the distance between now an the count down date
  		//     var distance = 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);
  
  		// var chandigarh = new Date("Nov 30, 2017 12:00:00").getTime();
  		// // Update the count down every 1 second
  		// var x = setInterval(function() {
  		//     // Get todays date and time
  		//     var now = new Date().getTime();
  		//     // Find the distance between now an the count down date
  		//     var distance = chandigarh - 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("chandigarh").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("chandigarh").innerHTML = "EXPIRED";
  		//     }
  		// }, 1000);
6ae8d3cdd   Palak Handa   add new module
253
  	    $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
e847b36f8   Palak Handa   minor changes
254
  	    $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
c62079487   Palak Handa   updated design
255
  	    // $scope.Textshow = "yes"
6ae8d3cdd   Palak Handa   add new module
256
  	    $scope.max = 100;
88dd26b3d   Palak Handa   update
257
  	    $scope.formPage = false;
6ae8d3cdd   Palak Handa   add new module
258
259
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
6ae8d3cdd   Palak Handa   add new module
260
  	    $scope.data = {};
ea3c31126   Palak Handa   complete
261
  	    $scope.discountAmount = 0;
7b2bef227   Palak Handa   background image ...
262
  	    // $scope.data.quantity = "1";
6ae8d3cdd   Palak Handa   add new module
263
264
  	    $scope.check = false;
  	    $scope.numberCheck = false;
6ae8d3cdd   Palak Handa   add new module
265
  	    $scope.paymentResult = {};
6ae8d3cdd   Palak Handa   add new module
266
267
268
269
270
  	    var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  	        "status": "pending"
  	    }
53b83aa9e   Palak Handa   first commit
271

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

317a80571   Palak Handa   city selected
277
278
279
280
281
282
  	    $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
283
  	    	$location.path('/registration/'+value+'');
317a80571   Palak Handa   city selected
284
  	    	//$state.go('registration', { 'city': value})
163c5adae   Palak Handa   minor changes
285
  	    }
e847b36f8   Palak Handa   minor changes
286

6a9f1f41e   Palak Handa   add left side but...
287
288
289
290
  	    $scope.select =  function(url){
  	    	console.log("cllll")
  	    	window.open(url)
  	    }
6ae8d3cdd   Palak Handa   add new module
291
  	    $scope.stagekeyPress = function() {
f8b43c6f8   Palak Handa   design changes
292
  	        $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
293
294
  	    }
  	    $scope.sectorkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
295
  	        $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
296
  	    }
163c5adae   Palak Handa   minor changes
297
  	    $scope.productLaunchkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
298
  	        $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
299
  	    }
163c5adae   Palak Handa   minor changes
300
  	    $scope.launchPeriodkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
301
  	        $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
302
  	    }
7b2bef227   Palak Handa   background image ...
303
304
  	    $scope.industrykeyPress = function(quantity) {
  	    	console.log("fghj",quantity)
f8b43c6f8   Palak Handa   design changes
305
  	    	$('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
306
  	    }
204302c02   Palak Handa   minor changes
307
308
309
310
311
  	    $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
312
  	            $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
204302c02   Palak Handa   minor changes
313
314
  	        }
  	    }
c62079487   Palak Handa   updated design
315
  	    $scope.amountkeyPress = function() {
f8b43c6f8   Palak Handa   design changes
316
  	        $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
317
  	    }
2321f803a   Palak Handa   updated changes
318
319
320
  	    $scope.firstNamekeyPress = function(name) {
  	        console.log("lastName==", name);
  	        if (name == undefined) {
6ae8d3cdd   Palak Handa   add new module
321
322
  	            $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
323
  	            $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
324
325
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
326

6ae8d3cdd   Palak Handa   add new module
327
328
329
330
331
  	    $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
332
  	            $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
8ddc94e00   Palak Handa   update
333
  	        }	                
6ae8d3cdd   Palak Handa   add new module
334
  	    }
6ae8d3cdd   Palak Handa   add new module
335
336
  	    $scope.phonekeyPress = function(number) {
  	        console.log("number", number);
204302c02   Palak Handa   minor changes
337
  	        if (number == undefined || number == '') {
6ae8d3cdd   Palak Handa   add new module
338
339
  	            $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
340
  	            $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
341
342
343
344
345
346
347
348
  	        }
  	    }
  
  	    $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
349
  	            $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
350
351
  	        }
  	    }
7e3bb1018   Palak Handa   field added
352
  	    $scope.startupNamekeyPress = function(q) {
6ae8d3cdd   Palak Handa   add new module
353
354
355
  	        if (q == undefined) {
  	            $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
356
  	            $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
357
358
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
359
  	    $scope.linkedInkeyPress = function(technology) {
204302c02   Palak Handa   minor changes
360
  	        if (technology == undefined || technology == '') {
6ae8d3cdd   Palak Handa   add new module
361
362
  	            $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
363
  	            $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
364
365
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
366
  	    $scope.companykeyPress = function(problem) {
6ae8d3cdd   Palak Handa   add new module
367
368
369
  	        if (problem == undefined) {
  	            $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
370
  	            $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
371
372
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
373
  	    $scope.productNamekeyPress = function(solution) {
6ae8d3cdd   Palak Handa   add new module
374
375
376
  	        if (solution == undefined) {
  	            $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
377
  	            $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
378
379
380
  	        }
  	    }
  	    $scope.businesskeyPress = function(business) {
58efec61e   Palak Handa   color change
381
382
383
384
385
  	    	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
386
  	    }
dcb703070   Palak Handa   updated new form ...
387
  	    $scope.websitekeyPress = function(prototype) {
204302c02   Palak Handa   minor changes
388
  	        if (prototype == undefined  || prototype == '') {
6ae8d3cdd   Palak Handa   add new module
389
390
  	            $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
391
  	            $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
392
393
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
394
  	    $scope.employeekeyPress = function(market) {
204302c02   Palak Handa   minor changes
395
  	        if (market == undefined || market == '') {
6ae8d3cdd   Palak Handa   add new module
396
397
  	            $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
398
  	            $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
399
400
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
401
  	    $scope.annualkeyPress = function(risk) {
204302c02   Palak Handa   minor changes
402
  	        if (risk == undefined || risk == '') {
6ae8d3cdd   Palak Handa   add new module
403
404
  	            $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
405
  	            $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
406
407
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
408
  	    $scope.revenuekeyPress = function(team) {
81526b56d   Palak Handa   minor change
409
  	        if (team == undefined) {
6ae8d3cdd   Palak Handa   add new module
410
411
  	            $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
412
  	            $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
413
414
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
415
  	    $scope.descriptionkeyPress = function(pitch) {
6ae8d3cdd   Palak Handa   add new module
416
417
418
  	        if (pitch == undefined) {
  	            $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
419
  	            $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
420
421
  	        }
  	    }
e284785e4   Palak Handa   update new field
422
  	    $scope.discountkeyPress = function(discount) {
e284785e4   Palak Handa   update new field
423
424
425
  	        if (discount == undefined) {
  	            $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
426
  	            $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
e284785e4   Palak Handa   update new field
427
428
  	        }
  	    }
91eeb4455   Palak Handa   modify
429
430
431
432
  	    $scope.removeNooError = function() {
  	    	$('#invalidIdea').css('display', 'block');
  	        $('#noExist').css('display', 'none');
  	    };
c62079487   Palak Handa   updated design
433
  	    $scope.ideakeyPress = function(financial) {
6ae8d3cdd   Palak Handa   add new module
434
435
436
437
  	        console.log("financial", financial);
  	        if (financial == undefined) {
  	            $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
f8b43c6f8   Palak Handa   design changes
438
  	            $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
6ae8d3cdd   Palak Handa   add new module
439
440
  	        }
  	    }
c62079487   Palak Handa   updated design
441
442
443
444
445
446
  
  	    $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
447
  	            $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
c62079487   Palak Handa   updated design
448
449
  	        }
  	    }
2d6a9fbea   Palak Handa   complete bugs
450
451
452
453
  	    $scope.changeReferalIconColor = function(referalToken){
  	    	if (referalToken == undefined || referalToken == '') {
  	    		$('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
  	    	}else {
f8b43c6f8   Palak Handa   design changes
454
  	            $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
2d6a9fbea   Palak Handa   complete bugs
455
456
  	        }
  	    }
6ae8d3cdd   Palak Handa   add new module
457

53b83aa9e   Palak Handa   first commit
458
  	});
b96c88383   Palak Handa   amount change
459
  	scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) {
6ae8d3cdd   Palak Handa   add new module
460
  		$scope.data = {};
8e25d825b   Palak Handa   changes the rajor...
461
462
  		$scope.check = false;
  	    $scope.numberCheck = false;
e856f2161   Palak Handa   new page design
463
464
  	    $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
465
466
467
468
  	    $scope.max = 100;
  	    $scope.formPage = false;
  	    $scope.current = 0;
  	    $scope.payingAmnt = 0;
e856f2161   Palak Handa   new page design
469
470
471
472
473
474
475
476
477
478
  	    $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...
479

5348de778   Palak Handa   design updated
480
481
482
483
  	    $scope.removeError = function() {
  	        $('#invalidEmail').css('display', 'none');
  	        $('#alreadyExist').css('display', 'none');
  	    };
248bd9b7c   Palak Handa   link validation
484
485
486
487
488
  		$scope.emailcheck = function(val) {
  	        if (val == undefined) {
  	            $('#invalidEmail').css('display', 'block');
  	        } else {
  	        	$('#alreadyExist').css('display', 'block');
248bd9b7c   Palak Handa   link validation
489
490
  	        }
  	    };
b678502c9   Palak Handa   update
491

dee1f7479   Palak Handa   validation use
492
493
494
495
496
497
498
499
500
501
502
503
  	    $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
504
  	 	// $scope.$on('city', function (event, value) {
9d4fa776e   Palak Handa   minor change space
505
506
  			$scope.data.city = localStorage.getItem("city");
  			console.log("HERE===",$scope.data.city );
317a80571   Palak Handa   city selected
507
  		// });
b96c88383   Palak Handa   amount change
508
509
510
511
512
513
514
  
  		$rootScope.tokenCall = function(val) {
  	        console.log('val-------->', val);
  	        if (val == undefined) {
  	            $('#invalidToken').css('display', 'block');
  	        } else {
  	        	val = val.toUpperCase();
eb567dbaa   Palak Handa   minr change
515
  	        	$http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
b96c88383   Palak Handa   amount change
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
  				    .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
533
  		$scope.submit = function() {
b96c88383   Palak Handa   amount change
534
535
536
537
538
  		$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
539
  			var x = document.getElementById("snackbar")
e856f2161   Palak Handa   new page design
540
  		    setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
317a80571   Palak Handa   city selected
541
  		}else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {	
e856f2161   Palak Handa   new page design
542
  			$scope.infoForm = true;
e856f2161   Palak Handa   new page design
543
544
  			$scope.detail = {};
  			$scope.data.phone = "+91"+$scope.data.number;
7cdbd289e   Palak Handa   content change
545
546
547
  			if($scope.data.referalToken == null){
              	$scope.data.referalToken = "N.A."
              }
e856f2161   Palak Handa   new page design
548
549
550
551
552
553
554
  			$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
555
556
557
  	           		$scope.detail = result;
  	               data.applicantId = result.data.id;
  	               $scope.userId = result.data.id;
b96c88383   Palak Handa   amount change
558
559
560
561
562
563
564
  	                console.log("=====data=====",data)
  	                var amount = $scope.ticketAmnt * 100
  			        if($scope.tokencheck == true){
  				        var amount = $scope.ticketAmnt
  				        console.log("====$scope.discountpercentage====",$scope.discountpercentage);
  				        if($scope.discountpercentage == "100") {
  				        	$scope.discountpercentage = "99.8";
eb567dbaa   Palak Handa   minr change
565
  				        	console.log("$scope.discountpercentage====",$scope.discountpercentage)
b96c88383   Palak Handa   amount change
566
567
568
569
570
571
572
573
574
575
576
  				        }
  				        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 ...
577
  		        	console.log("====$scope.payingAmnt====",$scope.payingAmnt)
b96c88383   Palak Handa   amount change
578
  		        	$scope.payingAmnt = $scope.payingAmnt.toFixed()	                
e8488da07   Palak Handa   amount regarding ...
579
580
  	                data.amount = $scope.payingAmnt;
  	                console.log("data.amount==",data.amount)
e856f2161   Palak Handa   new page design
581
582
583
584
585
586
587
588
589
590
591
592
  	               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
593
  				$scope.payingAmnt =  $scope.payingAmnt * 100;
e856f2161   Palak Handa   new page design
594
  				var options = {
50e8f0737   Palak Handa   minor change
595
596
  					//"key": "rzp_test_YwHsVFiDIQ2WUQ",
  					"key": "rzp_live_mkmCb4FkstuWaS",
e856f2161   Palak Handa   new page design
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
  					"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 ...
631
  					console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
e856f2161   Palak Handa   new page design
632
633
634
635
636
637
638
  					$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
639
  					   	$location.path("/confirmation")
e856f2161   Palak Handa   new page design
640
641
642
643
644
  					   }, function myError(error) {
  					});
  				}
  
  	           }, function myError(error) {
317a80571   Palak Handa   city selected
645

e856f2161   Palak Handa   new page design
646
  	        });
317a80571   Palak Handa   city selected
647

e856f2161   Palak Handa   new page design
648
  		}
e856f2161   Palak Handa   new page design
649

317a80571   Palak Handa   city selected
650
651
652
  	}
  	
  });
53b83aa9e   Palak Handa   first commit
653

b96c88383   Palak Handa   amount change
654
655
656
657
658
659
660
  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
661
662
663
  			var randomNumber = ""+Math.random();
  			var nameSpliced = $scope.data.name.slice(0,5);
  			var numberSpliced = randomNumber.slice(2,4);;
b96c88383   Palak Handa   amount change
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
  			$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
685
686
  	        }
  	});
96991e0c1   Palak Handa   update
687