Blame view

script.js 47.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
5
  
  	// configure our routes
  	scotchApp.config(function($routeProvider) {
6ae8d3cdd   Palak Handa   add new module
6
  	    $routeProvider
dcb703070   Palak Handa   updated new form ...
7
  	    	// route for the Home page
6ae8d3cdd   Palak Handa   add new module
8
  	        .when('/', {
dcb703070   Palak Handa   updated new form ...
9
10
11
12
13
14
15
  	            templateUrl: 'pages/Home.html',
  	            controller: 'mainController'
  	        })
  
  	        // route for the registration page
  	        .when('/registration', {
  	            templateUrl: 'pages/registration.html',
6ae8d3cdd   Palak Handa   add new module
16
17
  	            controller: 'mainController'
  	        })
2d6a9fbea   Palak Handa   complete bugs
18
  	        // route for the paymentVerify page
4de569579   Palak Handa   design update
19
  	        .when('/pendingPayment/:id', {
6ae8d3cdd   Palak Handa   add new module
20
21
22
23
24
  	            templateUrl: 'pages/verify.html',
  	            controller: 'verifyController'
  	        })
  
  	        // route for the ambassador page
b678502c9   Palak Handa   update
25
  	        .when('/startupJalsaPromocode', {
6ae8d3cdd   Palak Handa   add new module
26
27
28
  	            templateUrl: 'pages/ambassador.html',
  	            controller: 'ambassadorController'
  	        })
5348de778   Palak Handa   design updated
29
30
31
32
33
34
  
  	        // route for the confirmation page
  	        .when('/confirmation', {
  	            templateUrl: 'pages/confirmation.html',
  	            controller: 'mainController'
  	        })
6ae8d3cdd   Palak Handa   add new module
35
  	});
53b83aa9e   Palak Handa   first commit
36

f263889f0   Palak Handa   analytics work
37
38
  	scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
  	   	// Add configuration code as desired
61b69ada0   Palak Handa   design updated
39
  	   	 AnalyticsProvider.setAccount('UA-106416759-1');  //UU-XXXXXXX-X should be your tracking code
f263889f0   Palak Handa   analytics work
40
41
42
43
44
45
46
47
  
  	   	// Track all routes (default is true).
  	  	AnalyticsProvider.trackPages(true);
  
  	  	// Track all URL query params (default is false).
  	  	AnalyticsProvider.trackUrlParams(true);
  
  	}]).run(['Analytics', function(Analytics) { }]);
19074e251   Palak Handa   dshf
48
  	scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/v1")
d3523e113   Palak Handa   update
49
  	//scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1")
6ae8d3cdd   Palak Handa   add new module
50

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

53b83aa9e   Palak Handa   first commit
274
  	    }
439352ca6   Palak Handa   base url changes
275
  	    //$scope.author = 'Swarn Singh';
6ae8d3cdd   Palak Handa   add new module
276
  	    $scope.data = {};
9cb631be0   Palak Handa   update minor changes
277
  	    $scope.data.stage = 'Pitch your Business plan';
326f3857f   Palak Handa   update radio buttons
278
  	    $scope.data.networkDinner = "true";
ea3c31126   Palak Handa   complete
279
  	    $scope.discountAmount = 0;
7b2bef227   Palak Handa   background image ...
280
  	    // $scope.data.quantity = "1";
6ae8d3cdd   Palak Handa   add new module
281
282
  	    $scope.check = false;
  	    $scope.numberCheck = false;
6ae8d3cdd   Palak Handa   add new module
283
  	    $scope.paymentResult = {};
6ae8d3cdd   Palak Handa   add new module
284
285
286
287
288
  	    var data = {
  	        "amount": $scope.payingAmnt,
  	        "currency": "INR",
  	        "status": "pending"
  	    }
53b83aa9e   Palak Handa   first commit
289

5259a7d0e   Digvijay Singh   video links added
290
  	    /*open videos in modal*/
b8938eb77   Palak Handa   add content
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
  	  //   $scope.openyoutube16 = function(){
  			// $('#videoModel').modal('show');
  	  //   }
  
  	  //    $scope.openyoutube17 = function(){
  			// $('#videoModels').modal('show');
  	  //   }
  
  	  //      $scope.closeModal = function(){
  	  //   	var url = $('#youtubePlayer').attr('src');
  			// $('#youtubePlayer').attr('src', '');
  			// $('#youtubePlayer').attr('src', url);
  	  //   }
  
  
  	  //   $scope.closed = function(){
  	  //   	var url = $('#youtubePlayersss').attr('src');
  			// $('#youtubePlayersss').attr('src', '');
  			// $('#youtubePlayersss').attr('src', url);
  	  //   }
5259a7d0e   Digvijay Singh   video links added
311
  	    /*open videos ends here*/
dcb703070   Palak Handa   updated new form ...
312
  	    $scope.apply = function() {
20db60d9c   Palak Handa   update analytics
313
  	    	Analytics.trackEvent('register', 'click', 'Registration');
dcb703070   Palak Handa   updated new form ...
314
315
  			$location.path("/registration")
  		}
88dd26b3d   Palak Handa   update
316
317
318
  		$scope.data.citymeetup = '';
  		$scope.register = function(value){
  			$scope.data.citymeetup = value;
2ddd928f5   Palak Handa   image change
319
320
321
322
323
324
325
326
327
  			// if (value == 'mainevent') {
  		 //    	$scope.eventType = true;
  		 //    	$scope.mainType = false;
  		 //    	$scope.data.stage = null;
  		 //    }
  		 //    else{
  		 //    	$scope.eventType = false;
  		 //    	$scope.mainType = true;
  		 //    }
88dd26b3d   Palak Handa   update
328
329
330
331
332
333
  			$('.hiddenForm').slideDown();
  			$('html, body').animate({
  		        scrollTop: $('.hiddenForm').offset().top
  		    }, 1000);
  			console.log('gdggsg', value);
  		}
5259a7d0e   Digvijay Singh   video links added
334

45141d246   Palak Handa   delete validation
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
  	  //   $scope.removeError = function() {
  	  //       $('#invalidEmail').css('display', 'none');
  	  //       $('#alreadyExist').css('display', 'none');
  	  //   };
  
  	  //   $scope.emailcheck = function(val) {
  	  //   	console.log(val)
  			// $scope.space = /\s/g.test(val);
     //  		console.log("space",$scope.space)
  	  //       if (val == undefined) {
  	  //           $('#invalidEmail').css('display', 'block');
  	  //       } else {
  	  //           $http({
  	  //               method: 'GET',
  	  //               url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}',
  	  //               headers: {}
  	  //           }).then(function mySuccess(searchResult) {
  	  //               console.log("searchResult1===>", searchResult)
  	  //               if (searchResult.data.length == 0) {
  	  //                   $scope.check = false;
  	  //               } else {
  	  //                   $scope.check = true;
  	  //                   $scope.emailId = searchResult.data[0].id
  	  //                   $('#alreadyExist').css('display', 'block');
  
  	  //               }
  	  //               console.log("$scope.data.id",searchResult.data)
  	  //           }, function myError(error) {});
  	  //       }
  	  //   };
6ae8d3cdd   Palak Handa   add new module
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
  
  	    $scope.removeNoError = function() {
  	        $('#noExist').css('display', 'none');
  	    };
  
  	    $scope.numbercheck = function(number) {
  	        $http({
  	            method: 'GET',
  	            url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}',
  	            data: $scope.data,
  	            headers: {}
  	        }).then(function mySuccess(searchResult) {
  	            console.log("searchResult===>", searchResult)
  	            if (searchResult.data.length == 0) {
  	                $scope.numberCheck = false;
ea3c31126   Palak Handa   complete
380

6ae8d3cdd   Palak Handa   add new module
381
382
383
384
385
386
387
388
389
390
  	            } else {
  	                $scope.numberCheck = true;
  	                $('#noExist').css('display', 'block');
  	            }
  	        }, function myError(error) {});
  	    };
  
  	    $rootScope.tokenCall = function(val) {
  	        console.log('val-------->', val);
  	        if (val == undefined) {
8257d964d   Palak Handa   update
391
  	            $('#invalidToken').css('display', 'block');
6ae8d3cdd   Palak Handa   add new module
392
393
394
395
  	        } else {
  	        	val = val.toUpperCase();
  	        	$http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}')
  				    .then(function(searchResult) {
e284785e4   Palak Handa   update new field
396
  				    	console.log("searchResult",searchResult)
6ae8d3cdd   Palak Handa   add new module
397
398
  				        if (searchResult.data.length == 0) {
  	                    	$scope.tokencheck = false;
ea3c31126   Palak Handa   complete
399
  	                    	 $scope.discountAmount = 0;
6ae8d3cdd   Palak Handa   add new module
400
  	                	} else {
e284785e4   Palak Handa   update new field
401
  	                    	 $scope.discountpercentage = searchResult.data[0].discount;
6ae8d3cdd   Palak Handa   add new module
402
  	                    	$scope.tokencheck = true;
6ae8d3cdd   Palak Handa   add new module
403
404
405
406
  	                	}
  				    },function(err){
  				    	console.log(err)
  				});
53b83aa9e   Palak Handa   first commit
407
  	           
6ae8d3cdd   Palak Handa   add new module
408
409
  	        }
  	    };
100de8860   Palak Handa   update
410
411
412
413
  	    $scope.IfDinnerCheck  = function(value){
  			$scope.data.networkDinner = value;
  			console.log("value",value)
  		}
3775d3cb9   Palak Handa   update location
414

6ae8d3cdd   Palak Handa   add new module
415
416
417
418
419
420
421
422
423
424
425
426
  	    /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/
  	    $(document).ready(
  	        function() {
  	            $('input:submit').attr('disabled', true);
  	            $('input:file').change(
  	                function() {
  	                    if ($("#picture").val()) {
  	                        $('input:submit').removeAttr('disabled');
  	                    } else {
  	                        $('input:submit').attr('disabled', true);
  	                    }
  	                });
53b83aa9e   Palak Handa   first commit
427
  	        });
6ae8d3cdd   Palak Handa   add new module
428
429
  
  	    /*****THIS IS FOR STEP ONE FORM ******/
dcb703070   Palak Handa   updated new form ...
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
  	    // $scope.next = function() {	  
  	    //     $scope.data.status = null
  	    //     if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) {
  	    //         var x = document.getElementById("snackbar")
  	    //         x.className = "show";
  	    //         setTimeout(function() {
  	    //             x.className = x.className.replace("show", "");
  	    //         }, 3000);
  	    //     } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) {
  	    //         $scope.infoForm = true;
  	    //         console.log("sdasdasdsa");
  	    //         $scope.data.stage = $scope.data.stage;
  	    //         $scope.detail = {};
  	    //         $scope.data.phone = "+91" + $scope.data.number;
  	    //         $http({
  	    //             method: 'POST',
  	    //             url: BASE_URL + '/information',
  	    //             data: $scope.data,
  	    //             headers: {}
  	    //         }).then(function mySuccess(result) {
  					// Analytics.trackEvent('information', 'click', 'django.mp4');
  	    //             console.log("result", result)
  	    //             $scope.detail = result;
  	    //             data.applicantId = result.data.id;
  	    //             $scope.userId = result.data.id;
  
  	    //         }, function myError(error) {});
  
  	    //     }
f263889f0   Palak Handa   analytics work
459

dcb703070   Palak Handa   updated new form ...
460
  	    // }
a5b95be91   Palak Handa   update
461
462
463
464
  	    $scope.watch =  function(url){
  	    	console.log("cllll")
  	    	window.open(url)
  	    }
6ae8d3cdd   Palak Handa   add new module
465

ea3c31126   Palak Handa   complete
466
  	    $scope.calculateAmount =  function(){
e9d943391   Palak Handa   update
467
468
469
  	    	if($scope.tokencheck == false){
  	    		$scope.data.referalToken = null;
  	    	}
d0714b854   Palak Handa   update
470
  	        if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
9842ccd27   Palak Handa   changes api call
471
472
473
474
475
  	            var x = document.getElementById("snackbar")
  	            x.className = "show";
  	            setTimeout(function() {
  	                x.className = x.className.replace("show", "");
  	            }, 3000);
d0714b854   Palak Handa   update
476
  	        } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
9842ccd27   Palak Handa   changes api call
477
478
479
480
481
482
483
484
485
486
487
  	            $scope.infoForm = true;
  	            console.log("sdasdasdsa");
  	            $scope.data.stage = $scope.data.stage;
  	            $scope.detail = {};
  	            $scope.data.phone = "+91" + $scope.data.number;
  	            $http({
  	                method: 'POST',
  	                url: BASE_URL + '/applicants',
  	                data: $scope.data,
  	                headers: {}
  	            }).then(function mySuccess(result) {
89fe83f92   Palak Handa   amount update
488
  	            	Analytics.trackEvent('applicants', 'click','Users');
9842ccd27   Palak Handa   changes api call
489
490
491
  	                console.log("result", result)
  	                $scope.detail = result;
  	                data.applicantId = result.data.id;
d122fec29   Palak Handa   modify
492
  	                //$scope.userId = result.data.id;
ef36be44d   Palak Handa   minor change
493

326f3857f   Palak Handa   update radio buttons
494
  	          	if($scope.data.networkDinner == "true"){
100de8860   Palak Handa   update
495
  			        if($scope.data.citymeetup == "chandigarh"){
9cb631be0   Palak Handa   update minor changes
496
  				    	if ($scope.data.stage == "Pitch your Business plan") {
100de8860   Palak Handa   update
497
  				            console.log("$scope.data", $scope.data)
9bbbd7ab2   Palak Handa   add 25percent amount
498
  				            $scope.ticketAmnt = 3250;
7b2bef227   Palak Handa   background image ...
499
  				            $scope.ticketAmnt = parseInt($scope.data.quantity)*$scope.ticketAmnt;			            
100de8860   Palak Handa   update
500
501
502
  				        }
  
  				        if ($scope.data.stage == "Pitch your Startup") {
9bbbd7ab2   Palak Handa   add 25percent amount
503
  				            $scope.ticketAmnt = 3875;
7b2bef227   Palak Handa   background image ...
504
  				            $scope.ticketAmnt = parseInt($scope.data.quantity)*$scope.ticketAmnt;			            
100de8860   Palak Handa   update
505
506
507
508
509
  				        }
  
  				        // if ($scope.data.stage == "Growth") {
  				        //     $scope.ticketAmnt = 1400;
  				        // }
d3523e113   Palak Handa   update
510
  			        }
100de8860   Palak Handa   update
511
512
513
514
  		    	}
  
  		 		else{
  		 			if($scope.data.citymeetup == "chandigarh"){
9cb631be0   Palak Handa   update minor changes
515
  				    	if ($scope.data.stage == "Pitch your Business plan") {
100de8860   Palak Handa   update
516
  				            console.log("$scope.data", $scope.data)
9bbbd7ab2   Palak Handa   add 25percent amount
517
518
  				            /*add 25%*/
  				            $scope.ticketAmnt = 1250 ;
7b2bef227   Palak Handa   background image ...
519
  				            $scope.ticketAmnt = parseInt($scope.data.quantity)*$scope.ticketAmnt;		            
100de8860   Palak Handa   update
520
521
522
  				        }
  
  				        if ($scope.data.stage == "Pitch your Startup") {
9bbbd7ab2   Palak Handa   add 25percent amount
523
  				            $scope.ticketAmnt = 1875;	
7b2bef227   Palak Handa   background image ...
524
  				            $scope.ticketAmnt = parseInt($scope.data.quantity)*$scope.ticketAmnt;		            
100de8860   Palak Handa   update
525
526
527
528
529
  				        }
  
  				        // if ($scope.data.stage == "Growth") {
  				        //     $scope.ticketAmnt = 1400;
  				        // }
d3523e113   Palak Handa   update
530
  			        }
100de8860   Palak Handa   update
531
  		 		}
2ddd928f5   Palak Handa   image change
532
  		       
100de8860   Palak Handa   update
533
534
535
536
537
538
539
540
541
542
543
544
545
546
  		        // else{
  		        // 	if ($scope.data.stage == "Pitch your Idea") {
  			       //      console.log("$scope.data", $scope.data)
  			       //      $scope.ticketAmnt = 500;			            
  			       //  }
  
  			       //  if ($scope.data.stage == "Pitch your Startup") {
  			       //      $scope.ticketAmnt = 1000;			            
  			       //  }
  
  			       //  // if ($scope.data.stage == "Growth") {
  			       //  //     $scope.ticketAmnt = 1000;
  			       //  // }
  		        // }
629cc1f8f   Palak Handa   minor changes
547
548
549
  		        // if ($scope.data.stage == "Visitor") {
  		        //     $scope.ticketAmnt = 500;
  		        // }
d122fec29   Palak Handa   modify
550
551
552
  		        var amount = $scope.ticketAmnt * 100
  		        if($scope.tokencheck == true){
  			        var amount = $scope.ticketAmnt
e284785e4   Palak Handa   update new field
553
554
  				    $scope.discountAmount = (amount * $scope.discountpercentage)/100
  				    console.log("finalAmount====>",$scope.discountAmount)
d122fec29   Palak Handa   modify
555
  		        }
e284785e4   Palak Handa   update new field
556
  		        var taxAmount = $scope.ticketAmnt - $scope.discountAmount
515649dae   Palak Handa   update changes
557
  		        console.log("$scope.taxTotal----",taxAmount)
bcefa53b8   Palak Handa   gst add
558
  	            $scope.taxTotal = (taxAmount * 18)/100
e284785e4   Palak Handa   update new field
559
  	            $scope.payingAmnt = taxAmount + $scope.taxTotal 
ef36be44d   Palak Handa   minor change
560
  	            $scope.payingAmnt = $scope.payingAmnt.toFixed()
d122fec29   Palak Handa   modify
561
  	            console.log("taxincludedamount----", $scope.payingAmnt)
bcefa53b8   Palak Handa   gst add
562
  	            console.log("$scope.taxTotal----", $scope.taxTotal)
d122fec29   Palak Handa   modify
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
  		    // }
  
  		    /*****THIS IS FOR STEP THREE FORM ******/
  		    // $scope.create = function() {
  		        // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
  		        //     var x = document.getElementById("snackbar")
  		        //     x.className = "show";
  		        //     setTimeout(function() {
  		        //         x.className = x.className.replace("show", "");
  		        //     }, 3000);
  		        // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
  		        //     $scope.infoForm = true;
  		        //     console.log("sdasdasdsa");
  		        //     $scope.data.stage = $scope.data.stage;
  		        //     $scope.detail = {};
  		        //     $scope.data.phone = "+91" + $scope.data.number;
  		        //     $http({
  		        //         method: 'POST',
  		        //         url: BASE_URL + '/applicants',
  		        //         data: $scope.data,
  		        //         headers: {}
  		        //     }).then(function mySuccess(result) {
  
  		        //         console.log("=====result=====", result)
  		        //         $scope.detail = result;
  		        //         data.applicantId = result.data.id;
  		        //         $scope.userId = result.data.id;
  		        //         console.log("=====data=====", data)
e284785e4   Palak Handa   update new field
591
592
  		                // data.amount = $scope.payingAmnt + $scope.taxTotal;
  		                data.amount = $scope.payingAmnt;
bcefa53b8   Palak Handa   gst add
593
  		                console.log("$scope.taxTotal",data.amount)
d122fec29   Palak Handa   modify
594
595
596
597
598
599
600
  		                if ($scope.detail != null) {
  		                    $http({
  		                        method: 'POST',
  		                        url: BASE_URL + '/payments',
  		                        data: data,
  		                        headers: {}
  		                    }).then(function mySuccess(paymentResult) {
d122fec29   Palak Handa   modify
601
602
603
604
605
  		                    	console.log("paymentResult",paymentResult)
  		                        $scope.paymentResult = paymentResult;
  		                    }, function myError(error) {});
  		                }
  		                var i = 0;
e284785e4   Palak Handa   update new field
606
607
608
  		                 //$scope.payingAmnt =  ($scope.payingAmnt + $scope.taxTotal) * 100;
  
   	                 $scope.payingAmnt =  $scope.payingAmnt * 100;
ef36be44d   Palak Handa   minor change
609

515649dae   Palak Handa   update changes
610
   	                 console.log("$scope.taxTotal----", $scope.payingAmnt)
d122fec29   Palak Handa   modify
611
  		                var options = {
07e435d22   Palak Handa   rajorkey
612
613
  		                   	"key": "rzp_live_mhSE1uOBlXvFyJ",
  		                    //"key": "rzp_test_YwHsVFiDIQ2WUQ",
bcefa53b8   Palak Handa   gst add
614
615
  		                    "amount": $scope.payingAmnt ,
   
d122fec29   Palak Handa   modify
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
  		                    "name": "Startup Jalsa",
  		                    "description": "amount",
  		                    "currency": "INR",
  		                    "status": "done",
  
  		                    "theme": {
  		                        "color": "#2196f3 ",
  		                        "image_padding": "NO"
  		                    },
  		                    "modal": {
  		                        "ondismiss": function() {}
  		                    },
  		                    "handler": function(response) {
  		                        createPayment(response);
  		                    }
  		                };
  		                var rzp1 = new Razorpay(options);
  		                rzp1.open();
  		                $scope.paymentResponse = {};
  
  		                function createPayment(response) {
d122fec29   Palak Handa   modify
637
638
639
640
641
642
643
  		                	console.log("response====from===razorpay",response)
  		                    $route.reload();
  		                    $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
  		                    $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
  		                    $scope.paymentResponse.amount = data.amount;
  		                    $scope.paymentResponse.currency = "INR";
  		                    $scope.paymentResponse.status = $scope.paymentResult.data.status;
89fe83f92   Palak Handa   amount update
644
  		                	Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount);
d122fec29   Palak Handa   modify
645
646
647
648
649
650
  		                    $http({
  		                        method: 'PUT',
  		                        url: BASE_URL + '/payments/' + $scope.paymentResult.data.id,
  		                        data: $scope.paymentResponse,
  		                        headers: {}
  		                    }).then(function mySuccess(searchResult) {
f6d172552   Palak Handa   analytics apply
651
  		                    	// if(paymentResult.data.status == "created"){
9babf5dba   Palak Handa   update
652
  		                    	
f6d172552   Palak Handa   analytics apply
653
  		                    	// }
d122fec29   Palak Handa   modify
654
655
656
657
658
659
660
  		                        console.log("searchResult", searchResult)
  		                        $location.path("/confirmation")
  		                        //$scope.showToastr()
  		                        //toaster.success("Registration done successfully");
  
  		                    }, function myError(error) {});
  		                }
0c83501f4   Palak Handa   show error message
661
662
  		            }, function myError(error) {
  		            	console.log("error",error)
45141d246   Palak Handa   delete validation
663
664
665
  		            	// $scope.emailId = error.data.error.message;
  		            	// $scope.id = error.data.error.id;
  		            	// $('#myModal').modal('show');
0c83501f4   Palak Handa   show error message
666
  		            });
d122fec29   Palak Handa   modify
667
668
669
  		        }
  
  	    	}
dcb703070   Palak Handa   updated new form ...
670

9842ccd27   Palak Handa   changes api call
671
672
  	            //}, function myError(error) {});
  	        //}
6ae8d3cdd   Palak Handa   add new module
673

dcb703070   Palak Handa   updated new form ...
674
  	    //}
6ae8d3cdd   Palak Handa   add new module
675

5348de778   Palak Handa   design updated
676
677
678
679
680
681
682
683
  	    // $scope.showToastr = function() {
  	    //     console.log("called toast")
  	    //     var x = document.getElementById("snacsskbar")
  	    //     x.className = "show";
  	    //     setTimeout(function() {
  	    //         x.className = x.className.replace("show", "");
  	    //     }, 3000);
  	    // }
6ae8d3cdd   Palak Handa   add new module
684

6ae8d3cdd   Palak Handa   add new module
685
  	    /*kk***This code for change data when click to chooses stages***/
163c5adae   Palak Handa   minor changes
686
687
688
689
690
691
692
693
  	    $scope.proto = true;
  	    $scope.businessmodel = true;
  	    $scope.Idea = true;
  	    $scope.current = true;
  
  	    $scope.stage = function(stage) {
  	    $scope.stagekeyPress();
  	    console.log("stage--2",stage)
e847b36f8   Palak Handa   minor changes
694

9cb631be0   Palak Handa   update minor changes
695
  	        if (stage == 'Pitch your Business plan') {
e847b36f8   Palak Handa   minor changes
696
  	        	$scope.Productshow = "no";
163c5adae   Palak Handa   minor changes
697
698
  	            $scope.current = 10;
  	            $scope.proto = true;
629cc1f8f   Palak Handa   minor changes
699
  	            // $scope.visitType = true;
163c5adae   Palak Handa   minor changes
700
  	            $scope.prototyp = false;
713fd1603   Palak Handa   minor changes
701
  	            $scope.protyp = false;
163c5adae   Palak Handa   minor changes
702
703
704
705
706
707
708
709
710
711
712
  	            $scope.market = false;
  	            $scope.risks = false;
  	            $scope.team = false;
  	            $scope.pitch = false;
  	            $scope.financials = false;
  	            $scope.businessmodel = true;
  	            $scope.data.stage = stage;
  	            // for right content
  	            $scope.Idea = true;
  	            $scope.Product = false;
  	            $scope.Growth = false;
629cc1f8f   Palak Handa   minor changes
713
  	            // $scope.Visitor = false;
5dc669c2c   Palak Handa   jaipur entries cl...
714
  	        } else if (stage == 'Pitch your Startup') {
e847b36f8   Palak Handa   minor changes
715
  	        	$scope.Productshow = "no";
163c5adae   Palak Handa   minor changes
716
717
  	            $scope.current = 10;
  	            $scope.proto = true;
629cc1f8f   Palak Handa   minor changes
718
  	            // $scope.visitType = true;
163c5adae   Palak Handa   minor changes
719
  	            $scope.prototyp = true;
713fd1603   Palak Handa   minor changes
720
  	            $scope.protyp = true;
163c5adae   Palak Handa   minor changes
721
722
723
724
725
726
727
728
729
730
731
  	            $scope.market = true;
  	            $scope.risks = true;
  	            $scope.team = true;
  	            $scope.pitch = true;
  	            $scope.financials = true;
  	            $scope.businessmodel = false;
  	            $scope.data.stage = stage;
  	            // for right content
  	            $scope.Idea = false;
  	            $scope.Product = true;
  	            $scope.Growth = false;
629cc1f8f   Palak Handa   minor changes
732
  	            // $scope.Visitor = false;
163c5adae   Palak Handa   minor changes
733
  	        } else if (stage == 'Growth') {
e847b36f8   Palak Handa   minor changes
734
  	        	$scope.Productshow = "yes";
163c5adae   Palak Handa   minor changes
735
736
  	            $scope.current = 10;
  	            $scope.proto = false;
629cc1f8f   Palak Handa   minor changes
737
  	            // $scope.visitType = true;
e847b36f8   Palak Handa   minor changes
738
739
  	            $scope.prototyp = true;
  	            $scope.protyp = false;
163c5adae   Palak Handa   minor changes
740
741
742
743
744
745
746
747
748
749
  	            $scope.market = true;
  	            $scope.risks = true;
  	            $scope.team = true;
  	            $scope.pitch = true;
  	            $scope.financials = true;
  	            $scope.businessmodel = false;
  	            // for right content
  	            $scope.Idea = false;
  	            $scope.Product = false;
  	            $scope.Growth = true;
629cc1f8f   Palak Handa   minor changes
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
  	            // $scope.Visitor = false;
  	        // } else if (stage == 'Visitor') {
  	        // 	$scope.Productshow = "no";
  	        //     $scope.current = 10;
  	        //     $scope.proto = false;
  	        //     $scope.visitType = false;
  	        //     $scope.prototyp = false;
  	        //     $scope.protyp = false;
  	        //     $scope.market = false;
  	        //     $scope.risks = false;
  	        //     $scope.team = false;
  	        //     $scope.pitch = false;
  	        //     $scope.financials = false;
  	        //     $scope.businessmodel = false;
  	        //     $scope.data.stage = stage;
  	        //     // for right content
  	        //     $scope.Idea = false;
  	        //     $scope.Product = false;
  	        //     $scope.Growth = false;
  	        //     $scope.Visitor = true;
163c5adae   Palak Handa   minor changes
770
771
  	            $scope.data.stage = stage;
  	        }
629cc1f8f   Palak Handa   minor changes
772

163c5adae   Palak Handa   minor changes
773
  	    }
e847b36f8   Palak Handa   minor changes
774

45141d246   Palak Handa   delete validation
775
776
777
  	 //    $scope.emailTest = function(s){
    //   		$scope.space = /\s/g.test(s.delegateTarget.value);
    //   		console.log("space",$scope.space)
e847b36f8   Palak Handa   minor changes
778

45141d246   Palak Handa   delete validation
779
  		// }	
c62079487   Palak Handa   updated design
780
781
782
783
  	    // $scope.enterbusiness = function(business) {
  	    //     console.log("business", business);
  	    //     if (name == undefined) {
  	    //         $scope.current = false;
2d6a9fbea   Palak Handa   complete bugs
784

c62079487   Palak Handa   updated design
785
786
787
788
  	    //     } else if (name != undefined) {
  	    //         $scope.current = true;
  	    //     }
  	    // }
6ae8d3cdd   Palak Handa   add new module
789
790
791
792
793
794
795
  	    /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/
  	    $scope.stagekeyPress = function() {
  	        $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)');
  	    }
  	    $scope.sectorkeyPress = function() {
  	        $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)');
  	    }
163c5adae   Palak Handa   minor changes
796
  	    $scope.productLaunchkeyPress = function() {
6ae8d3cdd   Palak Handa   add new module
797
798
  	        $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)');
  	    }
163c5adae   Palak Handa   minor changes
799
  	    $scope.launchPeriodkeyPress = function() {
c62079487   Palak Handa   updated design
800
801
  	        $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)');
  	    }
7b2bef227   Palak Handa   background image ...
802
803
804
805
806
807
808
809
810
811
812
813
  	    $scope.industrykeyPress = function(quantity) {
  	    	console.log("fghj",quantity)
  	    	$('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)');
  	  //   	$scope.addOther = false;
  			// $scope.hideSelectBox = true;
  	  //       $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)');
  	  //       var e = document.getElementById("dataIndustry");
  			// var dataIndustry = e.options[e.selectedIndex].value;
  			// if(dataIndustry == "others") {
  			// 	$scope.addOther = true;
  			// 	$scope.hideSelectBox = false;
  			// }
c62079487   Palak Handa   updated design
814
  	    }
204302c02   Palak Handa   minor changes
815
816
817
818
819
820
821
822
  	    $scope.industryNamekeyPress = function(firstName) {
  	        console.log("lastName==", firstName);
  	        if (firstName == undefined) {
  	            $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
c62079487   Palak Handa   updated design
823
824
825
  	    $scope.amountkeyPress = function() {
  	        $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)');
  	    }
2321f803a   Palak Handa   updated changes
826
827
828
  	    $scope.firstNamekeyPress = function(name) {
  	        console.log("lastName==", name);
  	        if (name == undefined) {
6ae8d3cdd   Palak Handa   add new module
829
830
831
832
833
  	            $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
834

6ae8d3cdd   Palak Handa   add new module
835
836
837
838
839
840
  	    $scope.emailkeyPress = function(email) {
  	        console.log("email", email);
  	        if (email == undefined) {
  	            $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)');
8ddc94e00   Palak Handa   update
841
  	        }	                
6ae8d3cdd   Palak Handa   add new module
842
  	    }
163c5adae   Palak Handa   minor changes
843
  	    $scope.textCheck = function(){
4697da41f   Palak Handa   updated code
844
  	    	console.log("Val1:::", $scope.textCheck);
163c5adae   Palak Handa   minor changes
845
846
  	    	var e = document.getElementById("fundingDiv");
  			var funding = e.options[e.selectedIndex].value;
204302c02   Palak Handa   minor changes
847
  			$scope.Textshow = "no";
163c5adae   Palak Handa   minor changes
848
  			if(funding == "yes") {
204302c02   Palak Handa   minor changes
849
  				$scope.Textshow = "yes";
163c5adae   Palak Handa   minor changes
850
851
852
  	    	 	console.log("Val:::", $scope.Textshow);
  			}
  	    	
c62079487   Palak Handa   updated design
853
  	    }
4697da41f   Palak Handa   updated code
854
855
856
857
858
859
860
861
862
863
864
  	    $scope.productCheck = function(){
  	    	console.log("Val2:::", $scope.productCheck);
  	    	var e = document.getElementById("productDiv");
  			var product = e.options[e.selectedIndex].value;
  			$scope.Productshow = "no";
  			if(product == "yes") {
  				$scope.Productshow = "yes";
  	    	 	console.log("Val1:::", $scope.Productshow);
  			}
  	    	
  	    }
6ae8d3cdd   Palak Handa   add new module
865
866
867
  
  	    $scope.phonekeyPress = function(number) {
  	        console.log("number", number);
204302c02   Palak Handa   minor changes
868
  	        if (number == undefined || number == '') {
6ae8d3cdd   Palak Handa   add new module
869
870
871
872
873
874
875
876
877
878
879
880
881
882
  	            $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
  
  	    $scope.citykeyPress = function(city) {
  	        console.log("city", city);
  	        if (city == undefined) {
  	            $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
7e3bb1018   Palak Handa   field added
883
  	    $scope.startupNamekeyPress = function(q) {
6ae8d3cdd   Palak Handa   add new module
884
885
886
887
888
889
  	        if (q == undefined) {
  	            $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
890
  	    $scope.linkedInkeyPress = function(technology) {
204302c02   Palak Handa   minor changes
891
  	        if (technology == undefined || technology == '') {
6ae8d3cdd   Palak Handa   add new module
892
893
894
895
896
  	            $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
897
  	    $scope.companykeyPress = function(problem) {
6ae8d3cdd   Palak Handa   add new module
898
899
900
901
902
903
  	        if (problem == undefined) {
  	            $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
904
  	    $scope.productNamekeyPress = function(solution) {
6ae8d3cdd   Palak Handa   add new module
905
906
907
908
909
910
911
912
913
  	        if (solution == undefined) {
  	            $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
  	    $scope.businesskeyPress = function(business) {
  	        $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)');
  	    }
dcb703070   Palak Handa   updated new form ...
914
  	    $scope.websitekeyPress = function(prototype) {
204302c02   Palak Handa   minor changes
915
  	        if (prototype == undefined  || prototype == '') {
6ae8d3cdd   Palak Handa   add new module
916
917
918
919
920
  	            $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
921
  	    $scope.employeekeyPress = function(market) {
204302c02   Palak Handa   minor changes
922
  	        if (market == undefined || market == '') {
6ae8d3cdd   Palak Handa   add new module
923
924
925
926
927
  	            $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
928
  	    $scope.annualkeyPress = function(risk) {
204302c02   Palak Handa   minor changes
929
  	        if (risk == undefined || risk == '') {
6ae8d3cdd   Palak Handa   add new module
930
931
932
933
934
  	            $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
935
  	    $scope.revenuekeyPress = function(team) {
204302c02   Palak Handa   minor changes
936
  	        if (team == undefined || team == '') {
6ae8d3cdd   Palak Handa   add new module
937
938
939
940
941
  	            $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
dcb703070   Palak Handa   updated new form ...
942
  	    $scope.descriptionkeyPress = function(pitch) {
6ae8d3cdd   Palak Handa   add new module
943
944
945
946
947
948
  	        if (pitch == undefined) {
  	            $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
e284785e4   Palak Handa   update new field
949
950
951
952
953
954
955
956
  	    $scope.discountkeyPress = function(discount) {
  	        console.log("lastName==", name);
  	        if (discount == undefined) {
  	            $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
91eeb4455   Palak Handa   modify
957
958
959
960
  	    $scope.removeNooError = function() {
  	    	$('#invalidIdea').css('display', 'block');
  	        $('#noExist').css('display', 'none');
  	    };
c62079487   Palak Handa   updated design
961
  	    $scope.ideakeyPress = function(financial) {
6ae8d3cdd   Palak Handa   add new module
962
963
  	        console.log("financial", financial);
  	        if (financial == undefined) {
91eeb4455   Palak Handa   modify
964
  	        	$('#invalidIdea').css('display', 'block');
6ae8d3cdd   Palak Handa   add new module
965
966
  	            $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
91eeb4455   Palak Handa   modify
967
  	        	$('#invalidIdea').css('display', 'none');
6ae8d3cdd   Palak Handa   add new module
968
969
970
  	            $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
c62079487   Palak Handa   updated design
971
972
973
974
975
976
977
978
979
  
  	    $scope.fundkeyPress = function(financial) {
  	        console.log("financial", financial);
  	        if (financial == undefined) {
  	            $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
  	        } else {
  	            $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
2d6a9fbea   Palak Handa   complete bugs
980
981
982
983
984
985
986
  	    $scope.changeReferalIconColor = function(referalToken){
  	    	if (referalToken == undefined || referalToken == '') {
  	    		$('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
  	    	}else {
  	            $('.referel-icon').css('background-color', 'rgb(66, 181, 73)');
  	        }
  	    }
6ae8d3cdd   Palak Handa   add new module
987

53b83aa9e   Palak Handa   first commit
988
  	});
8ecb55ed6   Palak Handa   update
989
  	scotchApp.controller('verifyController', function($scope, $http, $location, $route, BASE_URL, Analytics) {
be44091b5   Palak Handa   update
990
  	    
d8feb0ddb   Palak Handa   design updated
991
  	    $scope.pendingPaymentId = $route.current.params.id
6ae8d3cdd   Palak Handa   add new module
992
993
994
995
996
997
  	    $http({
  	        method: "GET",
  	        url: BASE_URL + '/applicants/' + $scope.pendingPaymentId,
  	    }).then(function mySuccess(response) {
  	        $scope.data = response.data;
  	        console.log("response-1", response);
d8feb0ddb   Palak Handa   design updated
998
999
  	        $scope.pendingPaymentId = $route.current.params.id;
  	        
6ae8d3cdd   Palak Handa   add new module
1000
1001
1002
1003
1004
1005
  	        $http({
  	            method: "GET",
  	            url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}',
  	        }).then(function mySuccess(response) {
  	            $scope.paymentRecord = response.data;
  	        }, function myError(response) {
be44091b5   Palak Handa   update
1006
  	        	console.log("response-2", response);
6ae8d3cdd   Palak Handa   add new module
1007
1008
1009
1010
1011
1012
1013
  	        });
  	    }, function myError(response) {
  	        $scope.myWelcome = response.statusText;
  	    });
  
  	    $scope.checkView = false;
  	    $scope.verifyView = false;
be44091b5   Palak Handa   update
1014
  	    $scope.searchResult = {}
6ae8d3cdd   Palak Handa   add new module
1015
  	    $scope.pendingPaymentId = '';
6ae8d3cdd   Palak Handa   add new module
1016
1017
1018
1019
1020
  	    $scope.update = function() {
  
  	        $http({
  	            method: 'GET',
  	            url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}',
6ae8d3cdd   Palak Handa   add new module
1021
1022
  	            headers: {}
  	        }).then(function mySuccess(searchResult) {
c556cc81b   Palak Handa   minor changes
1023
1024
  	            if (searchResult.data[0].status == "created") {
  	            //if (searchResult.data[0].status == "cancelled") {
6ae8d3cdd   Palak Handa   add new module
1025
1026
  	                $scope.checkView = true;
  	                $scope.verifyView = false;
ced66f2dc   Palak Handa   minor changes
1027
1028
1029
1030
  	                $scope.amount = searchResult.data[0].amount;
  	                $scope.searchResult = searchResult.data[0];
  	                console.log('====searchResult===', searchResult);
  	        		console.log("searchResult=====",searchResult.data[0].razorOrderId)
6ae8d3cdd   Palak Handa   add new module
1031
  	                var i = 0;
ced66f2dc   Palak Handa   minor changes
1032
  	                $scope.amount =  $scope.amount * 100;
6ae8d3cdd   Palak Handa   add new module
1033
  	                var options = {
f2142e490   Palak Handa   rajorpay key updated
1034
1035
  	                    "key": "rzp_live_mhSE1uOBlXvFyJ",
  	                    //"key" : "rzp_test_YwHsVFiDIQ2WUQ",
6ae8d3cdd   Palak Handa   add new module
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
  	                    "amount": $scope.amount,
  
  	                    "name": "Startup Jalsa",
  	                    "description": "amount",
  	                    "currency": "INR",
  	                    "status": "done",
  
  	                    "theme": {
  	                        "color": "#2196f3 ",
  	                        "image_padding": "NO"
  	                    },
  	                    "modal": {
  	                        "ondismiss": function() {}
  	                    },
  	                    "handler": function(response) {
  	                        createPayment(response);
  	                    }
  	                };
  	                var rzp1 = new Razorpay(options);
  	                rzp1.open();
  	                $scope.paymentResponse = {};
6ae8d3cdd   Palak Handa   add new module
1057
  	                function createPayment(response) {
ced66f2dc   Palak Handa   minor changes
1058
  	                	console.log("response======retepaymen",response);
be44091b5   Palak Handa   update
1059
1060
  	                	$scope.amount =  $scope.amount/100;
  	                	
6ae8d3cdd   Palak Handa   add new module
1061
  	                    $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
ced66f2dc   Palak Handa   minor changes
1062
  	                    $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId;
6ae8d3cdd   Palak Handa   add new module
1063
  	                    $scope.paymentResponse.amount = $scope.amount;
ced66f2dc   Palak Handa   minor changes
1064
1065
1066
  	                    $scope.paymentResponse.currency = $scope.searchResult.currency;
  	                    $scope.paymentResponse.status = $scope.searchResult.status;
  	                    $scope.paymentResponse.applicantId = $scope.searchResult.applicantId;
6ae8d3cdd   Palak Handa   add new module
1067
1068
1069
  	                    console.log("$scope.paymentResponse", $scope.paymentResponse)
  	                    $http({
  	                        method: 'PUT',
ced66f2dc   Palak Handa   minor changes
1070
  	                        url: BASE_URL + '/payments/' + $scope.searchResult.id,
6ae8d3cdd   Palak Handa   add new module
1071
1072
1073
  	                        data: $scope.paymentResponse,
  	                        headers: {}
  	                    }).then(function mySuccess(searchResult) {
9babf5dba   Palak Handa   update
1074
  	                    	console.log("searchResult--->",searchResult)
f6d172552   Palak Handa   analytics apply
1075
  	                    	// if(paymentResult.data.status == "created"){
9babf5dba   Palak Handa   update
1076
  		                    	// Analytics.trackEvent('payments', 'click', 'Thankyou');
f6d172552   Palak Handa   analytics apply
1077
  		                    // }
8e25d825b   Palak Handa   changes the rajor...
1078
  	                    	console.log("finalsearchResult",searchResult)
ced66f2dc   Palak Handa   minor changes
1079
  	                    	$location.path("/confirmation")
8ecb55ed6   Palak Handa   update
1080
  	                		Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount);
6ae8d3cdd   Palak Handa   add new module
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
  	                    }, function myError(error) {
  
  	                    });
  	                }
  	            } else {
  
  	            }
  
  	        }, function myError(error) {});
  	    }
  	});
53b83aa9e   Palak Handa   first commit
1092

2d6a9fbea   Palak Handa   complete bugs
1093
  	scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) {
6ae8d3cdd   Palak Handa   add new module
1094
  		$scope.data = {};
8e25d825b   Palak Handa   changes the rajor...
1095
1096
  		$scope.check = false;
  	    $scope.numberCheck = false;
5348de778   Palak Handa   design updated
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
  	    /*open videos in modal*/
  	    $scope.openyoutube16 = function(){
  			$('#videoModel').modal('show');
  	    }
  
  	     $scope.openyoutube17 = function(){
  			$('#videoModels').modal('show');
  	    }
  
  	    $scope.closeModal = function(){
  	    	var url = $('#youtubePlayer').attr('src');
  			$('#youtubePlayer').attr('src', '');
  			$('#youtubePlayer').attr('src', url);
  	    }
  	    /*open videos ends here*/
  
  	    $scope.removeError = function() {
e847b36f8   Palak Handa   minor changes
1114
  	    	console.log("doooo")
5348de778   Palak Handa   design updated
1115
1116
1117
  	        $('#invalidEmail').css('display', 'none');
  	        $('#alreadyExist').css('display', 'none');
  	    };
b678502c9   Palak Handa   update
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
1159
1160
1161
1162
1163
1164
1165
1166
  		// $scope.emailcheck = function(val) {
  		// 	consol.log("kdsbd")
  		// 	$scope.space = /\s/g.test(val);
    //   		console.log("space",$scope.space)
  	 //        if (val == undefined) {
  	 //            $('#invalidEmail').css('display', 'block');
  	 //        } else {
  	 //            $http({
  	 //                method: 'GET',
  	 //                url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}',
  	 //                headers: {}
  	 //            }).then(function mySuccess(searchResult) {
  	 //                console.log("searchResult1===>", searchResult)
  	 //                if (searchResult.data.length == 0) {
  	 //                    $scope.check = false;
  	 //                } else {
  	 //                    $scope.check = true;
  	 //                    $('#alreadyExist').css('display', 'block');
  	 //                }
  	 //            }, function myError(error) {});
  	 //        }
  	 //    };
  
  	 //    $scope.removeNoError = function() {
  	 //    	$('#invalidNumber').css('display', 'none');
  	 //        $('#noExist').css('display', 'none');
  	 //    };
  
  	 //    $scope.numbercheck = function(number) {
  	 //    	// if (val == undefined) {
  	 //     //        $('#invalidNumber').css('display', 'block');
  	 //     //    } else {
  	 //        	$http({
  	 //            	method: 'GET',
  	 //            	url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}',
  	 //            	data: $scope.data,
  	 //            	headers: {}
  	 //        	}).then(function mySuccess(searchResult) {
  	 //            	console.log("searchResult===>", searchResult)
  	 //            	if (searchResult.data.length == 0) {
  	 //                	$scope.numberCheck = false;
  	 //            	} else {
  	 //                	$scope.numberCheck = true;
  	 //                	$('#noExist').css('display', 'block');
  	 //            	}
  	 //        	}, function myError(error) {});
  	 //       	//}
  
  	 //    };
8e25d825b   Palak Handa   changes the rajor...
1167

6ae8d3cdd   Palak Handa   add new module
1168
1169
1170
1171
1172
1173
1174
  		$scope.submit = function() {
  			console.log($scope.data.name)
  			var randomNumber = ""+Math.random();
  			var nameSpliced = $scope.data.name.slice(0,3);
  			var numberSpliced = randomNumber.slice(2,5);
  			$scope.data.referalToken = nameSpliced+numberSpliced;
  			$scope.data.referalToken = $scope.data.referalToken.toUpperCase();
2d6a9fbea   Palak Handa   complete bugs
1175

6ae8d3cdd   Palak Handa   add new module
1176
1177
1178
1179
1180
1181
1182
1183
  	         $http({
  	                method: 'POST',
  	                url: BASE_URL + '/ambassadors',
  	                data: $scope.data,
  	                headers: {}
  	            }).then(function mySuccess(result) {
  	                console.log("result", result)
  	                $scope.detail = result;
2d6a9fbea   Palak Handa   complete bugs
1184
  	                $('#myModal').modal('show');
0dacc8fef   Palak Handa   update city
1185
  	              	$scope.data.name = '';
2d6a9fbea   Palak Handa   complete bugs
1186
1187
  	                $scope.data.email = '';
  	                $scope.data.mobile = '';
18f937f88   Palak Handa   update
1188
  	                // $scope.data.discount = '';
2d6a9fbea   Palak Handa   complete bugs
1189
  	            
6db0109b5   Palak Handa   minor changes
1190
1191
1192
1193
  	            }, function myError(error) {
  	            	console.log(error)
  	            	console.log(error.data.error.message)
  	            });
2d6a9fbea   Palak Handa   complete bugs
1194
  	        console.log($scope.data)
6ae8d3cdd   Palak Handa   add new module
1195
1196
  	        }
  	});
53b83aa9e   Palak Handa   first commit
1197

96991e0c1   Palak Handa   update
1198