Commit 5e401c7a94ab100fcce5788898ffc9fe124ac842

Authored by Shilpi Saini
1 parent 247ee19c91
Exists in master

baseurl change

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