Commit a65d2455e13ba780a77dccb82968f829fc092b4c

Authored by Palak Handa
1 parent e3d25d2618
Exists in master and in 1 other branch paytm

minor change

Showing 1 changed file with 9 additions and 3 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) { 5 scotchApp.config(function($routeProvider) {
6 $routeProvider 6 $routeProvider
7 7
8 // route for the Home page 8 // route for the Home page
9 .when('/', { 9 .when('/', {
10 templateUrl: 'pages/Home.html', 10 templateUrl: 'pages/Home.html',
11 controller: 'mainController' 11 controller: 'mainController'
12 }) 12 })
13 13
14 // route for the caricatures page 14 // route for the caricatures page
15 .when('/caricatures', { 15 .when('/caricatures', {
16 templateUrl: 'pages/caricatures.html', 16 templateUrl: 'pages/caricatures.html',
17 controller: 'mainController' 17 controller: 'mainController'
18 }) 18 })
19 19
20 // // route for the paymentVerify page 20 // // route for the paymentVerify page
21 // .when('/pendingPayment/:id', { 21 // .when('/pendingPayment/:id', {
22 // templateUrl: 'pages/verify.html', 22 // templateUrl: 'pages/verify.html',
23 // controller: 'verifyController' 23 // controller: 'verifyController'
24 // }) 24 // })
25 25
26 // route for the registration page 26 // route for the registration page
27 .when('/registration/:city', { 27 .when('/registration/:city', {
28 templateUrl: 'pages/registration.html', 28 templateUrl: 'pages/registration.html',
29 controller: 'registrationController' 29 controller: 'registrationController'
30 }) 30 })
31 31
32 // route for the ambassador page 32 // route for the ambassador page
33 // .when('/startupJalsaPromocode', { 33 // .when('/startupJalsaPromocode', {
34 // templateUrl: 'pages/ambassador.html', 34 // templateUrl: 'pages/ambassador.html',
35 // controller: 'ambassadorController' 35 // controller: 'ambassadorController'
36 // }) 36 // })
37 37
38 // route for the confirmation page 38 // route for the confirmation page
39 .when('/confirmation', { 39 .when('/confirmation', {
40 templateUrl: 'pages/confirmation.html', 40 templateUrl: 'pages/confirmation.html',
41 controller: 'registrationController' 41 controller: 'registrationController'
42 }) 42 })
43 43
44 }); 44 });
45 45
46 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { 46 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
47 // Add configuration code as desired 47 // Add configuration code as desired
48 AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code 48 AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code
49 49
50 // Track all routes (default is true). 50 // Track all routes (default is true).
51 AnalyticsProvider.trackPages(true); 51 AnalyticsProvider.trackPages(true);
52 52
53 // Track all URL query params (default is false). 53 // Track all URL query params (default is false).
54 AnalyticsProvider.trackUrlParams(true); 54 AnalyticsProvider.trackUrlParams(true);
55 55
56 }]).run(['Analytics', function(Analytics) { }]); 56 }]).run(['Analytics', function(Analytics) { }]);
57 57
58 scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") 58 scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1")
59 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") 59 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1")
60 60
61 // create the controller and inject Angular's $scope 61 // create the controller and inject Angular's $scope
62 scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { 62 scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) {
63 $scope.data = { 63 $scope.data = {
64 show: true, 64 show: true,
65 hide: false 65 hide: false
66 }; 66 };
67 67
68 var chennai = new Date("Sept 20, 2018 12:00:00").getTime(); 68 var chennai = new Date("Sept 20, 2018 12:00:00").getTime();
69 // Update the count down every 1 second 69 // Update the count down every 1 second
70 var x = setInterval(function() { 70 var x = setInterval(function() {
71 // Get todays date and time 71 // Get todays date and time
72 var now = new Date().getTime(); 72 var now = new Date().getTime();
73 // Find the distance between now an the count down date 73 // Find the distance between now an the count down date
74 var distance = chennai - now; 74 var distance = chennai - now;
75 // Time calculations for days, hours, minutes and seconds 75 // Time calculations for days, hours, minutes and seconds
76 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 76 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
77 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 77 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
78 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 78 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
79 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 79 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
80 $scope.timer = days + "d " + hours + "h " 80 $scope.timer = days + "d " + hours + "h "
81 + minutes + "m " + seconds + "s " 81 + minutes + "m " + seconds + "s "
82 // Output the result in an element with id="demo" 82 // Output the result in an element with id="demo"
83 document.getElementById("chennai").innerHTML = days + "d " + hours + "h " 83 document.getElementById("chennai").innerHTML = days + "d " + hours + "h "
84 + minutes + "m " + seconds + "s "; 84 + minutes + "m " + seconds + "s ";
85 // If the count down is over, write some text 85 // If the count down is over, write some text
86 if (distance < 0) { 86 if (distance < 0) {
87 clearInterval(x); 87 clearInterval(x);
88 document.getElementById("chennai").innerHTML = "EXPIRED"; 88 document.getElementById("chennai").innerHTML = "EXPIRED";
89 } 89 }
90 }, 1000); 90 }, 1000);
91 91
92 var hyderabad = new Date("Sept 22, 2018 12:00:00").getTime(); 92 var hyderabad = new Date("Sept 22, 2018 12:00:00").getTime();
93 // Update the count down every 1 second 93 // Update the count down every 1 second
94 var x = setInterval(function() { 94 var x = setInterval(function() {
95 // Get todays date and time 95 // Get todays date and time
96 var now = new Date().getTime(); 96 var now = new Date().getTime();
97 // Find the distance between now an the count down date 97 // Find the distance between now an the count down date
98 var distance = hyderabad - now; 98 var distance = hyderabad - now;
99 // Time calculations for days, hours, minutes and seconds 99 // Time calculations for days, hours, minutes and seconds
100 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 100 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
101 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 101 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
102 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 102 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
103 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 103 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
104 $scope.timer = days + "d " + hours + "h " 104 $scope.timer = days + "d " + hours + "h "
105 + minutes + "m " + seconds + "s " 105 + minutes + "m " + seconds + "s "
106 // Output the result in an element with id="demo" 106 // Output the result in an element with id="demo"
107 document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " 107 document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h "
108 + minutes + "m " + seconds + "s "; 108 + minutes + "m " + seconds + "s ";
109 // If the count down is over, write some text 109 // If the count down is over, write some text
110 if (distance < 0) { 110 if (distance < 0) {
111 clearInterval(x); 111 clearInterval(x);
112 document.getElementById("hyderabad").innerHTML = "EXPIRED"; 112 document.getElementById("hyderabad").innerHTML = "EXPIRED";
113 } 113 }
114 }, 1000); 114 }, 1000);
115 115
116 var mumbai = new Date("Sept 26, 2018 12:00:00").getTime(); 116 var mumbai = new Date("Sept 26, 2018 12:00:00").getTime();
117 // Update the count down every 1 second 117 // Update the count down every 1 second
118 var x = setInterval(function() { 118 var x = setInterval(function() {
119 // Get todays date and time 119 // Get todays date and time
120 var now = new Date().getTime(); 120 var now = new Date().getTime();
121 // Find the distance between now an the count down date 121 // Find the distance between now an the count down date
122 var distance = mumbai - now; 122 var distance = mumbai - now;
123 // Time calculations for days, hours, minutes and seconds 123 // Time calculations for days, hours, minutes and seconds
124 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 124 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
125 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 125 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
126 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 126 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
127 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 127 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
128 $scope.timer = days + "d " + hours + "h " 128 $scope.timer = days + "d " + hours + "h "
129 + minutes + "m " + seconds + "s " 129 + minutes + "m " + seconds + "s "
130 // Output the result in an element with id="demo" 130 // Output the result in an element with id="demo"
131 document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " 131 document.getElementById("mumbai").innerHTML = days + "d " + hours + "h "
132 + minutes + "m " + seconds + "s "; 132 + minutes + "m " + seconds + "s ";
133 // If the count down is over, write some text 133 // If the count down is over, write some text
134 if (distance < 0) { 134 if (distance < 0) {
135 clearInterval(x); 135 clearInterval(x);
136 document.getElementById("mumbai").innerHTML = "EXPIRED"; 136 document.getElementById("mumbai").innerHTML = "EXPIRED";
137 } 137 }
138 }, 1000); 138 }, 1000);
139 139
140 var kolkata = new Date("Oct 3, 2018 12:00:00").getTime(); 140 var kolkata = new Date("Oct 3, 2018 12:00:00").getTime();
141 // Update the count down every 1 second 141 // Update the count down every 1 second
142 var x = setInterval(function() { 142 var x = setInterval(function() {
143 // Get todays date and time 143 // Get todays date and time
144 var now = new Date().getTime(); 144 var now = new Date().getTime();
145 // Find the distance between now an the count down date 145 // Find the distance between now an the count down date
146 var distance = kolkata - now; 146 var distance = kolkata - now;
147 // Time calculations for days, hours, minutes and seconds 147 // Time calculations for days, hours, minutes and seconds
148 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 148 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
149 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 149 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
150 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 150 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
151 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 151 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
152 $scope.timer = days + "d " + hours + "h " 152 $scope.timer = days + "d " + hours + "h "
153 + minutes + "m " + seconds + "s " 153 + minutes + "m " + seconds + "s "
154 // Output the result in an element with id="demo" 154 // Output the result in an element with id="demo"
155 document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " 155 document.getElementById("kolkata").innerHTML = days + "d " + hours + "h "
156 + minutes + "m " + seconds + "s "; 156 + minutes + "m " + seconds + "s ";
157 // If the count down is over, write some text 157 // If the count down is over, write some text
158 if (distance < 0) { 158 if (distance < 0) {
159 clearInterval(x); 159 clearInterval(x);
160 document.getElementById("kolkata").innerHTML = "EXPIRED"; 160 document.getElementById("kolkata").innerHTML = "EXPIRED";
161 } 161 }
162 }, 1000); 162 }, 1000);
163 163
164 var jaipur = new Date("Oct 5, 2018 12:00:00").getTime(); 164 var jaipur = new Date("Oct 5, 2018 12:00:00").getTime();
165 // Update the count down every 1 second 165 // Update the count down every 1 second
166 var x = setInterval(function() { 166 var x = setInterval(function() {
167 // Get todays date and time 167 // Get todays date and time
168 var now = new Date().getTime(); 168 var now = new Date().getTime();
169 // Find the distance between now an the count down date 169 // Find the distance between now an the count down date
170 var distance = jaipur - now; 170 var distance = jaipur - now;
171 // Time calculations for days, hours, minutes and seconds 171 // Time calculations for days, hours, minutes and seconds
172 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 172 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
173 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 173 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
174 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 174 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
175 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 175 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
176 $scope.timer = days + "d " + hours + "h " 176 $scope.timer = days + "d " + hours + "h "
177 + minutes + "m " + seconds + "s " 177 + minutes + "m " + seconds + "s "
178 // Output the result in an element with id="demo" 178 // Output the result in an element with id="demo"
179 document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " 179 document.getElementById("jaipur").innerHTML = days + "d " + hours + "h "
180 + minutes + "m " + seconds + "s "; 180 + minutes + "m " + seconds + "s ";
181 // If the count down is over, write some text 181 // If the count down is over, write some text
182 if (distance < 0) { 182 if (distance < 0) {
183 clearInterval(x); 183 clearInterval(x);
184 document.getElementById("jaipur").innerHTML = "EXPIRED"; 184 document.getElementById("jaipur").innerHTML = "EXPIRED";
185 } 185 }
186 }, 1000); 186 }, 1000);
187 187
188 var delhi = new Date("Oct 8, 2018 12:00:00").getTime(); 188 var delhi = new Date("Oct 8, 2018 12:00:00").getTime();
189 // Update the count down every 1 second 189 // Update the count down every 1 second
190 var x = setInterval(function() { 190 var x = setInterval(function() {
191 // Get todays date and time 191 // Get todays date and time
192 var now = new Date().getTime(); 192 var now = new Date().getTime();
193 // Find the distance between now an the count down date 193 // Find the distance between now an the count down date
194 var distance = delhi - now; 194 var distance = delhi - now;
195 // Time calculations for days, hours, minutes and seconds 195 // Time calculations for days, hours, minutes and seconds
196 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 196 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
197 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 197 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
198 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 198 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
199 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 199 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
200 $scope.timer = days + "d " + hours + "h " 200 $scope.timer = days + "d " + hours + "h "
201 + minutes + "m " + seconds + "s " 201 + minutes + "m " + seconds + "s "
202 // Output the result in an element with id="demo" 202 // Output the result in an element with id="demo"
203 document.getElementById("delhi").innerHTML = days + "d " + hours + "h " 203 document.getElementById("delhi").innerHTML = days + "d " + hours + "h "
204 + minutes + "m " + seconds + "s "; 204 + minutes + "m " + seconds + "s ";
205 // If the count down is over, write some text 205 // If the count down is over, write some text
206 if (distance < 0) { 206 if (distance < 0) {
207 clearInterval(x); 207 clearInterval(x);
208 document.getElementById("delhi").innerHTML = "EXPIRED"; 208 document.getElementById("delhi").innerHTML = "EXPIRED";
209 } 209 }
210 }, 1000); 210 }, 1000);
211 211
212 var kanpur = new Date("Oct 10, 2018 12:00:00").getTime(); 212 var kanpur = new Date("Oct 10, 2018 12:00:00").getTime();
213 // Update the count down every 1 second 213 // Update the count down every 1 second
214 var x = setInterval(function() { 214 var x = setInterval(function() {
215 // Get todays date and time 215 // Get todays date and time
216 var now = new Date().getTime(); 216 var now = new Date().getTime();
217 // Find the distance between now an the count down date 217 // Find the distance between now an the count down date
218 var distance = kanpur - now; 218 var distance = kanpur - now;
219 // Time calculations for days, hours, minutes and seconds 219 // Time calculations for days, hours, minutes and seconds
220 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 220 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
221 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 221 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
222 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 222 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
223 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 223 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
224 $scope.timer = days + "d " + hours + "h " 224 $scope.timer = days + "d " + hours + "h "
225 + minutes + "m " + seconds + "s " 225 + minutes + "m " + seconds + "s "
226 // Output the result in an element with id="demo" 226 // Output the result in an element with id="demo"
227 document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " 227 document.getElementById("kanpur").innerHTML = days + "d " + hours + "h "
228 + minutes + "m " + seconds + "s "; 228 + minutes + "m " + seconds + "s ";
229 // If the count down is over, write some text 229 // If the count down is over, write some text
230 if (distance < 0) { 230 if (distance < 0) {
231 clearInterval(x); 231 clearInterval(x);
232 document.getElementById("kanpur").innerHTML = "EXPIRED"; 232 document.getElementById("kanpur").innerHTML = "EXPIRED";
233 } 233 }
234 }, 1000); 234 }, 1000);
235 235
236 var ahmedabad = new Date("Oct 12, 2018 12:00:00").getTime(); 236 var ahmedabad = new Date("Oct 12, 2018 12:00:00").getTime();
237 // Update the count down every 1 second 237 // Update the count down every 1 second
238 var x = setInterval(function() { 238 var x = setInterval(function() {
239 // Get todays date and time 239 // Get todays date and time
240 var now = new Date().getTime(); 240 var now = new Date().getTime();
241 // Find the distance between now an the count down date 241 // Find the distance between now an the count down date
242 var distance = ahmedabad - now; 242 var distance = ahmedabad - now;
243 // Time calculations for days, hours, minutes and seconds 243 // Time calculations for days, hours, minutes and seconds
244 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 244 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
245 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 245 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
246 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 246 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
247 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 247 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
248 $scope.timer = days + "d " + hours + "h " 248 $scope.timer = days + "d " + hours + "h "
249 + minutes + "m " + seconds + "s " 249 + minutes + "m " + seconds + "s "
250 // Output the result in an element with id="demo" 250 // Output the result in an element with id="demo"
251 document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " 251 document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h "
252 + minutes + "m " + seconds + "s "; 252 + minutes + "m " + seconds + "s ";
253 // If the count down is over, write some text 253 // If the count down is over, write some text
254 if (distance < 0) { 254 if (distance < 0) {
255 clearInterval(x); 255 clearInterval(x);
256 document.getElementById("ahmedabad").innerHTML = "EXPIRED"; 256 document.getElementById("ahmedabad").innerHTML = "EXPIRED";
257 } 257 }
258 }, 1000); 258 }, 1000);
259 259
260 var bengaluru = new Date("Oct 13, 2018 12:00:00").getTime(); 260 var bengaluru = new Date("Oct 13, 2018 12:00:00").getTime();
261 // Update the count down every 1 second 261 // Update the count down every 1 second
262 var x = setInterval(function() { 262 var x = setInterval(function() {
263 // Get todays date and time 263 // Get todays date and time
264 var now = new Date().getTime(); 264 var now = new Date().getTime();
265 // Find the distance between now an the count down date 265 // Find the distance between now an the count down date
266 var distance = bengaluru - now; 266 var distance = bengaluru - now;
267 // Time calculations for days, hours, minutes and seconds 267 // Time calculations for days, hours, minutes and seconds
268 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 268 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
269 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 269 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
270 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 270 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
271 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 271 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
272 $scope.timer = days + "d " + hours + "h " 272 $scope.timer = days + "d " + hours + "h "
273 + minutes + "m " + seconds + "s " 273 + minutes + "m " + seconds + "s "
274 // Output the result in an element with id="demo" 274 // Output the result in an element with id="demo"
275 document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " 275 document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h "
276 + minutes + "m " + seconds + "s "; 276 + minutes + "m " + seconds + "s ";
277 // If the count down is over, write some text 277 // If the count down is over, write some text
278 if (distance < 0) { 278 if (distance < 0) {
279 clearInterval(x); 279 clearInterval(x);
280 document.getElementById("bengaluru").innerHTML = "EXPIRED"; 280 document.getElementById("bengaluru").innerHTML = "EXPIRED";
281 } 281 }
282 }, 1000); 282 }, 1000);
283 283
284 var dharamsala = new Date("Dec 14, 2018 12:00:00").getTime(); 284 var dharamsala = new Date("Dec 14, 2018 12:00:00").getTime();
285 // Update the count down every 1 second 285 // Update the count down every 1 second
286 var x = setInterval(function() { 286 var x = setInterval(function() {
287 // Get todays date and time 287 // Get todays date and time
288 var now = new Date().getTime(); 288 var now = new Date().getTime();
289 // Find the distance between now an the count down date 289 // Find the distance between now an the count down date
290 var distance = dharamsala - now; 290 var distance = dharamsala - now;
291 // Time calculations for days, hours, minutes and seconds 291 // Time calculations for days, hours, minutes and seconds
292 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 292 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
293 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 293 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
294 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 294 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
295 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 295 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
296 $scope.timer = days + "d " + hours + "h " 296 $scope.timer = days + "d " + hours + "h "
297 + minutes + "m " + seconds + "s " 297 + minutes + "m " + seconds + "s "
298 // Output the result in an element with id="demo" 298 // Output the result in an element with id="demo"
299 document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " 299 document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h "
300 + minutes + "m " + seconds + "s "; 300 + minutes + "m " + seconds + "s ";
301 // If the count down is over, write some text 301 // If the count down is over, write some text
302 if (distance < 0) { 302 if (distance < 0) {
303 clearInterval(x); 303 clearInterval(x);
304 document.getElementById("dharamsala").innerHTML = "EXPIRED"; 304 document.getElementById("dharamsala").innerHTML = "EXPIRED";
305 } 305 }
306 }, 1000); 306 }, 1000);
307 307
308 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 308 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
309 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 309 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
310 // $scope.Textshow = "yes" 310 // $scope.Textshow = "yes"
311 $scope.max = 100; 311 $scope.max = 100;
312 $scope.formPage = false; 312 $scope.formPage = false;
313 $scope.current = 0; 313 $scope.current = 0;
314 $scope.payingAmnt = 0; 314 $scope.payingAmnt = 0;
315 $scope.data = {}; 315 $scope.data = {};
316 $scope.discountAmount = 0; 316 $scope.discountAmount = 0;
317 // $scope.data.quantity = "1"; 317 // $scope.data.quantity = "1";
318 $scope.check = false; 318 $scope.check = false;
319 $scope.numberCheck = false; 319 $scope.numberCheck = false;
320 $scope.paymentResult = {}; 320 $scope.paymentResult = {};
321 var data = { 321 var data = {
322 "amount": $scope.payingAmnt, 322 "amount": $scope.payingAmnt,
323 "currency": "INR", 323 "currency": "INR",
324 "status": "pending" 324 "status": "pending"
325 } 325 }
326 326
327 $scope.apply = function() { 327 $scope.apply = function() {
328 //Analytics.trackEvent('register', 'click', 'Registration'); 328 //Analytics.trackEvent('register', 'click', 'Registration');
329 $location.path("/caricatures") 329 $location.path("/caricatures")
330 } 330 }
331 331
332 $scope.data.city = ''; 332 $scope.data.city = '';
333 $scope.watch = function(value){ 333 $scope.watch = function(value){
334 console.log("cllll",value) 334 console.log("cllll",value)
335 $scope.data.city = value; 335 $scope.data.city = value;
336 localStorage.setItem("city" ,value); 336 localStorage.setItem("city" ,value);
337 //$location.path('/registration').search({city: value}); 337 //$location.path('/registration').search({city: value});
338 $location.path('/registration/'+value+''); 338 $location.path('/registration/'+value+'');
339 //$state.go('registration', { 'city': value}) 339 //$state.go('registration', { 'city': value})
340 } 340 }
341 341
342 $scope.select = function(url){ 342 $scope.select = function(url){
343 console.log("cllll") 343 console.log("cllll")
344 window.open(url) 344 window.open(url)
345 } 345 }
346 346
347 $scope.stagekeyPress = function() { 347 $scope.stagekeyPress = function() {
348 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); 348 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
349 } 349 }
350 $scope.sectorkeyPress = function() { 350 $scope.sectorkeyPress = function() {
351 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); 351 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
352 } 352 }
353 353
354 $scope.productLaunchkeyPress = function() { 354 $scope.productLaunchkeyPress = function() {
355 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); 355 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
356 } 356 }
357 357
358 $scope.launchPeriodkeyPress = function() { 358 $scope.launchPeriodkeyPress = function() {
359 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); 359 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
360 } 360 }
361 361
362 $scope.industrykeyPress = function(quantity) { 362 $scope.industrykeyPress = function(quantity) {
363 console.log("fghj",quantity) 363 console.log("fghj",quantity)
364 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); 364 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
365 } 365 }
366 366
367 $scope.industryNamekeyPress = function(firstName) { 367 $scope.industryNamekeyPress = function(firstName) {
368 console.log("lastName==", firstName); 368 console.log("lastName==", firstName);
369 if (firstName == undefined) { 369 if (firstName == undefined) {
370 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 370 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
371 } else { 371 } else {
372 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 372 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
373 } 373 }
374 } 374 }
375 375
376 $scope.amountkeyPress = function() { 376 $scope.amountkeyPress = function() {
377 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); 377 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
378 } 378 }
379 379
380 $scope.firstNamekeyPress = function(name) { 380 $scope.firstNamekeyPress = function(name) {
381 console.log("lastName==", name); 381 console.log("lastName==", name);
382 if (name == undefined) { 382 if (name == undefined) {
383 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); 383 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
384 } else { 384 } else {
385 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); 385 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
386 } 386 }
387 } 387 }
388 388
389 $scope.emailkeyPress = function(email) { 389 $scope.emailkeyPress = function(email) {
390 console.log("email", email); 390 console.log("email", email);
391 if (email == undefined) { 391 if (email == undefined) {
392 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); 392 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
393 } else { 393 } else {
394 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); 394 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
395 } 395 }
396 } 396 }
397 397
398 $scope.phonekeyPress = function(number) { 398 $scope.phonekeyPress = function(number) {
399 console.log("number", number); 399 console.log("number", number);
400 if (number == undefined || number == '') { 400 if (number == undefined || number == '') {
401 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); 401 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
402 } else { 402 } else {
403 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); 403 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
404 } 404 }
405 } 405 }
406 406
407 $scope.citykeyPress = function(city) { 407 $scope.citykeyPress = function(city) {
408 console.log("city", city); 408 console.log("city", city);
409 if (city == undefined) { 409 if (city == undefined) {
410 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); 410 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
411 } else { 411 } else {
412 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); 412 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
413 } 413 }
414 } 414 }
415 415
416 $scope.startupNamekeyPress = function(q) { 416 $scope.startupNamekeyPress = function(q) {
417 if (q == undefined) { 417 if (q == undefined) {
418 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); 418 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
419 } else { 419 } else {
420 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); 420 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
421 } 421 }
422 } 422 }
423 423
424 $scope.linkedInkeyPress = function(technology) { 424 $scope.linkedInkeyPress = function(technology) {
425 if (technology == undefined || technology == '') { 425 if (technology == undefined || technology == '') {
426 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); 426 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
427 } else { 427 } else {
428 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); 428 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
429 } 429 }
430 } 430 }
431 $scope.companykeyPress = function(problem) { 431 $scope.companykeyPress = function(problem) {
432 if (problem == undefined) { 432 if (problem == undefined) {
433 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); 433 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
434 } else { 434 } else {
435 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); 435 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
436 } 436 }
437 } 437 }
438 $scope.productNamekeyPress = function(solution) { 438 $scope.productNamekeyPress = function(solution) {
439 if (solution == undefined) { 439 if (solution == undefined) {
440 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); 440 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
441 } else { 441 } else {
442 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); 442 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
443 } 443 }
444 } 444 }
445 $scope.businesskeyPress = function(business) { 445 $scope.businesskeyPress = function(business) {
446 if (business == undefined) { 446 if (business == undefined) {
447 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); 447 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)');
448 } else { 448 } else {
449 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); 449 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)');
450 } 450 }
451 } 451 }
452 452
453 $scope.websitekeyPress = function(prototype) { 453 $scope.websitekeyPress = function(prototype) {
454 if (prototype == undefined || prototype == '') { 454 if (prototype == undefined || prototype == '') {
455 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); 455 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
456 } else { 456 } else {
457 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); 457 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
458 } 458 }
459 } 459 }
460 460
461 $scope.employeekeyPress = function(market) { 461 $scope.employeekeyPress = function(market) {
462 if (market == undefined || market == '') { 462 if (market == undefined || market == '') {
463 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); 463 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
464 } else { 464 } else {
465 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); 465 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
466 } 466 }
467 } 467 }
468 468
469 $scope.annualkeyPress = function(risk) { 469 $scope.annualkeyPress = function(risk) {
470 if (risk == undefined || risk == '') { 470 if (risk == undefined || risk == '') {
471 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); 471 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
472 } else { 472 } else {
473 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); 473 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
474 } 474 }
475 } 475 }
476 476
477 $scope.revenuekeyPress = function(team) { 477 $scope.revenuekeyPress = function(team) {
478 if (team == undefined) { 478 if (team == undefined) {
479 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); 479 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
480 } else { 480 } else {
481 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); 481 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
482 } 482 }
483 } 483 }
484 484
485 $scope.descriptionkeyPress = function(pitch) { 485 $scope.descriptionkeyPress = function(pitch) {
486 if (pitch == undefined) { 486 if (pitch == undefined) {
487 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); 487 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
488 } else { 488 } else {
489 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); 489 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
490 } 490 }
491 } 491 }
492 492
493 $scope.discountkeyPress = function(discount) { 493 $scope.discountkeyPress = function(discount) {
494 if (discount == undefined) { 494 if (discount == undefined) {
495 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 495 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
496 } else { 496 } else {
497 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 497 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
498 } 498 }
499 } 499 }
500 500
501 $scope.removeNooError = function() { 501 $scope.removeNooError = function() {
502 $('#invalidIdea').css('display', 'block'); 502 $('#invalidIdea').css('display', 'block');
503 $('#noExist').css('display', 'none'); 503 $('#noExist').css('display', 'none');
504 }; 504 };
505 505
506 $scope.ideakeyPress = function(financial) { 506 $scope.ideakeyPress = function(financial) {
507 console.log("financial", financial); 507 console.log("financial", financial);
508 if (financial == undefined) { 508 if (financial == undefined) {
509 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); 509 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
510 } else { 510 } else {
511 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); 511 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
512 } 512 }
513 } 513 }
514 514
515 $scope.fundkeyPress = function(financial) { 515 $scope.fundkeyPress = function(financial) {
516 console.log("financial", financial); 516 console.log("financial", financial);
517 if (financial == undefined) { 517 if (financial == undefined) {
518 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); 518 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
519 } else { 519 } else {
520 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); 520 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
521 } 521 }
522 } 522 }
523 523
524 $scope.changeReferalIconColor = function(referalToken){ 524 $scope.changeReferalIconColor = function(referalToken){
525 if (referalToken == undefined || referalToken == '') { 525 if (referalToken == undefined || referalToken == '') {
526 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); 526 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
527 }else { 527 }else {
528 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); 528 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
529 } 529 }
530 } 530 }
531 531
532 }); 532 });
533 533
534 scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) { 534 scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) {
535 $scope.data = {}; 535 $scope.data = {};
536 $scope.check = false; 536 $scope.check = false;
537 $scope.numberCheck = false; 537 $scope.numberCheck = false;
538 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 538 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
539 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 539 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
540 $scope.max = 100; 540 $scope.max = 100;
541 $scope.formPage = false; 541 $scope.formPage = false;
542 $scope.current = 0; 542 $scope.current = 0;
543 $scope.payingAmnt = 0; 543 $scope.payingAmnt = 0;
544 $scope.discountAmount = 0; 544 $scope.discountAmount = 0;
545 // $scope.data.quantity = "1"; 545 // $scope.data.quantity = "1";
546 $scope.check = false; 546 $scope.check = false;
547 $scope.numberCheck = false; 547 $scope.numberCheck = false;
548 $scope.paymentResult = {}; 548 $scope.paymentResult = {};
549 var data = { 549 var data = {
550 "amount": $scope.payingAmnt, 550 "amount": $scope.payingAmnt,
551 "currency": "INR", 551 "currency": "INR",
552 "status": "pending" 552 "status": "pending"
553 } 553 }
554 554
555 $scope.removeError = function() { 555 $scope.removeError = function() {
556 $('#invalidEmail').css('display', 'none'); 556 $('#invalidEmail').css('display', 'none');
557 $('#alreadyExist').css('display', 'none'); 557 $('#alreadyExist').css('display', 'none');
558 }; 558 };
559 559
560 $scope.emailcheck = function(val) { 560 $scope.emailcheck = function(val) {
561 if (val == undefined) { 561 if (val == undefined) {
562 $('#invalidEmail').css('display', 'block'); 562 $('#invalidEmail').css('display', 'block');
563 } else { 563 } else {
564 $('#alreadyExist').css('display', 'block'); 564 $('#alreadyExist').css('display', 'block');
565 } 565 }
566 }; 566 };
567 567
568 $scope.removeNoError = function() { 568 $scope.removeNoError = function() {
569 $('#invalidNumber').css('display', 'none'); 569 $('#invalidNumber').css('display', 'none');
570 $('#alreadyExist').css('display', 'none'); 570 $('#alreadyExist').css('display', 'none');
571 }; 571 };
572 572
573 $scope.numbercheck = function(val) { 573 $scope.numbercheck = function(val) {
574 if (val == undefined) { 574 if (val == undefined) {
575 $('#invalidNumber').css('display', 'block'); 575 $('#invalidNumber').css('display', 'block');
576 } else { 576 } else {
577 $('#alreadyExist').css('display', 'block'); 577 $('#alreadyExist').css('display', 'block');
578 } 578 }
579 }; 579 };
580 580
581 // $scope.$on('city', function (event, value) { 581 // $scope.$on('city', function (event, value) {
582 $scope.data.city = localStorage.getItem("city"); 582 $scope.data.city = localStorage.getItem("city");
583 console.log("HERE===",$scope.data.city ); 583 console.log("HERE===",$scope.data.city );
584 // }); 584 // });
585 585
586 $rootScope.tokenCall = function(val) { 586 $rootScope.tokenCall = function(val) {
587 console.log('val-------->', val); 587 console.log('val-------->', val);
588 if (val == undefined) { 588 if (val == undefined) {
589 $('#invalidToken').css('display', 'block'); 589 $('#invalidToken').css('display', 'block');
590 } else { 590 } else {
591 val = val.toUpperCase(); 591 val = val.toUpperCase();
592 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")){
593 $scope.tokencheck = false;
594 return;
595 }
592 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') 596 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
593 .then(function(searchResult) { 597 .then(function(searchResult) {
594 console.log("searchResult",searchResult) 598 console.log("searchResult",searchResult)
595 if (searchResult.data.length == 0) { 599 if (searchResult.data.length == 0) {
596 $scope.tokencheck = false; 600 $scope.tokencheck = false;
597 $scope.discountAmount = 0; 601 $scope.discountAmount = 0;
598 } else { 602 } else {
599 console.log("===searchResult.data[0].discount===",searchResult.data[0].discount); 603 console.log("===searchResult.data[0].discount===",searchResult.data[0].discount);
600 $scope.discountpercentage = searchResult.data[0].discount; 604 $scope.discountpercentage = searchResult.data[0].discount;
601 console.log("===searchResultdiscountpercentage===",$scope.discountpercentage); 605 console.log("===searchResultdiscountpercentage===",$scope.discountpercentage);
602 $scope.tokencheck = true; 606 $scope.tokencheck = true;
603 } 607 }
604 },function(err){ 608 },function(err){
605 console.log(err) 609 console.log(err)
606 }); 610 });
607 611
608 } 612 }
609 }; 613 };
610 614
611 $scope.submit = function() { 615 $scope.submit = function() {
612 $scope.ticketAmnt = 500; 616 $scope.ticketAmnt = 500;
613 if($scope.tokencheck == false){ 617 if($scope.tokencheck == false){
614 $scope.data.referalToken = null; 618 $scope.data.referalToken = null;
615 } 619 }
616 if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 620 if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
617 var x = document.getElementById("snackbar") 621 var x = document.getElementById("snackbar")
618 setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 622 setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
619 }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 623 }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
620 $scope.infoForm = true; 624 $scope.infoForm = true;
621 $scope.detail = {}; 625 $scope.detail = {};
622 $scope.data.phone = "+91"+$scope.data.number; 626 $scope.data.phone = "+91"+$scope.data.number;
623 if($scope.data.referalToken == null){ 627 if($scope.data.referalToken == null){
624 $scope.data.referalToken = "N.A." 628 $scope.data.referalToken = "N.A."
625 } 629 }
626 $http({ 630 $http({
627 method: 'POST', 631 method: 'POST',
628 url: BASE_URL+'/applicants', 632 url: BASE_URL+'/applicants',
629 data: $scope.data, 633 data: $scope.data,
630 headers: {} 634 headers: {}
631 }).then(function mySuccess(result) { 635 }).then(function mySuccess(result) {
632 console.log("=====result=====",result) 636 console.log("=====result=====",result)
633 $scope.detail = result; 637 $scope.detail = result;
634 data.applicantId = result.data.id; 638 data.applicantId = result.data.id;
635 $scope.userId = result.data.id; 639 $scope.userId = result.data.id;
636 console.log("=====data=====",data) 640 console.log("=====data=====",data)
637 var amount = $scope.ticketAmnt * 100 641 var amount = $scope.ticketAmnt * 100
638 if($scope.tokencheck == true){ 642 if($scope.tokencheck == true){
639 var amount = $scope.ticketAmnt 643 var amount = $scope.ticketAmnt
640 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 644 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
641 if($scope.discountpercentage == "100") { 645 console.log("resultcity===",$scope.data.city)
642 $scope.discountpercentage = "99.8"; 646 if($scope.discountpercentage == "100") {
643 console.log("$scope.discountpercentage====",$scope.discountpercentage) 647 $scope.discountpercentage = "99.8";
648 console.log("$scope.discountpercentage====",$scope.discountpercentage)
644 } 649 }
645 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 650 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
646 $scope.percDiscount = $scope.discountpercentage/100; 651 $scope.percDiscount = $scope.discountpercentage/100;
647 console.log("====$scope.percDiscount====",$scope.percDiscount); 652 console.log("====$scope.percDiscount====",$scope.percDiscount);
648 console.log("====amount=====",amount); 653 console.log("====amount=====",amount);
649 $scope.discountAmount = amount * $scope.percDiscount; 654 $scope.discountAmount = amount * $scope.percDiscount;
650 console.log("finalAmount====>",$scope.discountAmount) 655 console.log("finalAmount====>",$scope.discountAmount)
651 } 656 }
652 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 657 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
653 console.log("$scope.taxTotal----",taxAmount) 658 console.log("$scope.taxTotal----",taxAmount)
654 $scope.payingAmnt = taxAmount; 659 $scope.payingAmnt = taxAmount;
655 console.log("====$scope.payingAmnt====",$scope.payingAmnt) 660 console.log("====$scope.payingAmnt====",$scope.payingAmnt)
656 $scope.payingAmnt = $scope.payingAmnt.toFixed() 661 $scope.payingAmnt = $scope.payingAmnt.toFixed()
657 data.amount = $scope.payingAmnt; 662 data.amount = $scope.payingAmnt;
658 console.log("data.amount==",data.amount) 663 console.log("data.amount==",data.amount)
659 if($scope.detail != null){ 664 if($scope.detail != null){
660 $http({ 665 $http({
661 method: 'POST', 666 method: 'POST',
662 url: BASE_URL+'/payments', 667 url: BASE_URL+'/payments',
663 data: data, 668 data: data,
664 headers: {} 669 headers: {}
665 }).then(function mySuccess(paymentResult) { 670 }).then(function mySuccess(paymentResult) {
666 $scope.paymentResult = paymentResult; 671 $scope.paymentResult = paymentResult;
667 }, function myError(error) { 672 }, function myError(error) {
668 }); 673 });
669 } 674 }
670 var i = 0; 675 var i = 0;
671 $scope.payingAmnt = $scope.payingAmnt * 100; 676 $scope.payingAmnt = $scope.payingAmnt * 100;
672 var options = { 677 var options = {
673 //"key": "rzp_test_YwHsVFiDIQ2WUQ", 678 //"key": "rzp_test_YwHsVFiDIQ2WUQ",
674 "key": "rzp_live_mkmCb4FkstuWaS", 679 "key": "rzp_live_mkmCb4FkstuWaS",
675 "amount": $scope.payingAmnt, 680 "amount": $scope.payingAmnt,
676 681
677 "name": "Startup Jalsa", 682 "name": "Startup Jalsa",
678 "description":"amount", 683 "description":"amount",
679 "currency": "INR", 684 "currency": "INR",
680 "status": "done", 685 "status": "done",
681 686
682 "prefill": { 687 "prefill": {
683 "email": $scope.detail.email, 688 "email": $scope.detail.email,
684 "contact": $scope.detail.phone 689 "contact": $scope.detail.phone
685 }, 690 },
686 691
687 "theme": { 692 "theme": {
688 "color": "#2196f3 ", 693 "color": "#2196f3 ",
689 "image_padding":"NO" 694 "image_padding":"NO"
690 }, 695 },
691 "modal": { 696 "modal": {
692 "ondismiss": function(){ 697 "ondismiss": function(){
693 } 698 }
694 }, 699 },
695 "handler": function (response){ 700 "handler": function (response){
696 createPayment(response); 701 createPayment(response);
697 } 702 }
698 }; 703 };
699 var rzp1 = new Razorpay(options); 704 var rzp1 = new Razorpay(options);
700 rzp1.open(); 705 rzp1.open();
701 $scope.paymentResponse = {}; 706 $scope.paymentResponse = {};
702 function createPayment(response){ 707 function createPayment(response){
703 console.log("response12333333",response) 708 console.log("response12333333",response)
704 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 709 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
705 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 710 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
706 $scope.paymentResponse.amount = data.amount; 711 $scope.paymentResponse.amount = data.amount;
707 $scope.paymentResponse.currency = "INR"; 712 $scope.paymentResponse.currency = "INR";
708 $scope.paymentResponse.status = $scope.paymentResult.data.status; 713 $scope.paymentResponse.status = $scope.paymentResult.data.status;
709 console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) 714 console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
710 $http({ 715 $http({
711 method: 'PUT', 716 method: 'PUT',
712 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 717 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
713 data: $scope.paymentResponse, 718 data: $scope.paymentResponse,
714 headers: {} 719 headers: {}
715 }).then(function mySuccess(searchResult) { 720 }).then(function mySuccess(searchResult) {
716 console.log("searchResult",searchResult) 721 console.log("searchResult",searchResult)
717 $location.path("/confirmation") 722 $location.path("/confirmation")
718 }, function myError(error) { 723 }, function myError(error) {
719 }); 724 });
720 } 725 }
726 //}
721 727
722 }, function myError(error) { 728 }, function myError(error) {
723 729
724 }); 730 });
725 731
726 } 732 }
727 733
728 } 734 }
729 735
730 }); 736 });
731 737
732 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { 738 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) {
733 $scope.data = {}; 739 $scope.data = {};
734 $scope.check = false; 740 $scope.check = false;
735 $scope.numberCheck = false; 741 $scope.numberCheck = false;
736 742
737 $scope.submit = function() { 743 $scope.submit = function() {
738 console.log($scope.data.name) 744 console.log($scope.data.name)
739 var randomNumber = ""+Math.random(); 745 var randomNumber = ""+Math.random();
740 var nameSpliced = $scope.data.name.slice(0,5); 746 var nameSpliced = $scope.data.name.slice(0,5);
741 var numberSpliced = randomNumber.slice(2,4);; 747 var numberSpliced = randomNumber.slice(2,4);;
742 $scope.data.referalToken = nameSpliced+numberSpliced; 748 $scope.data.referalToken = nameSpliced+numberSpliced;
743 $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); 749 $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
744 console.log("dsdfs",numberSpliced); 750 console.log("dsdfs",numberSpliced);
745 $http({ 751 $http({
746 method: 'POST', 752 method: 'POST',
747 url: BASE_URL + '/ambassadors', 753 url: BASE_URL + '/ambassadors',
748 data: $scope.data, 754 data: $scope.data,
749 headers: {} 755 headers: {}
750 }).then(function mySuccess(result) { 756 }).then(function mySuccess(result) {
751 console.log("result", result) 757 console.log("result", result)
752 $scope.detail = result; 758 $scope.detail = result;
753 $('#myModal').modal('show'); 759 $('#myModal').modal('show');
754 $scope.data.name = ''; 760 $scope.data.name = '';
755 $scope.data.email = ''; 761 $scope.data.email = '';
756 $scope.data.mobile = ''; 762 $scope.data.mobile = '';
757 //$scope.data.discount = ''; 763 //$scope.data.discount = '';
758 764
759 }, function myError(error) { 765 }, function myError(error) {
760 console.log(error) 766 console.log(error)
761 console.log(error.data.error.message) 767 console.log(error.data.error.message)
762 }); 768 });
763 } 769 }
764 }); 770 });
765 771
766 772
767 773
768 774
769 775