Commit 5c0d96b385e710afc384001cfb13b61509ccb5ac
1 parent
ce1c575fe6
Exists in
master
rajorpay comment
Showing
1 changed file
with
65 additions
and
57 deletions
Show diff stats
script.js
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); | ||
737 | console.log(result.data) | ||
738 | // { | ||
739 | // results[i].content = $sce.trustAsHtml(response.data.data[i].content); | ||
740 | // } | ||
741 | //$scope.languages = results; | ||
736 | }); | 742 | }); |
737 | } | 743 | } |
738 | 744 | ||
739 | $scope.submit = function() { | 745 | $scope.submit = function() { |
740 | 746 | ||
741 | // if($scope.tokencheck == false){ | 747 | // if($scope.tokencheck == false){ |
742 | // $scope.data.referalToken = null; | 748 | // $scope.data.referalToken = null; |
743 | // } | 749 | // } |
744 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 750 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
745 | // var x = document.getElementById("snackbar") | 751 | // var x = document.getElementById("snackbar") |
746 | // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 752 | // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
747 | // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 753 | // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
748 | $scope.infoForm = true; | 754 | $scope.infoForm = true; |
749 | $scope.ticketAmnt = 500; | 755 | $scope.ticketAmnt = 500; |
750 | $scope.detail = {}; | 756 | $scope.detail = {}; |
751 | $scope.data.phone = "+91"+$scope.data.number; | 757 | $scope.data.phone = "+91"+$scope.data.number; |
752 | // if($scope.data.referalToken == null){ | 758 | // if($scope.data.referalToken == null){ |
753 | // $scope.data.referalToken = "N.A." | 759 | // $scope.data.referalToken = "N.A." |
754 | // } | 760 | // } |
755 | // var file =document.getElementById('filePicker').files[0]; | 761 | // var file =document.getElementById('filePicker').files[0]; |
756 | // console.log("file",filePicker) | 762 | // console.log("file",filePicker) |
757 | // var image = BASE_URL+'/containers/applicants/download/' | 763 | // var image = BASE_URL+'/containers/applicants/download/' |
758 | // var imagePath = file.name; | 764 | // var imagePath = file.name; |
759 | // $scope.data.uploadFile = image + imagePath; | 765 | // $scope.data.uploadFile = image + imagePath; |
760 | // console.log($scope.data.uploadFile) | 766 | // console.log($scope.data.uploadFile) |
761 | // var fd = new FormData() | 767 | // var fd = new FormData() |
762 | // fd.append('filePicker',$scope.data); | 768 | // fd.append('filePicker',$scope.data); |
763 | // var deferred = $q.defer(); | 769 | // var deferred = $q.defer(); |
764 | // $http({ | 770 | // $http({ |
765 | // method:'POST', | 771 | // method:'POST', |
766 | // url: BASE_URL+'/containers/applicants/upload', | 772 | // url: BASE_URL+'/containers/applicants/upload', |
767 | // data:fd, | 773 | // data:fd, |
768 | // transformRequest:angular.identity, | 774 | // transformRequest:angular.identity, |
769 | // headers:{'Content-Type':undefined} | 775 | // headers:{'Content-Type':undefined} |
770 | // }) | 776 | // }) |
771 | // .success(function(result){ | 777 | // .success(function(result){ |
772 | // deferred.resolve(result); | 778 | // deferred.resolve(result); |
773 | $http({ | 779 | $http({ |
774 | method: 'POST', | 780 | method: 'POST', |
775 | url: BASE_URL+'/applicants', | 781 | url: BASE_URL+'/applicants', |
776 | data: $scope.data, | 782 | data: $scope.data, |
777 | headers: {} | 783 | headers: {} |
778 | }).then(function mySuccess(result) { | 784 | }).then(function mySuccess(result) { |
779 | console.log("=====result=====",result) | 785 | console.log("=====result=====",result) |
780 | $scope.detail = result; | 786 | $scope.detail = result; |
781 | data.applicantId = result.data.id; | 787 | data.applicantId = result.data.id; |
782 | $scope.userId = result.data.id; | 788 | $scope.userId = result.data.id; |
783 | console.log("=====data=====",data) | 789 | console.log("=====data=====",data) |
784 | var amount = $scope.ticketAmnt * 100 | 790 | var amount = $scope.ticketAmnt * 100 |
785 | if($scope.tokencheck == true){ | 791 | if($scope.tokencheck == true){ |
786 | var amount = $scope.ticketAmnt | 792 | var amount = $scope.ticketAmnt |
787 | console.log("====$scope.discountpercentage====",$scope.discountpercentage); | 793 | console.log("====$scope.discountpercentage====",$scope.discountpercentage); |
788 | console.log("resultcity===",$scope.data.city) | 794 | console.log("resultcity===",$scope.data.city) |
789 | if($scope.discountpercentage == "100") { | 795 | if($scope.discountpercentage == "100") { |
790 | $scope.discountpercentage = "99.8"; | 796 | $scope.discountpercentage = "99.8"; |
791 | console.log("$scope.discountpercentage====",$scope.discountpercentage) | 797 | console.log("$scope.discountpercentage====",$scope.discountpercentage) |
792 | } | 798 | } |
793 | console.log("====$scope.discountpercentage====",$scope.discountpercentage); | 799 | console.log("====$scope.discountpercentage====",$scope.discountpercentage); |
794 | $scope.percDiscount = $scope.discountpercentage/100; | 800 | $scope.percDiscount = $scope.discountpercentage/100; |
795 | console.log("====$scope.percDiscount====",$scope.percDiscount); | 801 | console.log("====$scope.percDiscount====",$scope.percDiscount); |
796 | console.log("====amount=====",amount); | 802 | console.log("====amount=====",amount); |
797 | $scope.discountAmount = amount * $scope.percDiscount; | 803 | $scope.discountAmount = amount * $scope.percDiscount; |
798 | console.log("finalAmount====>",$scope.discountAmount) | 804 | console.log("finalAmount====>",$scope.discountAmount) |
799 | } | 805 | } |
800 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 806 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
801 | console.log("$scope.taxTotal----",taxAmount) | 807 | console.log("$scope.taxTotal----",taxAmount) |
802 | $scope.payingAmnt = taxAmount; | 808 | $scope.payingAmnt = taxAmount; |
803 | console.log("====$scope.payingAmnt====",$scope.payingAmnt) | 809 | console.log("====$scope.payingAmnt====",$scope.payingAmnt) |
804 | $scope.payingAmnt = $scope.payingAmnt.toFixed() | 810 | $scope.payingAmnt = $scope.payingAmnt.toFixed() |
805 | data.amount = $scope.payingAmnt; | 811 | data.amount = $scope.payingAmnt; |
806 | console.log("data.amount==",data.amount) | 812 | console.log("data.amount==",data.amount) |
807 | if($scope.detail != null){ | 813 | if($scope.detail != null){ |
808 | $http({ | 814 | $http({ |
809 | method: 'POST', | 815 | method: 'POST', |
810 | url: BASE_URL+'/payments', | 816 | url: BASE_URL+'/payments', |
811 | data: data, | 817 | data: data, |
812 | headers: {} | 818 | headers: {} |
813 | }).then(function mySuccess(paymentResult) { | 819 | }).then(function mySuccess(paymentResult) { |
814 | $scope.paymentResult = paymentResult; | 820 | $scope.paymentResult = paymentResult; |
821 | $location.path("/confirmation") | ||
815 | }, function myError(error) { | 822 | }, function myError(error) { |
816 | }); | 823 | }); |
817 | } | 824 | } |
818 | var i = 0; | 825 | // var i = 0; |
819 | $scope.payingAmnt = $scope.payingAmnt * 100; | 826 | // $scope.payingAmnt = $scope.payingAmnt * 100; |
820 | var options = { | 827 | // var options = { |
821 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", | 828 | // //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
822 | "key": "rzp_live_mkmCb4FkstuWaS", | 829 | // "key": "rzp_live_mkmCb4FkstuWaS", |
823 | "amount": $scope.payingAmnt, | 830 | // "amount": $scope.payingAmnt, |
824 | 831 | ||
825 | "name": "Startup Jalsa", | 832 | // "name": "Startup Jalsa", |
826 | "description":"amount", | 833 | // "description":"amount", |
827 | "currency": "INR", | 834 | // "currency": "INR", |
828 | "status": "done", | 835 | // "status": "done", |
829 | 836 | ||
830 | "prefill": { | 837 | // "prefill": { |
831 | "email": $scope.detail.email, | 838 | // "email": $scope.detail.email, |
832 | "contact": $scope.detail.phone | 839 | // "contact": $scope.detail.phone |
833 | }, | 840 | // }, |
834 | 841 | ||
835 | "theme": { | 842 | // "theme": { |
836 | "color": "#2196f3 ", | 843 | // "color": "#2196f3 ", |
837 | "image_padding":"NO" | 844 | // "image_padding":"NO" |
838 | }, | 845 | // }, |
839 | "modal": { | 846 | // "modal": { |
840 | "ondismiss": function(){ | 847 | // "ondismiss": function(){ |
841 | } | 848 | // } |
842 | }, | 849 | // }, |
843 | "handler": function (response){ | 850 | // "handler": function (response){ |
844 | createPayment(response); | 851 | // createPayment(response); |
845 | } | 852 | // } |
846 | }; | 853 | // }; |
847 | var rzp1 = new Razorpay(options); | 854 | // var rzp1 = new Razorpay(options); |
848 | rzp1.open(); | 855 | // rzp1.open(); |
849 | $scope.paymentResponse = {}; | 856 | // $scope.paymentResponse = {}; |
850 | function createPayment(response){ | 857 | // function createPayment(response){ |
851 | console.log("response12333333",response) | 858 | // console.log("response12333333",response) |
852 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 859 | // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
853 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 860 | // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
854 | $scope.paymentResponse.amount = data.amount; | 861 | // $scope.paymentResponse.amount = data.amount; |
855 | $scope.paymentResponse.currency = "INR"; | 862 | // $scope.paymentResponse.currency = "INR"; |
856 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 863 | // $scope.paymentResponse.status = $scope.paymentResult.data.status; |
857 | console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) | 864 | // console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) |
858 | $http({ | 865 | // $http({ |
859 | method: 'PUT', | 866 | // method: 'PUT', |
860 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | 867 | // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, |
861 | data: $scope.paymentResponse, | 868 | // data: $scope.paymentResponse, |
862 | headers: {} | 869 | // headers: {} |
863 | }).then(function mySuccess(searchResult) { | 870 | // }).then(function mySuccess(searchResult) { |
864 | console.log("searchResult",searchResult) | 871 | // console.log("searchResult",searchResult) |
865 | $location.path("/confirmation") | 872 | // $location.path("/confirmation") |
866 | }, function myError(error) { | 873 | // }, function myError(error) { |
867 | }); | 874 | // }); |
868 | } | 875 | // } |
869 | //} | 876 | // //} |
870 | 877 | ||
871 | }, function myError(error) { | 878 | // }, function myError(error) { |
872 | 879 | ||
873 | }); | 880 | // }); |
874 | 881 | ||
875 | // }) | 882 | // }) |
876 | 883 | ||
877 | //} | 884 | //} |
885 | }) | ||
878 | 886 | ||
879 | } | 887 | } |
880 | 888 | ||
881 | }); | 889 | }); |
882 | 890 | ||
883 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { | 891 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { |
884 | $scope.data = {}; | 892 | $scope.data = {}; |
885 | $scope.check = false; | 893 | $scope.check = false; |
886 | $scope.numberCheck = false; | 894 | $scope.numberCheck = false; |
887 | 895 | ||
888 | $scope.submit = function() { | 896 | $scope.submit = function() { |
889 | console.log($scope.data.name) | 897 | console.log($scope.data.name) |
890 | var randomNumber = ""+Math.random(); | 898 | var randomNumber = ""+Math.random(); |
891 | var nameSpliced = $scope.data.name.slice(0,5); | 899 | var nameSpliced = $scope.data.name.slice(0,5); |
892 | var numberSpliced = randomNumber.slice(2,4);; | 900 | var numberSpliced = randomNumber.slice(2,4);; |
893 | $scope.data.referalToken = nameSpliced+numberSpliced; | 901 | $scope.data.referalToken = nameSpliced+numberSpliced; |
894 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 902 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
895 | console.log("dsdfs",numberSpliced); | 903 | console.log("dsdfs",numberSpliced); |
896 | $http({ | 904 | $http({ |
897 | method: 'POST', | 905 | method: 'POST', |
898 | url: BASE_URL + '/ambassadors', | 906 | url: BASE_URL + '/ambassadors', |
899 | data: $scope.data, | 907 | data: $scope.data, |
900 | headers: {} | 908 | headers: {} |
901 | }).then(function mySuccess(result) { | 909 | }).then(function mySuccess(result) { |
902 | console.log("result", result) | 910 | console.log("result", result) |
903 | $scope.detail = result; | 911 | $scope.detail = result; |
904 | $('#myModal').modal('show'); | 912 | $('#myModal').modal('show'); |
905 | $scope.data.name = ''; | 913 | $scope.data.name = ''; |
906 | $scope.data.email = ''; | 914 | $scope.data.email = ''; |
907 | $scope.data.mobile = ''; | 915 | $scope.data.mobile = ''; |
908 | //$scope.data.discount = ''; | 916 | //$scope.data.discount = ''; |
909 | 917 | ||
910 | }, function myError(error) { | 918 | }, function myError(error) { |
911 | console.log(error) | 919 | console.log(error) |
912 | console.log(error.data.error.message) | 920 | console.log(error.data.error.message) |
913 | }); | 921 | }); |
914 | } | 922 | } |
915 | }); | 923 | }); |
916 | 924 | ||
917 | 925 | ||
918 | 926 | ||
919 | 927 | ||
920 | 928 |