Commit 1725e9c33686306d68f6df74d05058e1d6260d42

Authored by Shilpi Saini
1 parent 51b1054e53
Exists in master

coupon code generated

Showing 1 changed file with 4 additions and 4 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 registration page 26 // route for the registration page
27 .when('/registration', { 27 .when('/registration', {
28 templateUrl: 'pages/registration.html', 28 templateUrl: 'pages/registration.html',
29 controller: 'registrationController' 29 controller: 'registrationController'
30 }) 30 })
31 31
32 // route for the registration page 32 // route for the registration page
33 .when('/registrationForm', { 33 .when('/registrationForm', {
34 templateUrl: 'pages/registrationForm.html', 34 templateUrl: 'pages/registrationForm.html',
35 controller: 'registrationFormController' 35 controller: 'registrationFormController'
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 campusAmbassador page 44 //route for the campusAmbassador page
45 .when('/campusAmbassador', { 45 .when('/campusAmbassador', {
46 templateUrl: 'pages/campusAmbassador.html', 46 templateUrl: 'pages/campusAmbassador.html',
47 controller: 'mainController' 47 controller: 'mainController'
48 }) 48 })
49 49
50 //route for the campusAmbassador page 50 //route for the campusAmbassador page
51 .when('/campusAmbassadorForm', { 51 .when('/campusAmbassadorForm', {
52 templateUrl: 'pages/campusAmbassadorForm.html', 52 templateUrl: 'pages/campusAmbassadorForm.html',
53 controller: 'campusAmbassadorController' 53 controller: 'campusAmbassadorController'
54 }) 54 })
55 55
56 // route for the confirmation page 56 // route for the confirmation page
57 // .when('/confirmation', { 57 // .when('/confirmation', {
58 // templateUrl: 'pages/confirmation.html', 58 // templateUrl: 'pages/confirmation.html',
59 // controller: 'confirmationController' 59 // controller: 'confirmationController'
60 // }) 60 // })
61 61
62 // route for the confirmation page 62 // route for the confirmation page
63 .when('/confirmation', { 63 .when('/confirmation', {
64 templateUrl: 'pages/campusAmbassadorConfirm.html', 64 templateUrl: 'pages/campusAmbassadorConfirm.html',
65 controller: 'confirmationController' 65 controller: 'confirmationController'
66 }) 66 })
67 67
68 // route for the confirmation page 68 // route for the confirmation page
69 .when('/confirm', { 69 .when('/confirm', {
70 templateUrl: 'pages/confirm.html', 70 templateUrl: 'pages/confirm.html',
71 controller: 'confirmationController' 71 controller: 'confirmationController'
72 }) 72 })
73 73
74 // route for the paytm page 74 // route for the paytm page
75 .when('/paytm', { 75 .when('/paytm', {
76 templateUrl: 'pages/paytm.html', 76 templateUrl: 'pages/paytm.html',
77 controller: 'mainController' 77 controller: 'mainController'
78 }) 78 })
79 79
80 // route for the paytm page 80 // route for the paytm page
81 .when('/paytm/caricatures', { 81 .when('/paytm/caricatures', {
82 templateUrl: 'pages/paytmCaricatures.html', 82 templateUrl: 'pages/paytmCaricatures.html',
83 controller: 'mainController' 83 controller: 'mainController'
84 }) 84 })
85 85
86 // route for the paytm page 86 // route for the paytm page
87 .when('/paytm/checkout', { 87 .when('/paytm/checkout', {
88 templateUrl: 'pages/paytmCheckout.html', 88 templateUrl: 'pages/paytmCheckout.html',
89 controller: 'paytmController' 89 controller: 'paytmController'
90 }) 90 })
91 91
92 // route for the confirmation page 92 // route for the confirmation page
93 .when('/paytm/confirm', { 93 .when('/paytm/confirm', {
94 templateUrl: 'pages/confirmed.html', 94 templateUrl: 'pages/confirmed.html',
95 controller: 'paytmController' 95 controller: 'paytmController'
96 }) 96 })
97 97
98 .otherwise({ 98 .otherwise({
99 redirectTo: '/' 99 redirectTo: '/'
100 }); 100 });
101 101
102 }); 102 });
103 103
104 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { 104 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
105 // Add configuration code as desired 105 // Add configuration code as desired
106 AnalyticsProvider.setAccount('UA-123583154-1'); //UU-XXXXXXX-X should be your tracking code 106 AnalyticsProvider.setAccount('UA-123583154-1'); //UU-XXXXXXX-X should be your tracking code
107 107
108 // Track all routes (default is true). 108 // Track all routes (default is true).
109 AnalyticsProvider.trackPages(true); 109 AnalyticsProvider.trackPages(true);
110 110
111 // Track all URL query params (default is false). 111 // Track all URL query params (default is false).
112 AnalyticsProvider.trackUrlParams(true); 112 AnalyticsProvider.trackUrlParams(true);
113 113
114 }]).run(['Analytics', function(Analytics) { }]); 114 }]).run(['Analytics', function(Analytics) { }]);
115 115
116 scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1") 116 scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1")
117 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") 117 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1")
118 118
119 scotchApp.directive('validFile',function(){ 119 scotchApp.directive('validFile',function(){
120 return { 120 return {
121 require:'ngModel', 121 require:'ngModel',
122 link:function(scope,el,attrs,ngModel){ 122 link:function(scope,el,attrs,ngModel){
123 //change event is fired when file is selected 123 //change event is fired when file is selected
124 el.bind('change',function(){ 124 el.bind('change',function(){
125 scope.$apply(function(){ 125 scope.$apply(function(){
126 ngModel.$setViewValue(el.val()); 126 ngModel.$setViewValue(el.val());
127 ngModel.$render(); 127 ngModel.$render();
128 }) 128 })
129 }) 129 })
130 } 130 }
131 } 131 }
132 }) 132 })
133 133
134 // create the controller and inject Angular's $scope 134 // create the controller and inject Angular's $scope
135 scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) { 135 scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) {
136 $scope.data = { 136 $scope.data = {
137 show: true, 137 show: true,
138 hide: false 138 hide: false
139 }; 139 };
140 jQuery('#defaultcountry').addClass('btn-active') 140 jQuery('#defaultcountry').addClass('btn-active')
141 // window.onload = function(){ 141 // window.onload = function(){
142 // // var element = document.getElementById("defaultcountry"); 142 // // var element = document.getElementById("defaultcountry");
143 // // element.classList.add("btn-active"); 143 // // element.classList.add("btn-active");
144 // jQuery('#defaultcountry').addClass('btn-active') 144 // jQuery('#defaultcountry').addClass('btn-active')
145 // //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png"; 145 // //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png";
146 // } 146 // }
147 147
148 var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); 148 var chennai = new Date("Sept 19, 2018 12:00:00").getTime();
149 // Update the count down every 1 second 149 // Update the count down every 1 second
150 var x = setInterval(function() { 150 var x = setInterval(function() {
151 // Get todays date and time 151 // Get todays date and time
152 var now = new Date().getTime(); 152 var now = new Date().getTime();
153 // Find the distance between now an the count down date 153 // Find the distance between now an the count down date
154 var distance = chennai - now; 154 var distance = chennai - now;
155 // Time calculations for days, hours, minutes and seconds 155 // Time calculations for days, hours, minutes and seconds
156 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 156 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
157 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 157 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
158 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 158 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
159 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 159 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
160 $scope.timer = days + "d " + hours + "h " 160 $scope.timer = days + "d " + hours + "h "
161 + minutes + "m " + seconds + "s " 161 + minutes + "m " + seconds + "s "
162 // Output the result in an element with id="demo" 162 // Output the result in an element with id="demo"
163 document.getElementById("chennai").innerHTML = days + "d " + hours + "h " 163 document.getElementById("chennai").innerHTML = days + "d " + hours + "h "
164 + minutes + "m " + seconds + "s "; 164 + minutes + "m " + seconds + "s ";
165 // If the count down is over, write some text 165 // If the count down is over, write some text
166 if (distance < 0) { 166 if (distance < 0) {
167 clearInterval(x); 167 clearInterval(x);
168 document.getElementById("chennai").innerHTML = "EXPIRED"; 168 document.getElementById("chennai").innerHTML = "EXPIRED";
169 } 169 }
170 }, 1000); 170 }, 1000);
171 171
172 var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime(); 172 var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime();
173 // Update the count down every 1 second 173 // Update the count down every 1 second
174 var x = setInterval(function() { 174 var x = setInterval(function() {
175 // Get todays date and time 175 // Get todays date and time
176 var now = new Date().getTime(); 176 var now = new Date().getTime();
177 // Find the distance between now an the count down date 177 // Find the distance between now an the count down date
178 var distance = hyderabad - now; 178 var distance = hyderabad - now;
179 // Time calculations for days, hours, minutes and seconds 179 // Time calculations for days, hours, minutes and seconds
180 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 180 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
181 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 181 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
182 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 182 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
183 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 183 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
184 $scope.timer = days + "d " + hours + "h " 184 $scope.timer = days + "d " + hours + "h "
185 + minutes + "m " + seconds + "s " 185 + minutes + "m " + seconds + "s "
186 // Output the result in an element with id="demo" 186 // Output the result in an element with id="demo"
187 document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " 187 document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h "
188 + minutes + "m " + seconds + "s "; 188 + minutes + "m " + seconds + "s ";
189 // If the count down is over, write some text 189 // If the count down is over, write some text
190 if (distance < 0) { 190 if (distance < 0) {
191 clearInterval(x); 191 clearInterval(x);
192 document.getElementById("hyderabad").innerHTML = "EXPIRED"; 192 document.getElementById("hyderabad").innerHTML = "EXPIRED";
193 } 193 }
194 }, 1000); 194 }, 1000);
195 195
196 var mumbai = new Date("Sept 26, 2018 14:00:00").getTime(); 196 var mumbai = new Date("Sept 26, 2018 14:00:00").getTime();
197 // Update the count down every 1 second 197 // Update the count down every 1 second
198 var x = setInterval(function() { 198 var x = setInterval(function() {
199 // Get todays date and time 199 // Get todays date and time
200 var now = new Date().getTime(); 200 var now = new Date().getTime();
201 // Find the distance between now an the count down date 201 // Find the distance between now an the count down date
202 var distance = mumbai - now; 202 var distance = mumbai - now;
203 // Time calculations for days, hours, minutes and seconds 203 // Time calculations for days, hours, minutes and seconds
204 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 204 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
205 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 205 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
206 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 206 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
207 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 207 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
208 $scope.timer = days + "d " + hours + "h " 208 $scope.timer = days + "d " + hours + "h "
209 + minutes + "m " + seconds + "s " 209 + minutes + "m " + seconds + "s "
210 // Output the result in an element with id="demo" 210 // Output the result in an element with id="demo"
211 document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " 211 document.getElementById("mumbai").innerHTML = days + "d " + hours + "h "
212 + minutes + "m " + seconds + "s "; 212 + minutes + "m " + seconds + "s ";
213 // If the count down is over, write some text 213 // If the count down is over, write some text
214 if (distance < 0) { 214 if (distance < 0) {
215 clearInterval(x); 215 clearInterval(x);
216 document.getElementById("mumbai").innerHTML = "EXPIRED"; 216 document.getElementById("mumbai").innerHTML = "EXPIRED";
217 } 217 }
218 }, 1000); 218 }, 1000);
219 219
220 var kolkata = new Date("Oct 3, 2018 14:00:00").getTime(); 220 var kolkata = new Date("Oct 3, 2018 14:00:00").getTime();
221 // Update the count down every 1 second 221 // Update the count down every 1 second
222 var x = setInterval(function() { 222 var x = setInterval(function() {
223 // Get todays date and time 223 // Get todays date and time
224 var now = new Date().getTime(); 224 var now = new Date().getTime();
225 // Find the distance between now an the count down date 225 // Find the distance between now an the count down date
226 var distance = kolkata - now; 226 var distance = kolkata - now;
227 // Time calculations for days, hours, minutes and seconds 227 // Time calculations for days, hours, minutes and seconds
228 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 228 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
229 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 229 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
230 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 230 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
231 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 231 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
232 $scope.timer = days + "d " + hours + "h " 232 $scope.timer = days + "d " + hours + "h "
233 + minutes + "m " + seconds + "s " 233 + minutes + "m " + seconds + "s "
234 // Output the result in an element with id="demo" 234 // Output the result in an element with id="demo"
235 document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " 235 document.getElementById("kolkata").innerHTML = days + "d " + hours + "h "
236 + minutes + "m " + seconds + "s "; 236 + minutes + "m " + seconds + "s ";
237 // If the count down is over, write some text 237 // If the count down is over, write some text
238 if (distance < 0) { 238 if (distance < 0) {
239 clearInterval(x); 239 clearInterval(x);
240 document.getElementById("kolkata").innerHTML = "EXPIRED"; 240 document.getElementById("kolkata").innerHTML = "EXPIRED";
241 } 241 }
242 }, 1000); 242 }, 1000);
243 243
244 var jaipur = new Date("Oct 5, 2018 14:00:00").getTime(); 244 var jaipur = new Date("Oct 5, 2018 14:00:00").getTime();
245 // Update the count down every 1 second 245 // Update the count down every 1 second
246 var x = setInterval(function() { 246 var x = setInterval(function() {
247 // Get todays date and time 247 // Get todays date and time
248 var now = new Date().getTime(); 248 var now = new Date().getTime();
249 // Find the distance between now an the count down date 249 // Find the distance between now an the count down date
250 var distance = jaipur - now; 250 var distance = jaipur - now;
251 // Time calculations for days, hours, minutes and seconds 251 // Time calculations for days, hours, minutes and seconds
252 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 252 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
253 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 253 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
254 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 254 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
255 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 255 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
256 $scope.timer = days + "d " + hours + "h " 256 $scope.timer = days + "d " + hours + "h "
257 + minutes + "m " + seconds + "s " 257 + minutes + "m " + seconds + "s "
258 // Output the result in an element with id="demo" 258 // Output the result in an element with id="demo"
259 document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " 259 document.getElementById("jaipur").innerHTML = days + "d " + hours + "h "
260 + minutes + "m " + seconds + "s "; 260 + minutes + "m " + seconds + "s ";
261 // If the count down is over, write some text 261 // If the count down is over, write some text
262 if (distance < 0) { 262 if (distance < 0) {
263 clearInterval(x); 263 clearInterval(x);
264 document.getElementById("jaipur").innerHTML = "EXPIRED"; 264 document.getElementById("jaipur").innerHTML = "EXPIRED";
265 } 265 }
266 }, 1000); 266 }, 1000);
267 267
268 var delhi = new Date("Oct 8, 2018 14:00:00").getTime(); 268 var delhi = new Date("Oct 8, 2018 14:00:00").getTime();
269 // Update the count down every 1 second 269 // Update the count down every 1 second
270 var x = setInterval(function() { 270 var x = setInterval(function() {
271 // Get todays date and time 271 // Get todays date and time
272 var now = new Date().getTime(); 272 var now = new Date().getTime();
273 // Find the distance between now an the count down date 273 // Find the distance between now an the count down date
274 var distance = delhi - now; 274 var distance = delhi - now;
275 // Time calculations for days, hours, minutes and seconds 275 // Time calculations for days, hours, minutes and seconds
276 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 276 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
277 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 277 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
278 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 278 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
279 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 279 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
280 $scope.timer = days + "d " + hours + "h " 280 $scope.timer = days + "d " + hours + "h "
281 + minutes + "m " + seconds + "s " 281 + minutes + "m " + seconds + "s "
282 // Output the result in an element with id="demo" 282 // Output the result in an element with id="demo"
283 document.getElementById("delhi").innerHTML = days + "d " + hours + "h " 283 document.getElementById("delhi").innerHTML = days + "d " + hours + "h "
284 + minutes + "m " + seconds + "s "; 284 + minutes + "m " + seconds + "s ";
285 // If the count down is over, write some text 285 // If the count down is over, write some text
286 if (distance < 0) { 286 if (distance < 0) {
287 clearInterval(x); 287 clearInterval(x);
288 document.getElementById("delhi").innerHTML = "EXPIRED"; 288 document.getElementById("delhi").innerHTML = "EXPIRED";
289 } 289 }
290 }, 1000); 290 }, 1000);
291 291
292 var kanpur = new Date("Oct 10, 2018 14:00:00").getTime(); 292 var kanpur = new Date("Oct 10, 2018 14:00:00").getTime();
293 // Update the count down every 1 second 293 // Update the count down every 1 second
294 var x = setInterval(function() { 294 var x = setInterval(function() {
295 // Get todays date and time 295 // Get todays date and time
296 var now = new Date().getTime(); 296 var now = new Date().getTime();
297 // Find the distance between now an the count down date 297 // Find the distance between now an the count down date
298 var distance = kanpur - now; 298 var distance = kanpur - now;
299 // Time calculations for days, hours, minutes and seconds 299 // Time calculations for days, hours, minutes and seconds
300 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 300 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
301 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 301 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
302 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 302 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
303 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 303 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
304 $scope.timer = days + "d " + hours + "h " 304 $scope.timer = days + "d " + hours + "h "
305 + minutes + "m " + seconds + "s " 305 + minutes + "m " + seconds + "s "
306 // Output the result in an element with id="demo" 306 // Output the result in an element with id="demo"
307 document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " 307 document.getElementById("kanpur").innerHTML = days + "d " + hours + "h "
308 + minutes + "m " + seconds + "s "; 308 + minutes + "m " + seconds + "s ";
309 // If the count down is over, write some text 309 // If the count down is over, write some text
310 if (distance < 0) { 310 if (distance < 0) {
311 clearInterval(x); 311 clearInterval(x);
312 document.getElementById("kanpur").innerHTML = "EXPIRED"; 312 document.getElementById("kanpur").innerHTML = "EXPIRED";
313 } 313 }
314 }, 1000); 314 }, 1000);
315 315
316 var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime(); 316 var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime();
317 // Update the count down every 1 second 317 // Update the count down every 1 second
318 var x = setInterval(function() { 318 var x = setInterval(function() {
319 // Get todays date and time 319 // Get todays date and time
320 var now = new Date().getTime(); 320 var now = new Date().getTime();
321 // Find the distance between now an the count down date 321 // Find the distance between now an the count down date
322 var distance = ahmedabad - now; 322 var distance = ahmedabad - now;
323 // Time calculations for days, hours, minutes and seconds 323 // Time calculations for days, hours, minutes and seconds
324 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 324 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
325 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 325 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
326 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 326 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
327 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 327 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
328 $scope.timer = days + "d " + hours + "h " 328 $scope.timer = days + "d " + hours + "h "
329 + minutes + "m " + seconds + "s " 329 + minutes + "m " + seconds + "s "
330 // Output the result in an element with id="demo" 330 // Output the result in an element with id="demo"
331 document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " 331 document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h "
332 + minutes + "m " + seconds + "s "; 332 + minutes + "m " + seconds + "s ";
333 // If the count down is over, write some text 333 // If the count down is over, write some text
334 if (distance < 0) { 334 if (distance < 0) {
335 clearInterval(x); 335 clearInterval(x);
336 document.getElementById("ahmedabad").innerHTML = "EXPIRED"; 336 document.getElementById("ahmedabad").innerHTML = "EXPIRED";
337 } 337 }
338 }, 1000); 338 }, 1000);
339 339
340 var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime(); 340 var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime();
341 // Update the count down every 1 second 341 // Update the count down every 1 second
342 var x = setInterval(function() { 342 var x = setInterval(function() {
343 // Get todays date and time 343 // Get todays date and time
344 var now = new Date().getTime(); 344 var now = new Date().getTime();
345 // Find the distance between now an the count down date 345 // Find the distance between now an the count down date
346 var distance = bengaluru - now; 346 var distance = bengaluru - now;
347 // Time calculations for days, hours, minutes and seconds 347 // Time calculations for days, hours, minutes and seconds
348 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 348 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
349 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 349 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
350 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 350 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
351 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 351 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
352 $scope.timer = days + "d " + hours + "h " 352 $scope.timer = days + "d " + hours + "h "
353 + minutes + "m " + seconds + "s " 353 + minutes + "m " + seconds + "s "
354 // Output the result in an element with id="demo" 354 // Output the result in an element with id="demo"
355 document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " 355 document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h "
356 + minutes + "m " + seconds + "s "; 356 + minutes + "m " + seconds + "s ";
357 // If the count down is over, write some text 357 // If the count down is over, write some text
358 if (distance < 0) { 358 if (distance < 0) {
359 clearInterval(x); 359 clearInterval(x);
360 document.getElementById("bengaluru").innerHTML = "EXPIRED"; 360 document.getElementById("bengaluru").innerHTML = "EXPIRED";
361 } 361 }
362 }, 1000); 362 }, 1000);
363 363
364 var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime(); 364 var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime();
365 // Update the count down every 1 second 365 // Update the count down every 1 second
366 var x = setInterval(function() { 366 var x = setInterval(function() {
367 // Get todays date and time 367 // Get todays date and time
368 var now = new Date().getTime(); 368 var now = new Date().getTime();
369 // Find the distance between now an the count down date 369 // Find the distance between now an the count down date
370 var distance = dharamsala - now; 370 var distance = dharamsala - now;
371 // Time calculations for days, hours, minutes and seconds 371 // Time calculations for days, hours, minutes and seconds
372 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 372 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
373 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 373 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
374 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 374 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
375 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 375 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
376 $scope.timer = days + "d " + hours + "h " 376 $scope.timer = days + "d " + hours + "h "
377 + minutes + "m " + seconds + "s " 377 + minutes + "m " + seconds + "s "
378 // Output the result in an element with id="demo" 378 // Output the result in an element with id="demo"
379 document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " 379 document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h "
380 + minutes + "m " + seconds + "s "; 380 + minutes + "m " + seconds + "s ";
381 // If the count down is over, write some text 381 // If the count down is over, write some text
382 if (distance < 0) { 382 if (distance < 0) {
383 clearInterval(x); 383 clearInterval(x);
384 document.getElementById("dharamsala").innerHTML = "EXPIRED"; 384 document.getElementById("dharamsala").innerHTML = "EXPIRED";
385 } 385 }
386 }, 1000); 386 }, 1000);
387 387
388 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 388 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
389 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 389 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
390 // $scope.Textshow = "yes" 390 // $scope.Textshow = "yes"
391 $scope.max = 100; 391 $scope.max = 100;
392 $scope.formPage = false; 392 $scope.formPage = false;
393 $scope.current = 0; 393 $scope.current = 0;
394 $scope.payingAmnt = 0; 394 $scope.payingAmnt = 0;
395 $scope.data = {}; 395 $scope.data = {};
396 $scope.discountAmount = 0; 396 $scope.discountAmount = 0;
397 // $scope.data.quantity = "1"; 397 // $scope.data.quantity = "1";
398 $scope.check = false; 398 $scope.check = false;
399 $scope.numberCheck = false; 399 $scope.numberCheck = false;
400 $scope.paymentResult = {}; 400 $scope.paymentResult = {};
401 var data = { 401 var data = {
402 "amount": $scope.payingAmnt, 402 "amount": $scope.payingAmnt,
403 "currency": "INR", 403 "currency": "INR",
404 "status": "pending" 404 "status": "pending"
405 } 405 }
406 406
407 $scope.showval = true; 407 $scope.showval = true;
408 $scope.hideval = false; 408 $scope.hideval = false;
409 $scope.showvalue = false; 409 $scope.showvalue = false;
410 $scope.hidevalue = false; 410 $scope.hidevalue = false;
411 localStorage.setItem("country",'INDIA'); 411 localStorage.setItem("country",'INDIA');
412 $scope.isShowHide = function (value) { 412 $scope.isShowHide = function (value) {
413 var element = document.getElementById("defaultcountry"); 413 var element = document.getElementById("defaultcountry");
414 element.classList.remove("btn-active"); 414 element.classList.remove("btn-active");
415 localStorage.setItem("country",value); 415 localStorage.setItem("country",value);
416 if (value == "INDIA") { 416 if (value == "INDIA") {
417 console.log("value",value) 417 console.log("value",value)
418 $scope.showval = true; 418 $scope.showval = true;
419 $scope.hideval = false; 419 $scope.hideval = false;
420 $scope.showvalue = false; 420 $scope.showvalue = false;
421 $scope.hidevalue = false; 421 $scope.hidevalue = false;
422 } 422 }
423 else if (value == "SRI LANKA") { 423 else if (value == "SRI LANKA") {
424 console.log("value1",value) 424 console.log("value1",value)
425 $scope.showval = false; 425 $scope.showval = false;
426 $scope.hideval = true; 426 $scope.hideval = true;
427 $scope.showvalue = false; 427 $scope.showvalue = false;
428 $scope.hidevalue = false; 428 $scope.hidevalue = false;
429 } 429 }
430 else if (value == "BANGLADESH") { 430 else if (value == "BANGLADESH") {
431 console.log("value2",value) 431 console.log("value2",value)
432 $scope.showval = false; 432 $scope.showval = false;
433 $scope.hideval = false; 433 $scope.hideval = false;
434 $scope.showvalue = true; 434 $scope.showvalue = true;
435 $scope.hidevalue = false; 435 $scope.hidevalue = false;
436 } 436 }
437 else { 437 else {
438 console.log("value3",value) 438 console.log("value3",value)
439 $scope.showval = false; 439 $scope.showval = false;
440 $scope.hideval = false; 440 $scope.hideval = false;
441 $scope.showvalue = false; 441 $scope.showvalue = false;
442 $scope.hidevalue = true; 442 $scope.hidevalue = true;
443 } 443 }
444 } 444 }
445 445
446 $scope.apply = function() { 446 $scope.apply = function() {
447 $location.path("/caricatures") 447 $location.path("/caricatures")
448 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg"; 448 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg";
449 449
450 } 450 }
451 451
452 $scope.applyRegister = function() { 452 $scope.applyRegister = function() {
453 $location.path("/paytm/caricatures") 453 $location.path("/paytm/caricatures")
454 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; 454 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register";
455 } 455 }
456 456
457 $scope.applyForm = function() { 457 $scope.applyForm = function() {
458 //console.log("palak") 458 //console.log("palak")
459 $location.path("/campusAmbassadorForm") 459 $location.path("/campusAmbassadorForm")
460 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; 460 //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register";
461 } 461 }
462 462
463 $scope.click=function(){ 463 $scope.click=function(){
464 Analytics.trackEvent('whatsapp', 'click', 'Registration'); 464 Analytics.trackEvent('whatsapp', 'click', 'Registration');
465 let redirectUrl = "https://wa.me/919855051678"; 465 let redirectUrl = "https://wa.me/919855051678";
466 window.open(redirectUrl,"_blank") 466 window.open(redirectUrl,"_blank")
467 } 467 }
468 468
469 // $scope.data.city = ''; 469 // $scope.data.city = '';
470 $scope.watch = function(value){ 470 $scope.watch = function(value){
471 //document.getElementById("ahmedabad").src = ""; 471 //document.getElementById("ahmedabad").src = "";
472 // console.log("cllll",value) 472 // console.log("cllll",value)
473 $scope.data.city = value; 473 $scope.data.city = value;
474 // if($scope.data.city == "Chennai"){ 474 // if($scope.data.city == "Chennai"){
475 // console.log("cllll1",value) 475 // console.log("cllll1",value)
476 // $window.location.href = 'http://35.154.24.158:8007'; 476 // $window.location.href = 'http://35.154.24.158:8007';
477 // }else{ 477 // }else{
478 // console.log("cllll2",value) 478 // console.log("cllll2",value)
479 localStorage.setItem("city" ,value); 479 localStorage.setItem("city" ,value);
480 480
481 //$location.path('/registration').search({city: value}); 481 //$location.path('/registration').search({city: value});
482 // $location.path('/registration/'+value+''); 482 // $location.path('/registration/'+value+'');
483 $location.path('/registration'); 483 $location.path('/registration');
484 //$state.go('registration', { 'city': value}) 484 //$state.go('registration', { 'city': value})
485 // } 485 // }
486 } 486 }
487 487
488 $scope.watch1 = function(value){ 488 $scope.watch1 = function(value){
489 //document.getElementById("ahmedabad").src = ""; 489 //document.getElementById("ahmedabad").src = "";
490 // console.log("cllll",value) 490 // console.log("cllll",value)
491 $scope.data.city = value; 491 $scope.data.city = value;
492 // if($scope.data.city == "Chennai"){ 492 // if($scope.data.city == "Chennai"){
493 // console.log("cllll1",value) 493 // console.log("cllll1",value)
494 // $window.location.href = 'http://35.154.24.158:8007'; 494 // $window.location.href = 'http://35.154.24.158:8007';
495 // }else{ 495 // }else{
496 // console.log("cllll2",value) 496 // console.log("cllll2",value)
497 localStorage.setItem("city" ,value); 497 localStorage.setItem("city" ,value);
498 498
499 //$location.path('/registration').search({city: value}); 499 //$location.path('/registration').search({city: value});
500 // $location.path('/registration/'+value+''); 500 // $location.path('/registration/'+value+'');
501 $location.path('/registrationForm'); 501 $location.path('/registrationForm');
502 //$state.go('registration', { 'city': value}) 502 //$state.go('registration', { 'city': value})
503 // } 503 // }
504 } 504 }
505 505
506 506
507 $scope.watchCity = function(value){ 507 $scope.watchCity = function(value){
508 $scope.data.city = value; 508 $scope.data.city = value;
509 localStorage.setItem("city" ,value); 509 localStorage.setItem("city" ,value);
510 $location.path('/paytm/checkout'); 510 $location.path('/paytm/checkout');
511 } 511 }
512 512
513 $scope.select = function(url){ 513 $scope.select = function(url){
514 console.log("cllll") 514 console.log("cllll")
515 window.open(url) 515 window.open(url)
516 } 516 }
517 517
518 $scope.stagekeyPress = function() { 518 $scope.stagekeyPress = function() {
519 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); 519 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
520 } 520 }
521 $scope.sectorkeyPress = function() { 521 $scope.sectorkeyPress = function() {
522 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); 522 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
523 } 523 }
524 524
525 $scope.productLaunchkeyPress = function() { 525 $scope.productLaunchkeyPress = function() {
526 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); 526 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
527 } 527 }
528 528
529 $scope.launchPeriodkeyPress = function() { 529 $scope.launchPeriodkeyPress = function() {
530 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); 530 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
531 } 531 }
532 532
533 $scope.industrykeyPress = function(quantity) { 533 $scope.industrykeyPress = function(quantity) {
534 console.log("fghj",quantity) 534 console.log("fghj",quantity)
535 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); 535 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
536 } 536 }
537 537
538 $scope.industryNamekeyPress = function(firstName) { 538 $scope.industryNamekeyPress = function(firstName) {
539 console.log("lastName==", firstName); 539 console.log("lastName==", firstName);
540 if (firstName == undefined) { 540 if (firstName == undefined) {
541 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 541 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
542 } else { 542 } else {
543 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 543 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
544 } 544 }
545 } 545 }
546 546
547 $scope.amountkeyPress = function() { 547 $scope.amountkeyPress = function() {
548 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); 548 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
549 } 549 }
550 550
551 $scope.firstNamekeyPress = function(name) { 551 $scope.firstNamekeyPress = function(name) {
552 console.log("lastName==", name); 552 console.log("lastName==", name);
553 if (name == undefined) { 553 if (name == undefined) {
554 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); 554 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
555 } else { 555 } else {
556 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); 556 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
557 } 557 }
558 } 558 }
559 559
560 $scope.emailkeyPress = function(email) { 560 $scope.emailkeyPress = function(email) {
561 console.log("email", email); 561 console.log("email", email);
562 if (email == undefined) { 562 if (email == undefined) {
563 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); 563 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
564 } else { 564 } else {
565 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); 565 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
566 } 566 }
567 } 567 }
568 568
569 $scope.phonekeyPress = function(number) { 569 $scope.phonekeyPress = function(number) {
570 console.log("number", number); 570 console.log("number", number);
571 if (number == undefined || number == '') { 571 if (number == undefined || number == '') {
572 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); 572 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
573 } else { 573 } else {
574 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); 574 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
575 } 575 }
576 } 576 }
577 577
578 $scope.citykeyPress = function(city) { 578 $scope.citykeyPress = function(city) {
579 console.log("city", city); 579 console.log("city", city);
580 if (city == undefined) { 580 if (city == undefined) {
581 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); 581 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
582 } else { 582 } else {
583 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); 583 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
584 } 584 }
585 } 585 }
586 586
587 $scope.startupNamekeyPress = function(q) { 587 $scope.startupNamekeyPress = function(q) {
588 if (q == undefined) { 588 if (q == undefined) {
589 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); 589 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
590 } else { 590 } else {
591 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); 591 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
592 } 592 }
593 } 593 }
594 594
595 $scope.linkedInkeyPress = function(technology) { 595 $scope.linkedInkeyPress = function(technology) {
596 if (technology == undefined || technology == '') { 596 if (technology == undefined || technology == '') {
597 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); 597 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
598 } else { 598 } else {
599 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); 599 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
600 } 600 }
601 } 601 }
602 $scope.companykeyPress = function(problem) { 602 $scope.companykeyPress = function(problem) {
603 if (problem == undefined) { 603 if (problem == undefined) {
604 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); 604 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
605 } else { 605 } else {
606 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); 606 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
607 } 607 }
608 } 608 }
609 $scope.productNamekeyPress = function(solution) { 609 $scope.productNamekeyPress = function(solution) {
610 if (solution == undefined) { 610 if (solution == undefined) {
611 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); 611 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
612 } else { 612 } else {
613 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); 613 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
614 } 614 }
615 } 615 }
616 $scope.businesskeyPress = function(business) { 616 $scope.businesskeyPress = function(business) {
617 if (business == undefined) { 617 if (business == undefined) {
618 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); 618 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)');
619 } else { 619 } else {
620 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); 620 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)');
621 } 621 }
622 } 622 }
623 623
624 $scope.websitekeyPress = function(prototype) { 624 $scope.websitekeyPress = function(prototype) {
625 if (prototype == undefined || prototype == '') { 625 if (prototype == undefined || prototype == '') {
626 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); 626 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
627 } else { 627 } else {
628 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); 628 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
629 } 629 }
630 } 630 }
631 631
632 $scope.employeekeyPress = function(market) { 632 $scope.employeekeyPress = function(market) {
633 if (market == undefined || market == '') { 633 if (market == undefined || market == '') {
634 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); 634 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
635 } else { 635 } else {
636 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); 636 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
637 } 637 }
638 } 638 }
639 639
640 $scope.annualkeyPress = function(risk) { 640 $scope.annualkeyPress = function(risk) {
641 if (risk == undefined || risk == '') { 641 if (risk == undefined || risk == '') {
642 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); 642 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
643 } else { 643 } else {
644 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); 644 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
645 } 645 }
646 } 646 }
647 647
648 $scope.revenuekeyPress = function(team) { 648 $scope.revenuekeyPress = function(team) {
649 if (team == undefined) { 649 if (team == undefined) {
650 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); 650 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
651 } else { 651 } else {
652 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); 652 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
653 } 653 }
654 } 654 }
655 655
656 $scope.descriptionkeyPress = function(pitch) { 656 $scope.descriptionkeyPress = function(pitch) {
657 if (pitch == undefined) { 657 if (pitch == undefined) {
658 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); 658 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
659 } else { 659 } else {
660 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); 660 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
661 } 661 }
662 } 662 }
663 663
664 $scope.discountkeyPress = function(discount) { 664 $scope.discountkeyPress = function(discount) {
665 if (discount == undefined) { 665 if (discount == undefined) {
666 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 666 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
667 } else { 667 } else {
668 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 668 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
669 } 669 }
670 } 670 }
671 671
672 $scope.removeNooError = function() { 672 $scope.removeNooError = function() {
673 $('#invalidIdea').css('display', 'block'); 673 $('#invalidIdea').css('display', 'block');
674 $('#noExist').css('display', 'none'); 674 $('#noExist').css('display', 'none');
675 }; 675 };
676 676
677 $scope.ideakeyPress = function(financial) { 677 $scope.ideakeyPress = function(financial) {
678 console.log("financial", financial); 678 console.log("financial", financial);
679 if (financial == undefined) { 679 if (financial == undefined) {
680 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); 680 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
681 } else { 681 } else {
682 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); 682 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
683 } 683 }
684 } 684 }
685 685
686 $scope.fundkeyPress = function(financial) { 686 $scope.fundkeyPress = function(financial) {
687 console.log("financial", financial); 687 console.log("financial", financial);
688 if (financial == undefined) { 688 if (financial == undefined) {
689 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); 689 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
690 } else { 690 } else {
691 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); 691 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
692 } 692 }
693 } 693 }
694 694
695 $scope.changeReferalIconColor = function(referalToken){ 695 $scope.changeReferalIconColor = function(referalToken){
696 if (referalToken == undefined || referalToken == '') { 696 if (referalToken == undefined || referalToken == '') {
697 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); 697 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
698 }else { 698 }else {
699 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); 699 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
700 } 700 }
701 } 701 }
702 702
703 }); 703 });
704 704
705 scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { 705 scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
706 $scope.data = {}; 706 $scope.data = {};
707 $scope.check = false; 707 $scope.check = false;
708 $scope.numberCheck = false; 708 $scope.numberCheck = false;
709 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 709 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
710 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 710 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
711 $scope.max = 100; 711 $scope.max = 100;
712 $scope.formPage = false; 712 $scope.formPage = false;
713 $scope.current = 0; 713 $scope.current = 0;
714 $scope.payingAmnt = 0; 714 $scope.payingAmnt = 0;
715 $scope.discountAmount = 0; 715 $scope.discountAmount = 0;
716 $scope.approvedMsg = false; 716 $scope.approvedMsg = false;
717 $scope.disApprovedMsg = false; 717 $scope.disApprovedMsg = false;
718 718
719 // $scope.data.quantity = "1"; 719 // $scope.data.quantity = "1";
720 $scope.check = false; 720 $scope.check = false;
721 $scope.numberCheck = false; 721 $scope.numberCheck = false;
722 $scope.paymentResult = {}; 722 $scope.paymentResult = {};
723 // var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] 723 // var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0]
724 // if(myParam){ 724 // if(myParam){
725 // if(myParam == "approved"){ 725 // if(myParam == "approved"){
726 // $scope.showResponse = true; 726 // $scope.showResponse = true;
727 // }else{ 727 // }else{
728 // $scope.disApprovedMsg = true; 728 // $scope.disApprovedMsg = true;
729 // } 729 // }
730 // }else{ 730 // }else{
731 // $scope.disApprovedMsg = true; 731 // $scope.disApprovedMsg = true;
732 // } 732 // }
733 733
734 $scope.click=function(){ 734 $scope.click=function(){
735 Analytics.trackEvent('whatsapp', 'click', 'Registration'); 735 Analytics.trackEvent('whatsapp', 'click', 'Registration');
736 let redirectUrl = "https://wa.me/919855051678"; 736 let redirectUrl = "https://wa.me/919855051678";
737 window.open(redirectUrl,"_blank") 737 window.open(redirectUrl,"_blank")
738 } 738 }
739 739
740 $scope.removeError = function() { 740 $scope.removeError = function() {
741 $('#invalidEmail').css('display', 'none'); 741 $('#invalidEmail').css('display', 'none');
742 $('#alreadyExist').css('display', 'none'); 742 $('#alreadyExist').css('display', 'none');
743 }; 743 };
744 744
745 $scope.emailcheck = function(val) { 745 $scope.emailcheck = function(val) {
746 if (val == undefined) { 746 if (val == undefined) {
747 $('#invalidEmail').css('display', 'block'); 747 $('#invalidEmail').css('display', 'block');
748 } else { 748 } else {
749 $('#alreadyExist').css('display', 'block'); 749 $('#alreadyExist').css('display', 'block');
750 } 750 }
751 }; 751 };
752 752
753 $scope.removeNoError = function() { 753 $scope.removeNoError = function() {
754 $('#invalidNumber').css('display', 'none'); 754 $('#invalidNumber').css('display', 'none');
755 $('#alreadyExist').css('display', 'none'); 755 $('#alreadyExist').css('display', 'none');
756 }; 756 };
757 757
758 $scope.numbercheck = function(val) { 758 $scope.numbercheck = function(val) {
759 if (val == undefined) { 759 if (val == undefined) {
760 $('#invalidNumber').css('display', 'block'); 760 $('#invalidNumber').css('display', 'block');
761 } else { 761 } else {
762 $('#alreadyExist').css('display', 'block'); 762 $('#alreadyExist').css('display', 'block');
763 } 763 }
764 }; 764 };
765 765
766 // $scope.$on('city', function (event, value) { 766 // $scope.$on('city', function (event, value) {
767 $scope.data.city = localStorage.getItem("city"); 767 $scope.data.city = localStorage.getItem("city");
768 $scope.data.country = localStorage.getItem("country"); 768 $scope.data.country = localStorage.getItem("country");
769 // }); 769 // });
770 var data = { 770 var data = {
771 "amount": $scope.payingAmnt, 771 "amount": $scope.payingAmnt,
772 "currency": "INR", 772 "currency": "INR",
773 "status": "pending", 773 "status": "pending",
774 "paymentType": $scope.data.country 774 "paymentType": $scope.data.country
775 } 775 }
776 776
777 var handleFileSelect = function(evt) { 777 var handleFileSelect = function(evt) {
778 var files = evt.target.files; 778 var files = evt.target.files;
779 var file = files[0]; 779 var file = files[0];
780 780
781 if (files && file) { 781 if (files && file) {
782 var reader = new FileReader(); 782 var reader = new FileReader();
783 783
784 reader.onload = function(readerEvt) { 784 reader.onload = function(readerEvt) {
785 var binaryString = readerEvt.target.result; 785 var binaryString = readerEvt.target.result;
786 $scope.base64textString = btoa(binaryString); 786 $scope.base64textString = btoa(binaryString);
787 //console.log("base64textarea",$scope.base64textString) 787 //console.log("base64textarea",$scope.base64textString)
788 //$scope.data.uploadFile = file.name; 788 //$scope.data.uploadFile = file.name;
789 $scope.fileSelect = false; 789 $scope.fileSelect = false;
790 if($scope.data.uploadFile == null){ 790 if($scope.data.uploadFile == null){
791 $scope.fileSelect = true; 791 $scope.fileSelect = true;
792 }else{ 792 }else{
793 $scope.fileSelect = false; 793 $scope.fileSelect = false;
794 }; 794 };
795 } 795 }
796 796
797 reader.readAsBinaryString(file); 797 reader.readAsBinaryString(file);
798 } 798 }
799 }; 799 };
800 if (window.File && window.FileReader && window.FileList && window.Blob) { 800 if (window.File && window.FileReader && window.FileList && window.Blob) {
801 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); 801 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
802 } 802 }
803 803
804 $scope.ngShowhide = false; 804 $scope.ngShowhide = false;
805 $scope.GetValue = function(){ 805 $scope.GetValue = function(){
806 if($scope.data.sector == "Other"){ 806 if($scope.data.sector == "Other"){
807 $scope.ngShowhide = true; 807 $scope.ngShowhide = true;
808 }else{ 808 }else{
809 $scope.ngShowhide = false; 809 $scope.ngShowhide = false;
810 } 810 }
811 } 811 }
812 812
813 $scope.ngShow = false; 813 $scope.ngShow = false;
814 $scope.getValue = function(){ 814 $scope.getValue = function(){
815 if($scope.data.hear == "Other"){ 815 if($scope.data.hear == "Other"){
816 $scope.ngShow = true; 816 $scope.ngShow = true;
817 }else{ 817 }else{
818 $scope.ngShow = false; 818 $scope.ngShow = false;
819 } 819 }
820 } 820 }
821 $scope.payingAmnt = 1180; 821 $scope.payingAmnt = 1180;
822 $rootScope.tokenCall = function(val) { 822 $rootScope.tokenCall = function(val) {
823 if (val == undefined) { 823 if (val == undefined) {
824 $('#invalidToken').css('display', 'block'); 824 $('#invalidToken').css('display', 'block');
825 } else { 825 } else {
826 val = val.toUpperCase(); 826 val = val.toUpperCase();
827 if(((val == "IITH99" || val == "IITH90") && $scope.data.city != "Hyderabad") || ((val == "OASIS" || val == "JALSA22") && $scope.data.city != "Jaipur") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ 827 if(((val == "IITH99" || val == "IITH90") && $scope.data.city != "Hyderabad") || ((val == "OASIS" || val == "JALSA22") && $scope.data.city != "Jaipur") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){
828 $scope.tokencheck = false; 828 $scope.tokencheck = false;
829 return; 829 return;
830 } 830 }
831 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') 831 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
832 .then(function(searchResult) { 832 .then(function(searchResult) {
833 if (searchResult.data.length == 0) { 833 if (searchResult.data.length == 0) {
834 $scope.tokencheck = false; 834 $scope.tokencheck = false;
835 $scope.discountAmount = 0; 835 $scope.discountAmount = 0;
836 836
837 } else { 837 } else {
838 $scope.discountpercentage = searchResult.data[0].discount; 838 $scope.discountpercentage = searchResult.data[0].discount;
839 $scope.tokencheck = true; 839 $scope.tokencheck = true;
840 } 840 }
841 $scope.ticketAmnt = 1180; 841 $scope.ticketAmnt = 1180;
842 var amount = $scope.ticketAmnt * 100 842 var amount = $scope.ticketAmnt * 100
843 if($scope.tokencheck == true){ 843 if($scope.tokencheck == true){
844 var amount = $scope.ticketAmnt 844 var amount = $scope.ticketAmnt
845 if($scope.discountpercentage == "100") { 845 if($scope.discountpercentage == "100") {
846 $scope.discountpercentage = "99.9"; 846 $scope.discountpercentage = "99.9";
847 } 847 }
848 $scope.percDiscount = $scope.discountpercentage/100; 848 $scope.percDiscount = $scope.discountpercentage/100;
849 $scope.discountAmount = amount * $scope.percDiscount; 849 $scope.discountAmount = amount * $scope.percDiscount;
850 } 850 }
851 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 851 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
852 $scope.payingAmnt = taxAmount; 852 $scope.payingAmnt = taxAmount;
853 $scope.payingAmnt = $scope.payingAmnt.toFixed() 853 $scope.payingAmnt = $scope.payingAmnt.toFixed()
854 },function(err){ 854 },function(err){
855 console.log(err) 855 console.log(err)
856 }); 856 });
857 857
858 } 858 }
859 }; 859 };
860 // if($scope.data.country == "INDIA"){ 860 // if($scope.data.country == "INDIA"){
861 // $scope.submit = function() { 861 // $scope.submit = function() {
862 // Analytics.trackEvent('register', 'click', 'Registration'); 862 // Analytics.trackEvent('register', 'click', 'Registration');
863 // $scope.loading = true; 863 // $scope.loading = true;
864 // $scope.data.uploadFile = $scope.base64textString; 864 // $scope.data.uploadFile = $scope.base64textString;
865 // console.log($scope.data.uploadFile) 865 // console.log($scope.data.uploadFile)
866 // // if($scope.tokencheck == false){ 866 // // if($scope.tokencheck == false){
867 // // $scope.data.referalToken = null; 867 // // $scope.data.referalToken = null;
868 // // } 868 // // }
869 // // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 869 // // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
870 // // var x = document.getElementById("snackbar") 870 // // var x = document.getElementById("snackbar")
871 // // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 871 // // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
872 // // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 872 // // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
873 // $scope.infoForm = true; 873 // $scope.infoForm = true;
874 // $scope.ticketAmnt = 1180; 874 // $scope.ticketAmnt = 1180;
875 // $scope.detail = {}; 875 // $scope.detail = {};
876 // $scope.data.phone = "+91"+$scope.data.number; 876 // $scope.data.phone = "+91"+$scope.data.number;
877 // if($scope.data.referalToken == null){ 877 // if($scope.data.referalToken == null){
878 // $scope.data.referalToken = "NA" 878 // $scope.data.referalToken = "NA"
879 // } 879 // }
880 // var file =document.getElementById('filePicker').files[0]; 880 // var file =document.getElementById('filePicker').files[0];
881 // var image = BASE_URL+'/containers/images/download/' 881 // var image = BASE_URL+'/containers/images/download/'
882 // var imagePath = file.name; 882 // var imagePath = file.name;
883 // $scope.data.uploadFile = image + imagePath; 883 // $scope.data.uploadFile = image + imagePath;
884 // var fd = new FormData() 884 // var fd = new FormData()
885 // fd.append('filePicker',file); 885 // fd.append('filePicker',file);
886 // var deferred = $q.defer(); 886 // var deferred = $q.defer();
887 // $http({ 887 // $http({
888 // method:'POST', 888 // method:'POST',
889 // url: BASE_URL+'/containers/images/upload', 889 // url: BASE_URL+'/containers/images/upload',
890 // data:fd, 890 // data:fd,
891 // transformRequest:angular.identity, 891 // transformRequest:angular.identity,
892 // headers:{'Content-Type':undefined} 892 // headers:{'Content-Type':undefined}
893 // }) 893 // })
894 // .success(function(result){ 894 // .success(function(result){
895 // deferred.resolve(result); 895 // deferred.resolve(result);
896 // $http({ 896 // $http({
897 // method: 'POST', 897 // method: 'POST',
898 // url: BASE_URL+'/applicants', 898 // url: BASE_URL+'/applicants',
899 // data: $scope.data, 899 // data: $scope.data,
900 // headers: {} 900 // headers: {}
901 // }).then(function mySuccess(result) { 901 // }).then(function mySuccess(result) {
902 // $scope.detail = result; 902 // $scope.detail = result;
903 // data.applicantId = result.data.id; 903 // data.applicantId = result.data.id;
904 // $scope.userId = result.data.id; 904 // $scope.userId = result.data.id;
905 // var amount = $scope.ticketAmnt * 100 905 // var amount = $scope.ticketAmnt * 100
906 // if($scope.tokencheck == true){ 906 // if($scope.tokencheck == true){
907 // var amount = $scope.ticketAmnt 907 // var amount = $scope.ticketAmnt
908 // console.log("resultcity===",$scope.data.city) 908 // console.log("resultcity===",$scope.data.city)
909 // if($scope.discountpercentage == "100") { 909 // if($scope.discountpercentage == "100") {
910 // $scope.discountpercentage = "99.9"; 910 // $scope.discountpercentage = "99.9";
911 // } 911 // }
912 // $scope.percDiscount = $scope.discountpercentage/100; 912 // $scope.percDiscount = $scope.discountpercentage/100;
913 // $scope.discountAmount = amount * $scope.percDiscount; 913 // $scope.discountAmount = amount * $scope.percDiscount;
914 // } 914 // }
915 // var taxAmount = $scope.ticketAmnt - $scope.discountAmount 915 // var taxAmount = $scope.ticketAmnt - $scope.discountAmount
916 // $scope.payingAmnt = taxAmount; 916 // $scope.payingAmnt = taxAmount;
917 // $scope.payingAmnt = $scope.payingAmnt.toFixed() 917 // $scope.payingAmnt = $scope.payingAmnt.toFixed()
918 // data.amount = $scope.payingAmnt; 918 // data.amount = $scope.payingAmnt;
919 // if($scope.detail != null){ 919 // if($scope.detail != null){
920 // $http({ 920 // $http({
921 // method: 'POST', 921 // method: 'POST',
922 // url: BASE_URL+'/payments', 922 // url: BASE_URL+'/payments',
923 // data: data, 923 // data: data,
924 // headers: {} 924 // headers: {}
925 // }).then(function mySuccess(paymentResult) { 925 // }).then(function mySuccess(paymentResult) {
926 // $scope.loading = false; 926 // $scope.loading = false;
927 // //$("p").html(paymentResult.data.data) 927 // //$("p").html(paymentResult.data.data)
928 // }, function myError(error) { 928 // }, function myError(error) {
929 // }); 929 // });
930 // } 930 // }
931 // var i = 0; 931 // var i = 0;
932 // $scope.payingAmnt = $scope.payingAmnt * 100; 932 // $scope.payingAmnt = $scope.payingAmnt * 100;
933 // var options = { 933 // var options = {
934 // "key": "rzp_test_YwHsVFiDIQ2WUQ", 934 // "key": "rzp_test_YwHsVFiDIQ2WUQ",
935 // //"key": "rzp_live_mkmCb4FkstuWaS", 935 // //"key": "rzp_live_mkmCb4FkstuWaS",
936 // "amount": $scope.payingAmnt, 936 // "amount": $scope.payingAmnt,
937 937
938 // "name": "Startup Jalsa", 938 // "name": "Startup Jalsa",
939 // "description":"amount", 939 // "description":"amount",
940 // "currency": "INR", 940 // "currency": "INR",
941 // "status": "done", 941 // "status": "done",
942 942
943 // "prefill": { 943 // "prefill": {
944 // "email": $scope.detail.email, 944 // "email": $scope.detail.email,
945 // "contact": $scope.detail.phone 945 // "contact": $scope.detail.phone
946 // }, 946 // },
947 947
948 // "theme": { 948 // "theme": {
949 // "color": "#2196f3 ", 949 // "color": "#2196f3 ",
950 // "image_padding":"NO" 950 // "image_padding":"NO"
951 // }, 951 // },
952 // "modal": { 952 // "modal": {
953 // "ondismiss": function(){ 953 // "ondismiss": function(){
954 // } 954 // }
955 // }, 955 // },
956 // "handler": function (response){ 956 // "handler": function (response){
957 // createPayment(response); 957 // createPayment(response);
958 // } 958 // }
959 // }; 959 // };
960 // var rzp1 = new Razorpay(options); 960 // var rzp1 = new Razorpay(options);
961 // rzp1.open(); 961 // rzp1.open();
962 // $scope.paymentResponse = {}; 962 // $scope.paymentResponse = {};
963 // function createPayment(response){ 963 // function createPayment(response){
964 // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 964 // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
965 // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 965 // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
966 // $scope.paymentResponse.amount = data.amount; 966 // $scope.paymentResponse.amount = data.amount;
967 // $scope.paymentResponse.currency = "INR"; 967 // $scope.paymentResponse.currency = "INR";
968 // $scope.paymentResponse.status = $scope.paymentResult.data.status; 968 // $scope.paymentResponse.status = $scope.paymentResult.data.status;
969 // $http({ 969 // $http({
970 // method: 'PUT', 970 // method: 'PUT',
971 // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 971 // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
972 // data: $scope.paymentResponse, 972 // data: $scope.paymentResponse,
973 // headers: {} 973 // headers: {}
974 // }).then(function mySuccess(searchResult) { 974 // }).then(function mySuccess(searchResult) {
975 // Analytics.trackEvent('register', 'click', 'Registration'); 975 // Analytics.trackEvent('register', 'click', 'Registration');
976 // $location.path("/confirm") 976 // $location.path("/confirm")
977 // }, function myError(error) { 977 // }, function myError(error) {
978 // }); 978 // });
979 // } 979 // }
980 // //} 980 // //}
981 981
982 // }, function myError(error) { 982 // }, function myError(error) {
983 983
984 // }); 984 // });
985 985
986 // }) 986 // })
987 987
988 // // }) 988 // // })
989 989
990 // //} 990 // //}
991 991
992 // } 992 // }
993 // }else{ 993 // }else{
994 // $scope.ticketAmnt = 1180; 994 // $scope.ticketAmnt = 1180;
995 // var amount = $scope.ticketAmnt * 100 995 // var amount = $scope.ticketAmnt * 100
996 // console.log("amount",amount) 996 // console.log("amount",amount)
997 // console.log("amount",$scope.tokencheck) 997 // console.log("amount",$scope.tokencheck)
998 // if($scope.tokencheck == true){ 998 // if($scope.tokencheck == true){
999 // var amount = $scope.ticketAmnt 999 // var amount = $scope.ticketAmnt
1000 // console.log("amount",amount) 1000 // console.log("amount",amount)
1001 // if($scope.discountpercentage == "100") { 1001 // if($scope.discountpercentage == "100") {
1002 // $scope.discountpercentage = "99.9"; 1002 // $scope.discountpercentage = "99.9";
1003 // } 1003 // }
1004 // $scope.percDiscount = $scope.discountpercentage/100; 1004 // $scope.percDiscount = $scope.discountpercentage/100;
1005 // console.log("$scope.percDiscount",$scope.percDiscount) 1005 // console.log("$scope.percDiscount",$scope.percDiscount)
1006 // $scope.discountAmount = amount * $scope.percDiscount; 1006 // $scope.discountAmount = amount * $scope.percDiscount;
1007 // } 1007 // }
1008 // console.log("$scope.discountAmount",$scope.discountAmount) 1008 // console.log("$scope.discountAmount",$scope.discountAmount)
1009 // var taxAmount = $scope.ticketAmnt - $scope.discountAmount 1009 // var taxAmount = $scope.ticketAmnt - $scope.discountAmount
1010 // console.log("taxAmount",taxAmount) 1010 // console.log("taxAmount",taxAmount)
1011 // $scope.payingAmnt = taxAmount; 1011 // $scope.payingAmnt = taxAmount;
1012 // $scope.payingAmnt = $scope.payingAmnt.toFixed() 1012 // $scope.payingAmnt = $scope.payingAmnt.toFixed()
1013 1013
1014 $scope.submit = function() { 1014 $scope.submit = function() {
1015 Analytics.trackEvent('register', 'click', 'Registration'); 1015 Analytics.trackEvent('register', 'click', 'Registration');
1016 $scope.loading = true; 1016 $scope.loading = true;
1017 $scope.data.uploadFile = $scope.base64textString; 1017 $scope.data.uploadFile = $scope.base64textString;
1018 // if($scope.tokencheck == false){ 1018 // if($scope.tokencheck == false){
1019 // $scope.data.referalToken = null; 1019 // $scope.data.referalToken = null;
1020 // } 1020 // }
1021 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 1021 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
1022 // var x = document.getElementById("snackbar") 1022 // var x = document.getElementById("snackbar")
1023 // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 1023 // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
1024 // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 1024 // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
1025 $scope.infoForm = true; 1025 $scope.infoForm = true;
1026 $scope.ticketAmnt = 1180; 1026 $scope.ticketAmnt = 1180;
1027 $scope.detail = {}; 1027 $scope.detail = {};
1028 $scope.paymentResultt = {}; 1028 $scope.paymentResultt = {};
1029 $rootScope.applicantResult = {}; 1029 $rootScope.applicantResult = {};
1030 $scope.data.phone = "+91"+$scope.data.number; 1030 $scope.data.phone = "+91"+$scope.data.number;
1031 if($scope.data.referalToken == null){ 1031 if($scope.data.referalToken == null){
1032 $scope.data.referalToken = "NA" 1032 $scope.data.referalToken = "NA"
1033 } 1033 }
1034 var file =document.getElementById('filePicker').files[0]; 1034 var file =document.getElementById('filePicker').files[0];
1035 //console.log("file",filePicker) 1035 //console.log("file",filePicker)
1036 var image = BASE_URL+'/containers/images/download/' 1036 var image = BASE_URL+'/containers/images/download/'
1037 var imagePath = file.name; 1037 var imagePath = file.name;
1038 $scope.data.uploadFile = image + imagePath; 1038 $scope.data.uploadFile = image + imagePath;
1039 //console.log($scope.data.uploadFile) 1039 //console.log($scope.data.uploadFile)
1040 var fd = new FormData() 1040 var fd = new FormData()
1041 fd.append('filePicker',file); 1041 fd.append('filePicker',file);
1042 var deferred = $q.defer(); 1042 var deferred = $q.defer();
1043 $http({ 1043 $http({
1044 method:'POST', 1044 method:'POST',
1045 url: BASE_URL+'/containers/images/upload', 1045 url: BASE_URL+'/containers/images/upload',
1046 data:fd, 1046 data:fd,
1047 transformRequest:angular.identity, 1047 transformRequest:angular.identity,
1048 headers:{'Content-Type':undefined} 1048 headers:{'Content-Type':undefined}
1049 }) 1049 })
1050 .success(function(result){ 1050 .success(function(result){
1051 deferred.resolve(result); 1051 deferred.resolve(result);
1052 $http({ 1052 $http({
1053 method: 'POST', 1053 method: 'POST',
1054 url: BASE_URL+'/applicants', 1054 url: BASE_URL+'/applicants',
1055 data: $scope.data, 1055 data: $scope.data,
1056 headers: {} 1056 headers: {}
1057 }).then(function mySuccess(result) { 1057 }).then(function mySuccess(result) {
1058 $scope.detail = result; 1058 $scope.detail = result;
1059 data.applicantId = result.data.id; 1059 data.applicantId = result.data.id;
1060 $scope.userId = result.data.id; 1060 $scope.userId = result.data.id;
1061 var amount = $scope.ticketAmnt * 100 1061 var amount = $scope.ticketAmnt * 100
1062 if($scope.tokencheck == true){ 1062 if($scope.tokencheck == true){
1063 var amount = $scope.ticketAmnt 1063 var amount = $scope.ticketAmnt
1064 if($scope.discountpercentage == "100") { 1064 if($scope.discountpercentage == "100") {
1065 $scope.discountpercentage = "99.9"; 1065 $scope.discountpercentage = "99.9";
1066 } 1066 }
1067 $scope.percDiscount = $scope.discountpercentage/100; 1067 $scope.percDiscount = $scope.discountpercentage/100;
1068 $scope.discountAmount = amount * $scope.percDiscount; 1068 $scope.discountAmount = amount * $scope.percDiscount;
1069 } 1069 }
1070 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 1070 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
1071 $scope.payingAmnt = taxAmount; 1071 $scope.payingAmnt = taxAmount;
1072 $scope.payingAmnt = $scope.payingAmnt.toFixed() 1072 $scope.payingAmnt = $scope.payingAmnt.toFixed()
1073 data.amount = $scope.payingAmnt; 1073 data.amount = $scope.payingAmnt;
1074 if($scope.detail != null){ 1074 if($scope.detail != null){
1075 $http({ 1075 $http({
1076 method: 'POST', 1076 method: 'POST',
1077 url: BASE_URL+'/payments', 1077 url: BASE_URL+'/payments',
1078 data: data, 1078 data: data,
1079 headers: {} 1079 headers: {}
1080 }).then(function mySuccess(paymentResult) { 1080 }).then(function mySuccess(paymentResult) {
1081 $scope.loading = false; 1081 $scope.loading = false;
1082 $scope.paymentResult = paymentResult; 1082 $scope.paymentResult = paymentResult;
1083 //$("p").html(paymentResult.data.data) 1083 //$("p").html(paymentResult.data.data)
1084 }, function myError(error) { 1084 }, function myError(error) {
1085 }); 1085 });
1086 } 1086 }
1087 var i = 0; 1087 var i = 0;
1088 $scope.payingAmntt = $scope.payingAmnt * 100; 1088 $scope.payingAmntt = $scope.payingAmnt * 100;
1089 var options = { 1089 var options = {
1090 //"key": "rzp_test_YwHsVFiDIQ2WUQ", 1090 //"key": "rzp_test_YwHsVFiDIQ2WUQ",
1091 "key": "rzp_live_mkmCb4FkstuWaS", 1091 "key": "rzp_live_mkmCb4FkstuWaS",
1092 "amount": $scope.payingAmntt, 1092 "amount": $scope.payingAmntt,
1093 1093
1094 "name": "Startup Jalsa", 1094 "name": "Startup Jalsa",
1095 "description":"amount", 1095 "description":"amount",
1096 "currency": "INR", 1096 "currency": "INR",
1097 "status": "done", 1097 "status": "done",
1098 1098
1099 "prefill": { 1099 "prefill": {
1100 "email": $scope.detail.email, 1100 "email": $scope.detail.email,
1101 "contact": $scope.detail.phone 1101 "contact": $scope.detail.phone
1102 }, 1102 },
1103 1103
1104 "theme": { 1104 "theme": {
1105 "color": "#2196f3 ", 1105 "color": "#2196f3 ",
1106 "image_padding":"NO" 1106 "image_padding":"NO"
1107 }, 1107 },
1108 "modal": { 1108 "modal": {
1109 "ondismiss": function(){ 1109 "ondismiss": function(){
1110 } 1110 }
1111 }, 1111 },
1112 "handler": function (response){ 1112 "handler": function (response){
1113 createPayment(response); 1113 createPayment(response);
1114 } 1114 }
1115 }; 1115 };
1116 var rzp1 = new Razorpay(options); 1116 var rzp1 = new Razorpay(options);
1117 rzp1.open(); 1117 rzp1.open();
1118 $scope.paymentResponse = {}; 1118 $scope.paymentResponse = {};
1119 function createPayment(response){ 1119 function createPayment(response){
1120 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 1120 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
1121 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 1121 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
1122 $scope.paymentResponse.amount = data.amount; 1122 $scope.paymentResponse.amount = data.amount;
1123 $scope.paymentResponse.currency = "INR"; 1123 $scope.paymentResponse.currency = "INR";
1124 $scope.paymentResponse.status = $scope.paymentResult.data.status; 1124 $scope.paymentResponse.status = $scope.paymentResult.data.status;
1125 $http({ 1125 $http({
1126 method: 'PUT', 1126 method: 'PUT',
1127 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 1127 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
1128 data: $scope.paymentResponse, 1128 data: $scope.paymentResponse,
1129 headers: {} 1129 headers: {}
1130 }).then(function mySuccess(searchResult) { 1130 }).then(function mySuccess(searchResult) {
1131 console.log("searchResult",searchResult) 1131 console.log("searchResult",searchResult)
1132 //$location.path("/confirm") 1132 //$location.path("/confirm")
1133 $rootScope.paymentResultt = searchResult.data; 1133 $rootScope.paymentResultt = searchResult.data;
1134 $http({ 1134 $http({
1135 method: 'GET', 1135 method: 'GET',
1136 url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId, 1136 url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId,
1137 data: $scope.data, 1137 data: $scope.data,
1138 headers: {} 1138 headers: {}
1139 }).then(function mySuccess(result) { 1139 }).then(function mySuccess(result) {
1140 //console.log("result2323324434",result) 1140 //console.log("result2323324434",result)
1141 $rootScope.applicantResult = result.data; 1141 $rootScope.applicantResult = result.data;
1142 if (result.data.city == "Chennai") { 1142 if (result.data.city == "Chennai") {
1143 $rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113", 1143 $rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113",
1144 $rootScope.applicantResult.date= "October 1st, 2019", 1144 $rootScope.applicantResult.date= "October 1st, 2019",
1145 $rootScope.applicantResult.time= "3 PM" 1145 $rootScope.applicantResult.time= "3 PM"
1146 1146
1147 } else if (result.data.city == "Hyderabad") { 1147 } else if (result.data.city == "Hyderabad") {
1148 $rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285", 1148 $rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285",
1149 $rootScope.applicantResult.date= "September 14th, 2019", 1149 $rootScope.applicantResult.date= "September 14th, 2019",
1150 $rootScope.applicantResult.time= "3 PM" 1150 $rootScope.applicantResult.time= "3 PM"
1151 1151
1152 } else if (result.data.city == "Mumbai") { 1152 } else if (result.data.city == "Mumbai") {
1153 $rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076", 1153 $rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076",
1154 $rootScope.applicantResult.date= "September 4th, 2019", 1154 $rootScope.applicantResult.date= "September 4th, 2019",
1155 $rootScope.applicantResult.time= "3 PM" 1155 $rootScope.applicantResult.time= "3 PM"
1156 1156
1157 } else if (result.data.city == "Ahmedabad") { 1157 } else if (result.data.city == "Ahmedabad") {
1158 $rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015", 1158 $rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015",
1159 $rootScope.applicantResult.date= "September 11th, 2019", 1159 $rootScope.applicantResult.date= "September 11th, 2019",
1160 $rootScope.applicantResult.time= "3 PM" 1160 $rootScope.applicantResult.time= "3 PM"
1161 1161
1162 } else if (result.data.city == "Jaipur") { 1162 } else if (result.data.city == "Jaipur") {
1163 $rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur", 1163 $rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur",
1164 $rootScope.applicantResult.date= "September 24th, 2019", 1164 $rootScope.applicantResult.date= "September 24th, 2019",
1165 $rootScope.applicantResult.time= "3 PM" 1165 $rootScope.applicantResult.time= "3 PM"
1166 1166
1167 } else if (result.data.city == "Kolkata") { 1167 } else if (result.data.city == "Kolkata") {
1168 $rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)", 1168 $rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)",
1169 $rootScope.applicantResult.time= "3 PM", 1169 $rootScope.applicantResult.time= "3 PM",
1170 $rootScope.applicantResult.date= "September 17th, 2019" 1170 $rootScope.applicantResult.date= "September 17th, 2019"
1171 1171
1172 } else if (result.data.city == "Bengaluru") { 1172 } else if (result.data.city == "Bengaluru") {
1173 $rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076", 1173 $rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076",
1174 $rootScope.applicantResult.time= "3 PM", 1174 $rootScope.applicantResult.time= "3 PM",
1175 $rootScope.applicantResult.date= "September 7th, 2019" 1175 $rootScope.applicantResult.date= "September 7th, 2019"
1176 1176
1177 } else if (result.data.city == "Delhi") { 1177 } else if (result.data.city == "Delhi") {
1178 $rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016", 1178 $rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016",
1179 $rootScope.applicantResult.time= "12 PM", 1179 $rootScope.applicantResult.time= "12 PM",
1180 $rootScope.applicantResult.date= "October 16th, 2019" 1180 $rootScope.applicantResult.date= "October 16th, 2019"
1181 1181
1182 } else if (result.data.city == "Kanpur"){ 1182 } else if (result.data.city == "Kanpur"){
1183 $rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016", 1183 $rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016",
1184 $rootScope.applicantResult.time= "3 PM", 1184 $rootScope.applicantResult.time= "3 PM",
1185 $rootScope.applicantResult.date= "September 28th, 2019" 1185 $rootScope.applicantResult.date= "September 28th, 2019"
1186 1186
1187 }else if (result.data.city == "Colombo") { 1187 }else if (result.data.city == "Colombo") {
1188 $rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka", 1188 $rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka",
1189 $rootScope.applicantResult.time= "3 PM", 1189 $rootScope.applicantResult.time= "3 PM",
1190 $rootScope.applicantResult.date= "October 5th, 2019" 1190 $rootScope.applicantResult.date= "October 5th, 2019"
1191 1191
1192 } else if (result.data.city == "Dhaka") { 1192 } else if (result.data.city == "Dhaka") {
1193 $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", 1193 $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",
1194 $rootScope.applicantResult.date= "September 21st, 2019", 1194 $rootScope.applicantResult.date= "September 21st, 2019",
1195 $rootScope.applicantResult.time= "3 PM" 1195 $rootScope.applicantResult.time= "3 PM"
1196 1196
1197 } else { 1197 } else {
1198 $rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445", 1198 $rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445",
1199 $rootScope.applicantResult.time= "3 PM", 1199 $rootScope.applicantResult.time= "3 PM",
1200 $rootScope.applicantResult.date= "October 12th, 2019" 1200 $rootScope.applicantResult.date= "October 12th, 2019"
1201 } 1201 }
1202 Analytics.trackEvent('success', 'click', 'Registration'); 1202 Analytics.trackEvent('success', 'click', 'Registration');
1203 $location.path("/confirm") 1203 $location.path("/confirm")
1204 }) 1204 })
1205 }, function myError(error) { 1205 }, function myError(error) {
1206 }); 1206 });
1207 } 1207 }
1208 //} 1208 //}
1209 1209
1210 }, function myError(error) { 1210 }, function myError(error) {
1211 1211
1212 }); 1212 });
1213 1213
1214 }) 1214 })
1215 1215
1216 // }) 1216 // })
1217 1217
1218 //} 1218 //}
1219 1219
1220 } 1220 }
1221 //} 1221 //}
1222 1222
1223 }); 1223 });
1224 1224
1225 scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) { 1225 scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) {
1226 $scope.approvedMsg = false; 1226 $scope.approvedMsg = false;
1227 $scope.disApprovedMsg = false; 1227 $scope.disApprovedMsg = false;
1228 1228
1229 var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] 1229 var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0]
1230 // if(myParam){ 1230 // if(myParam){
1231 if(myParam == "approved"){ 1231 if(myParam == "approved"){
1232 $scope.approvedMsg = true; 1232 $scope.approvedMsg = true;
1233 $scope.disApprovedMsg = false; 1233 $scope.disApprovedMsg = false;
1234 }else{ 1234 }else{
1235 $scope.approvedMsg = false; 1235 $scope.approvedMsg = false;
1236 $scope.disApprovedMsg = true; 1236 $scope.disApprovedMsg = true;
1237 } 1237 }
1238 // }else{ 1238 // }else{
1239 // $scope.disApprovedMsg = true; 1239 // $scope.disApprovedMsg = true;
1240 // } 1240 // }
1241 1241
1242 }); 1242 });
1243 1243
1244 scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { 1244 scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
1245 $scope.data = {}; 1245 $scope.data = {};
1246 $scope.data.city = localStorage.getItem("city"); 1246 $scope.data.city = localStorage.getItem("city");
1247 $scope.data.country = localStorage.getItem("country");; 1247 $scope.data.country = localStorage.getItem("country");;
1248 var data = { 1248 var data = {
1249 //"amount": $scope.payingAmnt, 1249 //"amount": $scope.payingAmnt,
1250 //"currency": "INR", 1250 //"currency": "INR",
1251 "status": "captured", 1251 "status": "captured",
1252 "paymentType": "Manual_Paytm" 1252 "paymentType": "Manual_Paytm"
1253 } 1253 }
1254 var handleFileSelect = function(evt) { 1254 var handleFileSelect = function(evt) {
1255 var files = evt.target.files; 1255 var files = evt.target.files;
1256 var file = files[0]; 1256 var file = files[0];
1257 1257
1258 if (files && file) { 1258 if (files && file) {
1259 var reader = new FileReader(); 1259 var reader = new FileReader();
1260 1260
1261 reader.onload = function(readerEvt) { 1261 reader.onload = function(readerEvt) {
1262 var binaryString = readerEvt.target.result; 1262 var binaryString = readerEvt.target.result;
1263 $scope.base64textString = btoa(binaryString); 1263 $scope.base64textString = btoa(binaryString);
1264 //console.log("base64textarea",$scope.base64textString) 1264 //console.log("base64textarea",$scope.base64textString)
1265 //$scope.data.uploadFile = file.name; 1265 //$scope.data.uploadFile = file.name;
1266 $scope.fileSelect = false; 1266 $scope.fileSelect = false;
1267 if($scope.data.uploadFile == null){ 1267 if($scope.data.uploadFile == null){
1268 $scope.fileSelect = true; 1268 $scope.fileSelect = true;
1269 }else{ 1269 }else{
1270 $scope.fileSelect = false; 1270 $scope.fileSelect = false;
1271 }; 1271 };
1272 } 1272 }
1273 1273
1274 reader.readAsBinaryString(file); 1274 reader.readAsBinaryString(file);
1275 } 1275 }
1276 }; 1276 };
1277 if (window.File && window.FileReader && window.FileList && window.Blob) { 1277 if (window.File && window.FileReader && window.FileList && window.Blob) {
1278 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); 1278 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
1279 } 1279 }
1280 1280
1281 $scope.ngShowhide = false; 1281 $scope.ngShowhide = false;
1282 $scope.GetValue = function(){ 1282 $scope.GetValue = function(){
1283 if($scope.data.sector == "Other"){ 1283 if($scope.data.sector == "Other"){
1284 $scope.ngShowhide = true; 1284 $scope.ngShowhide = true;
1285 }else{ 1285 }else{
1286 $scope.ngShowhide = false; 1286 $scope.ngShowhide = false;
1287 } 1287 }
1288 } 1288 }
1289 1289
1290 $scope.ngShow = false; 1290 $scope.ngShow = false;
1291 $scope.getValue = function(){ 1291 $scope.getValue = function(){
1292 if($scope.data.hear == "Other"){ 1292 if($scope.data.hear == "Other"){
1293 $scope.ngShow = true; 1293 $scope.ngShow = true;
1294 }else{ 1294 }else{
1295 $scope.ngShow = false; 1295 $scope.ngShow = false;
1296 } 1296 }
1297 } 1297 }
1298 1298
1299 $scope.register = function() { 1299 $scope.register = function() {
1300 Analytics.trackEvent('register', 'click', 'Registration'); 1300 Analytics.trackEvent('register', 'click', 'Registration');
1301 $scope.loading = true; 1301 $scope.loading = true;
1302 $scope.data.uploadFile = $scope.base64textString; 1302 $scope.data.uploadFile = $scope.base64textString;
1303 $scope.infoForm = true; 1303 $scope.infoForm = true;
1304 //$scope.ticketAmnt = 1180; 1304 //$scope.ticketAmnt = 1180;
1305 $scope.detail = {}; 1305 $scope.detail = {};
1306 $scope.data.phone = "+91"+$scope.data.number; 1306 $scope.data.phone = "+91"+$scope.data.number;
1307 1307
1308 var file =document.getElementById('filePicker').files[0]; 1308 var file =document.getElementById('filePicker').files[0];
1309 var image = BASE_URL+'/containers/images/download/' 1309 var image = BASE_URL+'/containers/images/download/'
1310 var imagePath = file.name; 1310 var imagePath = file.name;
1311 $scope.data.uploadFile = image + imagePath; 1311 $scope.data.uploadFile = image + imagePath;
1312 var fd = new FormData() 1312 var fd = new FormData()
1313 fd.append('filePicker',file); 1313 fd.append('filePicker',file);
1314 var deferred = $q.defer(); 1314 var deferred = $q.defer();
1315 $http({ 1315 $http({
1316 method:'POST', 1316 method:'POST',
1317 url: BASE_URL+'/containers/images/upload', 1317 url: BASE_URL+'/containers/images/upload',
1318 data:fd, 1318 data:fd,
1319 transformRequest:angular.identity, 1319 transformRequest:angular.identity,
1320 headers:{'Content-Type':undefined} 1320 headers:{'Content-Type':undefined}
1321 }) 1321 })
1322 .success(function(result){ 1322 .success(function(result){
1323 deferred.resolve(result); 1323 deferred.resolve(result);
1324 $http({ 1324 $http({
1325 method: 'POST', 1325 method: 'POST',
1326 url: BASE_URL+'/applicantIns', 1326 url: BASE_URL+'/applicantIns',
1327 data: $scope.data, 1327 data: $scope.data,
1328 headers: {} 1328 headers: {}
1329 }).then(function mySuccess(result) { 1329 }).then(function mySuccess(result) {
1330 $scope.detail = result; 1330 $scope.detail = result;
1331 data.applicantInId = result.data.id; 1331 data.applicantInId = result.data.id;
1332 $scope.userId = result.data.id; 1332 $scope.userId = result.data.id;
1333 // var amount = $scope.ticketAmnt * 100 1333 // var amount = $scope.ticketAmnt * 100
1334 // if($scope.tokencheck == true){ 1334 // if($scope.tokencheck == true){
1335 // var amount = $scope.ticketAmnt 1335 // var amount = $scope.ticketAmnt
1336 // console.log("resultcity===",$scope.data.city) 1336 // console.log("resultcity===",$scope.data.city)
1337 // if($scope.discountpercentage == "100") { 1337 // if($scope.discountpercentage == "100") {
1338 // $scope.discountpercentage = "99.9"; 1338 // $scope.discountpercentage = "99.9";
1339 // } 1339 // }
1340 // $scope.percDiscount = $scope.discountpercentage/100; 1340 // $scope.percDiscount = $scope.discountpercentage/100;
1341 // $scope.discountAmount = amount * $scope.percDiscount; 1341 // $scope.discountAmount = amount * $scope.percDiscount;
1342 // } 1342 // }
1343 // var taxAmount = $scope.ticketAmnt - $scope.discountAmount 1343 // var taxAmount = $scope.ticketAmnt - $scope.discountAmount
1344 // $scope.payingAmnt = taxAmount; 1344 // $scope.payingAmnt = taxAmount;
1345 // $scope.payingAmnt = $scope.payingAmnt.toFixed() 1345 // $scope.payingAmnt = $scope.payingAmnt.toFixed()
1346 // data.amount = $scope.payingAmnt; 1346 // data.amount = $scope.payingAmnt;
1347 if($scope.detail != null){ 1347 if($scope.detail != null){
1348 $http({ 1348 $http({
1349 method: 'POST', 1349 method: 'POST',
1350 url: BASE_URL+'/paymentsIns', 1350 url: BASE_URL+'/paymentsIns',
1351 data: data, 1351 data: data,
1352 headers: {} 1352 headers: {}
1353 }).then(function mySuccess(paymentResult) { 1353 }).then(function mySuccess(paymentResult) {
1354 $scope.loading = false; 1354 $scope.loading = false;
1355 $scope.paymentResult = paymentResult; 1355 $scope.paymentResult = paymentResult;
1356 $location.path("/paytm/confirm") 1356 $location.path("/paytm/confirm")
1357 }, function myError(error) { 1357 }, function myError(error) {
1358 }); 1358 });
1359 } 1359 }
1360 1360
1361 }, function myError(error) { 1361 }, function myError(error) {
1362 1362
1363 }); 1363 });
1364 1364
1365 }) 1365 })
1366 1366
1367 } 1367 }
1368 1368
1369 }); 1369 });
1370 1370
1371 scotchApp.controller('registrationFormController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { 1371 scotchApp.controller('registrationFormController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
1372 $scope.data = {}; 1372 $scope.data = {};
1373 $scope.data.city = localStorage.getItem("city"); 1373 $scope.data.city = localStorage.getItem("city");
1374 var data = { 1374 var data = {
1375 "amount": $scope.payingAmnt, 1375 "amount": $scope.payingAmnt,
1376 "currency": "INR", 1376 "currency": "INR",
1377 "status": "pending" 1377 "status": "pending"
1378 } 1378 }
1379 //$scope.payingAmnt = 590; 1379 //$scope.payingAmnt = 590;
1380 $rootScope.tokenCall = function(val) { 1380 $rootScope.tokenCall = function(val) {
1381 if (val == undefined) { 1381 if (val == undefined) {
1382 $('#invalidToken').css('display', 'block'); 1382 $('#invalidToken').css('display', 'block');
1383 } else { 1383 } else {
1384 val = val.toUpperCase(); 1384 val = val.toUpperCase();
1385 // if(((val == "IITH99" || val == "IITH90") && $scope.data.city != "Hyderabad") || ((val == "OASIS" || val == "JALSA22") && $scope.data.city != "Jaipur") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ 1385 if(((val == "SMVDU") && $scope.data.city != "Katra") || ((val == "LEH") && $scope.data.city != "Leh")){
1386 // $scope.tokencheck = false; 1386 $scope.tokencheck = false;
1387 // return; 1387 return;
1388 // } 1388 }
1389 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') 1389 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
1390 .then(function(searchResult) { 1390 .then(function(searchResult) {
1391 if (searchResult.data.length == 0) { 1391 if (searchResult.data.length == 0) {
1392 $scope.tokencheck = false; 1392 $scope.tokencheck = false;
1393 $scope.discountAmount = 0; 1393 $scope.discountAmount = 0;
1394 1394
1395 } else { 1395 } else {
1396 $scope.discountpercentage = searchResult.data[0].discount; 1396 $scope.discountpercentage = searchResult.data[0].discount;
1397 $scope.tokencheck = true; 1397 $scope.tokencheck = true;
1398 } 1398 }
1399 $scope.ticketAmnt = 590; 1399 $scope.ticketAmnt = 590;
1400 var amount = $scope.ticketAmnt * 100 1400 var amount = $scope.ticketAmnt * 100
1401 if($scope.tokencheck == true){ 1401 if($scope.tokencheck == true){
1402 var amount = $scope.ticketAmnt 1402 var amount = $scope.ticketAmnt
1403 if($scope.discountpercentage == "100") { 1403 if($scope.discountpercentage == "100") {
1404 $scope.discountpercentage = "99.9"; 1404 $scope.discountpercentage = "99.9";
1405 } 1405 }
1406 //console.log($scope.ticketAmnt) 1406 //console.log($scope.ticketAmnt)
1407 $scope.percDiscount = $scope.discountpercentage/100; 1407 $scope.percDiscount = $scope.discountpercentage/100;
1408 //console.log($scope.percDiscount) 1408 //console.log($scope.percDiscount)
1409 $scope.discountAmount = amount * $scope.percDiscount; 1409 $scope.discountAmount = amount * $scope.percDiscount;
1410 //console.log($scope.discountAmount) 1410 //console.log($scope.discountAmount)
1411 } 1411 }
1412 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 1412 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
1413 //console.log(taxAmount) 1413 //console.log(taxAmount)
1414 $scope.payingAmnt = taxAmount; 1414 $scope.payingAmnt = taxAmount;
1415 $scope.payingAmnt = $scope.payingAmnt.toFixed() 1415 $scope.payingAmnt = $scope.payingAmnt.toFixed()
1416 //console.log($scope.payingAmnt) 1416 //console.log($scope.payingAmnt)
1417 },function(err){ 1417 },function(err){
1418 console.log(err) 1418 console.log(err)
1419 }); 1419 });
1420 1420
1421 } 1421 }
1422 }; 1422 };
1423 1423
1424 $scope.formRegister = function() { 1424 $scope.formRegister = function() {
1425 //Analytics.trackEvent('register', 'click', 'Registration'); 1425 //Analytics.trackEvent('register', 'click', 'Registration');
1426 $scope.loading = true; 1426 $scope.loading = true;
1427 $scope.detail = {}; 1427 $scope.detail = {};
1428 $scope.data.phone = "+91"+$scope.data.number; 1428 $scope.data.phone = "+91"+$scope.data.number;
1429 console.log($scope.data.register) 1429 console.log($scope.data.register)
1430 if($scope.data.referalToken == null){ 1430 if($scope.data.referalToken == null){
1431 $scope.data.referalToken = "NA" 1431 $scope.data.referalToken = "NA"
1432 } 1432 }
1433 if($scope.data.register == "Pitch"){ 1433 if($scope.data.register == "Pitch"){
1434 $scope.ticketAmnt = 590; 1434 $scope.ticketAmnt = 590;
1435 }else { 1435 }else {
1436 $scope.ticketAmnt = 118; 1436 $scope.ticketAmnt = 118;
1437 } 1437 }
1438 $http({ 1438 $http({
1439 method: 'POST', 1439 method: 'POST',
1440 url: BASE_URL+'/applicantIndia', 1440 url: BASE_URL+'/applicantIndia',
1441 data: $scope.data, 1441 data: $scope.data,
1442 headers: {} 1442 headers: {}
1443 }).then(function mySuccess(result) { 1443 }).then(function mySuccess(result) {
1444 $scope.detail = result; 1444 $scope.detail = result;
1445 data.applicantIndiaId = result.data.id; 1445 data.applicantIndiaId = result.data.id;
1446 var amount = $scope.ticketAmnt * 100 1446 var amount = $scope.ticketAmnt * 100
1447 if($scope.tokencheck == true){ 1447 if($scope.tokencheck == true){
1448 //console.log("test") 1448 //console.log("test")
1449 var amount = $scope.ticketAmnt 1449 var amount = $scope.ticketAmnt
1450 //console.log("test",$scope.ticketAmnt) 1450 //console.log("test",$scope.ticketAmnt)
1451 if($scope.discountpercentage == "100") { 1451 if($scope.discountpercentage == "100") {
1452 $scope.discountpercentage = "99.9"; 1452 $scope.discountpercentage = "99.9";
1453 } 1453 }
1454 $scope.percDiscount = $scope.discountpercentage/100; 1454 $scope.percDiscount = $scope.discountpercentage/100;
1455 //console.log($scope.percDiscount) 1455 //console.log($scope.percDiscount)
1456 $scope.discountAmount = amount * $scope.percDiscount; 1456 $scope.discountAmount = amount * $scope.percDiscount;
1457 //console.log($scope.discountAmount) 1457 //console.log($scope.discountAmount)
1458 } 1458 }
1459 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 1459 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
1460 $scope.payingAmnt = taxAmount; 1460 $scope.payingAmnt = taxAmount;
1461 $scope.payingAmnt = $scope.payingAmnt.toFixed() 1461 $scope.payingAmnt = $scope.payingAmnt.toFixed()
1462 //console.log($scope.payingAmnt) 1462 //console.log($scope.payingAmnt)
1463 data.amount = $scope.payingAmnt; 1463 data.amount = $scope.payingAmnt;
1464 //var amount = $scope.ticketAmnt * 100 1464 //var amount = $scope.ticketAmnt * 100
1465 if($scope.detail != null){ 1465 if($scope.detail != null){
1466 $http({ 1466 $http({
1467 method: 'POST', 1467 method: 'POST',
1468 url: BASE_URL+'/paymentsIndia', 1468 url: BASE_URL+'/paymentsIndia',
1469 data: data, 1469 data: data,
1470 headers: {} 1470 headers: {}
1471 }).then(function mySuccess(paymentResult) { 1471 }).then(function mySuccess(paymentResult) {
1472 console.log(paymentResult) 1472 console.log(paymentResult)
1473 $scope.loading = false; 1473 $scope.loading = false;
1474 //$scope.ambassadorId = paymentResult.data.ambassadorId 1474 //$scope.ambassadorId = paymentResult.data.ambassadorId
1475 $scope.paymentResult = paymentResult; 1475 $scope.paymentResult = paymentResult;
1476 //$location.path("/paytm/confirm") 1476 //$location.path("/paytm/confirm")
1477 }, function myError(error) { 1477 }, function myError(error) {
1478 }); 1478 });
1479 } 1479 }
1480 1480
1481 var i = 0; 1481 var i = 0;
1482 $scope.payingAmntt = $scope.payingAmnt * 100; 1482 $scope.payingAmntt = $scope.payingAmnt * 100;
1483 //console.log($scope.payingAmntt) 1483 //console.log($scope.payingAmntt)
1484 var options = { 1484 var options = {
1485 //"key": "rzp_test_YwHsVFiDIQ2WUQ", 1485 //"key": "rzp_test_YwHsVFiDIQ2WUQ",
1486 "key": "rzp_live_mkmCb4FkstuWaS", 1486 "key": "rzp_live_mkmCb4FkstuWaS",
1487 "amount": $scope.payingAmntt, 1487 "amount": $scope.payingAmntt,
1488 1488
1489 "name": "Startup Jalsa", 1489 "name": "Startup Jalsa",
1490 "description":"amount", 1490 "description":"amount",
1491 "currency": "INR", 1491 "currency": "INR",
1492 "status": "done", 1492 "status": "done",
1493 1493
1494 "prefill": { 1494 "prefill": {
1495 "email": $scope.detail.email, 1495 "email": $scope.detail.email,
1496 "contact": $scope.detail.phone 1496 "contact": $scope.detail.phone
1497 }, 1497 },
1498 1498
1499 "theme": { 1499 "theme": {
1500 "color": "#2196f3 ", 1500 "color": "#2196f3 ",
1501 "image_padding":"NO" 1501 "image_padding":"NO"
1502 }, 1502 },
1503 "modal": { 1503 "modal": {
1504 "ondismiss": function(){ 1504 "ondismiss": function(){
1505 } 1505 }
1506 }, 1506 },
1507 "handler": function (response){ 1507 "handler": function (response){
1508 createPayment(response); 1508 createPayment(response);
1509 } 1509 }
1510 }; 1510 };
1511 var rzp1 = new Razorpay(options); 1511 var rzp1 = new Razorpay(options);
1512 rzp1.open(); 1512 rzp1.open();
1513 $scope.paymentResponse = {}; 1513 $scope.paymentResponse = {};
1514 function createPayment(response){ 1514 function createPayment(response){
1515 console.log("response",response) 1515 console.log("response",response)
1516 console.log($scope.paymentResult) 1516 console.log($scope.paymentResult)
1517 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 1517 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
1518 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 1518 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
1519 $scope.paymentResponse.amount = data.amount; 1519 $scope.paymentResponse.amount = data.amount;
1520 $scope.paymentResponse.currency = "INR"; 1520 $scope.paymentResponse.currency = "INR";
1521 $scope.paymentResponse.status = $scope.paymentResult.data.status; 1521 $scope.paymentResponse.status = $scope.paymentResult.data.status;
1522 $http({ 1522 $http({
1523 method: 'PUT', 1523 method: 'PUT',
1524 url: BASE_URL+'/paymentsIndia/'+$scope.paymentResult.data.id, 1524 url: BASE_URL+'/paymentsIndia/'+$scope.paymentResult.data.id,
1525 data: $scope.paymentResponse, 1525 data: $scope.paymentResponse,
1526 headers: {} 1526 headers: {}
1527 }).then(function mySuccess(searchResult) { 1527 }).then(function mySuccess(searchResult) {
1528 console.log("searchResult",searchResult) 1528 console.log("searchResult",searchResult)
1529 $location.path("/confirm") 1529 $location.path("/confirm")
1530 }, function myError(error) { 1530 }, function myError(error) {
1531 }); 1531 });
1532 } 1532 }
1533 //} 1533 //}
1534 1534
1535 }, function myError(error) { 1535 }, function myError(error) {
1536 1536
1537 }); 1537 });
1538 1538
1539 //}) 1539 //})
1540 1540
1541 } 1541 }
1542 1542
1543 }); 1543 });
1544 1544
1545 scotchApp.controller('campusAmbassadorController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { 1545 scotchApp.controller('campusAmbassadorController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) {
1546 $scope.data = {}; 1546 $scope.data = {};
1547 var data = { 1547 var data = {
1548 "amount": $scope.ticketAmnt, 1548 "amount": $scope.ticketAmnt,
1549 "currency": "INR", 1549 "currency": "INR",
1550 "status": "pending" 1550 "status": "pending"
1551 } 1551 }
1552 1552
1553 $scope.formRegister = function() { 1553 $scope.formRegister = function() {
1554 //Analytics.trackEvent('register', 'click', 'Registration'); 1554 //Analytics.trackEvent('register', 'click', 'Registration');
1555 $scope.loading = true; 1555 $scope.loading = true;
1556 $scope.ticketAmnt = 500; 1556 $scope.ticketAmnt = 500;
1557 $scope.detail = {}; 1557 $scope.detail = {};
1558 $scope.data.phone = "+91"+$scope.data.number; 1558 $scope.data.phone = "+91"+$scope.data.number;
1559 var randomNumber = ""+Math.random(); 1559 var randomNumber = ""+Math.random();
1560 var nameSpliced = $scope.data.name.slice(0,3); 1560 var nameSpliced = $scope.data.name.slice(0,3);
1561 var numberSpliced = randomNumber.slice(2,4); 1561 var numberSpliced = randomNumber.slice(2,4);
1562 //var numberSpliced = "90"; 1562 //var numberSpliced = "90";
1563 $scope.data.referalToken = nameSpliced+numberSpliced; 1563 $scope.data.referalToken = nameSpliced+numberSpliced;
1564 //$scope.data.referalToken = nameSpliced; 1564 //$scope.data.referalToken = nameSpliced;
1565 $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); 1565 $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
1566 var ambassDorpayload = {"name":$scope.data.name,"email":$scope.data.email,"mobile":$scope.data.phone,"discount":10,"referalToken":$scope.data.referalToken} 1566 var ambassDorpayload = {"name":$scope.data.name,"email":$scope.data.email,"mobile":$scope.data.phone,"discount":10,"referalToken":$scope.data.referalToken}
1567 1567
1568 $http({ 1568 $http({
1569 method: 'POST', 1569 method: 'POST',
1570 url: BASE_URL+'/campusAmbassadors', 1570 url: BASE_URL+'/campusAmbassadors',
1571 data: $scope.data, 1571 data: $scope.data,
1572 headers: {} 1572 headers: {}
1573 }).then(function mySuccess(result) { 1573 }).then(function mySuccess(result) {
1574 $scope.detail = result; 1574 $scope.detail = result;
1575 data.campusAmbassadorId = result.data.id; 1575 data.campusAmbassadorId = result.data.id;
1576 $scope.userId = result.data.id; 1576 $scope.userId = result.data.id;
1577 var amount = $scope.ticketAmnt * 100 1577 var amount = $scope.ticketAmnt * 100
1578 $scope.ambassCall(ambassDorpayload); 1578 $scope.ambassCall(ambassDorpayload);
1579 if($scope.detail != null){ 1579 if($scope.detail != null){
1580 $http({ 1580 $http({
1581 method: 'POST', 1581 method: 'POST',
1582 url: BASE_URL+'/ambassadorPayments', 1582 url: BASE_URL+'/ambassadorPayments',
1583 data: data, 1583 data: data,
1584 headers: {} 1584 headers: {}
1585 }).then(function mySuccess(paymentResult) { 1585 }).then(function mySuccess(paymentResult) {
1586 console.log(paymentResult) 1586 console.log(paymentResult)
1587 $scope.loading = false; 1587 $scope.loading = false;
1588 //$scope.ambassadorId = paymentResult.data.ambassadorId 1588 //$scope.ambassadorId = paymentResult.data.ambassadorId
1589 $scope.paymentResult = paymentResult; 1589 $scope.paymentResult = paymentResult;
1590 //$location.path("/paytm/confirm") 1590 //$location.path("/paytm/confirm")
1591 }, function myError(error) { 1591 }, function myError(error) {
1592 }); 1592 });
1593 } 1593 }
1594 1594
1595 var i = 0; 1595 var i = 0;
1596 $scope.payingAmntt = $scope.ticketAmnt * 100; 1596 $scope.payingAmntt = $scope.ticketAmnt * 100;
1597 data.amount = $scope.ticketAmnt; 1597 data.amount = $scope.ticketAmnt;
1598 var options = { 1598 var options = {
1599 //"key": "rzp_test_YwHsVFiDIQ2WUQ", 1599 //"key": "rzp_test_YwHsVFiDIQ2WUQ",
1600 "key": "rzp_live_mkmCb4FkstuWaS", 1600 "key": "rzp_live_mkmCb4FkstuWaS",
1601 "amount": $scope.payingAmntt, 1601 "amount": $scope.payingAmntt,
1602 1602
1603 "name": "Startup Jalsa", 1603 "name": "Startup Jalsa",
1604 "description":"amount", 1604 "description":"amount",
1605 "currency": "INR", 1605 "currency": "INR",
1606 "status": "done", 1606 "status": "done",
1607 1607
1608 "prefill": { 1608 "prefill": {
1609 "email": $scope.detail.email, 1609 "email": $scope.detail.email,
1610 "contact": $scope.detail.phone 1610 "contact": $scope.detail.phone
1611 }, 1611 },
1612 1612
1613 "theme": { 1613 "theme": {
1614 "color": "#2196f3 ", 1614 "color": "#2196f3 ",
1615 "image_padding":"NO" 1615 "image_padding":"NO"
1616 }, 1616 },
1617 "modal": { 1617 "modal": {
1618 "ondismiss": function(){ 1618 "ondismiss": function(){
1619 } 1619 }
1620 }, 1620 },
1621 "handler": function (response){ 1621 "handler": function (response){
1622 createPayment(response); 1622 createPayment(response);
1623 } 1623 }
1624 }; 1624 };
1625 var rzp1 = new Razorpay(options); 1625 var rzp1 = new Razorpay(options);
1626 rzp1.open(); 1626 rzp1.open();
1627 $scope.paymentResponse = {}; 1627 $scope.paymentResponse = {};
1628 function createPayment(response){ 1628 function createPayment(response){
1629 console.log("response",response) 1629 console.log("response",response)
1630 console.log($scope.paymentResult) 1630 console.log($scope.paymentResult)
1631 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 1631 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
1632 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 1632 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
1633 $scope.paymentResponse.amount = data.amount; 1633 $scope.paymentResponse.amount = data.amount;
1634 $scope.paymentResponse.currency = "INR"; 1634 $scope.paymentResponse.currency = "INR";
1635 $scope.paymentResponse.status = $scope.paymentResult.data.status; 1635 $scope.paymentResponse.status = $scope.paymentResult.data.status;
1636 $http({ 1636 $http({
1637 method: 'PUT', 1637 method: 'PUT',
1638 url: BASE_URL+'/ambassadorPayments/'+$scope.paymentResult.data.id, 1638 url: BASE_URL+'/ambassadorPayments/'+$scope.paymentResult.data.id,
1639 data: $scope.paymentResponse, 1639 data: $scope.paymentResponse,
1640 headers: {} 1640 headers: {}
1641 }).then(function mySuccess(searchResult) { 1641 }).then(function mySuccess(searchResult) {
1642 console.log("searchResult",searchResult) 1642 console.log("searchResult",searchResult)
1643 $location.path("/confirmation") 1643 $location.path("/confirmation")
1644 //$scope.paymentResultt = searchResult.data; 1644 //$scope.paymentResultt = searchResult.data;
1645 // $http({ 1645 // $http({
1646 // method: 'GET', 1646 // method: 'GET',
1647 // url: BASE_URL+'/campusAmbassadors/'+$rootScope.paymentResultt.campusAmbassadorId, 1647 // url: BASE_URL+'/campusAmbassadors/'+$rootScope.paymentResultt.campusAmbassadorId,
1648 // data: $scope.data, 1648 // data: $scope.data,
1649 // headers: {} 1649 // headers: {}
1650 // }).then(function mySuccess(result) { 1650 // }).then(function mySuccess(result) {
1651 // //console.log("result2323324434",result) 1651 // //console.log("result2323324434",result)
1652 // //Analytics.trackEvent('success', 'click', 'Registration'); 1652 // //Analytics.trackEvent('success', 'click', 'Registration');
1653 // $location.path("/confirm") 1653 // $location.path("/confirm")
1654 // }) 1654 // })
1655 }, function myError(error) { 1655 }, function myError(error) {
1656 }); 1656 });
1657 } 1657 }
1658 //} 1658 //}
1659 1659
1660 }, function myError(error) { 1660 }, function myError(error) {
1661 1661
1662 }); 1662 });
1663 1663
1664 $scope.ambassCall = function(data){ 1664 $scope.ambassCall = function(data){
1665 $http({ 1665 $http({
1666 method: 'POST', 1666 method: 'POST',
1667 url: BASE_URL+'/ambassadors', 1667 url: BASE_URL+'/ambassadors',
1668 data: data, 1668 data: data,
1669 headers: {} 1669 headers: {}
1670 }).then(function mySuccess(result) { 1670 }).then(function mySuccess(result) {
1671 console.log(result) 1671 console.log(result)
1672 }); 1672 });
1673 } 1673 }
1674 1674
1675 //}) 1675 //})
1676 1676
1677 } 1677 }
1678 1678
1679 }); 1679 });
1680 1680
1681 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) { 1681 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) {
1682 $scope.data = {}; 1682 $scope.data = {};
1683 $scope.check = false; 1683 $scope.check = false;
1684 $scope.numberCheck = false; 1684 $scope.numberCheck = false;
1685 1685
1686 $scope.submit = function() { 1686 $scope.submit = function() {
1687 //var randomNumber = ""+Math.random(); 1687 //var randomNumber = ""+Math.random();
1688 var nameSpliced = $scope.data.name.slice(0,5); 1688 var nameSpliced = $scope.data.name.slice(0,5);
1689 //var numberSpliced = randomNumber.slice(2,4); 1689 //var numberSpliced = randomNumber.slice(2,4);
1690 //var numberSpliced = "22"; 1690 //var numberSpliced = "22";
1691 //$scope.data.referalToken = nameSpliced+numberSpliced; 1691 //$scope.data.referalToken = nameSpliced+numberSpliced;
1692 $scope.data.referalToken = nameSpliced; 1692 $scope.data.referalToken = nameSpliced;
1693 $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); 1693 $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
1694 //$scope.data.referalToken = $scope.data.referalToken.toString(); 1694 //$scope.data.referalToken = $scope.data.referalToken.toString();
1695 $http({ 1695 $http({
1696 method: 'POST', 1696 method: 'POST',
1697 url: BASE_URL + '/ambassadors', 1697 url: BASE_URL + '/ambassadors',
1698 data: $scope.data, 1698 data: $scope.data,
1699 headers: {} 1699 headers: {}
1700 }).then(function mySuccess(result) { 1700 }).then(function mySuccess(result) {
1701 $scope.detail = result; 1701 $scope.detail = result;
1702 $('#myModal').modal('show'); 1702 $('#myModal').modal('show');
1703 $scope.data.name = ''; 1703 $scope.data.name = '';
1704 $scope.data.email = ''; 1704 $scope.data.email = '';
1705 $scope.data.mobile = ''; 1705 $scope.data.mobile = '';
1706 //$scope.data.discount = ''; 1706 //$scope.data.discount = '';
1707 1707
1708 }, function myError(error) { 1708 }, function myError(error) {
1709 console.log(error) 1709 console.log(error)
1710 console.log(error.data.error.message) 1710 console.log(error.data.error.message)
1711 }); 1711 });
1712 } 1712 }
1713 }); 1713 });
1714 1714
1715 1715
1716 1716
1717 1717
1718 1718