Commit e3d25d261853808b647638927f94d91dbf709200

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

delete url

Showing 1 changed file with 243 additions and 195 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 pune = new Date("Nov 11, 2017 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 = pune - 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("pune").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("pune").innerHTML = "EXPIRED"; 88 document.getElementById("chennai").innerHTML = "EXPIRED";
89 // } 89 }
90 // }, 1000); 90 }, 1000);
91 91
92 // var mumbai = new Date("Nov 13, 2017 16: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 = mumbai - 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("mumbai").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("mumbai").innerHTML = "EXPIRED"; 112 document.getElementById("hyderabad").innerHTML = "EXPIRED";
113 // } 113 }
114 // }, 1000); 114 }, 1000);
115 115
116 // var ahmedabad = new Date("Nov 15, 2017 16: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 = ahmedabad - 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("ahmedabad").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("ahmedabad").innerHTML = "EXPIRED"; 136 document.getElementById("mumbai").innerHTML = "EXPIRED";
137 // } 137 }
138 // }, 1000); 138 }, 1000);
139 139
140 // var jaipur = new Date("Nov 17, 2017 16: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 = jaipur - 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("jaipur").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("jaipur").innerHTML = "EXPIRED"; 160 document.getElementById("kolkata").innerHTML = "EXPIRED";
161 // } 161 }
162 // }, 1000); 162 }, 1000);
163 163
164 // var bangalore = new Date("Nov 22, 2017 16: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 = bangalore - 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("bangalore").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("bangalore").innerHTML = "EXPIRED"; 184 document.getElementById("jaipur").innerHTML = "EXPIRED";
185 // } 185 }
186 // }, 1000); 186 }, 1000);
187 187
188 // var hyderabad = new Date("Nov 21, 2017 16: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 = hyderabad - 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("hyderabad").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("hyderabad").innerHTML = "EXPIRED"; 208 document.getElementById("delhi").innerHTML = "EXPIRED";
209 // } 209 }
210 // }, 1000); 210 }, 1000);
211 211
212 // var delhi = new Date("Nov 27, 2017 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 = delhi - 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("delhi").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("delhi").innerHTML = "EXPIRED"; 232 document.getElementById("kanpur").innerHTML = "EXPIRED";
233 // } 233 }
234 // }, 1000); 234 }, 1000);
235 235
236 // var chandigarh = new Date("Nov 30, 2017 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 = chandigarh - 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("chandigarh").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("chandigarh").innerHTML = "EXPIRED"; 256 document.getElementById("ahmedabad").innerHTML = "EXPIRED";
257 // } 257 }
258 // }, 1000); 258 }, 1000);
259
260 var bengaluru = new Date("Oct 13, 2018 12:00:00").getTime();
261 // Update the count down every 1 second
262 var x = setInterval(function() {
263 // Get todays date and time
264 var now = new Date().getTime();
265 // Find the distance between now an the count down date
266 var distance = bengaluru - now;
267 // Time calculations for days, hours, minutes and seconds
268 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
269 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
270 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
271 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
272 $scope.timer = days + "d " + hours + "h "
273 + minutes + "m " + seconds + "s "
274 // Output the result in an element with id="demo"
275 document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h "
276 + minutes + "m " + seconds + "s ";
277 // If the count down is over, write some text
278 if (distance < 0) {
279 clearInterval(x);
280 document.getElementById("bengaluru").innerHTML = "EXPIRED";
281 }
282 }, 1000);
283
284 var dharamsala = new Date("Dec 14, 2018 12:00:00").getTime();
285 // Update the count down every 1 second
286 var x = setInterval(function() {
287 // Get todays date and time
288 var now = new Date().getTime();
289 // Find the distance between now an the count down date
290 var distance = dharamsala - now;
291 // Time calculations for days, hours, minutes and seconds
292 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
293 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
294 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
295 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
296 $scope.timer = days + "d " + hours + "h "
297 + minutes + "m " + seconds + "s "
298 // Output the result in an element with id="demo"
299 document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h "
300 + minutes + "m " + seconds + "s ";
301 // If the count down is over, write some text
302 if (distance < 0) {
303 clearInterval(x);
304 document.getElementById("dharamsala").innerHTML = "EXPIRED";
305 }
306 }, 1000);
259 307
260 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 308 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
261 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 309 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
262 // $scope.Textshow = "yes" 310 // $scope.Textshow = "yes"
263 $scope.max = 100; 311 $scope.max = 100;
264 $scope.formPage = false; 312 $scope.formPage = false;
265 $scope.current = 0; 313 $scope.current = 0;
266 $scope.payingAmnt = 0; 314 $scope.payingAmnt = 0;
267 $scope.data = {}; 315 $scope.data = {};
268 $scope.discountAmount = 0; 316 $scope.discountAmount = 0;
269 // $scope.data.quantity = "1"; 317 // $scope.data.quantity = "1";
270 $scope.check = false; 318 $scope.check = false;
271 $scope.numberCheck = false; 319 $scope.numberCheck = false;
272 $scope.paymentResult = {}; 320 $scope.paymentResult = {};
273 var data = { 321 var data = {
274 "amount": $scope.payingAmnt, 322 "amount": $scope.payingAmnt,
275 "currency": "INR", 323 "currency": "INR",
276 "status": "pending" 324 "status": "pending"
277 } 325 }
278 326
279 $scope.apply = function() { 327 $scope.apply = function() {
280 //Analytics.trackEvent('register', 'click', 'Registration'); 328 //Analytics.trackEvent('register', 'click', 'Registration');
281 $location.path("/caricatures") 329 $location.path("/caricatures")
282 } 330 }
283 331
284 $scope.data.city = ''; 332 $scope.data.city = '';
285 $scope.watch = function(value){ 333 $scope.watch = function(value){
286 console.log("cllll",value) 334 console.log("cllll",value)
287 $scope.data.city = value; 335 $scope.data.city = value;
288 localStorage.setItem("city" ,value); 336 localStorage.setItem("city" ,value);
289 //$location.path('/registration').search({city: value}); 337 //$location.path('/registration').search({city: value});
290 $location.path('/registration/'+value+''); 338 $location.path('/registration/'+value+'');
291 //$state.go('registration', { 'city': value}) 339 //$state.go('registration', { 'city': value})
292 } 340 }
293 341
294 $scope.select = function(url){ 342 $scope.select = function(url){
295 console.log("cllll") 343 console.log("cllll")
296 window.open(url) 344 window.open(url)
297 } 345 }
298 346
299 $scope.stagekeyPress = function() { 347 $scope.stagekeyPress = function() {
300 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); 348 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
301 } 349 }
302 $scope.sectorkeyPress = function() { 350 $scope.sectorkeyPress = function() {
303 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); 351 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
304 } 352 }
305 353
306 $scope.productLaunchkeyPress = function() { 354 $scope.productLaunchkeyPress = function() {
307 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); 355 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
308 } 356 }
309 357
310 $scope.launchPeriodkeyPress = function() { 358 $scope.launchPeriodkeyPress = function() {
311 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); 359 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
312 } 360 }
313 361
314 $scope.industrykeyPress = function(quantity) { 362 $scope.industrykeyPress = function(quantity) {
315 console.log("fghj",quantity) 363 console.log("fghj",quantity)
316 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); 364 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
317 } 365 }
318 366
319 $scope.industryNamekeyPress = function(firstName) { 367 $scope.industryNamekeyPress = function(firstName) {
320 console.log("lastName==", firstName); 368 console.log("lastName==", firstName);
321 if (firstName == undefined) { 369 if (firstName == undefined) {
322 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 370 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
323 } else { 371 } else {
324 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 372 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
325 } 373 }
326 } 374 }
327 375
328 $scope.amountkeyPress = function() { 376 $scope.amountkeyPress = function() {
329 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); 377 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
330 } 378 }
331 379
332 $scope.firstNamekeyPress = function(name) { 380 $scope.firstNamekeyPress = function(name) {
333 console.log("lastName==", name); 381 console.log("lastName==", name);
334 if (name == undefined) { 382 if (name == undefined) {
335 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); 383 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
336 } else { 384 } else {
337 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); 385 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
338 } 386 }
339 } 387 }
340 388
341 $scope.emailkeyPress = function(email) { 389 $scope.emailkeyPress = function(email) {
342 console.log("email", email); 390 console.log("email", email);
343 if (email == undefined) { 391 if (email == undefined) {
344 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); 392 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
345 } else { 393 } else {
346 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); 394 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
347 } 395 }
348 } 396 }
349 397
350 $scope.phonekeyPress = function(number) { 398 $scope.phonekeyPress = function(number) {
351 console.log("number", number); 399 console.log("number", number);
352 if (number == undefined || number == '') { 400 if (number == undefined || number == '') {
353 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); 401 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
354 } else { 402 } else {
355 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); 403 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
356 } 404 }
357 } 405 }
358 406
359 $scope.citykeyPress = function(city) { 407 $scope.citykeyPress = function(city) {
360 console.log("city", city); 408 console.log("city", city);
361 if (city == undefined) { 409 if (city == undefined) {
362 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); 410 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
363 } else { 411 } else {
364 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); 412 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
365 } 413 }
366 } 414 }
367 415
368 $scope.startupNamekeyPress = function(q) { 416 $scope.startupNamekeyPress = function(q) {
369 if (q == undefined) { 417 if (q == undefined) {
370 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); 418 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
371 } else { 419 } else {
372 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); 420 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
373 } 421 }
374 } 422 }
375 423
376 $scope.linkedInkeyPress = function(technology) { 424 $scope.linkedInkeyPress = function(technology) {
377 if (technology == undefined || technology == '') { 425 if (technology == undefined || technology == '') {
378 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); 426 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
379 } else { 427 } else {
380 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); 428 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
381 } 429 }
382 } 430 }
383 $scope.companykeyPress = function(problem) { 431 $scope.companykeyPress = function(problem) {
384 if (problem == undefined) { 432 if (problem == undefined) {
385 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); 433 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
386 } else { 434 } else {
387 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); 435 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
388 } 436 }
389 } 437 }
390 $scope.productNamekeyPress = function(solution) { 438 $scope.productNamekeyPress = function(solution) {
391 if (solution == undefined) { 439 if (solution == undefined) {
392 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); 440 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
393 } else { 441 } else {
394 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); 442 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
395 } 443 }
396 } 444 }
397 $scope.businesskeyPress = function(business) { 445 $scope.businesskeyPress = function(business) {
398 if (business == undefined) { 446 if (business == undefined) {
399 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); 447 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)');
400 } else { 448 } else {
401 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); 449 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)');
402 } 450 }
403 } 451 }
404 452
405 $scope.websitekeyPress = function(prototype) { 453 $scope.websitekeyPress = function(prototype) {
406 if (prototype == undefined || prototype == '') { 454 if (prototype == undefined || prototype == '') {
407 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); 455 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
408 } else { 456 } else {
409 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); 457 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
410 } 458 }
411 } 459 }
412 460
413 $scope.employeekeyPress = function(market) { 461 $scope.employeekeyPress = function(market) {
414 if (market == undefined || market == '') { 462 if (market == undefined || market == '') {
415 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); 463 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
416 } else { 464 } else {
417 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); 465 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
418 } 466 }
419 } 467 }
420 468
421 $scope.annualkeyPress = function(risk) { 469 $scope.annualkeyPress = function(risk) {
422 if (risk == undefined || risk == '') { 470 if (risk == undefined || risk == '') {
423 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); 471 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
424 } else { 472 } else {
425 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); 473 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
426 } 474 }
427 } 475 }
428 476
429 $scope.revenuekeyPress = function(team) { 477 $scope.revenuekeyPress = function(team) {
430 if (team == undefined) { 478 if (team == undefined) {
431 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); 479 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
432 } else { 480 } else {
433 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); 481 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
434 } 482 }
435 } 483 }
436 484
437 $scope.descriptionkeyPress = function(pitch) { 485 $scope.descriptionkeyPress = function(pitch) {
438 if (pitch == undefined) { 486 if (pitch == undefined) {
439 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); 487 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
440 } else { 488 } else {
441 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); 489 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
442 } 490 }
443 } 491 }
444 492
445 $scope.discountkeyPress = function(discount) { 493 $scope.discountkeyPress = function(discount) {
446 if (discount == undefined) { 494 if (discount == undefined) {
447 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 495 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
448 } else { 496 } else {
449 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 497 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
450 } 498 }
451 } 499 }
452 500
453 $scope.removeNooError = function() { 501 $scope.removeNooError = function() {
454 $('#invalidIdea').css('display', 'block'); 502 $('#invalidIdea').css('display', 'block');
455 $('#noExist').css('display', 'none'); 503 $('#noExist').css('display', 'none');
456 }; 504 };
457 505
458 $scope.ideakeyPress = function(financial) { 506 $scope.ideakeyPress = function(financial) {
459 console.log("financial", financial); 507 console.log("financial", financial);
460 if (financial == undefined) { 508 if (financial == undefined) {
461 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); 509 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
462 } else { 510 } else {
463 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); 511 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
464 } 512 }
465 } 513 }
466 514
467 $scope.fundkeyPress = function(financial) { 515 $scope.fundkeyPress = function(financial) {
468 console.log("financial", financial); 516 console.log("financial", financial);
469 if (financial == undefined) { 517 if (financial == undefined) {
470 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); 518 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
471 } else { 519 } else {
472 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); 520 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
473 } 521 }
474 } 522 }
475 523
476 $scope.changeReferalIconColor = function(referalToken){ 524 $scope.changeReferalIconColor = function(referalToken){
477 if (referalToken == undefined || referalToken == '') { 525 if (referalToken == undefined || referalToken == '') {
478 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); 526 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
479 }else { 527 }else {
480 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); 528 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
481 } 529 }
482 } 530 }
483 531
484 }); 532 });
485 533
486 scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) { 534 scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) {
487 $scope.data = {}; 535 $scope.data = {};
488 $scope.check = false; 536 $scope.check = false;
489 $scope.numberCheck = false; 537 $scope.numberCheck = false;
490 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 538 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
491 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 539 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
492 $scope.max = 100; 540 $scope.max = 100;
493 $scope.formPage = false; 541 $scope.formPage = false;
494 $scope.current = 0; 542 $scope.current = 0;
495 $scope.payingAmnt = 0; 543 $scope.payingAmnt = 0;
496 $scope.discountAmount = 0; 544 $scope.discountAmount = 0;
497 // $scope.data.quantity = "1"; 545 // $scope.data.quantity = "1";
498 $scope.check = false; 546 $scope.check = false;
499 $scope.numberCheck = false; 547 $scope.numberCheck = false;
500 $scope.paymentResult = {}; 548 $scope.paymentResult = {};
501 var data = { 549 var data = {
502 "amount": $scope.payingAmnt, 550 "amount": $scope.payingAmnt,
503 "currency": "INR", 551 "currency": "INR",
504 "status": "pending" 552 "status": "pending"
505 } 553 }
506 554
507 $scope.removeError = function() { 555 $scope.removeError = function() {
508 $('#invalidEmail').css('display', 'none'); 556 $('#invalidEmail').css('display', 'none');
509 $('#alreadyExist').css('display', 'none'); 557 $('#alreadyExist').css('display', 'none');
510 }; 558 };
511 559
512 $scope.emailcheck = function(val) { 560 $scope.emailcheck = function(val) {
513 if (val == undefined) { 561 if (val == undefined) {
514 $('#invalidEmail').css('display', 'block'); 562 $('#invalidEmail').css('display', 'block');
515 } else { 563 } else {
516 $('#alreadyExist').css('display', 'block'); 564 $('#alreadyExist').css('display', 'block');
517 } 565 }
518 }; 566 };
519 567
520 $scope.removeNoError = function() { 568 $scope.removeNoError = function() {
521 $('#invalidNumber').css('display', 'none'); 569 $('#invalidNumber').css('display', 'none');
522 $('#alreadyExist').css('display', 'none'); 570 $('#alreadyExist').css('display', 'none');
523 }; 571 };
524 572
525 $scope.numbercheck = function(val) { 573 $scope.numbercheck = function(val) {
526 if (val == undefined) { 574 if (val == undefined) {
527 $('#invalidNumber').css('display', 'block'); 575 $('#invalidNumber').css('display', 'block');
528 } else { 576 } else {
529 $('#alreadyExist').css('display', 'block'); 577 $('#alreadyExist').css('display', 'block');
530 } 578 }
531 }; 579 };
532 580
533 // $scope.$on('city', function (event, value) { 581 // $scope.$on('city', function (event, value) {
534 $scope.data.city = localStorage.getItem("city"); 582 $scope.data.city = localStorage.getItem("city");
535 console.log("HERE===",$scope.data.city ); 583 console.log("HERE===",$scope.data.city );
536 // }); 584 // });
537 585
538 $rootScope.tokenCall = function(val) { 586 $rootScope.tokenCall = function(val) {
539 console.log('val-------->', val); 587 console.log('val-------->', val);
540 if (val == undefined) { 588 if (val == undefined) {
541 $('#invalidToken').css('display', 'block'); 589 $('#invalidToken').css('display', 'block');
542 } else { 590 } else {
543 val = val.toUpperCase(); 591 val = val.toUpperCase();
544 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') 592 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
545 .then(function(searchResult) { 593 .then(function(searchResult) {
546 console.log("searchResult",searchResult) 594 console.log("searchResult",searchResult)
547 if (searchResult.data.length == 0) { 595 if (searchResult.data.length == 0) {
548 $scope.tokencheck = false; 596 $scope.tokencheck = false;
549 $scope.discountAmount = 0; 597 $scope.discountAmount = 0;
550 } else { 598 } else {
551 console.log("===searchResult.data[0].discount===",searchResult.data[0].discount); 599 console.log("===searchResult.data[0].discount===",searchResult.data[0].discount);
552 $scope.discountpercentage = searchResult.data[0].discount; 600 $scope.discountpercentage = searchResult.data[0].discount;
553 console.log("===searchResultdiscountpercentage===",$scope.discountpercentage); 601 console.log("===searchResultdiscountpercentage===",$scope.discountpercentage);
554 $scope.tokencheck = true; 602 $scope.tokencheck = true;
555 } 603 }
556 },function(err){ 604 },function(err){
557 console.log(err) 605 console.log(err)
558 }); 606 });
559 607
560 } 608 }
561 }; 609 };
562 610
563 $scope.submit = function() { 611 $scope.submit = function() {
564 $scope.ticketAmnt = 500; 612 $scope.ticketAmnt = 500;
565 if($scope.tokencheck == false){ 613 if($scope.tokencheck == false){
566 $scope.data.referalToken = null; 614 $scope.data.referalToken = null;
567 } 615 }
568 if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 616 if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
569 var x = document.getElementById("snackbar") 617 var x = document.getElementById("snackbar")
570 setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 618 setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
571 }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 619 }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
572 $scope.infoForm = true; 620 $scope.infoForm = true;
573 $scope.detail = {}; 621 $scope.detail = {};
574 $scope.data.phone = "+91"+$scope.data.number; 622 $scope.data.phone = "+91"+$scope.data.number;
575 if($scope.data.referalToken == null){ 623 if($scope.data.referalToken == null){
576 $scope.data.referalToken = "N.A." 624 $scope.data.referalToken = "N.A."
577 } 625 }
578 $http({ 626 $http({
579 method: 'POST', 627 method: 'POST',
580 url: BASE_URL+'/applicants', 628 url: BASE_URL+'/applicants',
581 data: $scope.data, 629 data: $scope.data,
582 headers: {} 630 headers: {}
583 }).then(function mySuccess(result) { 631 }).then(function mySuccess(result) {
584 console.log("=====result=====",result) 632 console.log("=====result=====",result)
585 $scope.detail = result; 633 $scope.detail = result;
586 data.applicantId = result.data.id; 634 data.applicantId = result.data.id;
587 $scope.userId = result.data.id; 635 $scope.userId = result.data.id;
588 console.log("=====data=====",data) 636 console.log("=====data=====",data)
589 var amount = $scope.ticketAmnt * 100 637 var amount = $scope.ticketAmnt * 100
590 if($scope.tokencheck == true){ 638 if($scope.tokencheck == true){
591 var amount = $scope.ticketAmnt 639 var amount = $scope.ticketAmnt
592 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 640 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
593 if($scope.discountpercentage == "100") { 641 if($scope.discountpercentage == "100") {
594 $scope.discountpercentage = "99.8"; 642 $scope.discountpercentage = "99.8";
595 console.log("$scope.discountpercentage====",$scope.discountpercentage) 643 console.log("$scope.discountpercentage====",$scope.discountpercentage)
596 } 644 }
597 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 645 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
598 $scope.percDiscount = $scope.discountpercentage/100; 646 $scope.percDiscount = $scope.discountpercentage/100;
599 console.log("====$scope.percDiscount====",$scope.percDiscount); 647 console.log("====$scope.percDiscount====",$scope.percDiscount);
600 console.log("====amount=====",amount); 648 console.log("====amount=====",amount);
601 $scope.discountAmount = amount * $scope.percDiscount; 649 $scope.discountAmount = amount * $scope.percDiscount;
602 console.log("finalAmount====>",$scope.discountAmount) 650 console.log("finalAmount====>",$scope.discountAmount)
603 } 651 }
604 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 652 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
605 console.log("$scope.taxTotal----",taxAmount) 653 console.log("$scope.taxTotal----",taxAmount)
606 $scope.payingAmnt = taxAmount; 654 $scope.payingAmnt = taxAmount;
607 console.log("====$scope.payingAmnt====",$scope.payingAmnt) 655 console.log("====$scope.payingAmnt====",$scope.payingAmnt)
608 $scope.payingAmnt = $scope.payingAmnt.toFixed() 656 $scope.payingAmnt = $scope.payingAmnt.toFixed()
609 data.amount = $scope.payingAmnt; 657 data.amount = $scope.payingAmnt;
610 console.log("data.amount==",data.amount) 658 console.log("data.amount==",data.amount)
611 if($scope.detail != null){ 659 if($scope.detail != null){
612 $http({ 660 $http({
613 method: 'POST', 661 method: 'POST',
614 url: BASE_URL+'/payments', 662 url: BASE_URL+'/payments',
615 data: data, 663 data: data,
616 headers: {} 664 headers: {}
617 }).then(function mySuccess(paymentResult) { 665 }).then(function mySuccess(paymentResult) {
618 $scope.paymentResult = paymentResult; 666 $scope.paymentResult = paymentResult;
619 }, function myError(error) { 667 }, function myError(error) {
620 }); 668 });
621 } 669 }
622 var i = 0; 670 var i = 0;
623 $scope.payingAmnt = $scope.payingAmnt * 100; 671 $scope.payingAmnt = $scope.payingAmnt * 100;
624 var options = { 672 var options = {
625 //"key": "rzp_test_YwHsVFiDIQ2WUQ", 673 //"key": "rzp_test_YwHsVFiDIQ2WUQ",
626 "key": "rzp_live_mkmCb4FkstuWaS", 674 "key": "rzp_live_mkmCb4FkstuWaS",
627 "amount": $scope.payingAmnt, 675 "amount": $scope.payingAmnt,
628 676
629 "name": "Startup Jalsa", 677 "name": "Startup Jalsa",
630 "description":"amount", 678 "description":"amount",
631 "currency": "INR", 679 "currency": "INR",
632 "status": "done", 680 "status": "done",
633 681
634 "prefill": { 682 "prefill": {
635 "email": $scope.detail.email, 683 "email": $scope.detail.email,
636 "contact": $scope.detail.phone 684 "contact": $scope.detail.phone
637 }, 685 },
638 686
639 "theme": { 687 "theme": {
640 "color": "#2196f3 ", 688 "color": "#2196f3 ",
641 "image_padding":"NO" 689 "image_padding":"NO"
642 }, 690 },
643 "modal": { 691 "modal": {
644 "ondismiss": function(){ 692 "ondismiss": function(){
645 } 693 }
646 }, 694 },
647 "handler": function (response){ 695 "handler": function (response){
648 createPayment(response); 696 createPayment(response);
649 } 697 }
650 }; 698 };
651 var rzp1 = new Razorpay(options); 699 var rzp1 = new Razorpay(options);
652 rzp1.open(); 700 rzp1.open();
653 $scope.paymentResponse = {}; 701 $scope.paymentResponse = {};
654 function createPayment(response){ 702 function createPayment(response){
655 console.log("response12333333",response) 703 console.log("response12333333",response)
656 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 704 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
657 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 705 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
658 $scope.paymentResponse.amount = data.amount; 706 $scope.paymentResponse.amount = data.amount;
659 $scope.paymentResponse.currency = "INR"; 707 $scope.paymentResponse.currency = "INR";
660 $scope.paymentResponse.status = $scope.paymentResult.data.status; 708 $scope.paymentResponse.status = $scope.paymentResult.data.status;
661 console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) 709 console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
662 $http({ 710 $http({
663 method: 'PUT', 711 method: 'PUT',
664 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 712 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
665 data: $scope.paymentResponse, 713 data: $scope.paymentResponse,
666 headers: {} 714 headers: {}
667 }).then(function mySuccess(searchResult) { 715 }).then(function mySuccess(searchResult) {
668 console.log("searchResult",searchResult) 716 console.log("searchResult",searchResult)
669 $location.path("/confirmation") 717 $location.path("/confirmation")
670 }, function myError(error) { 718 }, function myError(error) {
671 }); 719 });
672 } 720 }
673 721
674 }, function myError(error) { 722 }, function myError(error) {
675 723
676 }); 724 });
677 725
678 } 726 }
679 727
680 } 728 }
681 729
682 }); 730 });
683 731
684 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { 732 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) {
685 $scope.data = {}; 733 $scope.data = {};
686 $scope.check = false; 734 $scope.check = false;
687 $scope.numberCheck = false; 735 $scope.numberCheck = false;
688 736
689 $scope.submit = function() { 737 $scope.submit = function() {
690 console.log($scope.data.name) 738 console.log($scope.data.name)
691 var randomNumber = ""+Math.random(); 739 var randomNumber = ""+Math.random();
692 var nameSpliced = $scope.data.name.slice(0,5); 740 var nameSpliced = $scope.data.name.slice(0,5);
693 var numberSpliced = randomNumber.slice(2,4);; 741 var numberSpliced = randomNumber.slice(2,4);;
694 $scope.data.referalToken = nameSpliced+numberSpliced; 742 $scope.data.referalToken = nameSpliced+numberSpliced;
695 $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); 743 $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
696 console.log("dsdfs",numberSpliced); 744 console.log("dsdfs",numberSpliced);
697 $http({ 745 $http({
698 method: 'POST', 746 method: 'POST',
699 url: BASE_URL + '/ambassadors', 747 url: BASE_URL + '/ambassadors',
700 data: $scope.data, 748 data: $scope.data,
701 headers: {} 749 headers: {}
702 }).then(function mySuccess(result) { 750 }).then(function mySuccess(result) {
703 console.log("result", result) 751 console.log("result", result)
704 $scope.detail = result; 752 $scope.detail = result;
705 $('#myModal').modal('show'); 753 $('#myModal').modal('show');
706 $scope.data.name = ''; 754 $scope.data.name = '';
707 $scope.data.email = ''; 755 $scope.data.email = '';
708 $scope.data.mobile = ''; 756 $scope.data.mobile = '';
709 //$scope.data.discount = ''; 757 //$scope.data.discount = '';
710 758
711 }, function myError(error) { 759 }, function myError(error) {
712 console.log(error) 760 console.log(error)
713 console.log(error.data.error.message) 761 console.log(error.data.error.message)
714 }); 762 });
715 } 763 }
716 }); 764 });
717 765
718 766
719 767
720 768
721 769