Commit 03c9e5d63623d58dbac8582eabfb58a96a21fd4b

Authored by apple
1 parent 397ded5808
Exists in master

upload file

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