Commit e025292231abbd1aca50d631fafe41b3c951e680

Authored by apple
1 parent bde6026059
Exists in master

minor change

Showing 1 changed file with 5 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 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-106416759-1'); //UU-XXXXXXX-X should be your tracking code 64 AnalyticsProvider.setAccount('UA-106416759-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", "http://35.154.24.158:4001/v1")
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 $scope.isShowHide = function (value) { 370 $scope.isShowHide = function (value) {
370 console.log(value) 371 console.log('--0-00-',value);
371 var element = document.getElementById("defaultcountry"); 372 var element = document.getElementById("defaultcountry");
372 element.classList.remove("btn-active"); 373 element.classList.remove("btn-active");
373 localStorage.setItem("country",value); 374 localStorage.setItem("country",value);
374 if (value == "INDIA") { 375 if (value == "INDIA") {
375 console.log("value",value) 376 console.log("value",value)
376 $scope.showval = true; 377 $scope.showval = true;
377 $scope.hideval = false; 378 $scope.hideval = false;
378 $scope.showvalue = false; 379 $scope.showvalue = false;
379 $scope.hidevalue = false; 380 $scope.hidevalue = false;
380 } 381 }
381 else if (value == "SRI LANKA") { 382 else if (value == "SRI LANKA") {
382 console.log("value1",value) 383 console.log("value1",value)
383 $scope.showval = false; 384 $scope.showval = false;
384 $scope.hideval = true; 385 $scope.hideval = true;
385 $scope.showvalue = false; 386 $scope.showvalue = false;
386 $scope.hidevalue = false; 387 $scope.hidevalue = false;
387 } 388 }
388 else if (value == "BANGLADESH") { 389 else if (value == "BANGLADESH") {
389 console.log("value2",value) 390 console.log("value2",value)
390 $scope.showval = false; 391 $scope.showval = false;
391 $scope.hideval = false; 392 $scope.hideval = false;
392 $scope.showvalue = true; 393 $scope.showvalue = true;
393 $scope.hidevalue = false; 394 $scope.hidevalue = false;
394 } 395 }
395 else { 396 else {
396 console.log("value3",value) 397 console.log("value3",value)
397 $scope.showval = false; 398 $scope.showval = false;
398 $scope.hideval = false; 399 $scope.hideval = false;
399 $scope.showvalue = false; 400 $scope.showvalue = false;
400 $scope.hidevalue = true; 401 $scope.hidevalue = true;
401 } 402 }
402 } 403 }
403 404
404 $scope.apply = function() { 405 $scope.apply = function() {
405 //Analytics.trackEvent('register', 'click', 'Registration'); 406 //Analytics.trackEvent('register', 'click', 'Registration');
406 $location.path("/caricatures") 407 $location.path("/caricatures")
407 408
408 } 409 }
409 410
410 // $scope.data.city = ''; 411 // $scope.data.city = '';
411 $scope.watch = function(value){ 412 $scope.watch = function(value){
412 console.log(value) 413 console.log("====",value);
413 //document.getElementById("ahmedabad").src = ""; 414 //document.getElementById("ahmedabad").src = "";
414 // console.log("cllll",value) 415 // console.log("cllll",value)
415 $scope.data.city = value; 416 $scope.data.city = value;
416 // if($scope.data.city == "Chennai"){ 417 // if($scope.data.city == "Chennai"){
417 // console.log("cllll1",value) 418 // console.log("cllll1",value)
418 // $window.location.href = 'http://35.154.24.158:8007'; 419 // $window.location.href = 'http://35.154.24.158:8007';
419 // }else{ 420 // }else{
420 // console.log("cllll2",value) 421 // console.log("cllll2",value)
421 localStorage.setItem("city" ,value); 422 localStorage.setItem("city" ,value);
422 //$location.path('/registration').search({city: value}); 423 //$location.path('/registration').search({city: value});
423 // $location.path('/registration/'+value+''); 424 // $location.path('/registration/'+value+'');
424 $location.path('/registration'); 425 $location.path('/registration');
425 //$state.go('registration', { 'city': value}) 426 //$state.go('registration', { 'city': value})
426 // } 427 // }
427 } 428 }
428 429
429 $scope.select = function(url){ 430 $scope.select = function(url){
430 console.log("cllll") 431 console.log("cllll")
431 window.open(url) 432 window.open(url)
432 } 433 }
433 434
434 $scope.stagekeyPress = function() { 435 $scope.stagekeyPress = function() {
435 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); 436 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
436 } 437 }
437 $scope.sectorkeyPress = function() { 438 $scope.sectorkeyPress = function() {
438 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); 439 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
439 } 440 }
440 441
441 $scope.productLaunchkeyPress = function() { 442 $scope.productLaunchkeyPress = function() {
442 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); 443 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
443 } 444 }
444 445
445 $scope.launchPeriodkeyPress = function() { 446 $scope.launchPeriodkeyPress = function() {
446 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); 447 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
447 } 448 }
448 449
449 $scope.industrykeyPress = function(quantity) { 450 $scope.industrykeyPress = function(quantity) {
450 console.log("fghj",quantity) 451 console.log("fghj",quantity)
451 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); 452 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
452 } 453 }
453 454
454 $scope.industryNamekeyPress = function(firstName) { 455 $scope.industryNamekeyPress = function(firstName) {
455 console.log("lastName==", firstName); 456 console.log("lastName==", firstName);
456 if (firstName == undefined) { 457 if (firstName == undefined) {
457 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 458 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
458 } else { 459 } else {
459 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 460 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
460 } 461 }
461 } 462 }
462 463
463 $scope.amountkeyPress = function() { 464 $scope.amountkeyPress = function() {
464 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); 465 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
465 } 466 }
466 467
467 $scope.firstNamekeyPress = function(name) { 468 $scope.firstNamekeyPress = function(name) {
468 console.log("lastName==", name); 469 console.log("lastName==", name);
469 if (name == undefined) { 470 if (name == undefined) {
470 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); 471 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
471 } else { 472 } else {
472 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); 473 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
473 } 474 }
474 } 475 }
475 476
476 $scope.emailkeyPress = function(email) { 477 $scope.emailkeyPress = function(email) {
477 console.log("email", email); 478 console.log("email", email);
478 if (email == undefined) { 479 if (email == undefined) {
479 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); 480 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
480 } else { 481 } else {
481 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); 482 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
482 } 483 }
483 } 484 }
484 485
485 $scope.phonekeyPress = function(number) { 486 $scope.phonekeyPress = function(number) {
486 console.log("number", number); 487 console.log("number", number);
487 if (number == undefined || number == '') { 488 if (number == undefined || number == '') {
488 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); 489 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
489 } else { 490 } else {
490 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); 491 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
491 } 492 }
492 } 493 }
493 494
494 $scope.citykeyPress = function(city) { 495 $scope.citykeyPress = function(city) {
495 console.log("city", city); 496 console.log("city", city);
496 if (city == undefined) { 497 if (city == undefined) {
497 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); 498 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
498 } else { 499 } else {
499 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); 500 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
500 } 501 }
501 } 502 }
502 503
503 $scope.startupNamekeyPress = function(q) { 504 $scope.startupNamekeyPress = function(q) {
504 if (q == undefined) { 505 if (q == undefined) {
505 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); 506 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
506 } else { 507 } else {
507 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); 508 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
508 } 509 }
509 } 510 }
510 511
511 $scope.linkedInkeyPress = function(technology) { 512 $scope.linkedInkeyPress = function(technology) {
512 if (technology == undefined || technology == '') { 513 if (technology == undefined || technology == '') {
513 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); 514 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
514 } else { 515 } else {
515 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); 516 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
516 } 517 }
517 } 518 }
518 $scope.companykeyPress = function(problem) { 519 $scope.companykeyPress = function(problem) {
519 if (problem == undefined) { 520 if (problem == undefined) {
520 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); 521 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
521 } else { 522 } else {
522 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); 523 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
523 } 524 }
524 } 525 }
525 $scope.productNamekeyPress = function(solution) { 526 $scope.productNamekeyPress = function(solution) {
526 if (solution == undefined) { 527 if (solution == undefined) {
527 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); 528 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
528 } else { 529 } else {
529 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); 530 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
530 } 531 }
531 } 532 }
532 $scope.businesskeyPress = function(business) { 533 $scope.businesskeyPress = function(business) {
533 if (business == undefined) { 534 if (business == undefined) {
534 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); 535 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)');
535 } else { 536 } else {
536 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); 537 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)');
537 } 538 }
538 } 539 }
539 540
540 $scope.websitekeyPress = function(prototype) { 541 $scope.websitekeyPress = function(prototype) {
541 if (prototype == undefined || prototype == '') { 542 if (prototype == undefined || prototype == '') {
542 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); 543 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
543 } else { 544 } else {
544 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); 545 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
545 } 546 }
546 } 547 }
547 548
548 $scope.employeekeyPress = function(market) { 549 $scope.employeekeyPress = function(market) {
549 if (market == undefined || market == '') { 550 if (market == undefined || market == '') {
550 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); 551 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
551 } else { 552 } else {
552 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); 553 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
553 } 554 }
554 } 555 }
555 556
556 $scope.annualkeyPress = function(risk) { 557 $scope.annualkeyPress = function(risk) {
557 if (risk == undefined || risk == '') { 558 if (risk == undefined || risk == '') {
558 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); 559 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
559 } else { 560 } else {
560 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); 561 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
561 } 562 }
562 } 563 }
563 564
564 $scope.revenuekeyPress = function(team) { 565 $scope.revenuekeyPress = function(team) {
565 if (team == undefined) { 566 if (team == undefined) {
566 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); 567 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
567 } else { 568 } else {
568 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); 569 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
569 } 570 }
570 } 571 }
571 572
572 $scope.descriptionkeyPress = function(pitch) { 573 $scope.descriptionkeyPress = function(pitch) {
573 if (pitch == undefined) { 574 if (pitch == undefined) {
574 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); 575 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
575 } else { 576 } else {
576 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); 577 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
577 } 578 }
578 } 579 }
579 580
580 $scope.discountkeyPress = function(discount) { 581 $scope.discountkeyPress = function(discount) {
581 if (discount == undefined) { 582 if (discount == undefined) {
582 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 583 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
583 } else { 584 } else {
584 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 585 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
585 } 586 }
586 } 587 }
587 588
588 $scope.removeNooError = function() { 589 $scope.removeNooError = function() {
589 $('#invalidIdea').css('display', 'block'); 590 $('#invalidIdea').css('display', 'block');
590 $('#noExist').css('display', 'none'); 591 $('#noExist').css('display', 'none');
591 }; 592 };
592 593
593 $scope.ideakeyPress = function(financial) { 594 $scope.ideakeyPress = function(financial) {
594 console.log("financial", financial); 595 console.log("financial", financial);
595 if (financial == undefined) { 596 if (financial == undefined) {
596 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); 597 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
597 } else { 598 } else {
598 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); 599 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
599 } 600 }
600 } 601 }
601 602
602 $scope.fundkeyPress = function(financial) { 603 $scope.fundkeyPress = function(financial) {
603 console.log("financial", financial); 604 console.log("financial", financial);
604 if (financial == undefined) { 605 if (financial == undefined) {
605 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); 606 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
606 } else { 607 } else {
607 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); 608 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
608 } 609 }
609 } 610 }
610 611
611 $scope.changeReferalIconColor = function(referalToken){ 612 $scope.changeReferalIconColor = function(referalToken){
612 if (referalToken == undefined || referalToken == '') { 613 if (referalToken == undefined || referalToken == '') {
613 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); 614 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
614 }else { 615 }else {
615 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); 616 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
616 } 617 }
617 } 618 }
618 619
619 }); 620 });
620 621
621 scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL) { 622 scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL) {
622 $scope.data = {}; 623 $scope.data = {};
623 $scope.check = false; 624 $scope.check = false;
624 $scope.numberCheck = false; 625 $scope.numberCheck = false;
625 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 626 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
626 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 627 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
627 $scope.max = 100; 628 $scope.max = 100;
628 $scope.formPage = false; 629 $scope.formPage = false;
629 $scope.current = 0; 630 $scope.current = 0;
630 $scope.payingAmnt = 0; 631 $scope.payingAmnt = 0;
631 $scope.discountAmount = 0; 632 $scope.discountAmount = 0;
632 $scope.approvedMsg = false; 633 $scope.approvedMsg = false;
633 $scope.disApprovedMsg = false; 634 $scope.disApprovedMsg = false;
634 635
635 // $scope.data.quantity = "1"; 636 // $scope.data.quantity = "1";
636 $scope.check = false; 637 $scope.check = false;
637 $scope.numberCheck = false; 638 $scope.numberCheck = false;
638 $scope.paymentResult = {}; 639 $scope.paymentResult = {};
639 // 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]
640 // if(myParam){ 641 // if(myParam){
641 // if(myParam == "approved"){ 642 // if(myParam == "approved"){
642 // $scope.showResponse = true; 643 // $scope.showResponse = true;
643 // }else{ 644 // }else{
644 // $scope.disApprovedMsg = true; 645 // $scope.disApprovedMsg = true;
645 // } 646 // }
646 // }else{ 647 // }else{
647 // $scope.disApprovedMsg = true; 648 // $scope.disApprovedMsg = true;
648 // } 649 // }
649 650
650 $scope.removeError = function() { 651 $scope.removeError = function() {
651 $('#invalidEmail').css('display', 'none'); 652 $('#invalidEmail').css('display', 'none');
652 $('#alreadyExist').css('display', 'none'); 653 $('#alreadyExist').css('display', 'none');
653 }; 654 };
654 655
655 $scope.emailcheck = function(val) { 656 $scope.emailcheck = function(val) {
656 if (val == undefined) { 657 if (val == undefined) {
657 $('#invalidEmail').css('display', 'block'); 658 $('#invalidEmail').css('display', 'block');
658 } else { 659 } else {
659 $('#alreadyExist').css('display', 'block'); 660 $('#alreadyExist').css('display', 'block');
660 } 661 }
661 }; 662 };
662 663
663 $scope.removeNoError = function() { 664 $scope.removeNoError = function() {
664 $('#invalidNumber').css('display', 'none'); 665 $('#invalidNumber').css('display', 'none');
665 $('#alreadyExist').css('display', 'none'); 666 $('#alreadyExist').css('display', 'none');
666 }; 667 };
667 668
668 $scope.numbercheck = function(val) { 669 $scope.numbercheck = function(val) {
669 if (val == undefined) { 670 if (val == undefined) {
670 $('#invalidNumber').css('display', 'block'); 671 $('#invalidNumber').css('display', 'block');
671 } else { 672 } else {
672 $('#alreadyExist').css('display', 'block'); 673 $('#alreadyExist').css('display', 'block');
673 } 674 }
674 }; 675 };
675 676
676 // $scope.$on('city', function (event, value) { 677 // $scope.$on('city', function (event, value) {
677 $scope.data.city = localStorage.getItem("city"); 678 $scope.data.city = localStorage.getItem("city");
678 $scope.data.country = localStorage.getItem("country"); 679 $scope.data.country = localStorage.getItem("country");
679 //console.log("HERE===",$scope.data.country ); 680 console.log("HERE===",$scope.data.country );
680 // }); 681 // });
681 var data = { 682 var data = {
682 "amount": $scope.payingAmnt, 683 "amount": $scope.payingAmnt,
683 "currency": "INR", 684 "currency": "INR",
684 "status": "pending", 685 "status": "pending",
685 "paymentType": $scope.data.country 686 "paymentType": $scope.data.country
686 } 687 }
687 688
688 var handleFileSelect = function(evt) { 689 var handleFileSelect = function(evt) {
689 var files = evt.target.files; 690 var files = evt.target.files;
690 var file = files[0]; 691 var file = files[0];
691 692
692 if (files && file) { 693 if (files && file) {
693 var reader = new FileReader(); 694 var reader = new FileReader();
694 695
695 reader.onload = function(readerEvt) { 696 reader.onload = function(readerEvt) {
696 var binaryString = readerEvt.target.result; 697 var binaryString = readerEvt.target.result;
697 $scope.base64textString = btoa(binaryString); 698 $scope.base64textString = btoa(binaryString);
698 //console.log("base64textarea",$scope.base64textString) 699 //console.log("base64textarea",$scope.base64textString)
699 //$scope.data.uploadFile = file.name; 700 //$scope.data.uploadFile = file.name;
700 $scope.fileSelect = false; 701 $scope.fileSelect = false;
701 if($scope.data.uploadFile == null){ 702 if($scope.data.uploadFile == null){
702 $scope.fileSelect = true; 703 $scope.fileSelect = true;
703 }else{ 704 }else{
704 $scope.fileSelect = false; 705 $scope.fileSelect = false;
705 }; 706 };
706 } 707 }
707 708
708 reader.readAsBinaryString(file); 709 reader.readAsBinaryString(file);
709 } 710 }
710 }; 711 };
711 if (window.File && window.FileReader && window.FileList && window.Blob) { 712 if (window.File && window.FileReader && window.FileList && window.Blob) {
712 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); 713 document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
713 } 714 }
714 715
715 $scope.ngShowhide = false; 716 $scope.ngShowhide = false;
716 $scope.GetValue = function(){ 717 $scope.GetValue = function(){
717 console.log("====$scope.value===",$scope.data.sector) 718 console.log("====$scope.value===",$scope.data.sector)
718 if($scope.data.sector == "Other"){ 719 if($scope.data.sector == "Other"){
719 $scope.ngShowhide = true; 720 $scope.ngShowhide = true;
720 }else{ 721 }else{
721 $scope.ngShowhide = false; 722 $scope.ngShowhide = false;
722 } 723 }
723 } 724 }
724 725
725 // $rootScope.tokenCall = function(val) { 726 // $rootScope.tokenCall = function(val) {
726 // console.log('val-------->', val); 727 // console.log('val-------->', val);
727 // if (val == undefined) { 728 // if (val == undefined) {
728 // $('#invalidToken').css('display', 'block'); 729 // $('#invalidToken').css('display', 'block');
729 // } else { 730 // } else {
730 // val = val.toUpperCase(); 731 // val = val.toUpperCase();
731 // 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 == "IIMA99" && $scope.data.city != "Ahmedabad") || (val == "JAI40" && $scope.data.city != "Jaipur")){ 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 == "IIMA99" && $scope.data.city != "Ahmedabad") || (val == "JAI40" && $scope.data.city != "Jaipur")){
732 // $scope.tokencheck = false; 733 // $scope.tokencheck = false;
733 // return; 734 // return;
734 // } 735 // }
735 // $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') 736 // $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
736 // .then(function(searchResult) { 737 // .then(function(searchResult) {
737 // console.log("searchResult",searchResult) 738 // console.log("searchResult",searchResult)
738 // if (searchResult.data.length == 0) { 739 // if (searchResult.data.length == 0) {
739 // $scope.tokencheck = false; 740 // $scope.tokencheck = false;
740 // $scope.discountAmount = 0; 741 // $scope.discountAmount = 0;
741 // } else { 742 // } else {
742 // console.log("===searchResult.data[0].discount===",searchResult.data[0].discount); 743 // console.log("===searchResult.data[0].discount===",searchResult.data[0].discount);
743 // $scope.discountpercentage = searchResult.data[0].discount; 744 // $scope.discountpercentage = searchResult.data[0].discount;
744 // console.log("===searchResultdiscountpercentage===",$scope.discountpercentage); 745 // console.log("===searchResultdiscountpercentage===",$scope.discountpercentage);
745 // $scope.tokencheck = true; 746 // $scope.tokencheck = true;
746 // } 747 // }
747 // },function(err){ 748 // },function(err){
748 // console.log(err) 749 // console.log(err)
749 // }); 750 // });
750 751
751 // } 752 // }
752 // }; 753 // };
753 754 console.log("$scope.data.country",$scope.data.country)
754 if($scope.data.country == "INDIA"){ 755 if($scope.data.country == "INDIA"){
755 $scope.submit = function() { 756 $scope.submit = function() {
756 $scope.loading = true; 757 $scope.loading = true;
757 $scope.data.uploadFile = $scope.base64textString; 758 $scope.data.uploadFile = $scope.base64textString;
758 console.log($scope.data.uploadFile) 759 console.log($scope.data.uploadFile)
759 // if($scope.tokencheck == false){ 760 // if($scope.tokencheck == false){
760 // $scope.data.referalToken = null; 761 // $scope.data.referalToken = null;
761 // } 762 // }
762 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 763 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
763 // var x = document.getElementById("snackbar") 764 // var x = document.getElementById("snackbar")
764 // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 765 // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
765 // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 766 // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
766 $scope.infoForm = true; 767 $scope.infoForm = true;
767 $scope.ticketAmnt = 1; 768 $scope.ticketAmnt = 1;
768 $scope.detail = {}; 769 $scope.detail = {};
769 $scope.data.phone = "+91"+$scope.data.number; 770 $scope.data.phone = "+91"+$scope.data.number;
770 if($scope.data.referalToken == null){ 771 if($scope.data.referalToken == null){
771 $scope.data.referalToken = "NA" 772 $scope.data.referalToken = "NA"
772 } 773 }
773 var file =document.getElementById('filePicker').files[0]; 774 var file =document.getElementById('filePicker').files[0];
774 //console.log("file",filePicker) 775 //console.log("file",filePicker)
775 var image = BASE_URL+'/containers/images/download/' 776 var image = BASE_URL+'/containers/images/download/'
776 var imagePath = file.name; 777 var imagePath = file.name;
777 $scope.data.uploadFile = image + imagePath; 778 $scope.data.uploadFile = image + imagePath;
778 //console.log($scope.data.uploadFile) 779 //console.log($scope.data.uploadFile)
779 var fd = new FormData() 780 var fd = new FormData()
780 fd.append('filePicker',file); 781 fd.append('filePicker',file);
781 var deferred = $q.defer(); 782 var deferred = $q.defer();
782 $http({ 783 $http({
783 method:'POST', 784 method:'POST',
784 url: BASE_URL+'/containers/images/upload', 785 url: BASE_URL+'/containers/images/upload',
785 data:fd, 786 data:fd,
786 transformRequest:angular.identity, 787 transformRequest:angular.identity,
787 headers:{'Content-Type':undefined} 788 headers:{'Content-Type':undefined}
788 }) 789 })
789 .success(function(result){ 790 .success(function(result){
790 deferred.resolve(result); 791 deferred.resolve(result);
791 $http({ 792 $http({
792 method: 'POST', 793 method: 'POST',
793 url: BASE_URL+'/applicants', 794 url: BASE_URL+'/applicants',
794 data: $scope.data, 795 data: $scope.data,
795 headers: {} 796 headers: {}
796 }).then(function mySuccess(result) { 797 }).then(function mySuccess(result) {
797 console.log("=====result=====",result) 798 console.log("=====result=====",result)
798 $scope.detail = result; 799 $scope.detail = result;
799 data.applicantId = result.data.id; 800 data.applicantId = result.data.id;
800 $scope.userId = result.data.id; 801 $scope.userId = result.data.id;
801 console.log("=====data=====",data) 802 console.log("=====data=====",data)
802 var amount = $scope.ticketAmnt * 100 803 var amount = $scope.ticketAmnt * 100
803 if($scope.tokencheck == true){ 804 if($scope.tokencheck == true){
804 var amount = $scope.ticketAmnt 805 var amount = $scope.ticketAmnt
805 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 806 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
806 console.log("resultcity===",$scope.data.city) 807 console.log("resultcity===",$scope.data.city)
807 if($scope.discountpercentage == "100") { 808 if($scope.discountpercentage == "100") {
808 $scope.discountpercentage = "99.8"; 809 $scope.discountpercentage = "99.8";
809 console.log("$scope.discountpercentage====",$scope.discountpercentage) 810 console.log("$scope.discountpercentage====",$scope.discountpercentage)
810 } 811 }
811 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 812 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
812 $scope.percDiscount = $scope.discountpercentage/100; 813 $scope.percDiscount = $scope.discountpercentage/100;
813 console.log("====$scope.percDiscount====",$scope.percDiscount); 814 console.log("====$scope.percDiscount====",$scope.percDiscount);
814 console.log("====amount=====",amount); 815 console.log("====amount=====",amount);
815 $scope.discountAmount = amount * $scope.percDiscount; 816 $scope.discountAmount = amount * $scope.percDiscount;
816 console.log("finalAmount====>",$scope.discountAmount) 817 console.log("finalAmount====>",$scope.discountAmount)
817 } 818 }
818 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 819 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
819 console.log("$scope.taxTotal----",taxAmount) 820 console.log("$scope.taxTotal----",taxAmount)
820 $scope.payingAmnt = taxAmount; 821 $scope.payingAmnt = taxAmount;
821 console.log("====$scope.payingAmnt====",$scope.payingAmnt) 822 console.log("====$scope.payingAmnt====",$scope.payingAmnt)
822 $scope.payingAmnt = $scope.payingAmnt.toFixed() 823 $scope.payingAmnt = $scope.payingAmnt.toFixed()
823 data.amount = $scope.payingAmnt; 824 data.amount = $scope.payingAmnt;
824 console.log("data.amount==",data.amount) 825 console.log("data.amount==",data.amount)
825 if($scope.detail != null){ 826 if($scope.detail != null){
826 $http({ 827 $http({
827 method: 'POST', 828 method: 'POST',
828 url: BASE_URL+'/payments', 829 url: BASE_URL+'/payments',
829 data: data, 830 data: data,
830 headers: {} 831 headers: {}
831 }).then(function mySuccess(paymentResult) { 832 }).then(function mySuccess(paymentResult) {
832 $scope.loading = false; 833 $scope.loading = false;
833 console.log("paymentResult",paymentResult.data.data) 834 console.log("paymentResult",paymentResult.data.data)
834 $("p").html(paymentResult.data.data) 835 $("p").html(paymentResult.data.data)
835 }, function myError(error) { 836 }, function myError(error) {
836 }); 837 });
837 } 838 }
838 // var i = 0; 839 // var i = 0;
839 // $scope.payingAmnt = $scope.payingAmnt * 100; 840 // $scope.payingAmnt = $scope.payingAmnt * 100;
840 // var options = { 841 // var options = {
841 // //"key": "rzp_test_YwHsVFiDIQ2WUQ", 842 // //"key": "rzp_test_YwHsVFiDIQ2WUQ",
842 // "key": "rzp_live_mkmCb4FkstuWaS", 843 // "key": "rzp_live_mkmCb4FkstuWaS",
843 // "amount": $scope.payingAmnt, 844 // "amount": $scope.payingAmnt,
844 845
845 // "name": "Startup Jalsa", 846 // "name": "Startup Jalsa",
846 // "description":"amount", 847 // "description":"amount",
847 // "currency": "INR", 848 // "currency": "INR",
848 // "status": "done", 849 // "status": "done",
849 850
850 // "prefill": { 851 // "prefill": {
851 // "email": $scope.detail.email, 852 // "email": $scope.detail.email,
852 // "contact": $scope.detail.phone 853 // "contact": $scope.detail.phone
853 // }, 854 // },
854 855
855 // "theme": { 856 // "theme": {
856 // "color": "#2196f3 ", 857 // "color": "#2196f3 ",
857 // "image_padding":"NO" 858 // "image_padding":"NO"
858 // }, 859 // },
859 // "modal": { 860 // "modal": {
860 // "ondismiss": function(){ 861 // "ondismiss": function(){
861 // } 862 // }
862 // }, 863 // },
863 // "handler": function (response){ 864 // "handler": function (response){
864 // createPayment(response); 865 // createPayment(response);
865 // } 866 // }
866 // }; 867 // };
867 // var rzp1 = new Razorpay(options); 868 // var rzp1 = new Razorpay(options);
868 // rzp1.open(); 869 // rzp1.open();
869 // $scope.paymentResponse = {}; 870 // $scope.paymentResponse = {};
870 // function createPayment(response){ 871 // function createPayment(response){
871 // console.log("response12333333",response) 872 // console.log("response12333333",response)
872 // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 873 // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
873 // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 874 // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
874 // $scope.paymentResponse.amount = data.amount; 875 // $scope.paymentResponse.amount = data.amount;
875 // $scope.paymentResponse.currency = "INR"; 876 // $scope.paymentResponse.currency = "INR";
876 // $scope.paymentResponse.status = $scope.paymentResult.data.status; 877 // $scope.paymentResponse.status = $scope.paymentResult.data.status;
877 // console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) 878 // console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
878 // $http({ 879 // $http({
879 // method: 'PUT', 880 // method: 'PUT',
880 // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 881 // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
881 // data: $scope.paymentResponse, 882 // data: $scope.paymentResponse,
882 // headers: {} 883 // headers: {}
883 // }).then(function mySuccess(searchResult) { 884 // }).then(function mySuccess(searchResult) {
884 // console.log("searchResult",searchResult) 885 // console.log("searchResult",searchResult)
885 // $location.path("/confirmation") 886 // $location.path("/confirmation")
886 // }, function myError(error) { 887 // }, function myError(error) {
887 // }); 888 // });
888 // } 889 // }
889 //} 890 //}
890 891
891 }, function myError(error) { 892 }, function myError(error) {
892 893
893 }); 894 });
894 895
895 }) 896 })
896 897
897 // }) 898 // })
898 899
899 //} 900 //}
900 901
901 } 902 }
902 }else{ 903 }else{
903 $scope.submit = function() { 904 $scope.submit = function() {
904 $scope.loading = true; 905 $scope.loading = true;
905 $scope.data.uploadFile = $scope.base64textString; 906 $scope.data.uploadFile = $scope.base64textString;
906 console.log($scope.data.uploadFile) 907 console.log($scope.data.uploadFile)
907 // if($scope.tokencheck == false){ 908 // if($scope.tokencheck == false){
908 // $scope.data.referalToken = null; 909 // $scope.data.referalToken = null;
909 // } 910 // }
910 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 911 // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
911 // var x = document.getElementById("snackbar") 912 // var x = document.getElementById("snackbar")
912 // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 913 // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
913 // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 914 // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
914 $scope.infoForm = true; 915 $scope.infoForm = true;
915 $scope.ticketAmnt = 1; 916 $scope.ticketAmnt = 1;
916 $scope.detail = {}; 917 $scope.detail = {};
917 $scope.data.phone = "+91"+$scope.data.number; 918 $scope.data.phone = "+91"+$scope.data.number;
918 if($scope.data.referalToken == null){ 919 if($scope.data.referalToken == null){
919 $scope.data.referalToken = "NA" 920 $scope.data.referalToken = "NA"
920 } 921 }
921 var file =document.getElementById('filePicker').files[0]; 922 var file =document.getElementById('filePicker').files[0];
922 //console.log("file",filePicker) 923 //console.log("file",filePicker)
923 var image = BASE_URL+'/containers/images/download/' 924 var image = BASE_URL+'/containers/images/download/'
924 var imagePath = file.name; 925 var imagePath = file.name;
925 $scope.data.uploadFile = image + imagePath; 926 $scope.data.uploadFile = image + imagePath;
926 //console.log($scope.data.uploadFile) 927 //console.log($scope.data.uploadFile)
927 var fd = new FormData() 928 var fd = new FormData()
928 fd.append('filePicker',file); 929 fd.append('filePicker',file);
929 var deferred = $q.defer(); 930 var deferred = $q.defer();
930 $http({ 931 $http({
931 method:'POST', 932 method:'POST',
932 url: BASE_URL+'/containers/images/upload', 933 url: BASE_URL+'/containers/images/upload',
933 data:fd, 934 data:fd,
934 transformRequest:angular.identity, 935 transformRequest:angular.identity,
935 headers:{'Content-Type':undefined} 936 headers:{'Content-Type':undefined}
936 }) 937 })
937 .success(function(result){ 938 .success(function(result){
938 deferred.resolve(result); 939 deferred.resolve(result);
939 $http({ 940 $http({
940 method: 'POST', 941 method: 'POST',
941 url: BASE_URL+'/applicants', 942 url: BASE_URL+'/applicants',
942 data: $scope.data, 943 data: $scope.data,
943 headers: {} 944 headers: {}
944 }).then(function mySuccess(result) { 945 }).then(function mySuccess(result) {
945 console.log("=====result=====",result) 946 console.log("=====result=====",result)
946 $scope.detail = result; 947 $scope.detail = result;
947 data.applicantId = result.data.id; 948 data.applicantId = result.data.id;
948 $scope.userId = result.data.id; 949 $scope.userId = result.data.id;
949 console.log("=====data=====",data) 950 console.log("=====data=====",data)
950 var amount = $scope.ticketAmnt * 100 951 var amount = $scope.ticketAmnt * 100
951 if($scope.tokencheck == true){ 952 if($scope.tokencheck == true){
952 var amount = $scope.ticketAmnt 953 var amount = $scope.ticketAmnt
953 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 954 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
954 console.log("resultcity===",$scope.data.city) 955 console.log("resultcity===",$scope.data.city)
955 if($scope.discountpercentage == "100") { 956 if($scope.discountpercentage == "100") {
956 $scope.discountpercentage = "99.8"; 957 $scope.discountpercentage = "99.8";
957 console.log("$scope.discountpercentage====",$scope.discountpercentage) 958 console.log("$scope.discountpercentage====",$scope.discountpercentage)
958 } 959 }
959 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 960 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
960 $scope.percDiscount = $scope.discountpercentage/100; 961 $scope.percDiscount = $scope.discountpercentage/100;
961 console.log("====$scope.percDiscount====",$scope.percDiscount); 962 console.log("====$scope.percDiscount====",$scope.percDiscount);
962 console.log("====amount=====",amount); 963 console.log("====amount=====",amount);
963 $scope.discountAmount = amount * $scope.percDiscount; 964 $scope.discountAmount = amount * $scope.percDiscount;
964 console.log("finalAmount====>",$scope.discountAmount) 965 console.log("finalAmount====>",$scope.discountAmount)
965 } 966 }
966 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 967 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
967 console.log("$scope.taxTotal----",taxAmount) 968 console.log("$scope.taxTotal----",taxAmount)
968 $scope.payingAmnt = taxAmount; 969 $scope.payingAmnt = taxAmount;
969 console.log("====$scope.payingAmnt====",$scope.payingAmnt) 970 console.log("====$scope.payingAmnt====",$scope.payingAmnt)
970 $scope.payingAmnt = $scope.payingAmnt.toFixed() 971 $scope.payingAmnt = $scope.payingAmnt.toFixed()
971 data.amount = $scope.payingAmnt; 972 data.amount = $scope.payingAmnt;
972 console.log("data.amount==",data.amount) 973 console.log("data.amount==",data.amount)
973 if($scope.detail != null){ 974 if($scope.detail != null){
974 $http({ 975 $http({
975 method: 'POST', 976 method: 'POST',
976 url: BASE_URL+'/payments', 977 url: BASE_URL+'/payments',
977 data: data, 978 data: data,
978 headers: {} 979 headers: {}
979 }).then(function mySuccess(paymentResult) { 980 }).then(function mySuccess(paymentResult) {
980 $scope.loading = false; 981 $scope.loading = false;
981 console.log("paymentResult",paymentResult) 982 console.log("paymentResult",paymentResult)
982 $scope.paymentResult = paymentResult; 983 $scope.paymentResult = paymentResult;
983 //$("p").html(paymentResult.data.data) 984 //$("p").html(paymentResult.data.data)
984 }, function myError(error) { 985 }, function myError(error) {
985 }); 986 });
986 } 987 }
987 var i = 0; 988 var i = 0;
988 $scope.payingAmnt = $scope.payingAmnt * 100; 989 $scope.payingAmnt = $scope.payingAmnt * 100;
989 var options = { 990 var options = {
990 //"key": "rzp_test_YwHsVFiDIQ2WUQ", 991 //"key": "rzp_test_YwHsVFiDIQ2WUQ",
991 "key": "rzp_live_mkmCb4FkstuWaS", 992 "key": "rzp_live_mkmCb4FkstuWaS",
992 "amount": $scope.payingAmnt, 993 "amount": $scope.payingAmnt,
993 994
994 "name": "Startup Jalsa", 995 "name": "Startup Jalsa",
995 "description":"amount", 996 "description":"amount",
996 "currency": "INR", 997 "currency": "INR",
997 "status": "done", 998 "status": "done",
998 999
999 "prefill": { 1000 "prefill": {
1000 "email": $scope.detail.email, 1001 "email": $scope.detail.email,
1001 "contact": $scope.detail.phone 1002 "contact": $scope.detail.phone
1002 }, 1003 },
1003 1004
1004 "theme": { 1005 "theme": {
1005 "color": "#2196f3 ", 1006 "color": "#2196f3 ",
1006 "image_padding":"NO" 1007 "image_padding":"NO"
1007 }, 1008 },
1008 "modal": { 1009 "modal": {
1009 "ondismiss": function(){ 1010 "ondismiss": function(){
1010 } 1011 }
1011 }, 1012 },
1012 "handler": function (response){ 1013 "handler": function (response){
1013 createPayment(response); 1014 createPayment(response);
1014 } 1015 }
1015 }; 1016 };
1016 var rzp1 = new Razorpay(options); 1017 var rzp1 = new Razorpay(options);
1017 rzp1.open(); 1018 rzp1.open();
1018 $scope.paymentResponse = {}; 1019 $scope.paymentResponse = {};
1019 function createPayment(response){ 1020 function createPayment(response){
1020 console.log("response12333333",response) 1021 console.log("response12333333",response)
1021 console.log("$scope.paymentResult",$scope.paymentResult) 1022 console.log("$scope.paymentResult",$scope.paymentResult)
1022 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 1023 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
1023 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 1024 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
1024 $scope.paymentResponse.amount = data.amount; 1025 $scope.paymentResponse.amount = data.amount;
1025 $scope.paymentResponse.currency = "INR"; 1026 $scope.paymentResponse.currency = "INR";
1026 $scope.paymentResponse.status = $scope.paymentResult.data.status; 1027 $scope.paymentResponse.status = $scope.paymentResult.data.status;
1027 console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) 1028 console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
1028 $http({ 1029 $http({
1029 method: 'PUT', 1030 method: 'PUT',
1030 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 1031 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
1031 data: $scope.paymentResponse, 1032 data: $scope.paymentResponse,
1032 headers: {} 1033 headers: {}
1033 }).then(function mySuccess(searchResult) { 1034 }).then(function mySuccess(searchResult) {
1034 console.log("searchResult",searchResult) 1035 console.log("searchResult",searchResult)
1035 $location.path("/confirm") 1036 $location.path("/confirm")
1036 }, function myError(error) { 1037 }, function myError(error) {
1037 }); 1038 });
1038 } 1039 }
1039 //} 1040 //}
1040 1041
1041 }, function myError(error) { 1042 }, function myError(error) {
1042 1043
1043 }); 1044 });
1044 1045
1045 }) 1046 })
1046 1047
1047 // }) 1048 // })
1048 1049
1049 //} 1050 //}
1050 1051
1051 } 1052 }
1052 } 1053 }
1053 1054
1054 }); 1055 });
1055 1056
1056 scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) { 1057 scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) {
1057 $scope.approvedMsg = false; 1058 $scope.approvedMsg = false;
1058 $scope.disApprovedMsg = false; 1059 $scope.disApprovedMsg = false;
1059 1060
1060 var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] 1061 var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0]
1061 console.log(myParam) 1062 console.log(myParam)
1062 // if(myParam){ 1063 // if(myParam){
1063 if(myParam == "approved"){ 1064 if(myParam == "approved"){
1064 $scope.approvedMsg = true; 1065 $scope.approvedMsg = true;
1065 $scope.disApprovedMsg = false; 1066 $scope.disApprovedMsg = false;
1066 }else{ 1067 }else{
1067 $scope.approvedMsg = false; 1068 $scope.approvedMsg = false;
1068 $scope.disApprovedMsg = true; 1069 $scope.disApprovedMsg = true;
1069 } 1070 }
1070 // }else{ 1071 // }else{
1071 // $scope.disApprovedMsg = true; 1072 // $scope.disApprovedMsg = true;
1072 // } 1073 // }
1073 1074
1074 }); 1075 });
1075 1076
1076 1077
1077 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) { 1078 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) {
1078 $scope.data = {}; 1079 $scope.data = {};
1079 $scope.check = false; 1080 $scope.check = false;
1080 $scope.numberCheck = false; 1081 $scope.numberCheck = false;
1081 1082
1082 $scope.submit = function() { 1083 $scope.submit = function() {
1083 console.log($scope.data.name) 1084 console.log($scope.data.name)
1084 var randomNumber = ""+Math.random(); 1085 var randomNumber = ""+Math.random();
1085 var nameSpliced = $scope.data.name.slice(0,5); 1086 var nameSpliced = $scope.data.name.slice(0,5);
1086 var numberSpliced = randomNumber.slice(2,4);; 1087 var numberSpliced = randomNumber.slice(2,4);;
1087 $scope.data.referalToken = nameSpliced+numberSpliced; 1088 $scope.data.referalToken = nameSpliced+numberSpliced;
1088 $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); 1089 $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
1089 console.log("dsdfs",numberSpliced); 1090 console.log("dsdfs",numberSpliced);
1090 $http({ 1091 $http({
1091 method: 'POST', 1092 method: 'POST',
1092 url: BASE_URL + '/ambassadors', 1093 url: BASE_URL + '/ambassadors',
1093 data: $scope.data, 1094 data: $scope.data,
1094 headers: {} 1095 headers: {}
1095 }).then(function mySuccess(result) { 1096 }).then(function mySuccess(result) {
1096 console.log("result", result) 1097 console.log("result", result)
1097 $scope.detail = result; 1098 $scope.detail = result;
1098 $('#myModal').modal('show'); 1099 $('#myModal').modal('show');
1099 $scope.data.name = ''; 1100 $scope.data.name = '';
1100 $scope.data.email = ''; 1101 $scope.data.email = '';
1101 $scope.data.mobile = ''; 1102 $scope.data.mobile = '';
1102 //$scope.data.discount = ''; 1103 //$scope.data.discount = '';
1103 1104
1104 }, function myError(error) { 1105 }, function myError(error) {
1105 console.log(error) 1106 console.log(error)
1106 console.log(error.data.error.message) 1107 console.log(error.data.error.message)
1107 }); 1108 });
1108 } 1109 }
1109 }); 1110 });
1110 1111
1111 1112
1112 1113
1113 1114
1114 1115