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