Commit 3c65df720f2b95163862495a87e720aa8bcdf3c7
1 parent
13526b42f9
Exists in
master
minor change
Showing
1 changed file
with
2 additions
and
2 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 registration page | 26 | // route for the registration page |
27 | .when('/registration', { | 27 | .when('/registration', { |
28 | templateUrl: 'pages/registration.html', | 28 | templateUrl: 'pages/registration.html', |
29 | controller: 'registrationController' | 29 | controller: 'registrationController' |
30 | }) | 30 | }) |
31 | 31 | ||
32 | //route for the ambassador page | 32 | //route for the ambassador page |
33 | .when('/startupJalsaPromocode', { | 33 | .when('/startupJalsaPromocode', { |
34 | templateUrl: 'pages/ambassador.html', | 34 | templateUrl: 'pages/ambassador.html', |
35 | controller: 'ambassadorController' | 35 | controller: 'ambassadorController' |
36 | }) | 36 | }) |
37 | 37 | ||
38 | //route for the campusAmbassador page | 38 | //route for the campusAmbassador page |
39 | .when('/campusAmbassador', { | 39 | .when('/campusAmbassador', { |
40 | templateUrl: 'pages/campusAmbassador.html', | 40 | templateUrl: 'pages/campusAmbassador.html', |
41 | controller: 'mainController' | 41 | controller: 'mainController' |
42 | }) | 42 | }) |
43 | 43 | ||
44 | //route for the campusAmbassador page | 44 | //route for the campusAmbassador page |
45 | .when('/campusAmbassadorForm', { | 45 | .when('/campusAmbassadorForm', { |
46 | templateUrl: 'pages/campusAmbassadorForm.html', | 46 | templateUrl: 'pages/campusAmbassadorForm.html', |
47 | controller: 'campusAmbassadorController' | 47 | controller: 'campusAmbassadorController' |
48 | }) | 48 | }) |
49 | 49 | ||
50 | // route for the confirmation page | 50 | // route for the confirmation page |
51 | // .when('/confirmation', { | 51 | // .when('/confirmation', { |
52 | // templateUrl: 'pages/confirmation.html', | 52 | // templateUrl: 'pages/confirmation.html', |
53 | // controller: 'confirmationController' | 53 | // controller: 'confirmationController' |
54 | // }) | 54 | // }) |
55 | 55 | ||
56 | // route for the confirmation page | 56 | // route for the confirmation page |
57 | .when('/confirmation', { | 57 | .when('/confirmation', { |
58 | templateUrl: 'pages/campusAmbassadorConfirm.html', | 58 | templateUrl: 'pages/campusAmbassadorConfirm.html', |
59 | controller: 'confirmationController' | 59 | controller: 'confirmationController' |
60 | }) | 60 | }) |
61 | 61 | ||
62 | // route for the confirmation page | 62 | // route for the confirmation page |
63 | .when('/confirm', { | 63 | .when('/confirm', { |
64 | templateUrl: 'pages/confirm.html', | 64 | templateUrl: 'pages/confirm.html', |
65 | controller: 'confirmationController' | 65 | controller: 'confirmationController' |
66 | }) | 66 | }) |
67 | 67 | ||
68 | // route for the paytm page | 68 | // route for the paytm page |
69 | .when('/paytm', { | 69 | .when('/paytm', { |
70 | templateUrl: 'pages/paytm.html', | 70 | templateUrl: 'pages/paytm.html', |
71 | controller: 'mainController' | 71 | controller: 'mainController' |
72 | }) | 72 | }) |
73 | 73 | ||
74 | // route for the paytm page | 74 | // route for the paytm page |
75 | .when('/paytm/caricatures', { | 75 | .when('/paytm/caricatures', { |
76 | templateUrl: 'pages/paytmCaricatures.html', | 76 | templateUrl: 'pages/paytmCaricatures.html', |
77 | controller: 'mainController' | 77 | controller: 'mainController' |
78 | }) | 78 | }) |
79 | 79 | ||
80 | // route for the paytm page | 80 | // route for the paytm page |
81 | .when('/paytm/checkout', { | 81 | .when('/paytm/checkout', { |
82 | templateUrl: 'pages/paytmCheckout.html', | 82 | templateUrl: 'pages/paytmCheckout.html', |
83 | controller: 'paytmController' | 83 | controller: 'paytmController' |
84 | }) | 84 | }) |
85 | 85 | ||
86 | // route for the confirmation page | 86 | // route for the confirmation page |
87 | .when('/paytm/confirm', { | 87 | .when('/paytm/confirm', { |
88 | templateUrl: 'pages/confirmed.html', | 88 | templateUrl: 'pages/confirmed.html', |
89 | controller: 'paytmController' | 89 | controller: 'paytmController' |
90 | }) | 90 | }) |
91 | 91 | ||
92 | .otherwise({ | 92 | .otherwise({ |
93 | redirectTo: '/' | 93 | redirectTo: '/' |
94 | }); | 94 | }); |
95 | 95 | ||
96 | }); | 96 | }); |
97 | 97 | ||
98 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { | 98 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { |
99 | // Add configuration code as desired | 99 | // Add configuration code as desired |
100 | AnalyticsProvider.setAccount('UA-123583154-1'); //UU-XXXXXXX-X should be your tracking code | 100 | AnalyticsProvider.setAccount('UA-123583154-1'); //UU-XXXXXXX-X should be your tracking code |
101 | 101 | ||
102 | // Track all routes (default is true). | 102 | // Track all routes (default is true). |
103 | AnalyticsProvider.trackPages(true); | 103 | AnalyticsProvider.trackPages(true); |
104 | 104 | ||
105 | // Track all URL query params (default is false). | 105 | // Track all URL query params (default is false). |
106 | AnalyticsProvider.trackUrlParams(true); | 106 | AnalyticsProvider.trackUrlParams(true); |
107 | 107 | ||
108 | }]).run(['Analytics', function(Analytics) { }]); | 108 | }]).run(['Analytics', function(Analytics) { }]); |
109 | 109 | ||
110 | scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1") | 110 | scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1") |
111 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") | 111 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") |
112 | 112 | ||
113 | scotchApp.directive('validFile',function(){ | 113 | scotchApp.directive('validFile',function(){ |
114 | return { | 114 | return { |
115 | require:'ngModel', | 115 | require:'ngModel', |
116 | link:function(scope,el,attrs,ngModel){ | 116 | link:function(scope,el,attrs,ngModel){ |
117 | //change event is fired when file is selected | 117 | //change event is fired when file is selected |
118 | el.bind('change',function(){ | 118 | el.bind('change',function(){ |
119 | scope.$apply(function(){ | 119 | scope.$apply(function(){ |
120 | ngModel.$setViewValue(el.val()); | 120 | ngModel.$setViewValue(el.val()); |
121 | ngModel.$render(); | 121 | ngModel.$render(); |
122 | }) | 122 | }) |
123 | }) | 123 | }) |
124 | } | 124 | } |
125 | } | 125 | } |
126 | }) | 126 | }) |
127 | 127 | ||
128 | // create the controller and inject Angular's $scope | 128 | // create the controller and inject Angular's $scope |
129 | scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) { | 129 | scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) { |
130 | $scope.data = { | 130 | $scope.data = { |
131 | show: true, | 131 | show: true, |
132 | hide: false | 132 | hide: false |
133 | }; | 133 | }; |
134 | jQuery('#defaultcountry').addClass('btn-active') | 134 | jQuery('#defaultcountry').addClass('btn-active') |
135 | // window.onload = function(){ | 135 | // window.onload = function(){ |
136 | // // var element = document.getElementById("defaultcountry"); | 136 | // // var element = document.getElementById("defaultcountry"); |
137 | // // element.classList.add("btn-active"); | 137 | // // element.classList.add("btn-active"); |
138 | // jQuery('#defaultcountry').addClass('btn-active') | 138 | // jQuery('#defaultcountry').addClass('btn-active') |
139 | // //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png"; | 139 | // //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png"; |
140 | // } | 140 | // } |
141 | 141 | ||
142 | var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); | 142 | var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); |
143 | // Update the count down every 1 second | 143 | // Update the count down every 1 second |
144 | var x = setInterval(function() { | 144 | var x = setInterval(function() { |
145 | // Get todays date and time | 145 | // Get todays date and time |
146 | var now = new Date().getTime(); | 146 | var now = new Date().getTime(); |
147 | // Find the distance between now an the count down date | 147 | // Find the distance between now an the count down date |
148 | var distance = chennai - now; | 148 | var distance = chennai - now; |
149 | // Time calculations for days, hours, minutes and seconds | 149 | // Time calculations for days, hours, minutes and seconds |
150 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 150 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
151 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 151 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
152 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 152 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
153 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 153 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
154 | $scope.timer = days + "d " + hours + "h " | 154 | $scope.timer = days + "d " + hours + "h " |
155 | + minutes + "m " + seconds + "s " | 155 | + minutes + "m " + seconds + "s " |
156 | // Output the result in an element with id="demo" | 156 | // Output the result in an element with id="demo" |
157 | document.getElementById("chennai").innerHTML = days + "d " + hours + "h " | 157 | document.getElementById("chennai").innerHTML = days + "d " + hours + "h " |
158 | + minutes + "m " + seconds + "s "; | 158 | + minutes + "m " + seconds + "s "; |
159 | // If the count down is over, write some text | 159 | // If the count down is over, write some text |
160 | if (distance < 0) { | 160 | if (distance < 0) { |
161 | clearInterval(x); | 161 | clearInterval(x); |
162 | document.getElementById("chennai").innerHTML = "EXPIRED"; | 162 | document.getElementById("chennai").innerHTML = "EXPIRED"; |
163 | } | 163 | } |
164 | }, 1000); | 164 | }, 1000); |
165 | 165 | ||
166 | var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime(); | 166 | var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime(); |
167 | // Update the count down every 1 second | 167 | // Update the count down every 1 second |
168 | var x = setInterval(function() { | 168 | var x = setInterval(function() { |
169 | // Get todays date and time | 169 | // Get todays date and time |
170 | var now = new Date().getTime(); | 170 | var now = new Date().getTime(); |
171 | // Find the distance between now an the count down date | 171 | // Find the distance between now an the count down date |
172 | var distance = hyderabad - now; | 172 | var distance = hyderabad - now; |
173 | // Time calculations for days, hours, minutes and seconds | 173 | // Time calculations for days, hours, minutes and seconds |
174 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 174 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
175 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 175 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
176 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 176 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
177 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 177 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
178 | $scope.timer = days + "d " + hours + "h " | 178 | $scope.timer = days + "d " + hours + "h " |
179 | + minutes + "m " + seconds + "s " | 179 | + minutes + "m " + seconds + "s " |
180 | // Output the result in an element with id="demo" | 180 | // Output the result in an element with id="demo" |
181 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " | 181 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " |
182 | + minutes + "m " + seconds + "s "; | 182 | + minutes + "m " + seconds + "s "; |
183 | // If the count down is over, write some text | 183 | // If the count down is over, write some text |
184 | if (distance < 0) { | 184 | if (distance < 0) { |
185 | clearInterval(x); | 185 | clearInterval(x); |
186 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; | 186 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; |
187 | } | 187 | } |
188 | }, 1000); | 188 | }, 1000); |
189 | 189 | ||
190 | var mumbai = new Date("Sept 26, 2018 14:00:00").getTime(); | 190 | var mumbai = new Date("Sept 26, 2018 14:00:00").getTime(); |
191 | // Update the count down every 1 second | 191 | // Update the count down every 1 second |
192 | var x = setInterval(function() { | 192 | var x = setInterval(function() { |
193 | // Get todays date and time | 193 | // Get todays date and time |
194 | var now = new Date().getTime(); | 194 | var now = new Date().getTime(); |
195 | // Find the distance between now an the count down date | 195 | // Find the distance between now an the count down date |
196 | var distance = mumbai - now; | 196 | var distance = mumbai - now; |
197 | // Time calculations for days, hours, minutes and seconds | 197 | // Time calculations for days, hours, minutes and seconds |
198 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 198 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
199 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 199 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
200 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 200 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
201 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 201 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
202 | $scope.timer = days + "d " + hours + "h " | 202 | $scope.timer = days + "d " + hours + "h " |
203 | + minutes + "m " + seconds + "s " | 203 | + minutes + "m " + seconds + "s " |
204 | // Output the result in an element with id="demo" | 204 | // Output the result in an element with id="demo" |
205 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " | 205 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " |
206 | + minutes + "m " + seconds + "s "; | 206 | + minutes + "m " + seconds + "s "; |
207 | // If the count down is over, write some text | 207 | // If the count down is over, write some text |
208 | if (distance < 0) { | 208 | if (distance < 0) { |
209 | clearInterval(x); | 209 | clearInterval(x); |
210 | document.getElementById("mumbai").innerHTML = "EXPIRED"; | 210 | document.getElementById("mumbai").innerHTML = "EXPIRED"; |
211 | } | 211 | } |
212 | }, 1000); | 212 | }, 1000); |
213 | 213 | ||
214 | var kolkata = new Date("Oct 3, 2018 14:00:00").getTime(); | 214 | var kolkata = new Date("Oct 3, 2018 14:00:00").getTime(); |
215 | // Update the count down every 1 second | 215 | // Update the count down every 1 second |
216 | var x = setInterval(function() { | 216 | var x = setInterval(function() { |
217 | // Get todays date and time | 217 | // Get todays date and time |
218 | var now = new Date().getTime(); | 218 | var now = new Date().getTime(); |
219 | // Find the distance between now an the count down date | 219 | // Find the distance between now an the count down date |
220 | var distance = kolkata - now; | 220 | var distance = kolkata - now; |
221 | // Time calculations for days, hours, minutes and seconds | 221 | // Time calculations for days, hours, minutes and seconds |
222 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 222 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
223 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 223 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
224 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 224 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
225 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 225 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
226 | $scope.timer = days + "d " + hours + "h " | 226 | $scope.timer = days + "d " + hours + "h " |
227 | + minutes + "m " + seconds + "s " | 227 | + minutes + "m " + seconds + "s " |
228 | // Output the result in an element with id="demo" | 228 | // Output the result in an element with id="demo" |
229 | document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " | 229 | document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " |
230 | + minutes + "m " + seconds + "s "; | 230 | + minutes + "m " + seconds + "s "; |
231 | // If the count down is over, write some text | 231 | // If the count down is over, write some text |
232 | if (distance < 0) { | 232 | if (distance < 0) { |
233 | clearInterval(x); | 233 | clearInterval(x); |
234 | document.getElementById("kolkata").innerHTML = "EXPIRED"; | 234 | document.getElementById("kolkata").innerHTML = "EXPIRED"; |
235 | } | 235 | } |
236 | }, 1000); | 236 | }, 1000); |
237 | 237 | ||
238 | var jaipur = new Date("Oct 5, 2018 14:00:00").getTime(); | 238 | var jaipur = new Date("Oct 5, 2018 14:00:00").getTime(); |
239 | // Update the count down every 1 second | 239 | // Update the count down every 1 second |
240 | var x = setInterval(function() { | 240 | var x = setInterval(function() { |
241 | // Get todays date and time | 241 | // Get todays date and time |
242 | var now = new Date().getTime(); | 242 | var now = new Date().getTime(); |
243 | // Find the distance between now an the count down date | 243 | // Find the distance between now an the count down date |
244 | var distance = jaipur - now; | 244 | var distance = jaipur - now; |
245 | // Time calculations for days, hours, minutes and seconds | 245 | // Time calculations for days, hours, minutes and seconds |
246 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 246 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
247 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 247 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
248 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 248 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
249 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 249 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
250 | $scope.timer = days + "d " + hours + "h " | 250 | $scope.timer = days + "d " + hours + "h " |
251 | + minutes + "m " + seconds + "s " | 251 | + minutes + "m " + seconds + "s " |
252 | // Output the result in an element with id="demo" | 252 | // Output the result in an element with id="demo" |
253 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " | 253 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " |
254 | + minutes + "m " + seconds + "s "; | 254 | + minutes + "m " + seconds + "s "; |
255 | // If the count down is over, write some text | 255 | // If the count down is over, write some text |
256 | if (distance < 0) { | 256 | if (distance < 0) { |
257 | clearInterval(x); | 257 | clearInterval(x); |
258 | document.getElementById("jaipur").innerHTML = "EXPIRED"; | 258 | document.getElementById("jaipur").innerHTML = "EXPIRED"; |
259 | } | 259 | } |
260 | }, 1000); | 260 | }, 1000); |
261 | 261 | ||
262 | var delhi = new Date("Oct 8, 2018 14:00:00").getTime(); | 262 | var delhi = new Date("Oct 8, 2018 14:00:00").getTime(); |
263 | // Update the count down every 1 second | 263 | // Update the count down every 1 second |
264 | var x = setInterval(function() { | 264 | var x = setInterval(function() { |
265 | // Get todays date and time | 265 | // Get todays date and time |
266 | var now = new Date().getTime(); | 266 | var now = new Date().getTime(); |
267 | // Find the distance between now an the count down date | 267 | // Find the distance between now an the count down date |
268 | var distance = delhi - now; | 268 | var distance = delhi - now; |
269 | // Time calculations for days, hours, minutes and seconds | 269 | // Time calculations for days, hours, minutes and seconds |
270 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 270 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
271 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 271 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
272 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 272 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
273 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 273 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
274 | $scope.timer = days + "d " + hours + "h " | 274 | $scope.timer = days + "d " + hours + "h " |
275 | + minutes + "m " + seconds + "s " | 275 | + minutes + "m " + seconds + "s " |
276 | // Output the result in an element with id="demo" | 276 | // Output the result in an element with id="demo" |
277 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " | 277 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " |
278 | + minutes + "m " + seconds + "s "; | 278 | + minutes + "m " + seconds + "s "; |
279 | // If the count down is over, write some text | 279 | // If the count down is over, write some text |
280 | if (distance < 0) { | 280 | if (distance < 0) { |
281 | clearInterval(x); | 281 | clearInterval(x); |
282 | document.getElementById("delhi").innerHTML = "EXPIRED"; | 282 | document.getElementById("delhi").innerHTML = "EXPIRED"; |
283 | } | 283 | } |
284 | }, 1000); | 284 | }, 1000); |
285 | 285 | ||
286 | var kanpur = new Date("Oct 10, 2018 14:00:00").getTime(); | 286 | var kanpur = new Date("Oct 10, 2018 14:00:00").getTime(); |
287 | // Update the count down every 1 second | 287 | // Update the count down every 1 second |
288 | var x = setInterval(function() { | 288 | var x = setInterval(function() { |
289 | // Get todays date and time | 289 | // Get todays date and time |
290 | var now = new Date().getTime(); | 290 | var now = new Date().getTime(); |
291 | // Find the distance between now an the count down date | 291 | // Find the distance between now an the count down date |
292 | var distance = kanpur - now; | 292 | var distance = kanpur - now; |
293 | // Time calculations for days, hours, minutes and seconds | 293 | // Time calculations for days, hours, minutes and seconds |
294 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 294 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
295 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 295 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
296 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 296 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
297 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 297 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
298 | $scope.timer = days + "d " + hours + "h " | 298 | $scope.timer = days + "d " + hours + "h " |
299 | + minutes + "m " + seconds + "s " | 299 | + minutes + "m " + seconds + "s " |
300 | // Output the result in an element with id="demo" | 300 | // Output the result in an element with id="demo" |
301 | document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " | 301 | document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " |
302 | + minutes + "m " + seconds + "s "; | 302 | + minutes + "m " + seconds + "s "; |
303 | // If the count down is over, write some text | 303 | // If the count down is over, write some text |
304 | if (distance < 0) { | 304 | if (distance < 0) { |
305 | clearInterval(x); | 305 | clearInterval(x); |
306 | document.getElementById("kanpur").innerHTML = "EXPIRED"; | 306 | document.getElementById("kanpur").innerHTML = "EXPIRED"; |
307 | } | 307 | } |
308 | }, 1000); | 308 | }, 1000); |
309 | 309 | ||
310 | var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime(); | 310 | var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime(); |
311 | // Update the count down every 1 second | 311 | // Update the count down every 1 second |
312 | var x = setInterval(function() { | 312 | var x = setInterval(function() { |
313 | // Get todays date and time | 313 | // Get todays date and time |
314 | var now = new Date().getTime(); | 314 | var now = new Date().getTime(); |
315 | // Find the distance between now an the count down date | 315 | // Find the distance between now an the count down date |
316 | var distance = ahmedabad - now; | 316 | var distance = ahmedabad - now; |
317 | // Time calculations for days, hours, minutes and seconds | 317 | // Time calculations for days, hours, minutes and seconds |
318 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 318 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
319 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 319 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
320 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 320 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
321 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 321 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
322 | $scope.timer = days + "d " + hours + "h " | 322 | $scope.timer = days + "d " + hours + "h " |
323 | + minutes + "m " + seconds + "s " | 323 | + minutes + "m " + seconds + "s " |
324 | // Output the result in an element with id="demo" | 324 | // Output the result in an element with id="demo" |
325 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " | 325 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " |
326 | + minutes + "m " + seconds + "s "; | 326 | + minutes + "m " + seconds + "s "; |
327 | // If the count down is over, write some text | 327 | // If the count down is over, write some text |
328 | if (distance < 0) { | 328 | if (distance < 0) { |
329 | clearInterval(x); | 329 | clearInterval(x); |
330 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; | 330 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; |
331 | } | 331 | } |
332 | }, 1000); | 332 | }, 1000); |
333 | 333 | ||
334 | var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime(); | 334 | var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime(); |
335 | // Update the count down every 1 second | 335 | // Update the count down every 1 second |
336 | var x = setInterval(function() { | 336 | var x = setInterval(function() { |
337 | // Get todays date and time | 337 | // Get todays date and time |
338 | var now = new Date().getTime(); | 338 | var now = new Date().getTime(); |
339 | // Find the distance between now an the count down date | 339 | // Find the distance between now an the count down date |
340 | var distance = bengaluru - now; | 340 | var distance = bengaluru - now; |
341 | // Time calculations for days, hours, minutes and seconds | 341 | // Time calculations for days, hours, minutes and seconds |
342 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 342 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
343 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 343 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
344 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 344 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
345 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 345 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
346 | $scope.timer = days + "d " + hours + "h " | 346 | $scope.timer = days + "d " + hours + "h " |
347 | + minutes + "m " + seconds + "s " | 347 | + minutes + "m " + seconds + "s " |
348 | // Output the result in an element with id="demo" | 348 | // Output the result in an element with id="demo" |
349 | document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " | 349 | document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " |
350 | + minutes + "m " + seconds + "s "; | 350 | + minutes + "m " + seconds + "s "; |
351 | // If the count down is over, write some text | 351 | // If the count down is over, write some text |
352 | if (distance < 0) { | 352 | if (distance < 0) { |
353 | clearInterval(x); | 353 | clearInterval(x); |
354 | document.getElementById("bengaluru").innerHTML = "EXPIRED"; | 354 | document.getElementById("bengaluru").innerHTML = "EXPIRED"; |
355 | } | 355 | } |
356 | }, 1000); | 356 | }, 1000); |
357 | 357 | ||
358 | var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime(); | 358 | var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime(); |
359 | // Update the count down every 1 second | 359 | // Update the count down every 1 second |
360 | var x = setInterval(function() { | 360 | var x = setInterval(function() { |
361 | // Get todays date and time | 361 | // Get todays date and time |
362 | var now = new Date().getTime(); | 362 | var now = new Date().getTime(); |
363 | // Find the distance between now an the count down date | 363 | // Find the distance between now an the count down date |
364 | var distance = dharamsala - now; | 364 | var distance = dharamsala - now; |
365 | // Time calculations for days, hours, minutes and seconds | 365 | // Time calculations for days, hours, minutes and seconds |
366 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 366 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
367 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 367 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
368 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 368 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
369 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 369 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
370 | $scope.timer = days + "d " + hours + "h " | 370 | $scope.timer = days + "d " + hours + "h " |
371 | + minutes + "m " + seconds + "s " | 371 | + minutes + "m " + seconds + "s " |
372 | // Output the result in an element with id="demo" | 372 | // Output the result in an element with id="demo" |
373 | document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " | 373 | document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " |
374 | + minutes + "m " + seconds + "s "; | 374 | + minutes + "m " + seconds + "s "; |
375 | // If the count down is over, write some text | 375 | // If the count down is over, write some text |
376 | if (distance < 0) { | 376 | if (distance < 0) { |
377 | clearInterval(x); | 377 | clearInterval(x); |
378 | document.getElementById("dharamsala").innerHTML = "EXPIRED"; | 378 | document.getElementById("dharamsala").innerHTML = "EXPIRED"; |
379 | } | 379 | } |
380 | }, 1000); | 380 | }, 1000); |
381 | 381 | ||
382 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 382 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
383 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 383 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
384 | // $scope.Textshow = "yes" | 384 | // $scope.Textshow = "yes" |
385 | $scope.max = 100; | 385 | $scope.max = 100; |
386 | $scope.formPage = false; | 386 | $scope.formPage = false; |
387 | $scope.current = 0; | 387 | $scope.current = 0; |
388 | $scope.payingAmnt = 0; | 388 | $scope.payingAmnt = 0; |
389 | $scope.data = {}; | 389 | $scope.data = {}; |
390 | $scope.discountAmount = 0; | 390 | $scope.discountAmount = 0; |
391 | // $scope.data.quantity = "1"; | 391 | // $scope.data.quantity = "1"; |
392 | $scope.check = false; | 392 | $scope.check = false; |
393 | $scope.numberCheck = false; | 393 | $scope.numberCheck = false; |
394 | $scope.paymentResult = {}; | 394 | $scope.paymentResult = {}; |
395 | var data = { | 395 | var data = { |
396 | "amount": $scope.payingAmnt, | 396 | "amount": $scope.payingAmnt, |
397 | "currency": "INR", | 397 | "currency": "INR", |
398 | "status": "pending" | 398 | "status": "pending" |
399 | } | 399 | } |
400 | 400 | ||
401 | $scope.showval = true; | 401 | $scope.showval = true; |
402 | $scope.hideval = false; | 402 | $scope.hideval = false; |
403 | $scope.showvalue = false; | 403 | $scope.showvalue = false; |
404 | $scope.hidevalue = false; | 404 | $scope.hidevalue = false; |
405 | localStorage.setItem("country",'INDIA'); | 405 | localStorage.setItem("country",'INDIA'); |
406 | $scope.isShowHide = function (value) { | 406 | $scope.isShowHide = function (value) { |
407 | var element = document.getElementById("defaultcountry"); | 407 | var element = document.getElementById("defaultcountry"); |
408 | element.classList.remove("btn-active"); | 408 | element.classList.remove("btn-active"); |
409 | localStorage.setItem("country",value); | 409 | localStorage.setItem("country",value); |
410 | if (value == "INDIA") { | 410 | if (value == "INDIA") { |
411 | console.log("value",value) | 411 | console.log("value",value) |
412 | $scope.showval = true; | 412 | $scope.showval = true; |
413 | $scope.hideval = false; | 413 | $scope.hideval = false; |
414 | $scope.showvalue = false; | 414 | $scope.showvalue = false; |
415 | $scope.hidevalue = false; | 415 | $scope.hidevalue = false; |
416 | } | 416 | } |
417 | else if (value == "SRI LANKA") { | 417 | else if (value == "SRI LANKA") { |
418 | console.log("value1",value) | 418 | console.log("value1",value) |
419 | $scope.showval = false; | 419 | $scope.showval = false; |
420 | $scope.hideval = true; | 420 | $scope.hideval = true; |
421 | $scope.showvalue = false; | 421 | $scope.showvalue = false; |
422 | $scope.hidevalue = false; | 422 | $scope.hidevalue = false; |
423 | } | 423 | } |
424 | else if (value == "BANGLADESH") { | 424 | else if (value == "BANGLADESH") { |
425 | console.log("value2",value) | 425 | console.log("value2",value) |
426 | $scope.showval = false; | 426 | $scope.showval = false; |
427 | $scope.hideval = false; | 427 | $scope.hideval = false; |
428 | $scope.showvalue = true; | 428 | $scope.showvalue = true; |
429 | $scope.hidevalue = false; | 429 | $scope.hidevalue = false; |
430 | } | 430 | } |
431 | else { | 431 | else { |
432 | console.log("value3",value) | 432 | console.log("value3",value) |
433 | $scope.showval = false; | 433 | $scope.showval = false; |
434 | $scope.hideval = false; | 434 | $scope.hideval = false; |
435 | $scope.showvalue = false; | 435 | $scope.showvalue = false; |
436 | $scope.hidevalue = true; | 436 | $scope.hidevalue = true; |
437 | } | 437 | } |
438 | } | 438 | } |
439 | 439 | ||
440 | $scope.apply = function() { | 440 | $scope.apply = function() { |
441 | $location.path("/caricatures") | 441 | $location.path("/caricatures") |
442 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg"; | 442 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg"; |
443 | 443 | ||
444 | } | 444 | } |
445 | 445 | ||
446 | $scope.applyRegister = function() { | 446 | $scope.applyRegister = function() { |
447 | $location.path("/paytm/caricatures") | 447 | $location.path("/paytm/caricatures") |
448 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; | 448 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; |
449 | } | 449 | } |
450 | 450 | ||
451 | $scope.applyForm = function() { | 451 | $scope.applyForm = function() { |
452 | //console.log("palak") | 452 | //console.log("palak") |
453 | $location.path("/campusAmbassadorForm") | 453 | $location.path("/campusAmbassadorForm") |
454 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; | 454 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; |
455 | } | 455 | } |
456 | 456 | ||
457 | $scope.click=function(){ | 457 | $scope.click=function(){ |
458 | Analytics.trackEvent('whatsapp', 'click', 'Registration'); | 458 | Analytics.trackEvent('whatsapp', 'click', 'Registration'); |
459 | let redirectUrl = "https://wa.me/918283056881"; | 459 | let redirectUrl = "https://wa.me/919855051678"; |
460 | window.open(redirectUrl,"_blank") | 460 | window.open(redirectUrl,"_blank") |
461 | } | 461 | } |
462 | 462 | ||
463 | // $scope.data.city = ''; | 463 | // $scope.data.city = ''; |
464 | $scope.watch = function(value){ | 464 | $scope.watch = function(value){ |
465 | //document.getElementById("ahmedabad").src = ""; | 465 | //document.getElementById("ahmedabad").src = ""; |
466 | // console.log("cllll",value) | 466 | // console.log("cllll",value) |
467 | $scope.data.city = value; | 467 | $scope.data.city = value; |
468 | // if($scope.data.city == "Chennai"){ | 468 | // if($scope.data.city == "Chennai"){ |
469 | // console.log("cllll1",value) | 469 | // console.log("cllll1",value) |
470 | // $window.location.href = 'http://35.154.24.158:8007'; | 470 | // $window.location.href = 'http://35.154.24.158:8007'; |
471 | // }else{ | 471 | // }else{ |
472 | // console.log("cllll2",value) | 472 | // console.log("cllll2",value) |
473 | localStorage.setItem("city" ,value); | 473 | localStorage.setItem("city" ,value); |
474 | 474 | ||
475 | //$location.path('/registration').search({city: value}); | 475 | //$location.path('/registration').search({city: value}); |
476 | // $location.path('/registration/'+value+''); | 476 | // $location.path('/registration/'+value+''); |
477 | $location.path('/registration'); | 477 | $location.path('/registration'); |
478 | //$state.go('registration', { 'city': value}) | 478 | //$state.go('registration', { 'city': value}) |
479 | // } | 479 | // } |
480 | } | 480 | } |
481 | 481 | ||
482 | $scope.watchCity = function(value){ | 482 | $scope.watchCity = function(value){ |
483 | $scope.data.city = value; | 483 | $scope.data.city = value; |
484 | localStorage.setItem("city" ,value); | 484 | localStorage.setItem("city" ,value); |
485 | $location.path('/paytm/checkout'); | 485 | $location.path('/paytm/checkout'); |
486 | } | 486 | } |
487 | 487 | ||
488 | $scope.select = function(url){ | 488 | $scope.select = function(url){ |
489 | console.log("cllll") | 489 | console.log("cllll") |
490 | window.open(url) | 490 | window.open(url) |
491 | } | 491 | } |
492 | 492 | ||
493 | $scope.stagekeyPress = function() { | 493 | $scope.stagekeyPress = function() { |
494 | $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); | 494 | $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); |
495 | } | 495 | } |
496 | $scope.sectorkeyPress = function() { | 496 | $scope.sectorkeyPress = function() { |
497 | $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); | 497 | $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); |
498 | } | 498 | } |
499 | 499 | ||
500 | $scope.productLaunchkeyPress = function() { | 500 | $scope.productLaunchkeyPress = function() { |
501 | $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); | 501 | $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); |
502 | } | 502 | } |
503 | 503 | ||
504 | $scope.launchPeriodkeyPress = function() { | 504 | $scope.launchPeriodkeyPress = function() { |
505 | $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); | 505 | $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); |
506 | } | 506 | } |
507 | 507 | ||
508 | $scope.industrykeyPress = function(quantity) { | 508 | $scope.industrykeyPress = function(quantity) { |
509 | console.log("fghj",quantity) | 509 | console.log("fghj",quantity) |
510 | $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); | 510 | $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); |
511 | } | 511 | } |
512 | 512 | ||
513 | $scope.industryNamekeyPress = function(firstName) { | 513 | $scope.industryNamekeyPress = function(firstName) { |
514 | console.log("lastName==", firstName); | 514 | console.log("lastName==", firstName); |
515 | if (firstName == undefined) { | 515 | if (firstName == undefined) { |
516 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 516 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
517 | } else { | 517 | } else { |
518 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); | 518 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
519 | } | 519 | } |
520 | } | 520 | } |
521 | 521 | ||
522 | $scope.amountkeyPress = function() { | 522 | $scope.amountkeyPress = function() { |
523 | $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); | 523 | $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); |
524 | } | 524 | } |
525 | 525 | ||
526 | $scope.firstNamekeyPress = function(name) { | 526 | $scope.firstNamekeyPress = function(name) { |
527 | console.log("lastName==", name); | 527 | console.log("lastName==", name); |
528 | if (name == undefined) { | 528 | if (name == undefined) { |
529 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); | 529 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); |
530 | } else { | 530 | } else { |
531 | $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); | 531 | $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); |
532 | } | 532 | } |
533 | } | 533 | } |
534 | 534 | ||
535 | $scope.emailkeyPress = function(email) { | 535 | $scope.emailkeyPress = function(email) { |
536 | console.log("email", email); | 536 | console.log("email", email); |
537 | if (email == undefined) { | 537 | if (email == undefined) { |
538 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); | 538 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); |
539 | } else { | 539 | } else { |
540 | $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); | 540 | $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); |
541 | } | 541 | } |
542 | } | 542 | } |
543 | 543 | ||
544 | $scope.phonekeyPress = function(number) { | 544 | $scope.phonekeyPress = function(number) { |
545 | console.log("number", number); | 545 | console.log("number", number); |
546 | if (number == undefined || number == '') { | 546 | if (number == undefined || number == '') { |
547 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); | 547 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); |
548 | } else { | 548 | } else { |
549 | $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); | 549 | $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); |
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | $scope.citykeyPress = function(city) { | 553 | $scope.citykeyPress = function(city) { |
554 | console.log("city", city); | 554 | console.log("city", city); |
555 | if (city == undefined) { | 555 | if (city == undefined) { |
556 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); | 556 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); |
557 | } else { | 557 | } else { |
558 | $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); | 558 | $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); |
559 | } | 559 | } |
560 | } | 560 | } |
561 | 561 | ||
562 | $scope.startupNamekeyPress = function(q) { | 562 | $scope.startupNamekeyPress = function(q) { |
563 | if (q == undefined) { | 563 | if (q == undefined) { |
564 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); | 564 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); |
565 | } else { | 565 | } else { |
566 | $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); | 566 | $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); |
567 | } | 567 | } |
568 | } | 568 | } |
569 | 569 | ||
570 | $scope.linkedInkeyPress = function(technology) { | 570 | $scope.linkedInkeyPress = function(technology) { |
571 | if (technology == undefined || technology == '') { | 571 | if (technology == undefined || technology == '') { |
572 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); | 572 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); |
573 | } else { | 573 | } else { |
574 | $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); | 574 | $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); |
575 | } | 575 | } |
576 | } | 576 | } |
577 | $scope.companykeyPress = function(problem) { | 577 | $scope.companykeyPress = function(problem) { |
578 | if (problem == undefined) { | 578 | if (problem == undefined) { |
579 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); | 579 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); |
580 | } else { | 580 | } else { |
581 | $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); | 581 | $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); |
582 | } | 582 | } |
583 | } | 583 | } |
584 | $scope.productNamekeyPress = function(solution) { | 584 | $scope.productNamekeyPress = function(solution) { |
585 | if (solution == undefined) { | 585 | if (solution == undefined) { |
586 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); | 586 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); |
587 | } else { | 587 | } else { |
588 | $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); | 588 | $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); |
589 | } | 589 | } |
590 | } | 590 | } |
591 | $scope.businesskeyPress = function(business) { | 591 | $scope.businesskeyPress = function(business) { |
592 | if (business == undefined) { | 592 | if (business == undefined) { |
593 | $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); | 593 | $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); |
594 | } else { | 594 | } else { |
595 | $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); | 595 | $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); |
596 | } | 596 | } |
597 | } | 597 | } |
598 | 598 | ||
599 | $scope.websitekeyPress = function(prototype) { | 599 | $scope.websitekeyPress = function(prototype) { |
600 | if (prototype == undefined || prototype == '') { | 600 | if (prototype == undefined || prototype == '') { |
601 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); | 601 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); |
602 | } else { | 602 | } else { |
603 | $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); | 603 | $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); |
604 | } | 604 | } |
605 | } | 605 | } |
606 | 606 | ||
607 | $scope.employeekeyPress = function(market) { | 607 | $scope.employeekeyPress = function(market) { |
608 | if (market == undefined || market == '') { | 608 | if (market == undefined || market == '') { |
609 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); | 609 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); |
610 | } else { | 610 | } else { |
611 | $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); | 611 | $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); |
612 | } | 612 | } |
613 | } | 613 | } |
614 | 614 | ||
615 | $scope.annualkeyPress = function(risk) { | 615 | $scope.annualkeyPress = function(risk) { |
616 | if (risk == undefined || risk == '') { | 616 | if (risk == undefined || risk == '') { |
617 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); | 617 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); |
618 | } else { | 618 | } else { |
619 | $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); | 619 | $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); |
620 | } | 620 | } |
621 | } | 621 | } |
622 | 622 | ||
623 | $scope.revenuekeyPress = function(team) { | 623 | $scope.revenuekeyPress = function(team) { |
624 | if (team == undefined) { | 624 | if (team == undefined) { |
625 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); | 625 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); |
626 | } else { | 626 | } else { |
627 | $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); | 627 | $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); |
628 | } | 628 | } |
629 | } | 629 | } |
630 | 630 | ||
631 | $scope.descriptionkeyPress = function(pitch) { | 631 | $scope.descriptionkeyPress = function(pitch) { |
632 | if (pitch == undefined) { | 632 | if (pitch == undefined) { |
633 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); | 633 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); |
634 | } else { | 634 | } else { |
635 | $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); | 635 | $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); |
636 | } | 636 | } |
637 | } | 637 | } |
638 | 638 | ||
639 | $scope.discountkeyPress = function(discount) { | 639 | $scope.discountkeyPress = function(discount) { |
640 | if (discount == undefined) { | 640 | if (discount == undefined) { |
641 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 641 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
642 | } else { | 642 | } else { |
643 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); | 643 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
644 | } | 644 | } |
645 | } | 645 | } |
646 | 646 | ||
647 | $scope.removeNooError = function() { | 647 | $scope.removeNooError = function() { |
648 | $('#invalidIdea').css('display', 'block'); | 648 | $('#invalidIdea').css('display', 'block'); |
649 | $('#noExist').css('display', 'none'); | 649 | $('#noExist').css('display', 'none'); |
650 | }; | 650 | }; |
651 | 651 | ||
652 | $scope.ideakeyPress = function(financial) { | 652 | $scope.ideakeyPress = function(financial) { |
653 | console.log("financial", financial); | 653 | console.log("financial", financial); |
654 | if (financial == undefined) { | 654 | if (financial == undefined) { |
655 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); | 655 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); |
656 | } else { | 656 | } else { |
657 | $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); | 657 | $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); |
658 | } | 658 | } |
659 | } | 659 | } |
660 | 660 | ||
661 | $scope.fundkeyPress = function(financial) { | 661 | $scope.fundkeyPress = function(financial) { |
662 | console.log("financial", financial); | 662 | console.log("financial", financial); |
663 | if (financial == undefined) { | 663 | if (financial == undefined) { |
664 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); | 664 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); |
665 | } else { | 665 | } else { |
666 | $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); | 666 | $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); |
667 | } | 667 | } |
668 | } | 668 | } |
669 | 669 | ||
670 | $scope.changeReferalIconColor = function(referalToken){ | 670 | $scope.changeReferalIconColor = function(referalToken){ |
671 | if (referalToken == undefined || referalToken == '') { | 671 | if (referalToken == undefined || referalToken == '') { |
672 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); | 672 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); |
673 | }else { | 673 | }else { |
674 | $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); | 674 | $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); |
675 | } | 675 | } |
676 | } | 676 | } |
677 | 677 | ||
678 | }); | 678 | }); |
679 | 679 | ||
680 | scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { | 680 | scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { |
681 | $scope.data = {}; | 681 | $scope.data = {}; |
682 | $scope.check = false; | 682 | $scope.check = false; |
683 | $scope.numberCheck = false; | 683 | $scope.numberCheck = false; |
684 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 684 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
685 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 685 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
686 | $scope.max = 100; | 686 | $scope.max = 100; |
687 | $scope.formPage = false; | 687 | $scope.formPage = false; |
688 | $scope.current = 0; | 688 | $scope.current = 0; |
689 | $scope.payingAmnt = 0; | 689 | $scope.payingAmnt = 0; |
690 | $scope.discountAmount = 0; | 690 | $scope.discountAmount = 0; |
691 | $scope.approvedMsg = false; | 691 | $scope.approvedMsg = false; |
692 | $scope.disApprovedMsg = false; | 692 | $scope.disApprovedMsg = false; |
693 | 693 | ||
694 | // $scope.data.quantity = "1"; | 694 | // $scope.data.quantity = "1"; |
695 | $scope.check = false; | 695 | $scope.check = false; |
696 | $scope.numberCheck = false; | 696 | $scope.numberCheck = false; |
697 | $scope.paymentResult = {}; | 697 | $scope.paymentResult = {}; |
698 | // var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] | 698 | // var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] |
699 | // if(myParam){ | 699 | // if(myParam){ |
700 | // if(myParam == "approved"){ | 700 | // if(myParam == "approved"){ |
701 | // $scope.showResponse = true; | 701 | // $scope.showResponse = true; |
702 | // }else{ | 702 | // }else{ |
703 | // $scope.disApprovedMsg = true; | 703 | // $scope.disApprovedMsg = true; |
704 | // } | 704 | // } |
705 | // }else{ | 705 | // }else{ |
706 | // $scope.disApprovedMsg = true; | 706 | // $scope.disApprovedMsg = true; |
707 | // } | 707 | // } |
708 | 708 | ||
709 | $scope.click=function(){ | 709 | $scope.click=function(){ |
710 | Analytics.trackEvent('whatsapp', 'click', 'Registration'); | 710 | Analytics.trackEvent('whatsapp', 'click', 'Registration'); |
711 | let redirectUrl = "https://wa.me/918283056881"; | 711 | let redirectUrl = "https://wa.me/919855051678"; |
712 | window.open(redirectUrl,"_blank") | 712 | window.open(redirectUrl,"_blank") |
713 | } | 713 | } |
714 | 714 | ||
715 | $scope.removeError = function() { | 715 | $scope.removeError = function() { |
716 | $('#invalidEmail').css('display', 'none'); | 716 | $('#invalidEmail').css('display', 'none'); |
717 | $('#alreadyExist').css('display', 'none'); | 717 | $('#alreadyExist').css('display', 'none'); |
718 | }; | 718 | }; |
719 | 719 | ||
720 | $scope.emailcheck = function(val) { | 720 | $scope.emailcheck = function(val) { |
721 | if (val == undefined) { | 721 | if (val == undefined) { |
722 | $('#invalidEmail').css('display', 'block'); | 722 | $('#invalidEmail').css('display', 'block'); |
723 | } else { | 723 | } else { |
724 | $('#alreadyExist').css('display', 'block'); | 724 | $('#alreadyExist').css('display', 'block'); |
725 | } | 725 | } |
726 | }; | 726 | }; |
727 | 727 | ||
728 | $scope.removeNoError = function() { | 728 | $scope.removeNoError = function() { |
729 | $('#invalidNumber').css('display', 'none'); | 729 | $('#invalidNumber').css('display', 'none'); |
730 | $('#alreadyExist').css('display', 'none'); | 730 | $('#alreadyExist').css('display', 'none'); |
731 | }; | 731 | }; |
732 | 732 | ||
733 | $scope.numbercheck = function(val) { | 733 | $scope.numbercheck = function(val) { |
734 | if (val == undefined) { | 734 | if (val == undefined) { |
735 | $('#invalidNumber').css('display', 'block'); | 735 | $('#invalidNumber').css('display', 'block'); |
736 | } else { | 736 | } else { |
737 | $('#alreadyExist').css('display', 'block'); | 737 | $('#alreadyExist').css('display', 'block'); |
738 | } | 738 | } |
739 | }; | 739 | }; |
740 | 740 | ||
741 | // $scope.$on('city', function (event, value) { | 741 | // $scope.$on('city', function (event, value) { |
742 | $scope.data.city = localStorage.getItem("city"); | 742 | $scope.data.city = localStorage.getItem("city"); |
743 | $scope.data.country = localStorage.getItem("country"); | 743 | $scope.data.country = localStorage.getItem("country"); |
744 | // }); | 744 | // }); |
745 | var data = { | 745 | var data = { |
746 | "amount": $scope.payingAmnt, | 746 | "amount": $scope.payingAmnt, |
747 | "currency": "INR", | 747 | "currency": "INR", |
748 | "status": "pending", | 748 | "status": "pending", |
749 | "paymentType": $scope.data.country | 749 | "paymentType": $scope.data.country |
750 | } | 750 | } |
751 | 751 | ||
752 | var handleFileSelect = function(evt) { | 752 | var handleFileSelect = function(evt) { |
753 | var files = evt.target.files; | 753 | var files = evt.target.files; |
754 | var file = files[0]; | 754 | var file = files[0]; |
755 | 755 | ||
756 | if (files && file) { | 756 | if (files && file) { |
757 | var reader = new FileReader(); | 757 | var reader = new FileReader(); |
758 | 758 | ||
759 | reader.onload = function(readerEvt) { | 759 | reader.onload = function(readerEvt) { |
760 | var binaryString = readerEvt.target.result; | 760 | var binaryString = readerEvt.target.result; |
761 | $scope.base64textString = btoa(binaryString); | 761 | $scope.base64textString = btoa(binaryString); |
762 | //console.log("base64textarea",$scope.base64textString) | 762 | //console.log("base64textarea",$scope.base64textString) |
763 | //$scope.data.uploadFile = file.name; | 763 | //$scope.data.uploadFile = file.name; |
764 | $scope.fileSelect = false; | 764 | $scope.fileSelect = false; |
765 | if($scope.data.uploadFile == null){ | 765 | if($scope.data.uploadFile == null){ |
766 | $scope.fileSelect = true; | 766 | $scope.fileSelect = true; |
767 | }else{ | 767 | }else{ |
768 | $scope.fileSelect = false; | 768 | $scope.fileSelect = false; |
769 | }; | 769 | }; |
770 | } | 770 | } |
771 | 771 | ||
772 | reader.readAsBinaryString(file); | 772 | reader.readAsBinaryString(file); |
773 | } | 773 | } |
774 | }; | 774 | }; |
775 | if (window.File && window.FileReader && window.FileList && window.Blob) { | 775 | if (window.File && window.FileReader && window.FileList && window.Blob) { |
776 | document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); | 776 | document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); |
777 | } | 777 | } |
778 | 778 | ||
779 | $scope.ngShowhide = false; | 779 | $scope.ngShowhide = false; |
780 | $scope.GetValue = function(){ | 780 | $scope.GetValue = function(){ |
781 | if($scope.data.sector == "Other"){ | 781 | if($scope.data.sector == "Other"){ |
782 | $scope.ngShowhide = true; | 782 | $scope.ngShowhide = true; |
783 | }else{ | 783 | }else{ |
784 | $scope.ngShowhide = false; | 784 | $scope.ngShowhide = false; |
785 | } | 785 | } |
786 | } | 786 | } |
787 | 787 | ||
788 | $scope.ngShow = false; | 788 | $scope.ngShow = false; |
789 | $scope.getValue = function(){ | 789 | $scope.getValue = function(){ |
790 | if($scope.data.hear == "Other"){ | 790 | if($scope.data.hear == "Other"){ |
791 | $scope.ngShow = true; | 791 | $scope.ngShow = true; |
792 | }else{ | 792 | }else{ |
793 | $scope.ngShow = false; | 793 | $scope.ngShow = false; |
794 | } | 794 | } |
795 | } | 795 | } |
796 | $scope.payingAmnt = 1180; | 796 | $scope.payingAmnt = 1180; |
797 | $rootScope.tokenCall = function(val) { | 797 | $rootScope.tokenCall = function(val) { |
798 | if (val == undefined) { | 798 | if (val == undefined) { |
799 | $('#invalidToken').css('display', 'block'); | 799 | $('#invalidToken').css('display', 'block'); |
800 | } else { | 800 | } else { |
801 | val = val.toUpperCase(); | 801 | val = val.toUpperCase(); |
802 | if(((val == "IITH99" || val == "IITH90") && $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 == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ | 802 | if(((val == "IITH99" || val == "IITH90") && $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 == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ |
803 | $scope.tokencheck = false; | 803 | $scope.tokencheck = false; |
804 | return; | 804 | return; |
805 | } | 805 | } |
806 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') | 806 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') |
807 | .then(function(searchResult) { | 807 | .then(function(searchResult) { |
808 | if (searchResult.data.length == 0) { | 808 | if (searchResult.data.length == 0) { |
809 | $scope.tokencheck = false; | 809 | $scope.tokencheck = false; |
810 | $scope.discountAmount = 0; | 810 | $scope.discountAmount = 0; |
811 | 811 | ||
812 | } else { | 812 | } else { |
813 | $scope.discountpercentage = searchResult.data[0].discount; | 813 | $scope.discountpercentage = searchResult.data[0].discount; |
814 | $scope.tokencheck = true; | 814 | $scope.tokencheck = true; |
815 | } | 815 | } |
816 | $scope.ticketAmnt = 1180; | 816 | $scope.ticketAmnt = 1180; |
817 | var amount = $scope.ticketAmnt * 100 | 817 | var amount = $scope.ticketAmnt * 100 |
818 | if($scope.tokencheck == true){ | 818 | if($scope.tokencheck == true){ |
819 | var amount = $scope.ticketAmnt | 819 | var amount = $scope.ticketAmnt |
820 | if($scope.discountpercentage == "100") { | 820 | if($scope.discountpercentage == "100") { |
821 | $scope.discountpercentage = "99.9"; | 821 | $scope.discountpercentage = "99.9"; |
822 | } | 822 | } |
823 | $scope.percDiscount = $scope.discountpercentage/100; | 823 | $scope.percDiscount = $scope.discountpercentage/100; |
824 | $scope.discountAmount = amount * $scope.percDiscount; | 824 | $scope.discountAmount = amount * $scope.percDiscount; |
825 | } | 825 | } |
826 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 826 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
827 | $scope.payingAmnt = taxAmount; | 827 | $scope.payingAmnt = taxAmount; |
828 | $scope.payingAmnt = $scope.payingAmnt.toFixed() | 828 | $scope.payingAmnt = $scope.payingAmnt.toFixed() |
829 | },function(err){ | 829 | },function(err){ |
830 | console.log(err) | 830 | console.log(err) |
831 | }); | 831 | }); |
832 | 832 | ||
833 | } | 833 | } |
834 | }; | 834 | }; |
835 | // if($scope.data.country == "INDIA"){ | 835 | // if($scope.data.country == "INDIA"){ |
836 | // $scope.submit = function() { | 836 | // $scope.submit = function() { |
837 | // Analytics.trackEvent('register', 'click', 'Registration'); | 837 | // Analytics.trackEvent('register', 'click', 'Registration'); |
838 | // $scope.loading = true; | 838 | // $scope.loading = true; |
839 | // $scope.data.uploadFile = $scope.base64textString; | 839 | // $scope.data.uploadFile = $scope.base64textString; |
840 | // console.log($scope.data.uploadFile) | 840 | // console.log($scope.data.uploadFile) |
841 | // // if($scope.tokencheck == false){ | 841 | // // if($scope.tokencheck == false){ |
842 | // // $scope.data.referalToken = null; | 842 | // // $scope.data.referalToken = null; |
843 | // // } | 843 | // // } |
844 | // // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 844 | // // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
845 | // // var x = document.getElementById("snackbar") | 845 | // // var x = document.getElementById("snackbar") |
846 | // // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 846 | // // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
847 | // // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 847 | // // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
848 | // $scope.infoForm = true; | 848 | // $scope.infoForm = true; |
849 | // $scope.ticketAmnt = 1180; | 849 | // $scope.ticketAmnt = 1180; |
850 | // $scope.detail = {}; | 850 | // $scope.detail = {}; |
851 | // $scope.data.phone = "+91"+$scope.data.number; | 851 | // $scope.data.phone = "+91"+$scope.data.number; |
852 | // if($scope.data.referalToken == null){ | 852 | // if($scope.data.referalToken == null){ |
853 | // $scope.data.referalToken = "NA" | 853 | // $scope.data.referalToken = "NA" |
854 | // } | 854 | // } |
855 | // var file =document.getElementById('filePicker').files[0]; | 855 | // var file =document.getElementById('filePicker').files[0]; |
856 | // var image = BASE_URL+'/containers/images/download/' | 856 | // var image = BASE_URL+'/containers/images/download/' |
857 | // var imagePath = file.name; | 857 | // var imagePath = file.name; |
858 | // $scope.data.uploadFile = image + imagePath; | 858 | // $scope.data.uploadFile = image + imagePath; |
859 | // var fd = new FormData() | 859 | // var fd = new FormData() |
860 | // fd.append('filePicker',file); | 860 | // fd.append('filePicker',file); |
861 | // var deferred = $q.defer(); | 861 | // var deferred = $q.defer(); |
862 | // $http({ | 862 | // $http({ |
863 | // method:'POST', | 863 | // method:'POST', |
864 | // url: BASE_URL+'/containers/images/upload', | 864 | // url: BASE_URL+'/containers/images/upload', |
865 | // data:fd, | 865 | // data:fd, |
866 | // transformRequest:angular.identity, | 866 | // transformRequest:angular.identity, |
867 | // headers:{'Content-Type':undefined} | 867 | // headers:{'Content-Type':undefined} |
868 | // }) | 868 | // }) |
869 | // .success(function(result){ | 869 | // .success(function(result){ |
870 | // deferred.resolve(result); | 870 | // deferred.resolve(result); |
871 | // $http({ | 871 | // $http({ |
872 | // method: 'POST', | 872 | // method: 'POST', |
873 | // url: BASE_URL+'/applicants', | 873 | // url: BASE_URL+'/applicants', |
874 | // data: $scope.data, | 874 | // data: $scope.data, |
875 | // headers: {} | 875 | // headers: {} |
876 | // }).then(function mySuccess(result) { | 876 | // }).then(function mySuccess(result) { |
877 | // $scope.detail = result; | 877 | // $scope.detail = result; |
878 | // data.applicantId = result.data.id; | 878 | // data.applicantId = result.data.id; |
879 | // $scope.userId = result.data.id; | 879 | // $scope.userId = result.data.id; |
880 | // var amount = $scope.ticketAmnt * 100 | 880 | // var amount = $scope.ticketAmnt * 100 |
881 | // if($scope.tokencheck == true){ | 881 | // if($scope.tokencheck == true){ |
882 | // var amount = $scope.ticketAmnt | 882 | // var amount = $scope.ticketAmnt |
883 | // console.log("resultcity===",$scope.data.city) | 883 | // console.log("resultcity===",$scope.data.city) |
884 | // if($scope.discountpercentage == "100") { | 884 | // if($scope.discountpercentage == "100") { |
885 | // $scope.discountpercentage = "99.9"; | 885 | // $scope.discountpercentage = "99.9"; |
886 | // } | 886 | // } |
887 | // $scope.percDiscount = $scope.discountpercentage/100; | 887 | // $scope.percDiscount = $scope.discountpercentage/100; |
888 | // $scope.discountAmount = amount * $scope.percDiscount; | 888 | // $scope.discountAmount = amount * $scope.percDiscount; |
889 | // } | 889 | // } |
890 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 890 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
891 | // $scope.payingAmnt = taxAmount; | 891 | // $scope.payingAmnt = taxAmount; |
892 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() | 892 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() |
893 | // data.amount = $scope.payingAmnt; | 893 | // data.amount = $scope.payingAmnt; |
894 | // if($scope.detail != null){ | 894 | // if($scope.detail != null){ |
895 | // $http({ | 895 | // $http({ |
896 | // method: 'POST', | 896 | // method: 'POST', |
897 | // url: BASE_URL+'/payments', | 897 | // url: BASE_URL+'/payments', |
898 | // data: data, | 898 | // data: data, |
899 | // headers: {} | 899 | // headers: {} |
900 | // }).then(function mySuccess(paymentResult) { | 900 | // }).then(function mySuccess(paymentResult) { |
901 | // $scope.loading = false; | 901 | // $scope.loading = false; |
902 | // //$("p").html(paymentResult.data.data) | 902 | // //$("p").html(paymentResult.data.data) |
903 | // }, function myError(error) { | 903 | // }, function myError(error) { |
904 | // }); | 904 | // }); |
905 | // } | 905 | // } |
906 | // var i = 0; | 906 | // var i = 0; |
907 | // $scope.payingAmnt = $scope.payingAmnt * 100; | 907 | // $scope.payingAmnt = $scope.payingAmnt * 100; |
908 | // var options = { | 908 | // var options = { |
909 | // "key": "rzp_test_YwHsVFiDIQ2WUQ", | 909 | // "key": "rzp_test_YwHsVFiDIQ2WUQ", |
910 | // //"key": "rzp_live_mkmCb4FkstuWaS", | 910 | // //"key": "rzp_live_mkmCb4FkstuWaS", |
911 | // "amount": $scope.payingAmnt, | 911 | // "amount": $scope.payingAmnt, |
912 | 912 | ||
913 | // "name": "Startup Jalsa", | 913 | // "name": "Startup Jalsa", |
914 | // "description":"amount", | 914 | // "description":"amount", |
915 | // "currency": "INR", | 915 | // "currency": "INR", |
916 | // "status": "done", | 916 | // "status": "done", |
917 | 917 | ||
918 | // "prefill": { | 918 | // "prefill": { |
919 | // "email": $scope.detail.email, | 919 | // "email": $scope.detail.email, |
920 | // "contact": $scope.detail.phone | 920 | // "contact": $scope.detail.phone |
921 | // }, | 921 | // }, |
922 | 922 | ||
923 | // "theme": { | 923 | // "theme": { |
924 | // "color": "#2196f3 ", | 924 | // "color": "#2196f3 ", |
925 | // "image_padding":"NO" | 925 | // "image_padding":"NO" |
926 | // }, | 926 | // }, |
927 | // "modal": { | 927 | // "modal": { |
928 | // "ondismiss": function(){ | 928 | // "ondismiss": function(){ |
929 | // } | 929 | // } |
930 | // }, | 930 | // }, |
931 | // "handler": function (response){ | 931 | // "handler": function (response){ |
932 | // createPayment(response); | 932 | // createPayment(response); |
933 | // } | 933 | // } |
934 | // }; | 934 | // }; |
935 | // var rzp1 = new Razorpay(options); | 935 | // var rzp1 = new Razorpay(options); |
936 | // rzp1.open(); | 936 | // rzp1.open(); |
937 | // $scope.paymentResponse = {}; | 937 | // $scope.paymentResponse = {}; |
938 | // function createPayment(response){ | 938 | // function createPayment(response){ |
939 | // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 939 | // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
940 | // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 940 | // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
941 | // $scope.paymentResponse.amount = data.amount; | 941 | // $scope.paymentResponse.amount = data.amount; |
942 | // $scope.paymentResponse.currency = "INR"; | 942 | // $scope.paymentResponse.currency = "INR"; |
943 | // $scope.paymentResponse.status = $scope.paymentResult.data.status; | 943 | // $scope.paymentResponse.status = $scope.paymentResult.data.status; |
944 | // $http({ | 944 | // $http({ |
945 | // method: 'PUT', | 945 | // method: 'PUT', |
946 | // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | 946 | // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, |
947 | // data: $scope.paymentResponse, | 947 | // data: $scope.paymentResponse, |
948 | // headers: {} | 948 | // headers: {} |
949 | // }).then(function mySuccess(searchResult) { | 949 | // }).then(function mySuccess(searchResult) { |
950 | // Analytics.trackEvent('register', 'click', 'Registration'); | 950 | // Analytics.trackEvent('register', 'click', 'Registration'); |
951 | // $location.path("/confirm") | 951 | // $location.path("/confirm") |
952 | // }, function myError(error) { | 952 | // }, function myError(error) { |
953 | // }); | 953 | // }); |
954 | // } | 954 | // } |
955 | // //} | 955 | // //} |
956 | 956 | ||
957 | // }, function myError(error) { | 957 | // }, function myError(error) { |
958 | 958 | ||
959 | // }); | 959 | // }); |
960 | 960 | ||
961 | // }) | 961 | // }) |
962 | 962 | ||
963 | // // }) | 963 | // // }) |
964 | 964 | ||
965 | // //} | 965 | // //} |
966 | 966 | ||
967 | // } | 967 | // } |
968 | // }else{ | 968 | // }else{ |
969 | // $scope.ticketAmnt = 1180; | 969 | // $scope.ticketAmnt = 1180; |
970 | // var amount = $scope.ticketAmnt * 100 | 970 | // var amount = $scope.ticketAmnt * 100 |
971 | // console.log("amount",amount) | 971 | // console.log("amount",amount) |
972 | // console.log("amount",$scope.tokencheck) | 972 | // console.log("amount",$scope.tokencheck) |
973 | // if($scope.tokencheck == true){ | 973 | // if($scope.tokencheck == true){ |
974 | // var amount = $scope.ticketAmnt | 974 | // var amount = $scope.ticketAmnt |
975 | // console.log("amount",amount) | 975 | // console.log("amount",amount) |
976 | // if($scope.discountpercentage == "100") { | 976 | // if($scope.discountpercentage == "100") { |
977 | // $scope.discountpercentage = "99.9"; | 977 | // $scope.discountpercentage = "99.9"; |
978 | // } | 978 | // } |
979 | // $scope.percDiscount = $scope.discountpercentage/100; | 979 | // $scope.percDiscount = $scope.discountpercentage/100; |
980 | // console.log("$scope.percDiscount",$scope.percDiscount) | 980 | // console.log("$scope.percDiscount",$scope.percDiscount) |
981 | // $scope.discountAmount = amount * $scope.percDiscount; | 981 | // $scope.discountAmount = amount * $scope.percDiscount; |
982 | // } | 982 | // } |
983 | // console.log("$scope.discountAmount",$scope.discountAmount) | 983 | // console.log("$scope.discountAmount",$scope.discountAmount) |
984 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 984 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
985 | // console.log("taxAmount",taxAmount) | 985 | // console.log("taxAmount",taxAmount) |
986 | // $scope.payingAmnt = taxAmount; | 986 | // $scope.payingAmnt = taxAmount; |
987 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() | 987 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() |
988 | 988 | ||
989 | $scope.submit = function() { | 989 | $scope.submit = function() { |
990 | Analytics.trackEvent('register', 'click', 'Registration'); | 990 | Analytics.trackEvent('register', 'click', 'Registration'); |
991 | $scope.loading = true; | 991 | $scope.loading = true; |
992 | $scope.data.uploadFile = $scope.base64textString; | 992 | $scope.data.uploadFile = $scope.base64textString; |
993 | // if($scope.tokencheck == false){ | 993 | // if($scope.tokencheck == false){ |
994 | // $scope.data.referalToken = null; | 994 | // $scope.data.referalToken = null; |
995 | // } | 995 | // } |
996 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 996 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
997 | // var x = document.getElementById("snackbar") | 997 | // var x = document.getElementById("snackbar") |
998 | // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 998 | // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
999 | // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 999 | // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
1000 | $scope.infoForm = true; | 1000 | $scope.infoForm = true; |
1001 | $scope.ticketAmnt = 1180; | 1001 | $scope.ticketAmnt = 1180; |
1002 | $scope.detail = {}; | 1002 | $scope.detail = {}; |
1003 | $scope.paymentResultt = {}; | 1003 | $scope.paymentResultt = {}; |
1004 | $rootScope.applicantResult = {}; | 1004 | $rootScope.applicantResult = {}; |
1005 | $scope.data.phone = "+91"+$scope.data.number; | 1005 | $scope.data.phone = "+91"+$scope.data.number; |
1006 | if($scope.data.referalToken == null){ | 1006 | if($scope.data.referalToken == null){ |
1007 | $scope.data.referalToken = "NA" | 1007 | $scope.data.referalToken = "NA" |
1008 | } | 1008 | } |
1009 | var file =document.getElementById('filePicker').files[0]; | 1009 | var file =document.getElementById('filePicker').files[0]; |
1010 | //console.log("file",filePicker) | 1010 | //console.log("file",filePicker) |
1011 | var image = BASE_URL+'/containers/images/download/' | 1011 | var image = BASE_URL+'/containers/images/download/' |
1012 | var imagePath = file.name; | 1012 | var imagePath = file.name; |
1013 | $scope.data.uploadFile = image + imagePath; | 1013 | $scope.data.uploadFile = image + imagePath; |
1014 | //console.log($scope.data.uploadFile) | 1014 | //console.log($scope.data.uploadFile) |
1015 | var fd = new FormData() | 1015 | var fd = new FormData() |
1016 | fd.append('filePicker',file); | 1016 | fd.append('filePicker',file); |
1017 | var deferred = $q.defer(); | 1017 | var deferred = $q.defer(); |
1018 | $http({ | 1018 | $http({ |
1019 | method:'POST', | 1019 | method:'POST', |
1020 | url: BASE_URL+'/containers/images/upload', | 1020 | url: BASE_URL+'/containers/images/upload', |
1021 | data:fd, | 1021 | data:fd, |
1022 | transformRequest:angular.identity, | 1022 | transformRequest:angular.identity, |
1023 | headers:{'Content-Type':undefined} | 1023 | headers:{'Content-Type':undefined} |
1024 | }) | 1024 | }) |
1025 | .success(function(result){ | 1025 | .success(function(result){ |
1026 | deferred.resolve(result); | 1026 | deferred.resolve(result); |
1027 | $http({ | 1027 | $http({ |
1028 | method: 'POST', | 1028 | method: 'POST', |
1029 | url: BASE_URL+'/applicants', | 1029 | url: BASE_URL+'/applicants', |
1030 | data: $scope.data, | 1030 | data: $scope.data, |
1031 | headers: {} | 1031 | headers: {} |
1032 | }).then(function mySuccess(result) { | 1032 | }).then(function mySuccess(result) { |
1033 | $scope.detail = result; | 1033 | $scope.detail = result; |
1034 | data.applicantId = result.data.id; | 1034 | data.applicantId = result.data.id; |
1035 | $scope.userId = result.data.id; | 1035 | $scope.userId = result.data.id; |
1036 | var amount = $scope.ticketAmnt * 100 | 1036 | var amount = $scope.ticketAmnt * 100 |
1037 | if($scope.tokencheck == true){ | 1037 | if($scope.tokencheck == true){ |
1038 | var amount = $scope.ticketAmnt | 1038 | var amount = $scope.ticketAmnt |
1039 | if($scope.discountpercentage == "100") { | 1039 | if($scope.discountpercentage == "100") { |
1040 | $scope.discountpercentage = "99.9"; | 1040 | $scope.discountpercentage = "99.9"; |
1041 | } | 1041 | } |
1042 | $scope.percDiscount = $scope.discountpercentage/100; | 1042 | $scope.percDiscount = $scope.discountpercentage/100; |
1043 | $scope.discountAmount = amount * $scope.percDiscount; | 1043 | $scope.discountAmount = amount * $scope.percDiscount; |
1044 | } | 1044 | } |
1045 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 1045 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
1046 | $scope.payingAmnt = taxAmount; | 1046 | $scope.payingAmnt = taxAmount; |
1047 | $scope.payingAmnt = $scope.payingAmnt.toFixed() | 1047 | $scope.payingAmnt = $scope.payingAmnt.toFixed() |
1048 | data.amount = $scope.payingAmnt; | 1048 | data.amount = $scope.payingAmnt; |
1049 | if($scope.detail != null){ | 1049 | if($scope.detail != null){ |
1050 | $http({ | 1050 | $http({ |
1051 | method: 'POST', | 1051 | method: 'POST', |
1052 | url: BASE_URL+'/payments', | 1052 | url: BASE_URL+'/payments', |
1053 | data: data, | 1053 | data: data, |
1054 | headers: {} | 1054 | headers: {} |
1055 | }).then(function mySuccess(paymentResult) { | 1055 | }).then(function mySuccess(paymentResult) { |
1056 | $scope.loading = false; | 1056 | $scope.loading = false; |
1057 | $scope.paymentResult = paymentResult; | 1057 | $scope.paymentResult = paymentResult; |
1058 | //$("p").html(paymentResult.data.data) | 1058 | //$("p").html(paymentResult.data.data) |
1059 | }, function myError(error) { | 1059 | }, function myError(error) { |
1060 | }); | 1060 | }); |
1061 | } | 1061 | } |
1062 | var i = 0; | 1062 | var i = 0; |
1063 | $scope.payingAmntt = $scope.payingAmnt * 100; | 1063 | $scope.payingAmntt = $scope.payingAmnt * 100; |
1064 | var options = { | 1064 | var options = { |
1065 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", | 1065 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
1066 | "key": "rzp_live_mkmCb4FkstuWaS", | 1066 | "key": "rzp_live_mkmCb4FkstuWaS", |
1067 | "amount": $scope.payingAmntt, | 1067 | "amount": $scope.payingAmntt, |
1068 | 1068 | ||
1069 | "name": "Startup Jalsa", | 1069 | "name": "Startup Jalsa", |
1070 | "description":"amount", | 1070 | "description":"amount", |
1071 | "currency": "INR", | 1071 | "currency": "INR", |
1072 | "status": "done", | 1072 | "status": "done", |
1073 | 1073 | ||
1074 | "prefill": { | 1074 | "prefill": { |
1075 | "email": $scope.detail.email, | 1075 | "email": $scope.detail.email, |
1076 | "contact": $scope.detail.phone | 1076 | "contact": $scope.detail.phone |
1077 | }, | 1077 | }, |
1078 | 1078 | ||
1079 | "theme": { | 1079 | "theme": { |
1080 | "color": "#2196f3 ", | 1080 | "color": "#2196f3 ", |
1081 | "image_padding":"NO" | 1081 | "image_padding":"NO" |
1082 | }, | 1082 | }, |
1083 | "modal": { | 1083 | "modal": { |
1084 | "ondismiss": function(){ | 1084 | "ondismiss": function(){ |
1085 | } | 1085 | } |
1086 | }, | 1086 | }, |
1087 | "handler": function (response){ | 1087 | "handler": function (response){ |
1088 | createPayment(response); | 1088 | createPayment(response); |
1089 | } | 1089 | } |
1090 | }; | 1090 | }; |
1091 | var rzp1 = new Razorpay(options); | 1091 | var rzp1 = new Razorpay(options); |
1092 | rzp1.open(); | 1092 | rzp1.open(); |
1093 | $scope.paymentResponse = {}; | 1093 | $scope.paymentResponse = {}; |
1094 | function createPayment(response){ | 1094 | function createPayment(response){ |
1095 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 1095 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
1096 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 1096 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
1097 | $scope.paymentResponse.amount = data.amount; | 1097 | $scope.paymentResponse.amount = data.amount; |
1098 | $scope.paymentResponse.currency = "INR"; | 1098 | $scope.paymentResponse.currency = "INR"; |
1099 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 1099 | $scope.paymentResponse.status = $scope.paymentResult.data.status; |
1100 | $http({ | 1100 | $http({ |
1101 | method: 'PUT', | 1101 | method: 'PUT', |
1102 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | 1102 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, |
1103 | data: $scope.paymentResponse, | 1103 | data: $scope.paymentResponse, |
1104 | headers: {} | 1104 | headers: {} |
1105 | }).then(function mySuccess(searchResult) { | 1105 | }).then(function mySuccess(searchResult) { |
1106 | console.log("searchResult",searchResult) | 1106 | console.log("searchResult",searchResult) |
1107 | //$location.path("/confirm") | 1107 | //$location.path("/confirm") |
1108 | $rootScope.paymentResultt = searchResult.data; | 1108 | $rootScope.paymentResultt = searchResult.data; |
1109 | $http({ | 1109 | $http({ |
1110 | method: 'GET', | 1110 | method: 'GET', |
1111 | url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId, | 1111 | url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId, |
1112 | data: $scope.data, | 1112 | data: $scope.data, |
1113 | headers: {} | 1113 | headers: {} |
1114 | }).then(function mySuccess(result) { | 1114 | }).then(function mySuccess(result) { |
1115 | //console.log("result2323324434",result) | 1115 | //console.log("result2323324434",result) |
1116 | $rootScope.applicantResult = result.data; | 1116 | $rootScope.applicantResult = result.data; |
1117 | if (result.data.city == "Chennai") { | 1117 | if (result.data.city == "Chennai") { |
1118 | $rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113", | 1118 | $rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113", |
1119 | $rootScope.applicantResult.date= "October 1st, 2019", | 1119 | $rootScope.applicantResult.date= "October 1st, 2019", |
1120 | $rootScope.applicantResult.time= "3 PM" | 1120 | $rootScope.applicantResult.time= "3 PM" |
1121 | 1121 | ||
1122 | } else if (result.data.city == "Hyderabad") { | 1122 | } else if (result.data.city == "Hyderabad") { |
1123 | $rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285", | 1123 | $rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285", |
1124 | $rootScope.applicantResult.date= "September 14th, 2019", | 1124 | $rootScope.applicantResult.date= "September 14th, 2019", |
1125 | $rootScope.applicantResult.time= "3 PM" | 1125 | $rootScope.applicantResult.time= "3 PM" |
1126 | 1126 | ||
1127 | } else if (result.data.city == "Mumbai") { | 1127 | } else if (result.data.city == "Mumbai") { |
1128 | $rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076", | 1128 | $rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076", |
1129 | $rootScope.applicantResult.date= "September 4th, 2019", | 1129 | $rootScope.applicantResult.date= "September 4th, 2019", |
1130 | $rootScope.applicantResult.time= "3 PM" | 1130 | $rootScope.applicantResult.time= "3 PM" |
1131 | 1131 | ||
1132 | } else if (result.data.city == "Ahmedabad") { | 1132 | } else if (result.data.city == "Ahmedabad") { |
1133 | $rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015", | 1133 | $rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015", |
1134 | $rootScope.applicantResult.date= "September 11th, 2019", | 1134 | $rootScope.applicantResult.date= "September 11th, 2019", |
1135 | $rootScope.applicantResult.time= "3 PM" | 1135 | $rootScope.applicantResult.time= "3 PM" |
1136 | 1136 | ||
1137 | } else if (result.data.city == "Jaipur") { | 1137 | } else if (result.data.city == "Jaipur") { |
1138 | $rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur", | 1138 | $rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur", |
1139 | $rootScope.applicantResult.date= "September 24th, 2019", | 1139 | $rootScope.applicantResult.date= "September 24th, 2019", |
1140 | $rootScope.applicantResult.time= "3 PM" | 1140 | $rootScope.applicantResult.time= "3 PM" |
1141 | 1141 | ||
1142 | } else if (result.data.city == "Kolkata") { | 1142 | } else if (result.data.city == "Kolkata") { |
1143 | $rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)", | 1143 | $rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)", |
1144 | $rootScope.applicantResult.time= "3 PM", | 1144 | $rootScope.applicantResult.time= "3 PM", |
1145 | $rootScope.applicantResult.date= "September 17th, 2019" | 1145 | $rootScope.applicantResult.date= "September 17th, 2019" |
1146 | 1146 | ||
1147 | } else if (result.data.city == "Bengaluru") { | 1147 | } else if (result.data.city == "Bengaluru") { |
1148 | $rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076", | 1148 | $rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076", |
1149 | $rootScope.applicantResult.time= "3 PM", | 1149 | $rootScope.applicantResult.time= "3 PM", |
1150 | $rootScope.applicantResult.date= "September 7th, 2019" | 1150 | $rootScope.applicantResult.date= "September 7th, 2019" |
1151 | 1151 | ||
1152 | } else if (result.data.city == "Delhi") { | 1152 | } else if (result.data.city == "Delhi") { |
1153 | $rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016", | 1153 | $rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016", |
1154 | $rootScope.applicantResult.time= "12 PM", | 1154 | $rootScope.applicantResult.time= "12 PM", |
1155 | $rootScope.applicantResult.date= "October 16th, 2019" | 1155 | $rootScope.applicantResult.date= "October 16th, 2019" |
1156 | 1156 | ||
1157 | } else if (result.data.city == "Kanpur"){ | 1157 | } else if (result.data.city == "Kanpur"){ |
1158 | $rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016", | 1158 | $rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016", |
1159 | $rootScope.applicantResult.time= "3 PM", | 1159 | $rootScope.applicantResult.time= "3 PM", |
1160 | $rootScope.applicantResult.date= "September 28th, 2019" | 1160 | $rootScope.applicantResult.date= "September 28th, 2019" |
1161 | 1161 | ||
1162 | }else if (result.data.city == "Colombo") { | 1162 | }else if (result.data.city == "Colombo") { |
1163 | $rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka", | 1163 | $rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka", |
1164 | $rootScope.applicantResult.time= "3 PM", | 1164 | $rootScope.applicantResult.time= "3 PM", |
1165 | $rootScope.applicantResult.date= "October 5th, 2019" | 1165 | $rootScope.applicantResult.date= "October 5th, 2019" |
1166 | 1166 | ||
1167 | } else if (result.data.city == "Dhaka") { | 1167 | } else if (result.data.city == "Dhaka") { |
1168 | $rootScope.applicantResult.location= "The Business Center, The Inspiration Hall Level 2, Lift number-2, Celebration Point, Plot: 3 & 5 (Beside Shahabuddin Medical College) Road: 113/A, Gulshan-2, Dhaka-1212", | 1168 | $rootScope.applicantResult.location= "The Business Center, The Inspiration Hall Level 2, Lift number-2, Celebration Point, Plot: 3 & 5 (Beside Shahabuddin Medical College) Road: 113/A, Gulshan-2, Dhaka-1212", |
1169 | $rootScope.applicantResult.date= "September 21st, 2019", | 1169 | $rootScope.applicantResult.date= "September 21st, 2019", |
1170 | $rootScope.applicantResult.time= "3 PM" | 1170 | $rootScope.applicantResult.time= "3 PM" |
1171 | 1171 | ||
1172 | } else { | 1172 | } else { |
1173 | $rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445", | 1173 | $rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445", |
1174 | $rootScope.applicantResult.time= "3 PM", | 1174 | $rootScope.applicantResult.time= "3 PM", |
1175 | $rootScope.applicantResult.date= "October 12th, 2019" | 1175 | $rootScope.applicantResult.date= "October 12th, 2019" |
1176 | } | 1176 | } |
1177 | Analytics.trackEvent('success', 'click', 'Registration'); | 1177 | Analytics.trackEvent('success', 'click', 'Registration'); |
1178 | $location.path("/confirm") | 1178 | $location.path("/confirm") |
1179 | }) | 1179 | }) |
1180 | }, function myError(error) { | 1180 | }, function myError(error) { |
1181 | }); | 1181 | }); |
1182 | } | 1182 | } |
1183 | //} | 1183 | //} |
1184 | 1184 | ||
1185 | }, function myError(error) { | 1185 | }, function myError(error) { |
1186 | 1186 | ||
1187 | }); | 1187 | }); |
1188 | 1188 | ||
1189 | }) | 1189 | }) |
1190 | 1190 | ||
1191 | // }) | 1191 | // }) |
1192 | 1192 | ||
1193 | //} | 1193 | //} |
1194 | 1194 | ||
1195 | } | 1195 | } |
1196 | //} | 1196 | //} |
1197 | 1197 | ||
1198 | }); | 1198 | }); |
1199 | 1199 | ||
1200 | scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) { | 1200 | scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) { |
1201 | $scope.approvedMsg = false; | 1201 | $scope.approvedMsg = false; |
1202 | $scope.disApprovedMsg = false; | 1202 | $scope.disApprovedMsg = false; |
1203 | 1203 | ||
1204 | var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] | 1204 | var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] |
1205 | // if(myParam){ | 1205 | // if(myParam){ |
1206 | if(myParam == "approved"){ | 1206 | if(myParam == "approved"){ |
1207 | $scope.approvedMsg = true; | 1207 | $scope.approvedMsg = true; |
1208 | $scope.disApprovedMsg = false; | 1208 | $scope.disApprovedMsg = false; |
1209 | }else{ | 1209 | }else{ |
1210 | $scope.approvedMsg = false; | 1210 | $scope.approvedMsg = false; |
1211 | $scope.disApprovedMsg = true; | 1211 | $scope.disApprovedMsg = true; |
1212 | } | 1212 | } |
1213 | // }else{ | 1213 | // }else{ |
1214 | // $scope.disApprovedMsg = true; | 1214 | // $scope.disApprovedMsg = true; |
1215 | // } | 1215 | // } |
1216 | 1216 | ||
1217 | }); | 1217 | }); |
1218 | 1218 | ||
1219 | scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { | 1219 | scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { |
1220 | $scope.data = {}; | 1220 | $scope.data = {}; |
1221 | $scope.data.city = localStorage.getItem("city"); | 1221 | $scope.data.city = localStorage.getItem("city"); |
1222 | $scope.data.country = localStorage.getItem("country");; | 1222 | $scope.data.country = localStorage.getItem("country");; |
1223 | var data = { | 1223 | var data = { |
1224 | //"amount": $scope.payingAmnt, | 1224 | //"amount": $scope.payingAmnt, |
1225 | //"currency": "INR", | 1225 | //"currency": "INR", |
1226 | "status": "captured", | 1226 | "status": "captured", |
1227 | "paymentType": "Manual_Paytm" | 1227 | "paymentType": "Manual_Paytm" |
1228 | } | 1228 | } |
1229 | var handleFileSelect = function(evt) { | 1229 | var handleFileSelect = function(evt) { |
1230 | var files = evt.target.files; | 1230 | var files = evt.target.files; |
1231 | var file = files[0]; | 1231 | var file = files[0]; |
1232 | 1232 | ||
1233 | if (files && file) { | 1233 | if (files && file) { |
1234 | var reader = new FileReader(); | 1234 | var reader = new FileReader(); |
1235 | 1235 | ||
1236 | reader.onload = function(readerEvt) { | 1236 | reader.onload = function(readerEvt) { |
1237 | var binaryString = readerEvt.target.result; | 1237 | var binaryString = readerEvt.target.result; |
1238 | $scope.base64textString = btoa(binaryString); | 1238 | $scope.base64textString = btoa(binaryString); |
1239 | //console.log("base64textarea",$scope.base64textString) | 1239 | //console.log("base64textarea",$scope.base64textString) |
1240 | //$scope.data.uploadFile = file.name; | 1240 | //$scope.data.uploadFile = file.name; |
1241 | $scope.fileSelect = false; | 1241 | $scope.fileSelect = false; |
1242 | if($scope.data.uploadFile == null){ | 1242 | if($scope.data.uploadFile == null){ |
1243 | $scope.fileSelect = true; | 1243 | $scope.fileSelect = true; |
1244 | }else{ | 1244 | }else{ |
1245 | $scope.fileSelect = false; | 1245 | $scope.fileSelect = false; |
1246 | }; | 1246 | }; |
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | reader.readAsBinaryString(file); | 1249 | reader.readAsBinaryString(file); |
1250 | } | 1250 | } |
1251 | }; | 1251 | }; |
1252 | if (window.File && window.FileReader && window.FileList && window.Blob) { | 1252 | if (window.File && window.FileReader && window.FileList && window.Blob) { |
1253 | document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); | 1253 | document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | $scope.ngShowhide = false; | 1256 | $scope.ngShowhide = false; |
1257 | $scope.GetValue = function(){ | 1257 | $scope.GetValue = function(){ |
1258 | if($scope.data.sector == "Other"){ | 1258 | if($scope.data.sector == "Other"){ |
1259 | $scope.ngShowhide = true; | 1259 | $scope.ngShowhide = true; |
1260 | }else{ | 1260 | }else{ |
1261 | $scope.ngShowhide = false; | 1261 | $scope.ngShowhide = false; |
1262 | } | 1262 | } |
1263 | } | 1263 | } |
1264 | 1264 | ||
1265 | $scope.ngShow = false; | 1265 | $scope.ngShow = false; |
1266 | $scope.getValue = function(){ | 1266 | $scope.getValue = function(){ |
1267 | if($scope.data.hear == "Other"){ | 1267 | if($scope.data.hear == "Other"){ |
1268 | $scope.ngShow = true; | 1268 | $scope.ngShow = true; |
1269 | }else{ | 1269 | }else{ |
1270 | $scope.ngShow = false; | 1270 | $scope.ngShow = false; |
1271 | } | 1271 | } |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | $scope.register = function() { | 1274 | $scope.register = function() { |
1275 | Analytics.trackEvent('register', 'click', 'Registration'); | 1275 | Analytics.trackEvent('register', 'click', 'Registration'); |
1276 | $scope.loading = true; | 1276 | $scope.loading = true; |
1277 | $scope.data.uploadFile = $scope.base64textString; | 1277 | $scope.data.uploadFile = $scope.base64textString; |
1278 | $scope.infoForm = true; | 1278 | $scope.infoForm = true; |
1279 | //$scope.ticketAmnt = 1180; | 1279 | //$scope.ticketAmnt = 1180; |
1280 | $scope.detail = {}; | 1280 | $scope.detail = {}; |
1281 | $scope.data.phone = "+91"+$scope.data.number; | 1281 | $scope.data.phone = "+91"+$scope.data.number; |
1282 | 1282 | ||
1283 | var file =document.getElementById('filePicker').files[0]; | 1283 | var file =document.getElementById('filePicker').files[0]; |
1284 | var image = BASE_URL+'/containers/images/download/' | 1284 | var image = BASE_URL+'/containers/images/download/' |
1285 | var imagePath = file.name; | 1285 | var imagePath = file.name; |
1286 | $scope.data.uploadFile = image + imagePath; | 1286 | $scope.data.uploadFile = image + imagePath; |
1287 | var fd = new FormData() | 1287 | var fd = new FormData() |
1288 | fd.append('filePicker',file); | 1288 | fd.append('filePicker',file); |
1289 | var deferred = $q.defer(); | 1289 | var deferred = $q.defer(); |
1290 | $http({ | 1290 | $http({ |
1291 | method:'POST', | 1291 | method:'POST', |
1292 | url: BASE_URL+'/containers/images/upload', | 1292 | url: BASE_URL+'/containers/images/upload', |
1293 | data:fd, | 1293 | data:fd, |
1294 | transformRequest:angular.identity, | 1294 | transformRequest:angular.identity, |
1295 | headers:{'Content-Type':undefined} | 1295 | headers:{'Content-Type':undefined} |
1296 | }) | 1296 | }) |
1297 | .success(function(result){ | 1297 | .success(function(result){ |
1298 | deferred.resolve(result); | 1298 | deferred.resolve(result); |
1299 | $http({ | 1299 | $http({ |
1300 | method: 'POST', | 1300 | method: 'POST', |
1301 | url: BASE_URL+'/applicantIns', | 1301 | url: BASE_URL+'/applicantIns', |
1302 | data: $scope.data, | 1302 | data: $scope.data, |
1303 | headers: {} | 1303 | headers: {} |
1304 | }).then(function mySuccess(result) { | 1304 | }).then(function mySuccess(result) { |
1305 | $scope.detail = result; | 1305 | $scope.detail = result; |
1306 | data.applicantInId = result.data.id; | 1306 | data.applicantInId = result.data.id; |
1307 | $scope.userId = result.data.id; | 1307 | $scope.userId = result.data.id; |
1308 | // var amount = $scope.ticketAmnt * 100 | 1308 | // var amount = $scope.ticketAmnt * 100 |
1309 | // if($scope.tokencheck == true){ | 1309 | // if($scope.tokencheck == true){ |
1310 | // var amount = $scope.ticketAmnt | 1310 | // var amount = $scope.ticketAmnt |
1311 | // console.log("resultcity===",$scope.data.city) | 1311 | // console.log("resultcity===",$scope.data.city) |
1312 | // if($scope.discountpercentage == "100") { | 1312 | // if($scope.discountpercentage == "100") { |
1313 | // $scope.discountpercentage = "99.9"; | 1313 | // $scope.discountpercentage = "99.9"; |
1314 | // } | 1314 | // } |
1315 | // $scope.percDiscount = $scope.discountpercentage/100; | 1315 | // $scope.percDiscount = $scope.discountpercentage/100; |
1316 | // $scope.discountAmount = amount * $scope.percDiscount; | 1316 | // $scope.discountAmount = amount * $scope.percDiscount; |
1317 | // } | 1317 | // } |
1318 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 1318 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
1319 | // $scope.payingAmnt = taxAmount; | 1319 | // $scope.payingAmnt = taxAmount; |
1320 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() | 1320 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() |
1321 | // data.amount = $scope.payingAmnt; | 1321 | // data.amount = $scope.payingAmnt; |
1322 | if($scope.detail != null){ | 1322 | if($scope.detail != null){ |
1323 | $http({ | 1323 | $http({ |
1324 | method: 'POST', | 1324 | method: 'POST', |
1325 | url: BASE_URL+'/paymentsIns', | 1325 | url: BASE_URL+'/paymentsIns', |
1326 | data: data, | 1326 | data: data, |
1327 | headers: {} | 1327 | headers: {} |
1328 | }).then(function mySuccess(paymentResult) { | 1328 | }).then(function mySuccess(paymentResult) { |
1329 | $scope.loading = false; | 1329 | $scope.loading = false; |
1330 | $scope.paymentResult = paymentResult; | 1330 | $scope.paymentResult = paymentResult; |
1331 | $location.path("/paytm/confirm") | 1331 | $location.path("/paytm/confirm") |
1332 | }, function myError(error) { | 1332 | }, function myError(error) { |
1333 | }); | 1333 | }); |
1334 | } | 1334 | } |
1335 | 1335 | ||
1336 | }, function myError(error) { | 1336 | }, function myError(error) { |
1337 | 1337 | ||
1338 | }); | 1338 | }); |
1339 | 1339 | ||
1340 | }) | 1340 | }) |
1341 | 1341 | ||
1342 | } | 1342 | } |
1343 | 1343 | ||
1344 | }); | 1344 | }); |
1345 | 1345 | ||
1346 | scotchApp.controller('campusAmbassadorController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { | 1346 | scotchApp.controller('campusAmbassadorController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { |
1347 | $scope.data = {}; | 1347 | $scope.data = {}; |
1348 | var data = { | 1348 | var data = { |
1349 | "amount": $scope.ticketAmnt, | 1349 | "amount": $scope.ticketAmnt, |
1350 | "currency": "INR", | 1350 | "currency": "INR", |
1351 | "status": "pending" | 1351 | "status": "pending" |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | $scope.formRegister = function() { | 1354 | $scope.formRegister = function() { |
1355 | //Analytics.trackEvent('register', 'click', 'Registration'); | 1355 | //Analytics.trackEvent('register', 'click', 'Registration'); |
1356 | $scope.loading = true; | 1356 | $scope.loading = true; |
1357 | $scope.ticketAmnt = 500; | 1357 | $scope.ticketAmnt = 500; |
1358 | $scope.detail = {}; | 1358 | $scope.detail = {}; |
1359 | $scope.data.phone = "+91"+$scope.data.number; | 1359 | $scope.data.phone = "+91"+$scope.data.number; |
1360 | var randomNumber = ""+Math.random(); | 1360 | var randomNumber = ""+Math.random(); |
1361 | var nameSpliced = $scope.data.name.slice(0,3); | 1361 | var nameSpliced = $scope.data.name.slice(0,3); |
1362 | var numberSpliced = randomNumber.slice(2,4); | 1362 | var numberSpliced = randomNumber.slice(2,4); |
1363 | //var numberSpliced = "90"; | 1363 | //var numberSpliced = "90"; |
1364 | $scope.data.referalToken = nameSpliced+numberSpliced; | 1364 | $scope.data.referalToken = nameSpliced+numberSpliced; |
1365 | //$scope.data.referalToken = nameSpliced; | 1365 | //$scope.data.referalToken = nameSpliced; |
1366 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 1366 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
1367 | var ambassDorpayload = {"name":$scope.data.name,"email":$scope.data.email,"mobile":$scope.data.phone,"discount":10,"referalToken":$scope.data.referalToken} | 1367 | var ambassDorpayload = {"name":$scope.data.name,"email":$scope.data.email,"mobile":$scope.data.phone,"discount":10,"referalToken":$scope.data.referalToken} |
1368 | 1368 | ||
1369 | $http({ | 1369 | $http({ |
1370 | method: 'POST', | 1370 | method: 'POST', |
1371 | url: BASE_URL+'/campusAmbassadors', | 1371 | url: BASE_URL+'/campusAmbassadors', |
1372 | data: $scope.data, | 1372 | data: $scope.data, |
1373 | headers: {} | 1373 | headers: {} |
1374 | }).then(function mySuccess(result) { | 1374 | }).then(function mySuccess(result) { |
1375 | $scope.detail = result; | 1375 | $scope.detail = result; |
1376 | data.campusAmbassadorId = result.data.id; | 1376 | data.campusAmbassadorId = result.data.id; |
1377 | $scope.userId = result.data.id; | 1377 | $scope.userId = result.data.id; |
1378 | var amount = $scope.ticketAmnt * 100 | 1378 | var amount = $scope.ticketAmnt * 100 |
1379 | $scope.ambassCall(ambassDorpayload); | 1379 | $scope.ambassCall(ambassDorpayload); |
1380 | if($scope.detail != null){ | 1380 | if($scope.detail != null){ |
1381 | $http({ | 1381 | $http({ |
1382 | method: 'POST', | 1382 | method: 'POST', |
1383 | url: BASE_URL+'/ambassadorPayments', | 1383 | url: BASE_URL+'/ambassadorPayments', |
1384 | data: data, | 1384 | data: data, |
1385 | headers: {} | 1385 | headers: {} |
1386 | }).then(function mySuccess(paymentResult) { | 1386 | }).then(function mySuccess(paymentResult) { |
1387 | console.log(paymentResult) | 1387 | console.log(paymentResult) |
1388 | $scope.loading = false; | 1388 | $scope.loading = false; |
1389 | //$scope.ambassadorId = paymentResult.data.ambassadorId | 1389 | //$scope.ambassadorId = paymentResult.data.ambassadorId |
1390 | $scope.paymentResult = paymentResult; | 1390 | $scope.paymentResult = paymentResult; |
1391 | //$location.path("/paytm/confirm") | 1391 | //$location.path("/paytm/confirm") |
1392 | }, function myError(error) { | 1392 | }, function myError(error) { |
1393 | }); | 1393 | }); |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | var i = 0; | 1396 | var i = 0; |
1397 | $scope.payingAmntt = $scope.ticketAmnt * 100; | 1397 | $scope.payingAmntt = $scope.ticketAmnt * 100; |
1398 | data.amount = $scope.ticketAmnt; | 1398 | data.amount = $scope.ticketAmnt; |
1399 | var options = { | 1399 | var options = { |
1400 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", | 1400 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
1401 | "key": "rzp_live_mkmCb4FkstuWaS", | 1401 | "key": "rzp_live_mkmCb4FkstuWaS", |
1402 | "amount": $scope.payingAmntt, | 1402 | "amount": $scope.payingAmntt, |
1403 | 1403 | ||
1404 | "name": "Startup Jalsa", | 1404 | "name": "Startup Jalsa", |
1405 | "description":"amount", | 1405 | "description":"amount", |
1406 | "currency": "INR", | 1406 | "currency": "INR", |
1407 | "status": "done", | 1407 | "status": "done", |
1408 | 1408 | ||
1409 | "prefill": { | 1409 | "prefill": { |
1410 | "email": $scope.detail.email, | 1410 | "email": $scope.detail.email, |
1411 | "contact": $scope.detail.phone | 1411 | "contact": $scope.detail.phone |
1412 | }, | 1412 | }, |
1413 | 1413 | ||
1414 | "theme": { | 1414 | "theme": { |
1415 | "color": "#2196f3 ", | 1415 | "color": "#2196f3 ", |
1416 | "image_padding":"NO" | 1416 | "image_padding":"NO" |
1417 | }, | 1417 | }, |
1418 | "modal": { | 1418 | "modal": { |
1419 | "ondismiss": function(){ | 1419 | "ondismiss": function(){ |
1420 | } | 1420 | } |
1421 | }, | 1421 | }, |
1422 | "handler": function (response){ | 1422 | "handler": function (response){ |
1423 | createPayment(response); | 1423 | createPayment(response); |
1424 | } | 1424 | } |
1425 | }; | 1425 | }; |
1426 | var rzp1 = new Razorpay(options); | 1426 | var rzp1 = new Razorpay(options); |
1427 | rzp1.open(); | 1427 | rzp1.open(); |
1428 | $scope.paymentResponse = {}; | 1428 | $scope.paymentResponse = {}; |
1429 | function createPayment(response){ | 1429 | function createPayment(response){ |
1430 | console.log("response",response) | 1430 | console.log("response",response) |
1431 | console.log($scope.paymentResult) | 1431 | console.log($scope.paymentResult) |
1432 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 1432 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
1433 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 1433 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
1434 | $scope.paymentResponse.amount = data.amount; | 1434 | $scope.paymentResponse.amount = data.amount; |
1435 | $scope.paymentResponse.currency = "INR"; | 1435 | $scope.paymentResponse.currency = "INR"; |
1436 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 1436 | $scope.paymentResponse.status = $scope.paymentResult.data.status; |
1437 | $http({ | 1437 | $http({ |
1438 | method: 'PUT', | 1438 | method: 'PUT', |
1439 | url: BASE_URL+'/ambassadorPayments/'+$scope.paymentResult.data.id, | 1439 | url: BASE_URL+'/ambassadorPayments/'+$scope.paymentResult.data.id, |
1440 | data: $scope.paymentResponse, | 1440 | data: $scope.paymentResponse, |
1441 | headers: {} | 1441 | headers: {} |
1442 | }).then(function mySuccess(searchResult) { | 1442 | }).then(function mySuccess(searchResult) { |
1443 | console.log("searchResult",searchResult) | 1443 | console.log("searchResult",searchResult) |
1444 | $location.path("/confirmation") | 1444 | $location.path("/confirmation") |
1445 | //$scope.paymentResultt = searchResult.data; | 1445 | //$scope.paymentResultt = searchResult.data; |
1446 | // $http({ | 1446 | // $http({ |
1447 | // method: 'GET', | 1447 | // method: 'GET', |
1448 | // url: BASE_URL+'/campusAmbassadors/'+$rootScope.paymentResultt.campusAmbassadorId, | 1448 | // url: BASE_URL+'/campusAmbassadors/'+$rootScope.paymentResultt.campusAmbassadorId, |
1449 | // data: $scope.data, | 1449 | // data: $scope.data, |
1450 | // headers: {} | 1450 | // headers: {} |
1451 | // }).then(function mySuccess(result) { | 1451 | // }).then(function mySuccess(result) { |
1452 | // //console.log("result2323324434",result) | 1452 | // //console.log("result2323324434",result) |
1453 | // //Analytics.trackEvent('success', 'click', 'Registration'); | 1453 | // //Analytics.trackEvent('success', 'click', 'Registration'); |
1454 | // $location.path("/confirm") | 1454 | // $location.path("/confirm") |
1455 | // }) | 1455 | // }) |
1456 | }, function myError(error) { | 1456 | }, function myError(error) { |
1457 | }); | 1457 | }); |
1458 | } | 1458 | } |
1459 | //} | 1459 | //} |
1460 | 1460 | ||
1461 | }, function myError(error) { | 1461 | }, function myError(error) { |
1462 | 1462 | ||
1463 | }); | 1463 | }); |
1464 | 1464 | ||
1465 | $scope.ambassCall = function(data){ | 1465 | $scope.ambassCall = function(data){ |
1466 | $http({ | 1466 | $http({ |
1467 | method: 'POST', | 1467 | method: 'POST', |
1468 | url: BASE_URL+'/ambassadors', | 1468 | url: BASE_URL+'/ambassadors', |
1469 | data: data, | 1469 | data: data, |
1470 | headers: {} | 1470 | headers: {} |
1471 | }).then(function mySuccess(result) { | 1471 | }).then(function mySuccess(result) { |
1472 | console.log(result) | 1472 | console.log(result) |
1473 | }); | 1473 | }); |
1474 | } | 1474 | } |
1475 | 1475 | ||
1476 | //}) | 1476 | //}) |
1477 | 1477 | ||
1478 | } | 1478 | } |
1479 | 1479 | ||
1480 | }); | 1480 | }); |
1481 | 1481 | ||
1482 | 1482 | ||
1483 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) { | 1483 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) { |
1484 | $scope.data = {}; | 1484 | $scope.data = {}; |
1485 | $scope.check = false; | 1485 | $scope.check = false; |
1486 | $scope.numberCheck = false; | 1486 | $scope.numberCheck = false; |
1487 | 1487 | ||
1488 | $scope.submit = function() { | 1488 | $scope.submit = function() { |
1489 | var randomNumber = ""+Math.random(); | 1489 | var randomNumber = ""+Math.random(); |
1490 | var nameSpliced = $scope.data.name.slice(0,3); | 1490 | var nameSpliced = $scope.data.name.slice(0,3); |
1491 | var numberSpliced = randomNumber.slice(2,4); | 1491 | var numberSpliced = randomNumber.slice(2,4); |
1492 | //var numberSpliced = "90"; | 1492 | //var numberSpliced = "90"; |
1493 | $scope.data.referalToken = nameSpliced+numberSpliced; | 1493 | $scope.data.referalToken = nameSpliced+numberSpliced; |
1494 | //$scope.data.referalToken = nameSpliced; | 1494 | //$scope.data.referalToken = nameSpliced; |
1495 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 1495 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
1496 | //$scope.data.referalToken = $scope.data.referalToken.toString(); | 1496 | //$scope.data.referalToken = $scope.data.referalToken.toString(); |
1497 | $http({ | 1497 | $http({ |
1498 | method: 'POST', | 1498 | method: 'POST', |
1499 | url: BASE_URL + '/ambassadors', | 1499 | url: BASE_URL + '/ambassadors', |
1500 | data: $scope.data, | 1500 | data: $scope.data, |
1501 | headers: {} | 1501 | headers: {} |
1502 | }).then(function mySuccess(result) { | 1502 | }).then(function mySuccess(result) { |
1503 | $scope.detail = result; | 1503 | $scope.detail = result; |
1504 | $('#myModal').modal('show'); | 1504 | $('#myModal').modal('show'); |
1505 | $scope.data.name = ''; | 1505 | $scope.data.name = ''; |
1506 | $scope.data.email = ''; | 1506 | $scope.data.email = ''; |
1507 | $scope.data.mobile = ''; | 1507 | $scope.data.mobile = ''; |
1508 | //$scope.data.discount = ''; | 1508 | //$scope.data.discount = ''; |
1509 | 1509 | ||
1510 | }, function myError(error) { | 1510 | }, function myError(error) { |
1511 | console.log(error) | 1511 | console.log(error) |
1512 | console.log(error.data.error.message) | 1512 | console.log(error.data.error.message) |
1513 | }); | 1513 | }); |
1514 | } | 1514 | } |
1515 | }); | 1515 | }); |
1516 | 1516 | ||
1517 | 1517 | ||
1518 | 1518 | ||
1519 | 1519 | ||
1520 | 1520 |