Commit 6ac108d15d093076b0cca5c31cdc82f41063eacc

Authored by Shilpi Saini
1 parent 2d5c1cbe7b
Exists in master

minor change

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
1 // create the module and name it scotchApp 1 // create the module and name it scotchApp
2 var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); 2 var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']);
3 3
4 // configure our routes 4 // configure our routes
5 scotchApp.config(function($routeProvider,$locationProvider) { 5 scotchApp.config(function($routeProvider,$locationProvider) {
6 6
7 // use the HTML5 History API 7 // use the HTML5 History API
8 // $locationProvider.html5Mode({ 8 // $locationProvider.html5Mode({
9 // enabled: true, 9 // enabled: true,
10 // requireBase: false 10 // requireBase: false
11 // }); 11 // });
12 //$locationProvider.hashPrefix('!'); 12 //$locationProvider.hashPrefix('!');
13 $routeProvider 13 $routeProvider
14 // route for the Home page 14 // route for the Home page
15 .when('/', { 15 .when('/', {
16 templateUrl: 'pages/Home.html', 16 templateUrl: 'pages/Home.html',
17 controller: 'mainController' 17 controller: 'mainController'
18 }) 18 })
19 19
20 // route for the caricatures page 20 // route for the caricatures page
21 .when('/caricatures', { 21 .when('/caricatures', {
22 templateUrl: 'pages/caricatures.html', 22 templateUrl: 'pages/caricatures.html',
23 controller: 'mainController' 23 controller: 'mainController'
24 }) 24 })
25 25
26 // route for the paymentVerify page 26 // route for the paymentVerify page
27 .when('/pendingPayment/:id', { 27 .when('/pendingPayment/:id', {
28 templateUrl: 'pages/verify.html', 28 templateUrl: 'pages/verify.html',
29 controller: 'verifyController' 29 controller: 'verifyController'
30 }) 30 })
31 31
32 // route for the registration page 32 // route for the registration page
33 .when('/registration', { 33 .when('/registration', {
34 templateUrl: 'pages/registration.html', 34 templateUrl: 'pages/registration.html',
35 controller: 'registrationController' 35 controller: 'registrationController'
36 }) 36 })
37 37
38 //route for the ambassador page 38 //route for the ambassador page
39 .when('/startupJalsaPromocode', { 39 .when('/startupJalsaPromocode', {
40 templateUrl: 'pages/ambassador.html', 40 templateUrl: 'pages/ambassador.html',
41 controller: 'ambassadorController' 41 controller: 'ambassadorController'
42 }) 42 })
43 43
44 // route for the confirmation page 44 // route for the confirmation page
45 .when('/confirmation', { 45 .when('/confirmation', {
46 templateUrl: 'pages/confirmation.html', 46 templateUrl: 'pages/confirmation.html',
47 controller: 'confirmationController' 47 controller: 'confirmationController'
48 }) 48 })
49 49
50 // route for the confirmation page 50 // route for the confirmation page
51 .when('/confirm', { 51 .when('/confirm', {
52 templateUrl: 'pages/confirm.html', 52 templateUrl: 'pages/confirm.html',
53 controller: 'confirmationController' 53 controller: 'confirmationController'
54 }) 54 })
55 55
56 // route for the paytm page 56 // route for the paytm page
57 .when('/paytm', { 57 .when('/paytm', {
58 templateUrl: 'pages/paytm.html', 58 templateUrl: 'pages/paytm.html',
59 controller: 'paytmController' 59 controller: 'paytmController'
60 }) 60 })
61 61
62 .otherwise({ 62 .otherwise({
63 redirectTo: '/' 63 redirectTo: '/'
64 }); 64 });
65 65
66 }); 66 });
67 67
68 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { 68 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
69 // Add configuration code as desired 69 // Add configuration code as desired
70 AnalyticsProvider.setAccount('UA-123583154-1'); //UU-XXXXXXX-X should be your tracking code 70 AnalyticsProvider.setAccount('UA-123583154-1'); //UU-XXXXXXX-X should be your tracking code
71 71
72 // Track all routes (default is true). 72 // Track all routes (default is true).
73 AnalyticsProvider.trackPages(true); 73 AnalyticsProvider.trackPages(true);
74 74
75 // Track all URL query params (default is false). 75 // Track all URL query params (default is false).
76 AnalyticsProvider.trackUrlParams(true); 76 AnalyticsProvider.trackUrlParams(true);
77 77
78 }]).run(['Analytics', function(Analytics) { }]); 78 }]).run(['Analytics', function(Analytics) { }]);
79 79
80 scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1") 80 scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1")
81 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") 81 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1")
82 82
83 scotchApp.directive('validFile',function(){ 83 scotchApp.directive('validFile',function(){
84 return { 84 return {
85 require:'ngModel', 85 require:'ngModel',
86 link:function(scope,el,attrs,ngModel){ 86 link:function(scope,el,attrs,ngModel){
87 //change event is fired when file is selected 87 //change event is fired when file is selected
88 el.bind('change',function(){ 88 el.bind('change',function(){
89 scope.$apply(function(){ 89 scope.$apply(function(){
90 ngModel.$setViewValue(el.val()); 90 ngModel.$setViewValue(el.val());
91 ngModel.$render(); 91 ngModel.$render();
92 }) 92 })
93 }) 93 })
94 } 94 }
95 } 95 }
96 }) 96 })
97 97
98 // create the controller and inject Angular's $scope 98 // create the controller and inject Angular's $scope
99 scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) { 99 scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) {
100 $scope.data = { 100 $scope.data = {
101 show: true, 101 show: true,
102 hide: false 102 hide: false
103 }; 103 };
104 jQuery('#defaultcountry').addClass('btn-active') 104 jQuery('#defaultcountry').addClass('btn-active')
105 // window.onload = function(){ 105 // window.onload = function(){
106 // // var element = document.getElementById("defaultcountry"); 106 // // var element = document.getElementById("defaultcountry");
107 // // element.classList.add("btn-active"); 107 // // element.classList.add("btn-active");
108 // jQuery('#defaultcountry').addClass('btn-active') 108 // jQuery('#defaultcountry').addClass('btn-active')
109 // //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png"; 109 // //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png";
110 // } 110 // }
111 111
112 var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); 112 var chennai = new Date("Sept 19, 2018 12:00:00").getTime();
113 // Update the count down every 1 second 113 // Update the count down every 1 second
114 var x = setInterval(function() { 114 var x = setInterval(function() {
115 // Get todays date and time 115 // Get todays date and time
116 var now = new Date().getTime(); 116 var now = new Date().getTime();
117 // Find the distance between now an the count down date 117 // Find the distance between now an the count down date
118 var distance = chennai - now; 118 var distance = chennai - now;
119 // Time calculations for days, hours, minutes and seconds 119 // Time calculations for days, hours, minutes and seconds
120 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 120 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
121 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 121 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
122 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 122 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
123 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 123 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
124 $scope.timer = days + "d " + hours + "h " 124 $scope.timer = days + "d " + hours + "h "
125 + minutes + "m " + seconds + "s " 125 + minutes + "m " + seconds + "s "
126 // Output the result in an element with id="demo" 126 // Output the result in an element with id="demo"
127 document.getElementById("chennai").innerHTML = days + "d " + hours + "h " 127 document.getElementById("chennai").innerHTML = days + "d " + hours + "h "
128 + minutes + "m " + seconds + "s "; 128 + minutes + "m " + seconds + "s ";
129 // If the count down is over, write some text 129 // If the count down is over, write some text
130 if (distance < 0) { 130 if (distance < 0) {
131 clearInterval(x); 131 clearInterval(x);
132 document.getElementById("chennai").innerHTML = "EXPIRED"; 132 document.getElementById("chennai").innerHTML = "EXPIRED";
133 } 133 }
134 }, 1000); 134 }, 1000);
135 135
136 var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime(); 136 var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime();
137 // Update the count down every 1 second 137 // Update the count down every 1 second
138 var x = setInterval(function() { 138 var x = setInterval(function() {
139 // Get todays date and time 139 // Get todays date and time
140 var now = new Date().getTime(); 140 var now = new Date().getTime();
141 // Find the distance between now an the count down date 141 // Find the distance between now an the count down date
142 var distance = hyderabad - now; 142 var distance = hyderabad - now;
143 // Time calculations for days, hours, minutes and seconds 143 // Time calculations for days, hours, minutes and seconds
144 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 144 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
145 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 145 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
146 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 146 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
147 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 147 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
148 $scope.timer = days + "d " + hours + "h " 148 $scope.timer = days + "d " + hours + "h "
149 + minutes + "m " + seconds + "s " 149 + minutes + "m " + seconds + "s "
150 // Output the result in an element with id="demo" 150 // Output the result in an element with id="demo"
151 document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " 151 document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h "
152 + minutes + "m " + seconds + "s "; 152 + minutes + "m " + seconds + "s ";
153 // If the count down is over, write some text 153 // If the count down is over, write some text
154 if (distance < 0) { 154 if (distance < 0) {
155 clearInterval(x); 155 clearInterval(x);
156 document.getElementById("hyderabad").innerHTML = "EXPIRED"; 156 document.getElementById("hyderabad").innerHTML = "EXPIRED";
157 } 157 }
158 }, 1000); 158 }, 1000);
159 159
160 var mumbai = new Date("Sept 26, 2018 14:00:00").getTime(); 160 var mumbai = new Date("Sept 26, 2018 14:00:00").getTime();
161 // Update the count down every 1 second 161 // Update the count down every 1 second
162 var x = setInterval(function() { 162 var x = setInterval(function() {
163 // Get todays date and time 163 // Get todays date and time
164 var now = new Date().getTime(); 164 var now = new Date().getTime();
165 // Find the distance between now an the count down date 165 // Find the distance between now an the count down date
166 var distance = mumbai - now; 166 var distance = mumbai - now;
167 // Time calculations for days, hours, minutes and seconds 167 // Time calculations for days, hours, minutes and seconds
168 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 168 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
169 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 169 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
170 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 170 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
171 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 171 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
172 $scope.timer = days + "d " + hours + "h " 172 $scope.timer = days + "d " + hours + "h "
173 + minutes + "m " + seconds + "s " 173 + minutes + "m " + seconds + "s "
174 // Output the result in an element with id="demo" 174 // Output the result in an element with id="demo"
175 document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " 175 document.getElementById("mumbai").innerHTML = days + "d " + hours + "h "
176 + minutes + "m " + seconds + "s "; 176 + minutes + "m " + seconds + "s ";
177 // If the count down is over, write some text 177 // If the count down is over, write some text
178 if (distance < 0) { 178 if (distance < 0) {
179 clearInterval(x); 179 clearInterval(x);
180 document.getElementById("mumbai").innerHTML = "EXPIRED"; 180 document.getElementById("mumbai").innerHTML = "EXPIRED";
181 } 181 }
182 }, 1000); 182 }, 1000);
183 183
184 var kolkata = new Date("Oct 3, 2018 14:00:00").getTime(); 184 var kolkata = new Date("Oct 3, 2018 14:00:00").getTime();
185 // Update the count down every 1 second 185 // Update the count down every 1 second
186 var x = setInterval(function() { 186 var x = setInterval(function() {
187 // Get todays date and time 187 // Get todays date and time
188 var now = new Date().getTime(); 188 var now = new Date().getTime();
189 // Find the distance between now an the count down date 189 // Find the distance between now an the count down date
190 var distance = kolkata - now; 190 var distance = kolkata - now;
191 // Time calculations for days, hours, minutes and seconds 191 // Time calculations for days, hours, minutes and seconds
192 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 192 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
193 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 193 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
194 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 194 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
195 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 195 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
196 $scope.timer = days + "d " + hours + "h " 196 $scope.timer = days + "d " + hours + "h "
197 + minutes + "m " + seconds + "s " 197 + minutes + "m " + seconds + "s "
198 // Output the result in an element with id="demo" 198 // Output the result in an element with id="demo"
199 document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " 199 document.getElementById("kolkata").innerHTML = days + "d " + hours + "h "
200 + minutes + "m " + seconds + "s "; 200 + minutes + "m " + seconds + "s ";
201 // If the count down is over, write some text 201 // If the count down is over, write some text
202 if (distance < 0) { 202 if (distance < 0) {
203 clearInterval(x); 203 clearInterval(x);
204 document.getElementById("kolkata").innerHTML = "EXPIRED"; 204 document.getElementById("kolkata").innerHTML = "EXPIRED";
205 } 205 }
206 }, 1000); 206 }, 1000);
207 207
208 var jaipur = new Date("Oct 5, 2018 14:00:00").getTime(); 208 var jaipur = new Date("Oct 5, 2018 14:00:00").getTime();
209 // Update the count down every 1 second 209 // Update the count down every 1 second
210 var x = setInterval(function() { 210 var x = setInterval(function() {
211 // Get todays date and time 211 // Get todays date and time
212 var now = new Date().getTime(); 212 var now = new Date().getTime();
213 // Find the distance between now an the count down date 213 // Find the distance between now an the count down date
214 var distance = jaipur - now; 214 var distance = jaipur - now;
215 // Time calculations for days, hours, minutes and seconds 215 // Time calculations for days, hours, minutes and seconds
216 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 216 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
217 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 217 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
218 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 218 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
219 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 219 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
220 $scope.timer = days + "d " + hours + "h " 220 $scope.timer = days + "d " + hours + "h "
221 + minutes + "m " + seconds + "s " 221 + minutes + "m " + seconds + "s "
222 // Output the result in an element with id="demo" 222 // Output the result in an element with id="demo"
223 document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " 223 document.getElementById("jaipur").innerHTML = days + "d " + hours + "h "
224 + minutes + "m " + seconds + "s "; 224 + minutes + "m " + seconds + "s ";
225 // If the count down is over, write some text 225 // If the count down is over, write some text
226 if (distance < 0) { 226 if (distance < 0) {
227 clearInterval(x); 227 clearInterval(x);
228 document.getElementById("jaipur").innerHTML = "EXPIRED"; 228 document.getElementById("jaipur").innerHTML = "EXPIRED";
229 } 229 }
230 }, 1000); 230 }, 1000);
231 231
232 var delhi = new Date("Oct 8, 2018 14:00:00").getTime(); 232 var delhi = new Date("Oct 8, 2018 14:00:00").getTime();
233 // Update the count down every 1 second 233 // Update the count down every 1 second
234 var x = setInterval(function() { 234 var x = setInterval(function() {
235 // Get todays date and time 235 // Get todays date and time
236 var now = new Date().getTime(); 236 var now = new Date().getTime();
237 // Find the distance between now an the count down date 237 // Find the distance between now an the count down date
238 var distance = delhi - now; 238 var distance = delhi - now;
239 // Time calculations for days, hours, minutes and seconds 239 // Time calculations for days, hours, minutes and seconds
240 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 240 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
241 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 241 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
242 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 242 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
243 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 243 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
244 $scope.timer = days + "d " + hours + "h " 244 $scope.timer = days + "d " + hours + "h "
245 + minutes + "m " + seconds + "s " 245 + minutes + "m " + seconds + "s "
246 // Output the result in an element with id="demo" 246 // Output the result in an element with id="demo"
247 document.getElementById("delhi").innerHTML = days + "d " + hours + "h " 247 document.getElementById("delhi").innerHTML = days + "d " + hours + "h "
248 + minutes + "m " + seconds + "s "; 248 + minutes + "m " + seconds + "s ";
249 // If the count down is over, write some text 249 // If the count down is over, write some text
250 if (distance < 0) { 250 if (distance < 0) {
251 clearInterval(x); 251 clearInterval(x);
252 document.getElementById("delhi").innerHTML = "EXPIRED"; 252 document.getElementById("delhi").innerHTML = "EXPIRED";
253 } 253 }
254 }, 1000); 254 }, 1000);
255 255
256 var kanpur = new Date("Oct 10, 2018 14:00:00").getTime(); 256 var kanpur = new Date("Oct 10, 2018 14:00:00").getTime();
257 // Update the count down every 1 second 257 // Update the count down every 1 second
258 var x = setInterval(function() { 258 var x = setInterval(function() {
259 // Get todays date and time 259 // Get todays date and time
260 var now = new Date().getTime(); 260 var now = new Date().getTime();
261 // Find the distance between now an the count down date 261 // Find the distance between now an the count down date
262 var distance = kanpur - now; 262 var distance = kanpur - now;
263 // Time calculations for days, hours, minutes and seconds 263 // Time calculations for days, hours, minutes and seconds
264 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 264 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
265 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 265 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
266 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 266 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
267 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 267 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
268 $scope.timer = days + "d " + hours + "h " 268 $scope.timer = days + "d " + hours + "h "
269 + minutes + "m " + seconds + "s " 269 + minutes + "m " + seconds + "s "
270 // Output the result in an element with id="demo" 270 // Output the result in an element with id="demo"
271 document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " 271 document.getElementById("kanpur").innerHTML = days + "d " + hours + "h "
272 + minutes + "m " + seconds + "s "; 272 + minutes + "m " + seconds + "s ";
273 // If the count down is over, write some text 273 // If the count down is over, write some text
274 if (distance < 0) { 274 if (distance < 0) {
275 clearInterval(x); 275 clearInterval(x);
276 document.getElementById("kanpur").innerHTML = "EXPIRED"; 276 document.getElementById("kanpur").innerHTML = "EXPIRED";
277 } 277 }
278 }, 1000); 278 }, 1000);
279 279
280 var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime(); 280 var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime();
281 // Update the count down every 1 second 281 // Update the count down every 1 second
282 var x = setInterval(function() { 282 var x = setInterval(function() {
283 // Get todays date and time 283 // Get todays date and time
284 var now = new Date().getTime(); 284 var now = new Date().getTime();
285 // Find the distance between now an the count down date 285 // Find the distance between now an the count down date
286 var distance = ahmedabad - now; 286 var distance = ahmedabad - now;
287 // Time calculations for days, hours, minutes and seconds 287 // Time calculations for days, hours, minutes and seconds
288 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 288 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
289 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 289 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
290 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 290 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
291 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 291 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
292 $scope.timer = days + "d " + hours + "h " 292 $scope.timer = days + "d " + hours + "h "
293 + minutes + "m " + seconds + "s " 293 + minutes + "m " + seconds + "s "
294 // Output the result in an element with id="demo" 294 // Output the result in an element with id="demo"
295 document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " 295 document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h "
296 + minutes + "m " + seconds + "s "; 296 + minutes + "m " + seconds + "s ";
297 // If the count down is over, write some text 297 // If the count down is over, write some text
298 if (distance < 0) { 298 if (distance < 0) {
299 clearInterval(x); 299 clearInterval(x);
300 document.getElementById("ahmedabad").innerHTML = "EXPIRED"; 300 document.getElementById("ahmedabad").innerHTML = "EXPIRED";
301 } 301 }
302 }, 1000); 302 }, 1000);
303 303
304 var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime(); 304 var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime();
305 // Update the count down every 1 second 305 // Update the count down every 1 second
306 var x = setInterval(function() { 306 var x = setInterval(function() {
307 // Get todays date and time 307 // Get todays date and time
308 var now = new Date().getTime(); 308 var now = new Date().getTime();
309 // Find the distance between now an the count down date 309 // Find the distance between now an the count down date
310 var distance = bengaluru - now; 310 var distance = bengaluru - now;
311 // Time calculations for days, hours, minutes and seconds 311 // Time calculations for days, hours, minutes and seconds
312 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 312 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
313 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 313 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
314 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 314 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
315 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 315 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
316 $scope.timer = days + "d " + hours + "h " 316 $scope.timer = days + "d " + hours + "h "
317 + minutes + "m " + seconds + "s " 317 + minutes + "m " + seconds + "s "
318 // Output the result in an element with id="demo" 318 // Output the result in an element with id="demo"
319 document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " 319 document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h "
320 + minutes + "m " + seconds + "s "; 320 + minutes + "m " + seconds + "s ";
321 // If the count down is over, write some text 321 // If the count down is over, write some text
322 if (distance < 0) { 322 if (distance < 0) {
323 clearInterval(x); 323 clearInterval(x);
324 document.getElementById("bengaluru").innerHTML = "EXPIRED"; 324 document.getElementById("bengaluru").innerHTML = "EXPIRED";
325 } 325 }
326 }, 1000); 326 }, 1000);
327 327
328 var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime(); 328 var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime();
329 // Update the count down every 1 second 329 // Update the count down every 1 second
330 var x = setInterval(function() { 330 var x = setInterval(function() {
331 // Get todays date and time 331 // Get todays date and time
332 var now = new Date().getTime(); 332 var now = new Date().getTime();
333 // Find the distance between now an the count down date 333 // Find the distance between now an the count down date
334 var distance = dharamsala - now; 334 var distance = dharamsala - now;
335 // Time calculations for days, hours, minutes and seconds 335 // Time calculations for days, hours, minutes and seconds
336 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 336 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
337 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 337 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
338 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 338 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
339 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 339 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
340 $scope.timer = days + "d " + hours + "h " 340 $scope.timer = days + "d " + hours + "h "
341 + minutes + "m " + seconds + "s " 341 + minutes + "m " + seconds + "s "
342 // Output the result in an element with id="demo" 342 // Output the result in an element with id="demo"
343 document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " 343 document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h "
344 + minutes + "m " + seconds + "s "; 344 + minutes + "m " + seconds + "s ";
345 // If the count down is over, write some text 345 // If the count down is over, write some text
346 if (distance < 0) { 346 if (distance < 0) {
347 clearInterval(x); 347 clearInterval(x);
348 document.getElementById("dharamsala").innerHTML = "EXPIRED"; 348 document.getElementById("dharamsala").innerHTML = "EXPIRED";
349 } 349 }
350 }, 1000); 350 }, 1000);
351 351
352 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 352 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
353 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 353 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
354 // $scope.Textshow = "yes" 354 // $scope.Textshow = "yes"
355 $scope.max = 100; 355 $scope.max = 100;
356 $scope.formPage = false; 356 $scope.formPage = false;
357 $scope.current = 0; 357 $scope.current = 0;
358 $scope.payingAmnt = 0; 358 $scope.payingAmnt = 0;
359 $scope.data = {}; 359 $scope.data = {};
360 $scope.discountAmount = 0; 360 $scope.discountAmount = 0;
361 // $scope.data.quantity = "1"; 361 // $scope.data.quantity = "1";
362 $scope.check = false; 362 $scope.check = false;
363 $scope.numberCheck = false; 363 $scope.numberCheck = false;
364 $scope.paymentResult = {}; 364 $scope.paymentResult = {};
365 var data = { 365 var data = {
366 "amount": $scope.payingAmnt, 366 "amount": $scope.payingAmnt,
367 "currency": "INR", 367 "currency": "INR",
368 "status": "pending" 368 "status": "pending"
369 } 369 }
370 370
371 $scope.showval = true; 371 $scope.showval = true;
372 $scope.hideval = false; 372 $scope.hideval = false;
373 $scope.showvalue = false; 373 $scope.showvalue = false;
374 $scope.hidevalue = false; 374 $scope.hidevalue = false;
375 localStorage.setItem("country",'INDIA'); 375 localStorage.setItem("country",'INDIA');
376 $scope.isShowHide = function (value) { 376 $scope.isShowHide = function (value) {
377 var element = document.getElementById("defaultcountry"); 377 var element = document.getElementById("defaultcountry");
378 element.classList.remove("btn-active"); 378 element.classList.remove("btn-active");
379 localStorage.setItem("country",value); 379 localStorage.setItem("country",value);
380 if (value == "INDIA") { 380 if (value == "INDIA") {
381 console.log("value",value) 381 console.log("value",value)
382 $scope.showval = true; 382 $scope.showval = true;
383 $scope.hideval = false; 383 $scope.hideval = false;
384 $scope.showvalue = false; 384 $scope.showvalue = false;
385 $scope.hidevalue = false; 385 $scope.hidevalue = false;
386 } 386 }
387 else if (value == "SRI LANKA") { 387 else if (value == "SRI LANKA") {
388 console.log("value1",value) 388 console.log("value1",value)
389 $scope.showval = false; 389 $scope.showval = false;
390 $scope.hideval = true; 390 $scope.hideval = true;
391 $scope.showvalue = false; 391 $scope.showvalue = false;
392 $scope.hidevalue = false; 392 $scope.hidevalue = false;
393 } 393 }
394 else if (value == "BANGLADESH") { 394 else if (value == "BANGLADESH") {
395 console.log("value2",value) 395 console.log("value2",value)
396 $scope.showval = false; 396 $scope.showval = false;
397 $scope.hideval = false; 397 $scope.hideval = false;
398 $scope.showvalue = true; 398 $scope.showvalue = true;
399 $scope.hidevalue = false; 399 $scope.hidevalue = false;
400 } 400 }
401 else { 401 else {
402 console.log("value3",value) 402 console.log("value3",value)
403 $scope.showval = false; 403 $scope.showval = false;
404 $scope.hideval = false; 404 $scope.hideval = false;
405 $scope.showvalue = false; 405 $scope.showvalue = false;
406 $scope.hidevalue = true; 406 $scope.hidevalue = true;
407 } 407 }
408 } 408 }
409 409
410 $scope.apply = function() { 410 $scope.apply = function() {
411 $location.path("/caricatures") 411 $location.path("/caricatures")
412 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg"; 412 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg";
413 413
414 } 414 }
415 415
416 $scope.apply1 = function() { 416 $scope.apply1 = function() {
417 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; 417 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register";
418 } 418 }
419 419
420 $scope.click=function(){ 420 $scope.click=function(){
421 Analytics.trackEvent('register', 'click', 'Registration'); 421 Analytics.trackEvent('whatsapp', 'click', 'Registration');
422 let redirectUrl = "https://wa.me/918283056881"; 422 let redirectUrl = "https://wa.me/918283056881";
423 window.open(redirectUrl,"_blank") 423 window.open(redirectUrl,"_blank")
424 } 424 }
425 425
426 // $scope.data.city = ''; 426 // $scope.data.city = '';
427 $scope.watch = function(value){ 427 $scope.watch = function(value){
428 //document.getElementById("ahmedabad").src = ""; 428 //document.getElementById("ahmedabad").src = "";
429 // console.log("cllll",value) 429 // console.log("cllll",value)
430 $scope.data.city = value; 430 $scope.data.city = value;
431 // if($scope.data.city == "Chennai"){ 431 // if($scope.data.city == "Chennai"){
432 // console.log("cllll1",value) 432 // console.log("cllll1",value)
433 // $window.location.href = 'http://35.154.24.158:8007'; 433 // $window.location.href = 'http://35.154.24.158:8007';
434 // }else{ 434 // }else{
435 // console.log("cllll2",value) 435 // console.log("cllll2",value)
436 localStorage.setItem("city" ,value); 436 localStorage.setItem("city" ,value);
437 437
438 //$location.path('/registration').search({city: value}); 438 //$location.path('/registration').search({city: value});
439 // $location.path('/registration/'+value+''); 439 // $location.path('/registration/'+value+'');
440 $location.path('/registration'); 440 $location.path('/registration');
441 //$state.go('registration', { 'city': value}) 441 //$state.go('registration', { 'city': value})
442 // } 442 // }
443 } 443 }
444 444
445 $scope.select = function(url){ 445 $scope.select = function(url){
446 console.log("cllll") 446 console.log("cllll")
447 window.open(url) 447 window.open(url)
448 } 448 }
449 449
450 $scope.stagekeyPress = function() { 450 $scope.stagekeyPress = function() {
451 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); 451 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
452 } 452 }
453 $scope.sectorkeyPress = function() { 453 $scope.sectorkeyPress = function() {
454 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); 454 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
455 } 455 }
456 456
457 $scope.productLaunchkeyPress = function() { 457 $scope.productLaunchkeyPress = function() {
458 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); 458 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
459 } 459 }
460 460
461 $scope.launchPeriodkeyPress = function() { 461 $scope.launchPeriodkeyPress = function() {
462 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); 462 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
463 } 463 }
464 464
465 $scope.industrykeyPress = function(quantity) { 465 $scope.industrykeyPress = function(quantity) {
466 console.log("fghj",quantity) 466 console.log("fghj",quantity)
467 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); 467 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
468 } 468 }
469 469
470 $scope.industryNamekeyPress = function(firstName) { 470 $scope.industryNamekeyPress = function(firstName) {
471 console.log("lastName==", firstName); 471 console.log("lastName==", firstName);
472 if (firstName == undefined) { 472 if (firstName == undefined) {
473 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 473 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
474 } else { 474 } else {
475 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 475 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
476 } 476 }
477 } 477 }
478 478
479 $scope.amountkeyPress = function() { 479 $scope.amountkeyPress = function() {
480 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); 480 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
481 } 481 }
482 482
483 $scope.firstNamekeyPress = function(name) { 483 $scope.firstNamekeyPress = function(name) {
484 console.log("lastName==", name); 484 console.log("lastName==", name);
485 if (name == undefined) { 485 if (name == undefined) {
486 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); 486 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
487 } else { 487 } else {
488 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); 488 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
489 } 489 }
490 } 490 }
491 491
492 $scope.emailkeyPress = function(email) { 492 $scope.emailkeyPress = function(email) {
493 console.log("email", email); 493 console.log("email", email);
494 if (email == undefined) { 494 if (email == undefined) {
495 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); 495 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
496 } else { 496 } else {
497 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); 497 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
498 } 498 }
499 } 499 }
500 500
501 $scope.phonekeyPress = function(number) { 501 $scope.phonekeyPress = function(number) {
502 console.log("number", number); 502 console.log("number", number);
503 if (number == undefined || number == '') { 503 if (number == undefined || number == '') {
504 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); 504 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
505 } else { 505 } else {
506 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); 506 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
507 } 507 }
508 } 508 }
509 509
510 $scope.citykeyPress = function(city) { 510 $scope.citykeyPress = function(city) {
511 console.log("city", city); 511 console.log("city", city);
512 if (city == undefined) { 512 if (city == undefined) {
513 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); 513 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
514 } else { 514 } else {
515 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); 515 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
516 } 516 }
517 } 517 }
518 518
519 $scope.startupNamekeyPress = function(q) { 519 $scope.startupNamekeyPress = function(q) {
520 if (q == undefined) { 520 if (q == undefined) {
521 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); 521 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
522 } else { 522 } else {
523 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); 523 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
524 } 524 }
525 } 525 }
526 526
527 $scope.linkedInkeyPress = function(technology) { 527 $scope.linkedInkeyPress = function(technology) {
528 if (technology == undefined || technology == '') { 528 if (technology == undefined || technology == '') {
529 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); 529 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
530 } else { 530 } else {
531 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); 531 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
532 } 532 }
533 } 533 }
534 $scope.companykeyPress = function(problem) { 534 $scope.companykeyPress = function(problem) {
535 if (problem == undefined) { 535 if (problem == undefined) {
536 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); 536 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
537 } else { 537 } else {
538 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); 538 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
539 } 539 }
540 } 540 }
541 $scope.productNamekeyPress = function(solution) { 541 $scope.productNamekeyPress = function(solution) {
542 if (solution == undefined) { 542 if (solution == undefined) {
543 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); 543 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
544 } else { 544 } else {
545 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); 545 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
546 } 546 }
547 } 547 }
548 $scope.businesskeyPress = function(business) { 548 $scope.businesskeyPress = function(business) {
549 if (business == undefined) { 549 if (business == undefined) {
550 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); 550 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)');
551 } else { 551 } else {
552 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); 552 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)');
553 } 553 }
554 } 554 }
555 555
556 $scope.websitekeyPress = function(prototype) { 556 $scope.websitekeyPress = function(prototype) {
557 if (prototype == undefined || prototype == '') { 557 if (prototype == undefined || prototype == '') {
558 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); 558 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
559 } else { 559 } else {
560 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); 560 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
561 } 561 }
562 } 562 }
563 563
564 $scope.employeekeyPress = function(market) { 564 $scope.employeekeyPress = function(market) {
565 if (market == undefined || market == '') { 565 if (market == undefined || market == '') {
566 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); 566 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
567 } else { 567 } else {
568 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); 568 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
569 } 569 }
570 } 570 }
571 571
572 $scope.annualkeyPress = function(risk) { 572 $scope.annualkeyPress = function(risk) {
573 if (risk == undefined || risk == '') { 573 if (risk == undefined || risk == '') {
574 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); 574 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
575 } else { 575 } else {
576 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); 576 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
577 } 577 }
578 } 578 }
579 579
580 $scope.revenuekeyPress = function(team) { 580 $scope.revenuekeyPress = function(team) {
581 if (team == undefined) { 581 if (team == undefined) {
582 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); 582 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
583 } else { 583 } else {
584 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); 584 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
585 } 585 }
586 } 586 }
587 587
588 $scope.descriptionkeyPress = function(pitch) { 588 $scope.descriptionkeyPress = function(pitch) {
589 if (pitch == undefined) { 589 if (pitch == undefined) {
590 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); 590 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
591 } else { 591 } else {
592 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); 592 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
593 } 593 }
594 } 594 }
595 595
596 $scope.discountkeyPress = function(discount) { 596 $scope.discountkeyPress = function(discount) {
597 if (discount == undefined) { 597 if (discount == undefined) {
598 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 598 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
599 } else { 599 } else {
600 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 600 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
601 } 601 }
602 } 602 }
603 603
604 $scope.removeNooError = function() { 604 $scope.removeNooError = function() {
605 $('#invalidIdea').css('display', 'block'); 605 $('#invalidIdea').css('display', 'block');
606 $('#noExist').css('display', 'none'); 606 $('#noExist').css('display', 'none');
607 }; 607 };
608 608
609 $scope.ideakeyPress = function(financial) { 609 $scope.ideakeyPress = function(financial) {
610 console.log("financial", financial); 610 console.log("financial", financial);
611 if (financial == undefined) { 611 if (financial == undefined) {
612 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); 612 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
613 } else { 613 } else {
614 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); 614 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
615 } 615 }
616 } 616 }
617 617
618 $scope.fundkeyPress = function(financial) { 618 $scope.fundkeyPress = function(financial) {
619 console.log("financial", financial); 619 console.log("financial", financial);
620 if (financial == undefined) { 620 if (financial == undefined) {
621 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); 621 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
622 } else { 622 } else {
623 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); 623 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
624 } 624 }
625 } 625 }
626 626
627 $scope.changeReferalIconColor = function(referalToken){ 627 $scope.changeReferalIconColor = function(referalToken){
628 if (referalToken == undefined || referalToken == '') { 628 if (referalToken == undefined || referalToken == '') {
629 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); 629 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
630 }else { 630 }else {
631 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); 631 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
632 } 632 }
633 } 633 }
634 634
635 }); 635 });
636 636
637 scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { 637 scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
638 $scope.data = {}; 638 $scope.data = {};
639 $scope.check = false; 639 $scope.check = false;
640 $scope.numberCheck = false; 640 $scope.numberCheck = false;
641 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 641 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
642 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 642 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
643 $scope.max = 100; 643 $scope.max = 100;
644 $scope.formPage = false; 644 $scope.formPage = false;
645 $scope.current = 0; 645 $scope.current = 0;
646 $scope.payingAmnt = 0; 646 $scope.payingAmnt = 0;
647 $scope.discountAmount = 0; 647 $scope.discountAmount = 0;
648 $scope.approvedMsg = false; 648 $scope.approvedMsg = false;
649 $scope.disApprovedMsg = false; 649 $scope.disApprovedMsg = false;
650 650
651 // $scope.data.quantity = "1"; 651 // $scope.data.quantity = "1";
652 $scope.check = false; 652 $scope.check = false;
653 $scope.numberCheck = false; 653 $scope.numberCheck = false;
654 $scope.paymentResult = {}; 654 $scope.paymentResult = {};
655 // var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] 655 // var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0]
656 // if(myParam){ 656 // if(myParam){
657 // if(myParam == "approved"){ 657 // if(myParam == "approved"){
658 // $scope.showResponse = true; 658 // $scope.showResponse = true;
659 // }else{ 659 // }else{
660 // $scope.disApprovedMsg = true; 660 // $scope.disApprovedMsg = true;
661 // } 661 // }
662 // }else{ 662 // }else{
663 // $scope.disApprovedMsg = true; 663 // $scope.disApprovedMsg = true;
664 // } 664 // }
665 665
666 $scope.click=function(){ 666 $scope.click=function(){
667 Analytics.trackEvent('whatsapp', 'click', 'Registration'); 667 Analytics.trackEvent('whatsapp', 'click', 'Registration');
668 let redirectUrl = "https://wa.me/918283056881"; 668 let redirectUrl = "https://wa.me/918283056881";
669 window.open(redirectUrl,"_blank") 669 window.open(redirectUrl,"_blank")
670 } 670 }
671 671
672 $scope.removeError = function() { 672 $scope.removeError = function() {
673 $('#invalidEmail').css('display', 'none'); 673 $('#invalidEmail').css('display', 'none');
674 $('#alreadyExist').css('display', 'none'); 674 $('#alreadyExist').css('display', 'none');
675 }; 675 };
676 676
677 $scope.emailcheck = function(val) { 677 $scope.emailcheck = function(val) {
678 if (val == undefined) { 678 if (val == undefined) {
679 $('#invalidEmail').css('display', 'block'); 679 $('#invalidEmail').css('display', 'block');
680 } else { 680 } else {
681 $('#alreadyExist').css('display', 'block'); 681 $('#alreadyExist').css('display', 'block');
682 } 682 }
683 }; 683 };
684 684
685 $scope.removeNoError = function() { 685 $scope.removeNoError = function() {
686 $('#invalidNumber').css('display', 'none'); 686 $('#invalidNumber').css('display', 'none');
687 $('#alreadyExist').css('display', 'none'); 687 $('#alreadyExist').css('display', 'none');
688 }; 688 };
689 689
690 $scope.numbercheck = function(val) { 690 $scope.numbercheck = function(val) {
691 if (val == undefined) { 691 if (val == undefined) {
692 $('#invalidNumber').css('display', 'block'); 692 $('#invalidNumber').css('display', 'block');
693 } else { 693 } else {
694 $('#alreadyExist').css('display', 'block'); 694 $('#alreadyExist').css('display', 'block');
695 } 695 }
696 }; 696 };
697 697
698 // $scope.$on('city', function (event, value) { 698 // $scope.$on('city', function (event, value) {
699 $scope.data.city = localStorage.getItem("city"); 699 $scope.data.city = localStorage.getItem("city");
700 $scope.data.country = localStorage.getItem("country"); 700 $scope.data.country = localStorage.getItem("country");
701 // }); 701 // });
702 var data = { 702 var data = {
703 "amount": $scope.payingAmnt, 703 "amount": $scope.payingAmnt,
704 "currency": "INR", 704 "currency": "INR",
705 "status": "pending", 705 "status": "pending",
706 "paymentType": $scope.data.country 706 "paymentType": $scope.data.country
707 } 707 }
708 708
709 var handleFileSelect = function(evt) { 709 var handleFileSelect = function(evt) {
710 var files = evt.target.files; 710 var files = evt.target.files;
711 var file = files[0]; 711 var file = files[0];
712 712
713 if (files && file) { 713 if (files && file) {
714 var reader = new FileReader(); 714 var reader = new FileReader();
715 715
716 reader.onload = function(readerEvt) { 716 reader.onload = function(readerEvt) {
717 var binaryString = readerEvt.target.result; 717 var binaryString = readerEvt.target.result;
718 $scope.base64textString = btoa(binaryString); 718 $scope.base64textString = btoa(binaryString);
719 //console.log("base64textarea",$scope.base64textString) 719 //console.log("base64textarea",$scope.base64textString)
720 //$scope.data.uploadFile = file.name; 720 //$scope.data.uploadFile = file.name;
721 $scope.fileSelect = false; 721 $scope.fileSelect = false;
722 if($scope.data.uploadFile == null){ 722 if($scope.data.uploadFile == null){
723 $scope.fileSelect = true; 723 $scope.fileSelect = true;
724 }else{ 724 }else{
725 $scope.fileSelect = false; 725 $scope.fileSelect = false;
726 }; 726 };
727 } 727 }
728 728
729 reader.readAsBinaryString(file); 729 reader.readAsBinaryString(file);
730 } 730 }
731 }; 731 };
732 if (window.File && window.FileReader && window.FileList && window.Blob) { 732 if (window.File && window.FileReader && window.FileList && window.Blob) {
733 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); 733 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
734 } 734 }
735 735
736 $scope.ngShowhide = false; 736 $scope.ngShowhide = false;
737 $scope.GetValue = function(){ 737 $scope.GetValue = function(){
738 if($scope.data.sector == "Other"){ 738 if($scope.data.sector == "Other"){
739 $scope.ngShowhide = true; 739 $scope.ngShowhide = true;
740 }else{ 740 }else{
741 $scope.ngShowhide = false; 741 $scope.ngShowhide = false;
742 } 742 }
743 } 743 }
744 744
745 $scope.ngShow = false; 745 $scope.ngShow = false;
746 $scope.getValue = function(){ 746 $scope.getValue = function(){
747 if($scope.data.hear == "Other"){ 747 if($scope.data.hear == "Other"){
748 $scope.ngShow = true; 748 $scope.ngShow = true;
749 }else{ 749 }else{
750 $scope.ngShow = false; 750 $scope.ngShow = false;
751 } 751 }
752 } 752 }
753 753
754 $rootScope.tokenCall = function(val) { 754 $rootScope.tokenCall = function(val) {
755 if (val == undefined) { 755 if (val == undefined) {
756 $('#invalidToken').css('display', 'block'); 756 $('#invalidToken').css('display', 'block');
757 } else { 757 } else {
758 val = val.toUpperCase(); 758 val = val.toUpperCase();
759 if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ 759 if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){
760 $scope.tokencheck = false; 760 $scope.tokencheck = false;
761 return; 761 return;
762 } 762 }
763 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') 763 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
764 .then(function(searchResult) { 764 .then(function(searchResult) {
765 if (searchResult.data.length == 0) { 765 if (searchResult.data.length == 0) {
766 $scope.tokencheck = false; 766 $scope.tokencheck = false;
767 $scope.discountAmount = 0; 767 $scope.discountAmount = 0;
768 } else { 768 } else {
769 $scope.discountpercentage = searchResult.data[0].discount; 769 $scope.discountpercentage = searchResult.data[0].discount;
770 $scope.tokencheck = true; 770 $scope.tokencheck = true;
771 } 771 }
772 },function(err){ 772 },function(err){
773 console.log(err) 773 console.log(err)
774 }); 774 });
775 775
776 } 776 }
777 }; 777 };
778 // if($scope.data.country == "INDIA"){ 778 // if($scope.data.country == "INDIA"){
779 // $scope.submit = function() { 779 // $scope.submit = function() {
780 // Analytics.trackEvent('register', 'click', 'Registration'); 780 // Analytics.trackEvent('register', 'click', 'Registration');
781 // $scope.loading = true; 781 // $scope.loading = true;
782 // $scope.data.uploadFile = $scope.base64textString; 782 // $scope.data.uploadFile = $scope.base64textString;
783 // console.log($scope.data.uploadFile) 783 // console.log($scope.data.uploadFile)
784 // // if($scope.tokencheck == false){ 784 // // if($scope.tokencheck == false){
785 // // $scope.data.referalToken = null; 785 // // $scope.data.referalToken = null;
786 // // } 786 // // }
787 // // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 787 // // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
788 // // var x = document.getElementById("snackbar") 788 // // var x = document.getElementById("snackbar")
789 // // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 789 // // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
790 // // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 790 // // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
791 // $scope.infoForm = true; 791 // $scope.infoForm = true;
792 // $scope.ticketAmnt = 1180; 792 // $scope.ticketAmnt = 1180;
793 // $scope.detail = {}; 793 // $scope.detail = {};
794 // $scope.data.phone = "+91"+$scope.data.number; 794 // $scope.data.phone = "+91"+$scope.data.number;
795 // if($scope.data.referalToken == null){ 795 // if($scope.data.referalToken == null){
796 // $scope.data.referalToken = "NA" 796 // $scope.data.referalToken = "NA"
797 // } 797 // }
798 // var file =document.getElementById('filePicker').files[0]; 798 // var file =document.getElementById('filePicker').files[0];
799 // var image = BASE_URL+'/containers/images/download/' 799 // var image = BASE_URL+'/containers/images/download/'
800 // var imagePath = file.name; 800 // var imagePath = file.name;
801 // $scope.data.uploadFile = image + imagePath; 801 // $scope.data.uploadFile = image + imagePath;
802 // var fd = new FormData() 802 // var fd = new FormData()
803 // fd.append('filePicker',file); 803 // fd.append('filePicker',file);
804 // var deferred = $q.defer(); 804 // var deferred = $q.defer();
805 // $http({ 805 // $http({
806 // method:'POST', 806 // method:'POST',
807 // url: BASE_URL+'/containers/images/upload', 807 // url: BASE_URL+'/containers/images/upload',
808 // data:fd, 808 // data:fd,
809 // transformRequest:angular.identity, 809 // transformRequest:angular.identity,
810 // headers:{'Content-Type':undefined} 810 // headers:{'Content-Type':undefined}
811 // }) 811 // })
812 // .success(function(result){ 812 // .success(function(result){
813 // deferred.resolve(result); 813 // deferred.resolve(result);
814 // $http({ 814 // $http({
815 // method: 'POST', 815 // method: 'POST',
816 // url: BASE_URL+'/applicants', 816 // url: BASE_URL+'/applicants',
817 // data: $scope.data, 817 // data: $scope.data,
818 // headers: {} 818 // headers: {}
819 // }).then(function mySuccess(result) { 819 // }).then(function mySuccess(result) {
820 // $scope.detail = result; 820 // $scope.detail = result;
821 // data.applicantId = result.data.id; 821 // data.applicantId = result.data.id;
822 // $scope.userId = result.data.id; 822 // $scope.userId = result.data.id;
823 // var amount = $scope.ticketAmnt * 100 823 // var amount = $scope.ticketAmnt * 100
824 // if($scope.tokencheck == true){ 824 // if($scope.tokencheck == true){
825 // var amount = $scope.ticketAmnt 825 // var amount = $scope.ticketAmnt
826 // console.log("resultcity===",$scope.data.city) 826 // console.log("resultcity===",$scope.data.city)
827 // if($scope.discountpercentage == "100") { 827 // if($scope.discountpercentage == "100") {
828 // $scope.discountpercentage = "99.9"; 828 // $scope.discountpercentage = "99.9";
829 // } 829 // }
830 // $scope.percDiscount = $scope.discountpercentage/100; 830 // $scope.percDiscount = $scope.discountpercentage/100;
831 // $scope.discountAmount = amount * $scope.percDiscount; 831 // $scope.discountAmount = amount * $scope.percDiscount;
832 // } 832 // }
833 // var taxAmount = $scope.ticketAmnt - $scope.discountAmount 833 // var taxAmount = $scope.ticketAmnt - $scope.discountAmount
834 // $scope.payingAmnt = taxAmount; 834 // $scope.payingAmnt = taxAmount;
835 // $scope.payingAmnt = $scope.payingAmnt.toFixed() 835 // $scope.payingAmnt = $scope.payingAmnt.toFixed()
836 // data.amount = $scope.payingAmnt; 836 // data.amount = $scope.payingAmnt;
837 // if($scope.detail != null){ 837 // if($scope.detail != null){
838 // $http({ 838 // $http({
839 // method: 'POST', 839 // method: 'POST',
840 // url: BASE_URL+'/payments', 840 // url: BASE_URL+'/payments',
841 // data: data, 841 // data: data,
842 // headers: {} 842 // headers: {}
843 // }).then(function mySuccess(paymentResult) { 843 // }).then(function mySuccess(paymentResult) {
844 // $scope.loading = false; 844 // $scope.loading = false;
845 // //$("p").html(paymentResult.data.data) 845 // //$("p").html(paymentResult.data.data)
846 // }, function myError(error) { 846 // }, function myError(error) {
847 // }); 847 // });
848 // } 848 // }
849 // var i = 0; 849 // var i = 0;
850 // $scope.payingAmnt = $scope.payingAmnt * 100; 850 // $scope.payingAmnt = $scope.payingAmnt * 100;
851 // var options = { 851 // var options = {
852 // "key": "rzp_test_YwHsVFiDIQ2WUQ", 852 // "key": "rzp_test_YwHsVFiDIQ2WUQ",
853 // //"key": "rzp_live_mkmCb4FkstuWaS", 853 // //"key": "rzp_live_mkmCb4FkstuWaS",
854 // "amount": $scope.payingAmnt, 854 // "amount": $scope.payingAmnt,
855 855
856 // "name": "Startup Jalsa", 856 // "name": "Startup Jalsa",
857 // "description":"amount", 857 // "description":"amount",
858 // "currency": "INR", 858 // "currency": "INR",
859 // "status": "done", 859 // "status": "done",
860 860
861 // "prefill": { 861 // "prefill": {
862 // "email": $scope.detail.email, 862 // "email": $scope.detail.email,
863 // "contact": $scope.detail.phone 863 // "contact": $scope.detail.phone
864 // }, 864 // },
865 865
866 // "theme": { 866 // "theme": {
867 // "color": "#2196f3 ", 867 // "color": "#2196f3 ",
868 // "image_padding":"NO" 868 // "image_padding":"NO"
869 // }, 869 // },
870 // "modal": { 870 // "modal": {
871 // "ondismiss": function(){ 871 // "ondismiss": function(){
872 // } 872 // }
873 // }, 873 // },
874 // "handler": function (response){ 874 // "handler": function (response){
875 // createPayment(response); 875 // createPayment(response);
876 // } 876 // }
877 // }; 877 // };
878 // var rzp1 = new Razorpay(options); 878 // var rzp1 = new Razorpay(options);
879 // rzp1.open(); 879 // rzp1.open();
880 // $scope.paymentResponse = {}; 880 // $scope.paymentResponse = {};
881 // function createPayment(response){ 881 // function createPayment(response){
882 // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 882 // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
883 // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 883 // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
884 // $scope.paymentResponse.amount = data.amount; 884 // $scope.paymentResponse.amount = data.amount;
885 // $scope.paymentResponse.currency = "INR"; 885 // $scope.paymentResponse.currency = "INR";
886 // $scope.paymentResponse.status = $scope.paymentResult.data.status; 886 // $scope.paymentResponse.status = $scope.paymentResult.data.status;
887 // $http({ 887 // $http({
888 // method: 'PUT', 888 // method: 'PUT',
889 // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 889 // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
890 // data: $scope.paymentResponse, 890 // data: $scope.paymentResponse,
891 // headers: {} 891 // headers: {}
892 // }).then(function mySuccess(searchResult) { 892 // }).then(function mySuccess(searchResult) {
893 // Analytics.trackEvent('register', 'click', 'Registration'); 893 // Analytics.trackEvent('register', 'click', 'Registration');
894 // $location.path("/confirm") 894 // $location.path("/confirm")
895 // }, function myError(error) { 895 // }, function myError(error) {
896 // }); 896 // });
897 // } 897 // }
898 // //} 898 // //}
899 899
900 // }, function myError(error) { 900 // }, function myError(error) {
901 901
902 // }); 902 // });
903 903
904 // }) 904 // })
905 905
906 // // }) 906 // // })
907 907
908 // //} 908 // //}
909 909
910 // } 910 // }
911 // }else{ 911 // }else{
912 $scope.submit = function() { 912 $scope.submit = function() {
913 Analytics.trackEvent('register', 'click', 'Registration'); 913 Analytics.trackEvent('register', 'click', 'Registration');
914 $scope.loading = true; 914 $scope.loading = true;
915 $scope.data.uploadFile = $scope.base64textString; 915 $scope.data.uploadFile = $scope.base64textString;
916 // if($scope.tokencheck == false){ 916 // if($scope.tokencheck == false){
917 // $scope.data.referalToken = null; 917 // $scope.data.referalToken = null;
918 // } 918 // }
919 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 919 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
920 // var x = document.getElementById("snackbar") 920 // var x = document.getElementById("snackbar")
921 // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 921 // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
922 // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 922 // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
923 $scope.infoForm = true; 923 $scope.infoForm = true;
924 $scope.ticketAmnt = 1180; 924 $scope.ticketAmnt = 1180;
925 $scope.detail = {}; 925 $scope.detail = {};
926 $scope.paymentResultt = {}; 926 $scope.paymentResultt = {};
927 $rootScope.applicantResult = {}; 927 $rootScope.applicantResult = {};
928 $scope.data.phone = "+91"+$scope.data.number; 928 $scope.data.phone = "+91"+$scope.data.number;
929 if($scope.data.referalToken == null){ 929 if($scope.data.referalToken == null){
930 $scope.data.referalToken = "NA" 930 $scope.data.referalToken = "NA"
931 } 931 }
932 var file =document.getElementById('filePicker').files[0]; 932 var file =document.getElementById('filePicker').files[0];
933 //console.log("file",filePicker) 933 //console.log("file",filePicker)
934 var image = BASE_URL+'/containers/images/download/' 934 var image = BASE_URL+'/containers/images/download/'
935 var imagePath = file.name; 935 var imagePath = file.name;
936 $scope.data.uploadFile = image + imagePath; 936 $scope.data.uploadFile = image + imagePath;
937 //console.log($scope.data.uploadFile) 937 //console.log($scope.data.uploadFile)
938 var fd = new FormData() 938 var fd = new FormData()
939 fd.append('filePicker',file); 939 fd.append('filePicker',file);
940 var deferred = $q.defer(); 940 var deferred = $q.defer();
941 $http({ 941 $http({
942 method:'POST', 942 method:'POST',
943 url: BASE_URL+'/containers/images/upload', 943 url: BASE_URL+'/containers/images/upload',
944 data:fd, 944 data:fd,
945 transformRequest:angular.identity, 945 transformRequest:angular.identity,
946 headers:{'Content-Type':undefined} 946 headers:{'Content-Type':undefined}
947 }) 947 })
948 .success(function(result){ 948 .success(function(result){
949 deferred.resolve(result); 949 deferred.resolve(result);
950 $http({ 950 $http({
951 method: 'POST', 951 method: 'POST',
952 url: BASE_URL+'/applicants', 952 url: BASE_URL+'/applicants',
953 data: $scope.data, 953 data: $scope.data,
954 headers: {} 954 headers: {}
955 }).then(function mySuccess(result) { 955 }).then(function mySuccess(result) {
956 $scope.detail = result; 956 $scope.detail = result;
957 data.applicantId = result.data.id; 957 data.applicantId = result.data.id;
958 $scope.userId = result.data.id; 958 $scope.userId = result.data.id;
959 var amount = $scope.ticketAmnt * 100 959 var amount = $scope.ticketAmnt * 100
960 if($scope.tokencheck == true){ 960 if($scope.tokencheck == true){
961 var amount = $scope.ticketAmnt 961 var amount = $scope.ticketAmnt
962 if($scope.discountpercentage == "100") { 962 if($scope.discountpercentage == "100") {
963 $scope.discountpercentage = "99.9"; 963 $scope.discountpercentage = "99.9";
964 } 964 }
965 $scope.percDiscount = $scope.discountpercentage/100; 965 $scope.percDiscount = $scope.discountpercentage/100;
966 $scope.discountAmount = amount * $scope.percDiscount; 966 $scope.discountAmount = amount * $scope.percDiscount;
967 } 967 }
968 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 968 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
969 $scope.payingAmnt = taxAmount; 969 $scope.payingAmnt = taxAmount;
970 $scope.payingAmnt = $scope.payingAmnt.toFixed() 970 $scope.payingAmnt = $scope.payingAmnt.toFixed()
971 data.amount = $scope.payingAmnt; 971 data.amount = $scope.payingAmnt;
972 if($scope.detail != null){ 972 if($scope.detail != null){
973 $http({ 973 $http({
974 method: 'POST', 974 method: 'POST',
975 url: BASE_URL+'/payments', 975 url: BASE_URL+'/payments',
976 data: data, 976 data: data,
977 headers: {} 977 headers: {}
978 }).then(function mySuccess(paymentResult) { 978 }).then(function mySuccess(paymentResult) {
979 $scope.loading = false; 979 $scope.loading = false;
980 $scope.paymentResult = paymentResult; 980 $scope.paymentResult = paymentResult;
981 //$("p").html(paymentResult.data.data) 981 //$("p").html(paymentResult.data.data)
982 }, function myError(error) { 982 }, function myError(error) {
983 }); 983 });
984 } 984 }
985 var i = 0; 985 var i = 0;
986 $scope.payingAmnt = $scope.payingAmnt * 100; 986 $scope.payingAmnt = $scope.payingAmnt * 100;
987 var options = { 987 var options = {
988 //"key": "rzp_test_YwHsVFiDIQ2WUQ", 988 //"key": "rzp_test_YwHsVFiDIQ2WUQ",
989 "key": "rzp_live_mkmCb4FkstuWaS", 989 "key": "rzp_live_mkmCb4FkstuWaS",
990 "amount": $scope.payingAmnt, 990 "amount": $scope.payingAmnt,
991 991
992 "name": "Startup Jalsa", 992 "name": "Startup Jalsa",
993 "description":"amount", 993 "description":"amount",
994 "currency": "INR", 994 "currency": "INR",
995 "status": "done", 995 "status": "done",
996 996
997 "prefill": { 997 "prefill": {
998 "email": $scope.detail.email, 998 "email": $scope.detail.email,
999 "contact": $scope.detail.phone 999 "contact": $scope.detail.phone
1000 }, 1000 },
1001 1001
1002 "theme": { 1002 "theme": {
1003 "color": "#2196f3 ", 1003 "color": "#2196f3 ",
1004 "image_padding":"NO" 1004 "image_padding":"NO"
1005 }, 1005 },
1006 "modal": { 1006 "modal": {
1007 "ondismiss": function(){ 1007 "ondismiss": function(){
1008 } 1008 }
1009 }, 1009 },
1010 "handler": function (response){ 1010 "handler": function (response){
1011 createPayment(response); 1011 createPayment(response);
1012 } 1012 }
1013 }; 1013 };
1014 var rzp1 = new Razorpay(options); 1014 var rzp1 = new Razorpay(options);
1015 rzp1.open(); 1015 rzp1.open();
1016 $scope.paymentResponse = {}; 1016 $scope.paymentResponse = {};
1017 function createPayment(response){ 1017 function createPayment(response){
1018 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 1018 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
1019 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 1019 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
1020 $scope.paymentResponse.amount = data.amount; 1020 $scope.paymentResponse.amount = data.amount;
1021 $scope.paymentResponse.currency = "INR"; 1021 $scope.paymentResponse.currency = "INR";
1022 $scope.paymentResponse.status = $scope.paymentResult.data.status; 1022 $scope.paymentResponse.status = $scope.paymentResult.data.status;
1023 $http({ 1023 $http({
1024 method: 'PUT', 1024 method: 'PUT',
1025 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 1025 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
1026 data: $scope.paymentResponse, 1026 data: $scope.paymentResponse,
1027 headers: {} 1027 headers: {}
1028 }).then(function mySuccess(searchResult) { 1028 }).then(function mySuccess(searchResult) {
1029 console.log("searchResult",searchResult) 1029 console.log("searchResult",searchResult)
1030 //$location.path("/confirm") 1030 //$location.path("/confirm")
1031 $rootScope.paymentResultt = searchResult.data; 1031 $rootScope.paymentResultt = searchResult.data;
1032 $http({ 1032 $http({
1033 method: 'GET', 1033 method: 'GET',
1034 url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId, 1034 url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId,
1035 data: $scope.data, 1035 data: $scope.data,
1036 headers: {} 1036 headers: {}
1037 }).then(function mySuccess(result) { 1037 }).then(function mySuccess(result) {
1038 //console.log("result2323324434",result) 1038 //console.log("result2323324434",result)
1039 $rootScope.applicantResult = result.data; 1039 $rootScope.applicantResult = result.data;
1040 if (result.data.city == "Chennai") { 1040 if (result.data.city == "Chennai") {
1041 $rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113", 1041 $rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113",
1042 $rootScope.applicantResult.date= "October 1st, 2019", 1042 $rootScope.applicantResult.date= "October 1st, 2019",
1043 $rootScope.applicantResult.time= "3 PM" 1043 $rootScope.applicantResult.time= "3 PM"
1044 1044
1045 } else if (result.data.city == "Hyderabad") { 1045 } else if (result.data.city == "Hyderabad") {
1046 $rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285", 1046 $rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285",
1047 $rootScope.applicantResult.date= "September 14th, 2019", 1047 $rootScope.applicantResult.date= "September 14th, 2019",
1048 $rootScope.applicantResult.time= "3 PM" 1048 $rootScope.applicantResult.time= "3 PM"
1049 1049
1050 } else if (result.data.city == "Mumbai") { 1050 } else if (result.data.city == "Mumbai") {
1051 $rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076", 1051 $rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076",
1052 $rootScope.applicantResult.date= "September 4th, 2019", 1052 $rootScope.applicantResult.date= "September 4th, 2019",
1053 $rootScope.applicantResult.time= "3 PM" 1053 $rootScope.applicantResult.time= "3 PM"
1054 1054
1055 } else if (result.data.city == "Ahmedabad") { 1055 } else if (result.data.city == "Ahmedabad") {
1056 $rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015", 1056 $rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015",
1057 $rootScope.applicantResult.date= "September 11th, 2019", 1057 $rootScope.applicantResult.date= "September 11th, 2019",
1058 $rootScope.applicantResult.time= "3 PM" 1058 $rootScope.applicantResult.time= "3 PM"
1059 1059
1060 } else if (result.data.city == "Jaipur") { 1060 } else if (result.data.city == "Jaipur") {
1061 $rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur", 1061 $rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur",
1062 $rootScope.applicantResult.date= "September 24th, 2019", 1062 $rootScope.applicantResult.date= "September 24th, 2019",
1063 $rootScope.applicantResult.time= "3 PM" 1063 $rootScope.applicantResult.time= "3 PM"
1064 1064
1065 } else if (result.data.city == "Kolkata") { 1065 } else if (result.data.city == "Kolkata") {
1066 $rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)", 1066 $rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)",
1067 $rootScope.applicantResult.time= "3 PM", 1067 $rootScope.applicantResult.time= "3 PM",
1068 $rootScope.applicantResult.date= "September 17th, 2019" 1068 $rootScope.applicantResult.date= "September 17th, 2019"
1069 1069
1070 } else if (result.data.city == "Bengaluru") { 1070 } else if (result.data.city == "Bengaluru") {
1071 $rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076", 1071 $rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076",
1072 $rootScope.applicantResult.time= "3 PM", 1072 $rootScope.applicantResult.time= "3 PM",
1073 $rootScope.applicantResult.date= "September 7th, 2019" 1073 $rootScope.applicantResult.date= "September 7th, 2019"
1074 1074
1075 } else if (result.data.city == "Delhi") { 1075 } else if (result.data.city == "Delhi") {
1076 $rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016", 1076 $rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016",
1077 $rootScope.applicantResult.time= "12 PM", 1077 $rootScope.applicantResult.time= "12 PM",
1078 $rootScope.applicantResult.date= "October 16th, 2019" 1078 $rootScope.applicantResult.date= "October 16th, 2019"
1079 1079
1080 } else if (result.data.city == "Kanpur"){ 1080 } else if (result.data.city == "Kanpur"){
1081 $rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016", 1081 $rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016",
1082 $rootScope.applicantResult.time= "3 PM", 1082 $rootScope.applicantResult.time= "3 PM",
1083 $rootScope.applicantResult.date= "September 28th, 2019" 1083 $rootScope.applicantResult.date= "September 28th, 2019"
1084 1084
1085 }else if (result.data.city == "Colombo") { 1085 }else if (result.data.city == "Colombo") {
1086 $rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka", 1086 $rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka",
1087 $rootScope.applicantResult.time= "3 PM", 1087 $rootScope.applicantResult.time= "3 PM",
1088 $rootScope.applicantResult.date= "October 5th, 2019" 1088 $rootScope.applicantResult.date= "October 5th, 2019"
1089 1089
1090 } else if (result.data.city == "Dhaka") { 1090 } else if (result.data.city == "Dhaka") {
1091 $rootScope.applicantResult.location= "The Business Center, The Inspiration Hall Level 2, Lift number-2, Celebration Point, Plot: 3 & 5 (Beside Shahabuddin Medical College) Road: 113/A, Gulshan-2, Dhaka-1212", 1091 $rootScope.applicantResult.location= "The Business Center, The Inspiration Hall Level 2, Lift number-2, Celebration Point, Plot: 3 & 5 (Beside Shahabuddin Medical College) Road: 113/A, Gulshan-2, Dhaka-1212",
1092 $rootScope.applicantResult.date= "September 21st, 2019", 1092 $rootScope.applicantResult.date= "September 21st, 2019",
1093 $rootScope.applicantResult.time= "3 PM" 1093 $rootScope.applicantResult.time= "3 PM"
1094 1094
1095 } else { 1095 } else {
1096 $rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445", 1096 $rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445",
1097 $rootScope.applicantResult.time= "3 PM", 1097 $rootScope.applicantResult.time= "3 PM",
1098 $rootScope.applicantResult.date= "October 12th, 2019" 1098 $rootScope.applicantResult.date= "October 12th, 2019"
1099 } 1099 }
1100 Analytics.trackEvent('success', 'click', 'Registration'); 1100 Analytics.trackEvent('success', 'click', 'Registration');
1101 $location.path("/confirm") 1101 $location.path("/confirm")
1102 }) 1102 })
1103 }, function myError(error) { 1103 }, function myError(error) {
1104 }); 1104 });
1105 } 1105 }
1106 //} 1106 //}
1107 1107
1108 }, function myError(error) { 1108 }, function myError(error) {
1109 1109
1110 }); 1110 });
1111 1111
1112 }) 1112 })
1113 1113
1114 // }) 1114 // })
1115 1115
1116 //} 1116 //}
1117 1117
1118 } 1118 }
1119 //} 1119 //}
1120 1120
1121 }); 1121 });
1122 1122
1123 scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) { 1123 scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) {
1124 $scope.approvedMsg = false; 1124 $scope.approvedMsg = false;
1125 $scope.disApprovedMsg = false; 1125 $scope.disApprovedMsg = false;
1126 1126
1127 var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] 1127 var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0]
1128 // if(myParam){ 1128 // if(myParam){
1129 if(myParam == "approved"){ 1129 if(myParam == "approved"){
1130 $scope.approvedMsg = true; 1130 $scope.approvedMsg = true;
1131 $scope.disApprovedMsg = false; 1131 $scope.disApprovedMsg = false;
1132 }else{ 1132 }else{
1133 $scope.approvedMsg = false; 1133 $scope.approvedMsg = false;
1134 $scope.disApprovedMsg = true; 1134 $scope.disApprovedMsg = true;
1135 } 1135 }
1136 // }else{ 1136 // }else{
1137 // $scope.disApprovedMsg = true; 1137 // $scope.disApprovedMsg = true;
1138 // } 1138 // }
1139 1139
1140 }); 1140 });
1141 1141
1142 scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL) { 1142 scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL) {
1143 $scope.data = {}; 1143 $scope.data = {};
1144 $scope.data.city = localStorage.getItem("city"); 1144 $scope.data.city = localStorage.getItem("city");
1145 $scope.data.country = localStorage.getItem("country");; 1145 $scope.data.country = localStorage.getItem("country");;
1146 var data = { 1146 var data = {
1147 "amount": $scope.payingAmnt, 1147 "amount": $scope.payingAmnt,
1148 "currency": "INR", 1148 "currency": "INR",
1149 "status": "pending", 1149 "status": "pending",
1150 "paymentType": "Manual_Paytm" 1150 "paymentType": "Manual_Paytm"
1151 } 1151 }
1152 var handleFileSelect = function(evt) { 1152 var handleFileSelect = function(evt) {
1153 var files = evt.target.files; 1153 var files = evt.target.files;
1154 var file = files[0]; 1154 var file = files[0];
1155 1155
1156 if (files && file) { 1156 if (files && file) {
1157 var reader = new FileReader(); 1157 var reader = new FileReader();
1158 1158
1159 reader.onload = function(readerEvt) { 1159 reader.onload = function(readerEvt) {
1160 var binaryString = readerEvt.target.result; 1160 var binaryString = readerEvt.target.result;
1161 $scope.base64textString = btoa(binaryString); 1161 $scope.base64textString = btoa(binaryString);
1162 //console.log("base64textarea",$scope.base64textString) 1162 //console.log("base64textarea",$scope.base64textString)
1163 //$scope.data.uploadFile = file.name; 1163 //$scope.data.uploadFile = file.name;
1164 $scope.fileSelect = false; 1164 $scope.fileSelect = false;
1165 if($scope.data.uploadFile == null){ 1165 if($scope.data.uploadFile == null){
1166 $scope.fileSelect = true; 1166 $scope.fileSelect = true;
1167 }else{ 1167 }else{
1168 $scope.fileSelect = false; 1168 $scope.fileSelect = false;
1169 }; 1169 };
1170 } 1170 }
1171 1171
1172 reader.readAsBinaryString(file); 1172 reader.readAsBinaryString(file);
1173 } 1173 }
1174 }; 1174 };
1175 if (window.File && window.FileReader && window.FileList && window.Blob) { 1175 if (window.File && window.FileReader && window.FileList && window.Blob) {
1176 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); 1176 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
1177 } 1177 }
1178 1178
1179 $scope.ngShowhide = false; 1179 $scope.ngShowhide = false;
1180 $scope.GetValue = function(){ 1180 $scope.GetValue = function(){
1181 if($scope.data.sector == "Other"){ 1181 if($scope.data.sector == "Other"){
1182 $scope.ngShowhide = true; 1182 $scope.ngShowhide = true;
1183 }else{ 1183 }else{
1184 $scope.ngShowhide = false; 1184 $scope.ngShowhide = false;
1185 } 1185 }
1186 } 1186 }
1187 1187
1188 $rootScope.tokenCall = function(val) { 1188 $rootScope.tokenCall = function(val) {
1189 if (val == undefined) { 1189 if (val == undefined) {
1190 $('#invalidToken').css('display', 'block'); 1190 $('#invalidToken').css('display', 'block');
1191 } else { 1191 } else {
1192 val = val.toUpperCase(); 1192 val = val.toUpperCase();
1193 if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ 1193 if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){
1194 $scope.tokencheck = false; 1194 $scope.tokencheck = false;
1195 return; 1195 return;
1196 } 1196 }
1197 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') 1197 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
1198 .then(function(searchResult) { 1198 .then(function(searchResult) {
1199 if (searchResult.data.length == 0) { 1199 if (searchResult.data.length == 0) {
1200 $scope.tokencheck = false; 1200 $scope.tokencheck = false;
1201 $scope.discountAmount = 0; 1201 $scope.discountAmount = 0;
1202 } else { 1202 } else {
1203 $scope.discountpercentage = searchResult.data[0].discount; 1203 $scope.discountpercentage = searchResult.data[0].discount;
1204 $scope.tokencheck = true; 1204 $scope.tokencheck = true;
1205 } 1205 }
1206 },function(err){ 1206 },function(err){
1207 console.log(err) 1207 console.log(err)
1208 }); 1208 });
1209 1209
1210 } 1210 }
1211 }; 1211 };
1212 1212
1213 $scope.submit = function() { 1213 $scope.submit = function() {
1214 // Analytics.trackEvent('register', 'click', 'Registration'); 1214 // Analytics.trackEvent('register', 'click', 'Registration');
1215 $scope.loading = true; 1215 $scope.loading = true;
1216 $scope.data.uploadFile = $scope.base64textString; 1216 $scope.data.uploadFile = $scope.base64textString;
1217 $scope.infoForm = true; 1217 $scope.infoForm = true;
1218 $scope.ticketAmnt = 1180; 1218 $scope.ticketAmnt = 1180;
1219 $scope.detail = {}; 1219 $scope.detail = {};
1220 $scope.data.phone = "+91"+$scope.data.number; 1220 $scope.data.phone = "+91"+$scope.data.number;
1221 if($scope.data.referalToken == null){ 1221 if($scope.data.referalToken == null){
1222 $scope.data.referalToken = "NA" 1222 $scope.data.referalToken = "NA"
1223 } 1223 }
1224 var file =document.getElementById('filePicker').files[0]; 1224 var file =document.getElementById('filePicker').files[0];
1225 var image = BASE_URL+'/containers/images/download/' 1225 var image = BASE_URL+'/containers/images/download/'
1226 var imagePath = file.name; 1226 var imagePath = file.name;
1227 $scope.data.uploadFile = image + imagePath; 1227 $scope.data.uploadFile = image + imagePath;
1228 var fd = new FormData() 1228 var fd = new FormData()
1229 fd.append('filePicker',file); 1229 fd.append('filePicker',file);
1230 var deferred = $q.defer(); 1230 var deferred = $q.defer();
1231 $http({ 1231 $http({
1232 method:'POST', 1232 method:'POST',
1233 url: BASE_URL+'/containers/images/upload', 1233 url: BASE_URL+'/containers/images/upload',
1234 data:fd, 1234 data:fd,
1235 transformRequest:angular.identity, 1235 transformRequest:angular.identity,
1236 headers:{'Content-Type':undefined} 1236 headers:{'Content-Type':undefined}
1237 }) 1237 })
1238 .success(function(result){ 1238 .success(function(result){
1239 deferred.resolve(result); 1239 deferred.resolve(result);
1240 $http({ 1240 $http({
1241 method: 'POST', 1241 method: 'POST',
1242 url: BASE_URL+'/applicants', 1242 url: BASE_URL+'/applicants',
1243 data: $scope.data, 1243 data: $scope.data,
1244 headers: {} 1244 headers: {}
1245 }).then(function mySuccess(result) { 1245 }).then(function mySuccess(result) {
1246 $scope.detail = result; 1246 $scope.detail = result;
1247 data.applicantId = result.data.id; 1247 data.applicantId = result.data.id;
1248 $scope.userId = result.data.id; 1248 $scope.userId = result.data.id;
1249 var amount = $scope.ticketAmnt * 100 1249 var amount = $scope.ticketAmnt * 100
1250 if($scope.tokencheck == true){ 1250 if($scope.tokencheck == true){
1251 var amount = $scope.ticketAmnt 1251 var amount = $scope.ticketAmnt
1252 console.log("resultcity===",$scope.data.city) 1252 console.log("resultcity===",$scope.data.city)
1253 if($scope.discountpercentage == "100") { 1253 if($scope.discountpercentage == "100") {
1254 $scope.discountpercentage = "99.9"; 1254 $scope.discountpercentage = "99.9";
1255 } 1255 }
1256 $scope.percDiscount = $scope.discountpercentage/100; 1256 $scope.percDiscount = $scope.discountpercentage/100;
1257 $scope.discountAmount = amount * $scope.percDiscount; 1257 $scope.discountAmount = amount * $scope.percDiscount;
1258 } 1258 }
1259 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 1259 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
1260 $scope.payingAmnt = taxAmount; 1260 $scope.payingAmnt = taxAmount;
1261 $scope.payingAmnt = $scope.payingAmnt.toFixed() 1261 $scope.payingAmnt = $scope.payingAmnt.toFixed()
1262 data.amount = $scope.payingAmnt; 1262 data.amount = $scope.payingAmnt;
1263 if($scope.detail != null){ 1263 if($scope.detail != null){
1264 $http({ 1264 $http({
1265 method: 'POST', 1265 method: 'POST',
1266 url: BASE_URL+'/payments', 1266 url: BASE_URL+'/payments',
1267 data: data, 1267 data: data,
1268 headers: {} 1268 headers: {}
1269 }).then(function mySuccess(paymentResult) { 1269 }).then(function mySuccess(paymentResult) {
1270 $scope.loading = false; 1270 $scope.loading = false;
1271 $scope.paymentResult = paymentResult; 1271 $scope.paymentResult = paymentResult;
1272 }, function myError(error) { 1272 }, function myError(error) {
1273 }); 1273 });
1274 } 1274 }
1275 1275
1276 }, function myError(error) { 1276 }, function myError(error) {
1277 1277
1278 }); 1278 });
1279 1279
1280 }) 1280 })
1281 1281
1282 } 1282 }
1283 1283
1284 }); 1284 });
1285 1285
1286 1286
1287 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) { 1287 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) {
1288 $scope.data = {}; 1288 $scope.data = {};
1289 $scope.check = false; 1289 $scope.check = false;
1290 $scope.numberCheck = false; 1290 $scope.numberCheck = false;
1291 1291
1292 $scope.submit = function() { 1292 $scope.submit = function() {
1293 //var randomNumber = ""+Math.random(); 1293 //var randomNumber = ""+Math.random();
1294 var nameSpliced = $scope.data.name.slice(0,5); 1294 var nameSpliced = $scope.data.name.slice(0,5);
1295 //var numberSpliced = randomNumber.slice(2,4); 1295 //var numberSpliced = randomNumber.slice(2,4);
1296 //var numberSpliced = "99"; 1296 //var numberSpliced = "99";
1297 $scope.data.referalToken = nameSpliced; 1297 $scope.data.referalToken = nameSpliced;
1298 $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); 1298 $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
1299 $http({ 1299 $http({
1300 method: 'POST', 1300 method: 'POST',
1301 url: BASE_URL + '/ambassadors', 1301 url: BASE_URL + '/ambassadors',
1302 data: $scope.data, 1302 data: $scope.data,
1303 headers: {} 1303 headers: {}
1304 }).then(function mySuccess(result) { 1304 }).then(function mySuccess(result) {
1305 $scope.detail = result; 1305 $scope.detail = result;
1306 $('#myModal').modal('show'); 1306 $('#myModal').modal('show');
1307 $scope.data.name = ''; 1307 $scope.data.name = '';
1308 $scope.data.email = ''; 1308 $scope.data.email = '';
1309 $scope.data.mobile = ''; 1309 $scope.data.mobile = '';
1310 //$scope.data.discount = ''; 1310 //$scope.data.discount = '';
1311 1311
1312 }, function myError(error) { 1312 }, function myError(error) {
1313 console.log(error) 1313 console.log(error)
1314 console.log(error.data.error.message) 1314 console.log(error.data.error.message)
1315 }); 1315 });
1316 } 1316 }
1317 }); 1317 });
1318 1318
1319 1319
1320 1320
1321 1321
1322 1322