Commit f37435b93263d31367408367217364445c5f568b
1 parent
f6d172552b
Exists in
master
and in
1 other branch
analytics apply
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) { | 5 | scotchApp.config(function($routeProvider) { |
6 | $routeProvider | 6 | $routeProvider |
7 | 7 | ||
8 | // route for the Home page | 8 | // route for the Home page |
9 | .when('/', { | 9 | .when('/', { |
10 | templateUrl: 'pages/Home.html', | 10 | templateUrl: 'pages/Home.html', |
11 | controller: 'mainController' | 11 | controller: 'mainController' |
12 | }) | 12 | }) |
13 | 13 | ||
14 | // route for the registration page | 14 | // route for the registration page |
15 | .when('/registration', { | 15 | .when('/registration', { |
16 | templateUrl: 'pages/registration.html', | 16 | templateUrl: 'pages/registration.html', |
17 | controller: 'mainController' | 17 | controller: 'mainController' |
18 | }) | 18 | }) |
19 | 19 | ||
20 | // route for the paymentVerify page | 20 | // route for the paymentVerify page |
21 | .when('/pendingPayment/:id', { | 21 | .when('/pendingPayment/:id', { |
22 | templateUrl: 'pages/verify.html', | 22 | templateUrl: 'pages/verify.html', |
23 | controller: 'verifyController' | 23 | controller: 'verifyController' |
24 | }) | 24 | }) |
25 | 25 | ||
26 | // route for the ambassador page | 26 | // route for the ambassador page |
27 | .when('/ambassador', { | 27 | .when('/ambassador', { |
28 | templateUrl: 'pages/ambassador.html', | 28 | templateUrl: 'pages/ambassador.html', |
29 | controller: 'ambassadorController' | 29 | controller: 'ambassadorController' |
30 | }) | 30 | }) |
31 | 31 | ||
32 | // route for the confirmation page | 32 | // route for the confirmation page |
33 | .when('/confirmation', { | 33 | .when('/confirmation', { |
34 | templateUrl: 'pages/confirmation.html', | 34 | templateUrl: 'pages/confirmation.html', |
35 | controller: 'mainController' | 35 | controller: 'mainController' |
36 | }) | 36 | }) |
37 | 37 | ||
38 | }); | 38 | }); |
39 | 39 | ||
40 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { | 40 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { |
41 | // Add configuration code as desired | 41 | // Add configuration code as desired |
42 | AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code | 42 | AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code |
43 | 43 | ||
44 | // Track all routes (default is true). | 44 | // Track all routes (default is true). |
45 | AnalyticsProvider.trackPages(true); | 45 | AnalyticsProvider.trackPages(true); |
46 | 46 | ||
47 | // Track all URL query params (default is false). | 47 | // Track all URL query params (default is false). |
48 | AnalyticsProvider.trackUrlParams(true); | 48 | AnalyticsProvider.trackUrlParams(true); |
49 | 49 | ||
50 | }]).run(['Analytics', function(Analytics) { }]); | 50 | }]).run(['Analytics', function(Analytics) { }]); |
51 | 51 | ||
52 | //scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/api") | 52 | scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/api") |
53 | scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/api") | 53 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/api") |
54 | 54 | ||
55 | // create the controller and inject Angular's $scope | 55 | // create the controller and inject Angular's $scope |
56 | scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { | 56 | scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { |
57 | $scope.data = { | 57 | $scope.data = { |
58 | show: true, | 58 | show: true, |
59 | hide: false | 59 | hide: false |
60 | }; | 60 | }; |
61 | 61 | ||
62 | var chennai = new Date("Nov 7, 2017 00:00:00").getTime(); | 62 | var chennai = new Date("Nov 7, 2017 00:00:00").getTime(); |
63 | // Update the count down every 1 second | 63 | // Update the count down every 1 second |
64 | var x = setInterval(function() { | 64 | var x = setInterval(function() { |
65 | // Get todays date and time | 65 | // Get todays date and time |
66 | var now = new Date().getTime(); | 66 | var now = new Date().getTime(); |
67 | // Find the distance between now an the count down date | 67 | // Find the distance between now an the count down date |
68 | var distance = chennai - now; | 68 | var distance = chennai - now; |
69 | // Time calculations for days, hours, minutes and seconds | 69 | // Time calculations for days, hours, minutes and seconds |
70 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 70 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
71 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 71 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
72 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 72 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
73 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 73 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
74 | $scope.timer = days + "d " + hours + "h " | 74 | $scope.timer = days + "d " + hours + "h " |
75 | + minutes + "m " + seconds + "s " | 75 | + minutes + "m " + seconds + "s " |
76 | // Output the result in an element with id="demo" | 76 | // Output the result in an element with id="demo" |
77 | document.getElementById("chennai").innerHTML = days + "d " + hours + "h " | 77 | document.getElementById("chennai").innerHTML = days + "d " + hours + "h " |
78 | + minutes + "m " + seconds + "s "; | 78 | + minutes + "m " + seconds + "s "; |
79 | // If the count down is over, write some text | 79 | // If the count down is over, write some text |
80 | if (distance < 0) { | 80 | if (distance < 0) { |
81 | clearInterval(x); | 81 | clearInterval(x); |
82 | document.getElementById("chennai").innerHTML = "EXPIRED"; | 82 | document.getElementById("chennai").innerHTML = "EXPIRED"; |
83 | } | 83 | } |
84 | }, 1000); | 84 | }, 1000); |
85 | 85 | ||
86 | var pune = new Date("Nov 9, 2017 00:00:00").getTime(); | 86 | var pune = new Date("Nov 9, 2017 00:00:00").getTime(); |
87 | // Update the count down every 1 second | 87 | // Update the count down every 1 second |
88 | var x = setInterval(function() { | 88 | var x = setInterval(function() { |
89 | // Get todays date and time | 89 | // Get todays date and time |
90 | var now = new Date().getTime(); | 90 | var now = new Date().getTime(); |
91 | // Find the distance between now an the count down date | 91 | // Find the distance between now an the count down date |
92 | var distance = pune - now; | 92 | var distance = pune - now; |
93 | // Time calculations for days, hours, minutes and seconds | 93 | // Time calculations for days, hours, minutes and seconds |
94 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 94 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
95 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 95 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
96 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 96 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
97 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 97 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
98 | $scope.timer = days + "d " + hours + "h " | 98 | $scope.timer = days + "d " + hours + "h " |
99 | + minutes + "m " + seconds + "s " | 99 | + minutes + "m " + seconds + "s " |
100 | // Output the result in an element with id="demo" | 100 | // Output the result in an element with id="demo" |
101 | document.getElementById("pune").innerHTML = days + "d " + hours + "h " | 101 | document.getElementById("pune").innerHTML = days + "d " + hours + "h " |
102 | + minutes + "m " + seconds + "s "; | 102 | + minutes + "m " + seconds + "s "; |
103 | // If the count down is over, write some text | 103 | // If the count down is over, write some text |
104 | if (distance < 0) { | 104 | if (distance < 0) { |
105 | clearInterval(x); | 105 | clearInterval(x); |
106 | document.getElementById("pune").innerHTML = "EXPIRED"; | 106 | document.getElementById("pune").innerHTML = "EXPIRED"; |
107 | } | 107 | } |
108 | }, 1000); | 108 | }, 1000); |
109 | 109 | ||
110 | var mumbai = new Date("Nov 11, 2017 00:00:00").getTime(); | 110 | var mumbai = new Date("Nov 11, 2017 00:00:00").getTime(); |
111 | // Update the count down every 1 second | 111 | // Update the count down every 1 second |
112 | var x = setInterval(function() { | 112 | var x = setInterval(function() { |
113 | // Get todays date and time | 113 | // Get todays date and time |
114 | var now = new Date().getTime(); | 114 | var now = new Date().getTime(); |
115 | // Find the distance between now an the count down date | 115 | // Find the distance between now an the count down date |
116 | var distance = mumbai - now; | 116 | var distance = mumbai - now; |
117 | // Time calculations for days, hours, minutes and seconds | 117 | // Time calculations for days, hours, minutes and seconds |
118 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 118 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
119 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 119 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
120 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 120 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
121 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 121 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
122 | $scope.timer = days + "d " + hours + "h " | 122 | $scope.timer = days + "d " + hours + "h " |
123 | + minutes + "m " + seconds + "s " | 123 | + minutes + "m " + seconds + "s " |
124 | // Output the result in an element with id="demo" | 124 | // Output the result in an element with id="demo" |
125 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " | 125 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " |
126 | + minutes + "m " + seconds + "s "; | 126 | + minutes + "m " + seconds + "s "; |
127 | // If the count down is over, write some text | 127 | // If the count down is over, write some text |
128 | if (distance < 0) { | 128 | if (distance < 0) { |
129 | clearInterval(x); | 129 | clearInterval(x); |
130 | document.getElementById("mumbai").innerHTML = "EXPIRED"; | 130 | document.getElementById("mumbai").innerHTML = "EXPIRED"; |
131 | } | 131 | } |
132 | }, 1000); | 132 | }, 1000); |
133 | 133 | ||
134 | var ahmedabad = new Date("Nov 13, 2017 00:00:00").getTime(); | 134 | var ahmedabad = new Date("Nov 13, 2017 00:00:00").getTime(); |
135 | // Update the count down every 1 second | 135 | // Update the count down every 1 second |
136 | var x = setInterval(function() { | 136 | var x = setInterval(function() { |
137 | // Get todays date and time | 137 | // Get todays date and time |
138 | var now = new Date().getTime(); | 138 | var now = new Date().getTime(); |
139 | // Find the distance between now an the count down date | 139 | // Find the distance between now an the count down date |
140 | var distance = ahmedabad - now; | 140 | var distance = ahmedabad - now; |
141 | // Time calculations for days, hours, minutes and seconds | 141 | // Time calculations for days, hours, minutes and seconds |
142 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 142 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
143 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 143 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
144 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 144 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
145 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 145 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
146 | $scope.timer = days + "d " + hours + "h " | 146 | $scope.timer = days + "d " + hours + "h " |
147 | + minutes + "m " + seconds + "s " | 147 | + minutes + "m " + seconds + "s " |
148 | // Output the result in an element with id="demo" | 148 | // Output the result in an element with id="demo" |
149 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " | 149 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " |
150 | + minutes + "m " + seconds + "s "; | 150 | + minutes + "m " + seconds + "s "; |
151 | // If the count down is over, write some text | 151 | // If the count down is over, write some text |
152 | if (distance < 0) { | 152 | if (distance < 0) { |
153 | clearInterval(x); | 153 | clearInterval(x); |
154 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; | 154 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; |
155 | } | 155 | } |
156 | }, 1000); | 156 | }, 1000); |
157 | 157 | ||
158 | var jaipur = new Date("Nov 15, 2017 00:00:00").getTime(); | 158 | var jaipur = new Date("Nov 15, 2017 00:00:00").getTime(); |
159 | // Update the count down every 1 second | 159 | // Update the count down every 1 second |
160 | var x = setInterval(function() { | 160 | var x = setInterval(function() { |
161 | // Get todays date and time | 161 | // Get todays date and time |
162 | var now = new Date().getTime(); | 162 | var now = new Date().getTime(); |
163 | // Find the distance between now an the count down date | 163 | // Find the distance between now an the count down date |
164 | var distance = jaipur - now; | 164 | var distance = jaipur - now; |
165 | // Time calculations for days, hours, minutes and seconds | 165 | // Time calculations for days, hours, minutes and seconds |
166 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 166 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
167 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 167 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
168 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 168 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
169 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 169 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
170 | $scope.timer = days + "d " + hours + "h " | 170 | $scope.timer = days + "d " + hours + "h " |
171 | + minutes + "m " + seconds + "s " | 171 | + minutes + "m " + seconds + "s " |
172 | // Output the result in an element with id="demo" | 172 | // Output the result in an element with id="demo" |
173 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " | 173 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " |
174 | + minutes + "m " + seconds + "s "; | 174 | + minutes + "m " + seconds + "s "; |
175 | // If the count down is over, write some text | 175 | // If the count down is over, write some text |
176 | if (distance < 0) { | 176 | if (distance < 0) { |
177 | clearInterval(x); | 177 | clearInterval(x); |
178 | document.getElementById("jaipur").innerHTML = "EXPIRED"; | 178 | document.getElementById("jaipur").innerHTML = "EXPIRED"; |
179 | } | 179 | } |
180 | }, 1000); | 180 | }, 1000); |
181 | 181 | ||
182 | var bangalore = new Date("Nov 21, 2017 00:00:00").getTime(); | 182 | var bangalore = new Date("Nov 21, 2017 00:00:00").getTime(); |
183 | // Update the count down every 1 second | 183 | // Update the count down every 1 second |
184 | var x = setInterval(function() { | 184 | var x = setInterval(function() { |
185 | // Get todays date and time | 185 | // Get todays date and time |
186 | var now = new Date().getTime(); | 186 | var now = new Date().getTime(); |
187 | // Find the distance between now an the count down date | 187 | // Find the distance between now an the count down date |
188 | var distance = bangalore - now; | 188 | var distance = bangalore - now; |
189 | // Time calculations for days, hours, minutes and seconds | 189 | // Time calculations for days, hours, minutes and seconds |
190 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 190 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
191 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 191 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
192 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 192 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
193 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 193 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
194 | $scope.timer = days + "d " + hours + "h " | 194 | $scope.timer = days + "d " + hours + "h " |
195 | + minutes + "m " + seconds + "s " | 195 | + minutes + "m " + seconds + "s " |
196 | // Output the result in an element with id="demo" | 196 | // Output the result in an element with id="demo" |
197 | document.getElementById("bangalore").innerHTML = days + "d " + hours + "h " | 197 | document.getElementById("bangalore").innerHTML = days + "d " + hours + "h " |
198 | + minutes + "m " + seconds + "s "; | 198 | + minutes + "m " + seconds + "s "; |
199 | // If the count down is over, write some text | 199 | // If the count down is over, write some text |
200 | if (distance < 0) { | 200 | if (distance < 0) { |
201 | clearInterval(x); | 201 | clearInterval(x); |
202 | document.getElementById("bangalore").innerHTML = "EXPIRED"; | 202 | document.getElementById("bangalore").innerHTML = "EXPIRED"; |
203 | } | 203 | } |
204 | }, 1000); | 204 | }, 1000); |
205 | 205 | ||
206 | var hyderabad = new Date("Nov 19, 2017 00:00:00").getTime(); | 206 | var hyderabad = new Date("Nov 19, 2017 00:00:00").getTime(); |
207 | // Update the count down every 1 second | 207 | // Update the count down every 1 second |
208 | var x = setInterval(function() { | 208 | var x = setInterval(function() { |
209 | // Get todays date and time | 209 | // Get todays date and time |
210 | var now = new Date().getTime(); | 210 | var now = new Date().getTime(); |
211 | // Find the distance between now an the count down date | 211 | // Find the distance between now an the count down date |
212 | var distance = hyderabad - now; | 212 | var distance = hyderabad - now; |
213 | // Time calculations for days, hours, minutes and seconds | 213 | // Time calculations for days, hours, minutes and seconds |
214 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 214 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
215 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 215 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
216 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 216 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
217 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 217 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
218 | $scope.timer = days + "d " + hours + "h " | 218 | $scope.timer = days + "d " + hours + "h " |
219 | + minutes + "m " + seconds + "s " | 219 | + minutes + "m " + seconds + "s " |
220 | // Output the result in an element with id="demo" | 220 | // Output the result in an element with id="demo" |
221 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " | 221 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " |
222 | + minutes + "m " + seconds + "s "; | 222 | + minutes + "m " + seconds + "s "; |
223 | // If the count down is over, write some text | 223 | // If the count down is over, write some text |
224 | if (distance < 0) { | 224 | if (distance < 0) { |
225 | clearInterval(x); | 225 | clearInterval(x); |
226 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; | 226 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; |
227 | } | 227 | } |
228 | }, 1000); | 228 | }, 1000); |
229 | 229 | ||
230 | var delhi = new Date("Nov 26, 2017 00:00:00").getTime(); | 230 | var delhi = new Date("Nov 26, 2017 00:00:00").getTime(); |
231 | // Update the count down every 1 second | 231 | // Update the count down every 1 second |
232 | var x = setInterval(function() { | 232 | var x = setInterval(function() { |
233 | // Get todays date and time | 233 | // Get todays date and time |
234 | var now = new Date().getTime(); | 234 | var now = new Date().getTime(); |
235 | // Find the distance between now an the count down date | 235 | // Find the distance between now an the count down date |
236 | var distance = delhi - now; | 236 | var distance = delhi - now; |
237 | // Time calculations for days, hours, minutes and seconds | 237 | // Time calculations for days, hours, minutes and seconds |
238 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 238 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
239 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 239 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
240 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 240 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
241 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 241 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
242 | $scope.timer = days + "d " + hours + "h " | 242 | $scope.timer = days + "d " + hours + "h " |
243 | + minutes + "m " + seconds + "s " | 243 | + minutes + "m " + seconds + "s " |
244 | // Output the result in an element with id="demo" | 244 | // Output the result in an element with id="demo" |
245 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " | 245 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " |
246 | + minutes + "m " + seconds + "s "; | 246 | + minutes + "m " + seconds + "s "; |
247 | // If the count down is over, write some text | 247 | // If the count down is over, write some text |
248 | if (distance < 0) { | 248 | if (distance < 0) { |
249 | clearInterval(x); | 249 | clearInterval(x); |
250 | document.getElementById("delhi").innerHTML = "EXPIRED"; | 250 | document.getElementById("delhi").innerHTML = "EXPIRED"; |
251 | } | 251 | } |
252 | }, 1000); | 252 | }, 1000); |
253 | 253 | ||
254 | var chandigarh = new Date("Nov 30, 2017 00:00:00").getTime(); | 254 | var chandigarh = new Date("Nov 30, 2017 00:00:00").getTime(); |
255 | // Update the count down every 1 second | 255 | // Update the count down every 1 second |
256 | var x = setInterval(function() { | 256 | var x = setInterval(function() { |
257 | // Get todays date and time | 257 | // Get todays date and time |
258 | var now = new Date().getTime(); | 258 | var now = new Date().getTime(); |
259 | // Find the distance between now an the count down date | 259 | // Find the distance between now an the count down date |
260 | var distance = chandigarh - now; | 260 | var distance = chandigarh - now; |
261 | // Time calculations for days, hours, minutes and seconds | 261 | // Time calculations for days, hours, minutes and seconds |
262 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 262 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
263 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 263 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
264 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 264 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
265 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 265 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
266 | $scope.timer = days + "d " + hours + "h " | 266 | $scope.timer = days + "d " + hours + "h " |
267 | + minutes + "m " + seconds + "s " | 267 | + minutes + "m " + seconds + "s " |
268 | // Output the result in an element with id="demo" | 268 | // Output the result in an element with id="demo" |
269 | document.getElementById("chandigarh").innerHTML = days + "d " + hours + "h " | 269 | document.getElementById("chandigarh").innerHTML = days + "d " + hours + "h " |
270 | + minutes + "m " + seconds + "s "; | 270 | + minutes + "m " + seconds + "s "; |
271 | // If the count down is over, write some text | 271 | // If the count down is over, write some text |
272 | if (distance < 0) { | 272 | if (distance < 0) { |
273 | clearInterval(x); | 273 | clearInterval(x); |
274 | document.getElementById("chandigarh").innerHTML = "EXPIRED"; | 274 | document.getElementById("chandigarh").innerHTML = "EXPIRED"; |
275 | } | 275 | } |
276 | }, 1000); | 276 | }, 1000); |
277 | 277 | ||
278 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 278 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
279 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 279 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
280 | // $scope.Textshow = "yes" | 280 | // $scope.Textshow = "yes" |
281 | $scope.max = 100; | 281 | $scope.max = 100; |
282 | $scope.formPage = false; | 282 | $scope.formPage = false; |
283 | $scope.current = 0; | 283 | $scope.current = 0; |
284 | $scope.payingAmnt = 0; | 284 | $scope.payingAmnt = 0; |
285 | if ($scope.data.stage == 'select') { | 285 | if ($scope.data.stage == 'select') { |
286 | 286 | ||
287 | } | 287 | } |
288 | 288 | ||
289 | //$scope.author = 'Swarn Singh'; | 289 | //$scope.author = 'Swarn Singh'; |
290 | $scope.data = {}; | 290 | $scope.data = {}; |
291 | $scope.data.stage = 'Idea'; | 291 | $scope.data.stage = 'Idea'; |
292 | $scope.discountAmount = 0; | 292 | $scope.discountAmount = 0; |
293 | $scope.check = false; | 293 | $scope.check = false; |
294 | $scope.numberCheck = false; | 294 | $scope.numberCheck = false; |
295 | $scope.paymentResult = {}; | 295 | $scope.paymentResult = {}; |
296 | var data = { | 296 | var data = { |
297 | "amount": $scope.payingAmnt, | 297 | "amount": $scope.payingAmnt, |
298 | "currency": "INR", | 298 | "currency": "INR", |
299 | "status": "pending" | 299 | "status": "pending" |
300 | } | 300 | } |
301 | 301 | ||
302 | /*open videos in modal*/ | 302 | /*open videos in modal*/ |
303 | // $scope.openyoutube16 = function(){ | 303 | // $scope.openyoutube16 = function(){ |
304 | // $('#videoModel').modal('show'); | 304 | // $('#videoModel').modal('show'); |
305 | // } | 305 | // } |
306 | 306 | ||
307 | // $scope.openyoutube17 = function(){ | 307 | // $scope.openyoutube17 = function(){ |
308 | // $('#videoModels').modal('show'); | 308 | // $('#videoModels').modal('show'); |
309 | // } | 309 | // } |
310 | 310 | ||
311 | // $scope.closeModal = function(){ | 311 | // $scope.closeModal = function(){ |
312 | // var url = $('#youtubePlayer').attr('src'); | 312 | // var url = $('#youtubePlayer').attr('src'); |
313 | // $('#youtubePlayer').attr('src', ''); | 313 | // $('#youtubePlayer').attr('src', ''); |
314 | // $('#youtubePlayer').attr('src', url); | 314 | // $('#youtubePlayer').attr('src', url); |
315 | // } | 315 | // } |
316 | 316 | ||
317 | 317 | ||
318 | // $scope.closed = function(){ | 318 | // $scope.closed = function(){ |
319 | // var url = $('#youtubePlayersss').attr('src'); | 319 | // var url = $('#youtubePlayersss').attr('src'); |
320 | // $('#youtubePlayersss').attr('src', ''); | 320 | // $('#youtubePlayersss').attr('src', ''); |
321 | // $('#youtubePlayersss').attr('src', url); | 321 | // $('#youtubePlayersss').attr('src', url); |
322 | // } | 322 | // } |
323 | /*open videos ends here*/ | 323 | /*open videos ends here*/ |
324 | $scope.apply = function() { | 324 | $scope.apply = function() { |
325 | Analytics.trackEvent('register', 'click', 'django.mp4'); | 325 | Analytics.trackEvent('register', 'click', 'django.mp4'); |
326 | $location.path("/registration") | 326 | $location.path("/registration") |
327 | } | 327 | } |
328 | $scope.data.citymeetup = ''; | 328 | $scope.data.citymeetup = ''; |
329 | $scope.register = function(value){ | 329 | $scope.register = function(value){ |
330 | $scope.data.citymeetup = value; | 330 | $scope.data.citymeetup = value; |
331 | $('.hiddenForm').slideDown(); | 331 | $('.hiddenForm').slideDown(); |
332 | $('html, body').animate({ | 332 | $('html, body').animate({ |
333 | scrollTop: $('.hiddenForm').offset().top | 333 | scrollTop: $('.hiddenForm').offset().top |
334 | }, 1000); | 334 | }, 1000); |
335 | console.log('gdggsg', value); | 335 | console.log('gdggsg', value); |
336 | } | 336 | } |
337 | 337 | ||
338 | $scope.removeError = function() { | 338 | $scope.removeError = function() { |
339 | $('#invalidEmail').css('display', 'none'); | 339 | $('#invalidEmail').css('display', 'none'); |
340 | $('#alreadyExist').css('display', 'none'); | 340 | $('#alreadyExist').css('display', 'none'); |
341 | }; | 341 | }; |
342 | 342 | ||
343 | $scope.emailcheck = function(val) { | 343 | $scope.emailcheck = function(val) { |
344 | console.log(val) | 344 | console.log(val) |
345 | $scope.space = /\s/g.test(val); | 345 | $scope.space = /\s/g.test(val); |
346 | console.log("space",$scope.space) | 346 | console.log("space",$scope.space) |
347 | if (val == undefined) { | 347 | if (val == undefined) { |
348 | $('#invalidEmail').css('display', 'block'); | 348 | $('#invalidEmail').css('display', 'block'); |
349 | } else { | 349 | } else { |
350 | $http({ | 350 | $http({ |
351 | method: 'GET', | 351 | method: 'GET', |
352 | url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | 352 | url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', |
353 | headers: {} | 353 | headers: {} |
354 | }).then(function mySuccess(searchResult) { | 354 | }).then(function mySuccess(searchResult) { |
355 | console.log("searchResult1===>", searchResult) | 355 | console.log("searchResult1===>", searchResult) |
356 | if (searchResult.data.length == 0) { | 356 | if (searchResult.data.length == 0) { |
357 | $scope.check = false; | 357 | $scope.check = false; |
358 | } else { | 358 | } else { |
359 | $scope.check = true; | 359 | $scope.check = true; |
360 | $('#alreadyExist').css('display', 'block'); | 360 | $('#alreadyExist').css('display', 'block'); |
361 | } | 361 | } |
362 | }, function myError(error) {}); | 362 | }, function myError(error) {}); |
363 | } | 363 | } |
364 | }; | 364 | }; |
365 | 365 | ||
366 | $scope.removeNoError = function() { | 366 | $scope.removeNoError = function() { |
367 | $('#noExist').css('display', 'none'); | 367 | $('#noExist').css('display', 'none'); |
368 | }; | 368 | }; |
369 | 369 | ||
370 | $scope.numbercheck = function(number) { | 370 | $scope.numbercheck = function(number) { |
371 | $http({ | 371 | $http({ |
372 | method: 'GET', | 372 | method: 'GET', |
373 | url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}', | 373 | url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}', |
374 | data: $scope.data, | 374 | data: $scope.data, |
375 | headers: {} | 375 | headers: {} |
376 | }).then(function mySuccess(searchResult) { | 376 | }).then(function mySuccess(searchResult) { |
377 | console.log("searchResult===>", searchResult) | 377 | console.log("searchResult===>", searchResult) |
378 | if (searchResult.data.length == 0) { | 378 | if (searchResult.data.length == 0) { |
379 | $scope.numberCheck = false; | 379 | $scope.numberCheck = false; |
380 | 380 | ||
381 | } else { | 381 | } else { |
382 | $scope.numberCheck = true; | 382 | $scope.numberCheck = true; |
383 | $('#noExist').css('display', 'block'); | 383 | $('#noExist').css('display', 'block'); |
384 | } | 384 | } |
385 | }, function myError(error) {}); | 385 | }, function myError(error) {}); |
386 | }; | 386 | }; |
387 | 387 | ||
388 | $rootScope.tokenCall = function(val) { | 388 | $rootScope.tokenCall = function(val) { |
389 | console.log('val-------->', val); | 389 | console.log('val-------->', val); |
390 | if (val == undefined) { | 390 | if (val == undefined) { |
391 | $('#invalidEmail').css('display', 'block'); | 391 | $('#invalidEmail').css('display', 'block'); |
392 | } else { | 392 | } else { |
393 | val = val.toUpperCase(); | 393 | val = val.toUpperCase(); |
394 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}') | 394 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}') |
395 | .then(function(searchResult) { | 395 | .then(function(searchResult) { |
396 | if (searchResult.data.length == 0) { | 396 | if (searchResult.data.length == 0) { |
397 | $scope.tokencheck = false; | 397 | $scope.tokencheck = false; |
398 | $scope.discountAmount = 0; | 398 | $scope.discountAmount = 0; |
399 | } else { | 399 | } else { |
400 | $scope.tokencheck = true; | 400 | $scope.tokencheck = true; |
401 | } | 401 | } |
402 | },function(err){ | 402 | },function(err){ |
403 | console.log(err) | 403 | console.log(err) |
404 | }); | 404 | }); |
405 | 405 | ||
406 | } | 406 | } |
407 | }; | 407 | }; |
408 | 408 | ||
409 | 409 | ||
410 | 410 | ||
411 | 411 | ||
412 | /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ | 412 | /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ |
413 | $(document).ready( | 413 | $(document).ready( |
414 | function() { | 414 | function() { |
415 | $('input:submit').attr('disabled', true); | 415 | $('input:submit').attr('disabled', true); |
416 | $('input:file').change( | 416 | $('input:file').change( |
417 | function() { | 417 | function() { |
418 | if ($("#picture").val()) { | 418 | if ($("#picture").val()) { |
419 | $('input:submit').removeAttr('disabled'); | 419 | $('input:submit').removeAttr('disabled'); |
420 | } else { | 420 | } else { |
421 | $('input:submit').attr('disabled', true); | 421 | $('input:submit').attr('disabled', true); |
422 | } | 422 | } |
423 | }); | 423 | }); |
424 | }); | 424 | }); |
425 | 425 | ||
426 | /*****THIS IS FOR STEP ONE FORM ******/ | 426 | /*****THIS IS FOR STEP ONE FORM ******/ |
427 | // $scope.next = function() { | 427 | // $scope.next = function() { |
428 | // $scope.data.status = null | 428 | // $scope.data.status = null |
429 | // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { | 429 | // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { |
430 | // var x = document.getElementById("snackbar") | 430 | // var x = document.getElementById("snackbar") |
431 | // x.className = "show"; | 431 | // x.className = "show"; |
432 | // setTimeout(function() { | 432 | // setTimeout(function() { |
433 | // x.className = x.className.replace("show", ""); | 433 | // x.className = x.className.replace("show", ""); |
434 | // }, 3000); | 434 | // }, 3000); |
435 | // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { | 435 | // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { |
436 | // $scope.infoForm = true; | 436 | // $scope.infoForm = true; |
437 | // console.log("sdasdasdsa"); | 437 | // console.log("sdasdasdsa"); |
438 | // $scope.data.stage = $scope.data.stage; | 438 | // $scope.data.stage = $scope.data.stage; |
439 | // $scope.detail = {}; | 439 | // $scope.detail = {}; |
440 | // $scope.data.phone = "+91" + $scope.data.number; | 440 | // $scope.data.phone = "+91" + $scope.data.number; |
441 | // $http({ | 441 | // $http({ |
442 | // method: 'POST', | 442 | // method: 'POST', |
443 | // url: BASE_URL + '/information', | 443 | // url: BASE_URL + '/information', |
444 | // data: $scope.data, | 444 | // data: $scope.data, |
445 | // headers: {} | 445 | // headers: {} |
446 | // }).then(function mySuccess(result) { | 446 | // }).then(function mySuccess(result) { |
447 | // Analytics.trackEvent('information', 'click', 'django.mp4'); | 447 | // Analytics.trackEvent('information', 'click', 'django.mp4'); |
448 | // console.log("result", result) | 448 | // console.log("result", result) |
449 | // $scope.detail = result; | 449 | // $scope.detail = result; |
450 | // data.applicantId = result.data.id; | 450 | // data.applicantId = result.data.id; |
451 | // $scope.userId = result.data.id; | 451 | // $scope.userId = result.data.id; |
452 | 452 | ||
453 | // }, function myError(error) {}); | 453 | // }, function myError(error) {}); |
454 | 454 | ||
455 | // } | 455 | // } |
456 | 456 | ||
457 | // } | 457 | // } |
458 | 458 | ||
459 | $scope.calculateAmount = function(){ | 459 | $scope.calculateAmount = function(){ |
460 | if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 460 | if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
461 | var x = document.getElementById("snackbar") | 461 | var x = document.getElementById("snackbar") |
462 | x.className = "show"; | 462 | x.className = "show"; |
463 | setTimeout(function() { | 463 | setTimeout(function() { |
464 | x.className = x.className.replace("show", ""); | 464 | x.className = x.className.replace("show", ""); |
465 | }, 3000); | 465 | }, 3000); |
466 | } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 466 | } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
467 | $scope.infoForm = true; | 467 | $scope.infoForm = true; |
468 | console.log("sdasdasdsa"); | 468 | console.log("sdasdasdsa"); |
469 | $scope.data.stage = $scope.data.stage; | 469 | $scope.data.stage = $scope.data.stage; |
470 | $scope.detail = {}; | 470 | $scope.detail = {}; |
471 | $scope.data.phone = "+91" + $scope.data.number; | 471 | $scope.data.phone = "+91" + $scope.data.number; |
472 | $http({ | 472 | $http({ |
473 | method: 'POST', | 473 | method: 'POST', |
474 | url: BASE_URL + '/applicants', | 474 | url: BASE_URL + '/applicants', |
475 | data: $scope.data, | 475 | data: $scope.data, |
476 | headers: {} | 476 | headers: {} |
477 | }).then(function mySuccess(result) { | 477 | }).then(function mySuccess(result) { |
478 | Analytics.trackEvent('applicants', 'click', 'django.mp4'); | 478 | Analytics.trackEvent('applicants', 'click', 'django.mp4'); |
479 | console.log("result", result) | 479 | console.log("result", result) |
480 | $scope.detail = result; | 480 | $scope.detail = result; |
481 | data.applicantId = result.data.id; | 481 | data.applicantId = result.data.id; |
482 | //$scope.userId = result.data.id; | 482 | //$scope.userId = result.data.id; |
483 | 483 | ||
484 | if ($scope.data.stage == "Idea") { | 484 | if ($scope.data.stage == "Idea") { |
485 | console.log("$scope.data", $scope.data) | 485 | console.log("$scope.data", $scope.data) |
486 | $scope.ticketAmnt = 500; | 486 | $scope.ticketAmnt = 500; |
487 | } | 487 | } |
488 | 488 | ||
489 | if ($scope.data.stage == "Product") { | 489 | if ($scope.data.stage == "Product") { |
490 | $scope.ticketAmnt = 1000; | 490 | $scope.ticketAmnt = 1000; |
491 | } | 491 | } |
492 | 492 | ||
493 | if ($scope.data.stage == "Growth") { | 493 | if ($scope.data.stage == "Growth") { |
494 | $scope.ticketAmnt = 1000; | 494 | $scope.ticketAmnt = 1000; |
495 | } | 495 | } |
496 | 496 | ||
497 | // if ($scope.data.stage == "Visitor") { | 497 | // if ($scope.data.stage == "Visitor") { |
498 | // $scope.ticketAmnt = 500; | 498 | // $scope.ticketAmnt = 500; |
499 | // } | 499 | // } |
500 | var amount = $scope.ticketAmnt * 100 | 500 | var amount = $scope.ticketAmnt * 100 |
501 | if($scope.tokencheck == true){ | 501 | if($scope.tokencheck == true){ |
502 | var amount = $scope.ticketAmnt | 502 | var amount = $scope.ticketAmnt |
503 | // $scope.discountAmount = (amount * 10)/100 | 503 | // $scope.discountAmount = (amount * 10)/100 |
504 | console.log("finalAmount====>",$scope.payingAmnt) | 504 | console.log("finalAmount====>",$scope.payingAmnt) |
505 | } | 505 | } |
506 | 506 | ||
507 | var taxAmount = $scope.ticketAmnt | 507 | var taxAmount = $scope.ticketAmnt |
508 | $scope.taxTotal = (taxAmount * 18)/100 | 508 | $scope.taxTotal = (taxAmount * 18)/100 |
509 | $scope.payingAmnt = taxAmount | 509 | $scope.payingAmnt = taxAmount |
510 | console.log("taxincludedamount----", $scope.payingAmnt) | 510 | console.log("taxincludedamount----", $scope.payingAmnt) |
511 | console.log("$scope.taxTotal----", $scope.taxTotal) | 511 | console.log("$scope.taxTotal----", $scope.taxTotal) |
512 | // } | 512 | // } |
513 | 513 | ||
514 | /*****THIS IS FOR STEP THREE FORM ******/ | 514 | /*****THIS IS FOR STEP THREE FORM ******/ |
515 | // $scope.create = function() { | 515 | // $scope.create = function() { |
516 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 516 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
517 | // var x = document.getElementById("snackbar") | 517 | // var x = document.getElementById("snackbar") |
518 | // x.className = "show"; | 518 | // x.className = "show"; |
519 | // setTimeout(function() { | 519 | // setTimeout(function() { |
520 | // x.className = x.className.replace("show", ""); | 520 | // x.className = x.className.replace("show", ""); |
521 | // }, 3000); | 521 | // }, 3000); |
522 | // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 522 | // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
523 | // $scope.infoForm = true; | 523 | // $scope.infoForm = true; |
524 | // console.log("sdasdasdsa"); | 524 | // console.log("sdasdasdsa"); |
525 | // $scope.data.stage = $scope.data.stage; | 525 | // $scope.data.stage = $scope.data.stage; |
526 | // $scope.detail = {}; | 526 | // $scope.detail = {}; |
527 | // $scope.data.phone = "+91" + $scope.data.number; | 527 | // $scope.data.phone = "+91" + $scope.data.number; |
528 | // $http({ | 528 | // $http({ |
529 | // method: 'POST', | 529 | // method: 'POST', |
530 | // url: BASE_URL + '/applicants', | 530 | // url: BASE_URL + '/applicants', |
531 | // data: $scope.data, | 531 | // data: $scope.data, |
532 | // headers: {} | 532 | // headers: {} |
533 | // }).then(function mySuccess(result) { | 533 | // }).then(function mySuccess(result) { |
534 | 534 | ||
535 | // console.log("=====result=====", result) | 535 | // console.log("=====result=====", result) |
536 | // $scope.detail = result; | 536 | // $scope.detail = result; |
537 | // data.applicantId = result.data.id; | 537 | // data.applicantId = result.data.id; |
538 | // $scope.userId = result.data.id; | 538 | // $scope.userId = result.data.id; |
539 | // console.log("=====data=====", data) | 539 | // console.log("=====data=====", data) |
540 | data.amount = $scope.payingAmnt + $scope.taxTotal; | 540 | data.amount = $scope.payingAmnt + $scope.taxTotal; |
541 | console.log("$scope.taxTotal",data.amount) | 541 | console.log("$scope.taxTotal",data.amount) |
542 | if ($scope.detail != null) { | 542 | if ($scope.detail != null) { |
543 | $http({ | 543 | $http({ |
544 | method: 'POST', | 544 | method: 'POST', |
545 | url: BASE_URL + '/payments', | 545 | url: BASE_URL + '/payments', |
546 | data: data, | 546 | data: data, |
547 | headers: {} | 547 | headers: {} |
548 | }).then(function mySuccess(paymentResult) { | 548 | }).then(function mySuccess(paymentResult) { |
549 | Analytics.trackEvent('payments', 'click', 'django.mp4'); | 549 | Analytics.trackEvent('payments', 'click', 'django.mp4'); |
550 | console.log("paymentResult",paymentResult) | 550 | console.log("paymentResult",paymentResult) |
551 | $scope.paymentResult = paymentResult; | 551 | $scope.paymentResult = paymentResult; |
552 | }, function myError(error) {}); | 552 | }, function myError(error) {}); |
553 | } | 553 | } |
554 | var i = 0; | 554 | var i = 0; |
555 | $scope.payingAmnt = ($scope.payingAmnt + $scope.taxTotal) * 100; | 555 | $scope.payingAmnt = ($scope.payingAmnt + $scope.taxTotal) * 100; |
556 | var options = { | 556 | var options = { |
557 | "key": "rzp_live_mhSE1uOBlXvFyJ", | 557 | "key": "rzp_live_mhSE1uOBlXvFyJ", |
558 | "amount": $scope.payingAmnt , | 558 | "amount": $scope.payingAmnt , |
559 | 559 | ||
560 | "name": "Startup Jalsa", | 560 | "name": "Startup Jalsa", |
561 | "description": "amount", | 561 | "description": "amount", |
562 | "currency": "INR", | 562 | "currency": "INR", |
563 | "status": "done", | 563 | "status": "done", |
564 | 564 | ||
565 | "theme": { | 565 | "theme": { |
566 | "color": "#2196f3 ", | 566 | "color": "#2196f3 ", |
567 | "image_padding": "NO" | 567 | "image_padding": "NO" |
568 | }, | 568 | }, |
569 | "modal": { | 569 | "modal": { |
570 | "ondismiss": function() {} | 570 | "ondismiss": function() {} |
571 | }, | 571 | }, |
572 | "handler": function(response) { | 572 | "handler": function(response) { |
573 | createPayment(response); | 573 | createPayment(response); |
574 | } | 574 | } |
575 | }; | 575 | }; |
576 | var rzp1 = new Razorpay(options); | 576 | var rzp1 = new Razorpay(options); |
577 | rzp1.open(); | 577 | rzp1.open(); |
578 | $scope.paymentResponse = {}; | 578 | $scope.paymentResponse = {}; |
579 | 579 | ||
580 | function createPayment(response) { | 580 | function createPayment(response) { |
581 | console.log("response====from===razorpay",response) | 581 | console.log("response====from===razorpay",response) |
582 | $route.reload(); | 582 | $route.reload(); |
583 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 583 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
584 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 584 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
585 | $scope.paymentResponse.amount = data.amount; | 585 | $scope.paymentResponse.amount = data.amount; |
586 | $scope.paymentResponse.currency = "INR"; | 586 | $scope.paymentResponse.currency = "INR"; |
587 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 587 | $scope.paymentResponse.status = $scope.paymentResult.data.status; |
588 | $http({ | 588 | $http({ |
589 | method: 'PUT', | 589 | method: 'PUT', |
590 | url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, | 590 | url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, |
591 | data: $scope.paymentResponse, | 591 | data: $scope.paymentResponse, |
592 | headers: {} | 592 | headers: {} |
593 | }).then(function mySuccess(searchResult) { | 593 | }).then(function mySuccess(searchResult) { |
594 | // if(paymentResult.data.status == "created"){ | 594 | // if(paymentResult.data.status == "created"){ |
595 | Analytics.trackEvent('payments', 'click', 'Thankyou'); | 595 | Analytics.trackEvent('payments', 'click', 'Thankyou'); |
596 | console.log("trackEvent", trackEvent) | 596 | console.log("trackEvent", trackEvent) |
597 | // } | 597 | // } |
598 | console.log("searchResult", searchResult) | 598 | console.log("searchResult", searchResult) |
599 | $location.path("/confirmation") | 599 | $location.path("/confirmation") |
600 | //$scope.showToastr() | 600 | //$scope.showToastr() |
601 | //toaster.success("Registration done successfully"); | 601 | //toaster.success("Registration done successfully"); |
602 | 602 | ||
603 | }, function myError(error) {}); | 603 | }, function myError(error) {}); |
604 | } | 604 | } |
605 | }, function myError(error) {}); | 605 | }, function myError(error) {}); |
606 | } | 606 | } |
607 | 607 | ||
608 | } | 608 | } |
609 | 609 | ||
610 | //}, function myError(error) {}); | 610 | //}, function myError(error) {}); |
611 | //} | 611 | //} |
612 | 612 | ||
613 | //} | 613 | //} |
614 | 614 | ||
615 | // $scope.showToastr = function() { | 615 | // $scope.showToastr = function() { |
616 | // console.log("called toast") | 616 | // console.log("called toast") |
617 | // var x = document.getElementById("snacsskbar") | 617 | // var x = document.getElementById("snacsskbar") |
618 | // x.className = "show"; | 618 | // x.className = "show"; |
619 | // setTimeout(function() { | 619 | // setTimeout(function() { |
620 | // x.className = x.className.replace("show", ""); | 620 | // x.className = x.className.replace("show", ""); |
621 | // }, 3000); | 621 | // }, 3000); |
622 | // } | 622 | // } |
623 | 623 | ||
624 | /*kk***This code for change data when click to chooses stages***/ | 624 | /*kk***This code for change data when click to chooses stages***/ |
625 | $scope.proto = true; | 625 | $scope.proto = true; |
626 | $scope.businessmodel = true; | 626 | $scope.businessmodel = true; |
627 | $scope.Idea = true; | 627 | $scope.Idea = true; |
628 | $scope.current = true; | 628 | $scope.current = true; |
629 | 629 | ||
630 | $scope.stage = function(stage) { | 630 | $scope.stage = function(stage) { |
631 | $scope.stagekeyPress(); | 631 | $scope.stagekeyPress(); |
632 | console.log("stage--2",stage) | 632 | console.log("stage--2",stage) |
633 | 633 | ||
634 | if (stage == 'Idea') { | 634 | if (stage == 'Idea') { |
635 | $scope.Productshow = "no"; | 635 | $scope.Productshow = "no"; |
636 | $scope.current = 10; | 636 | $scope.current = 10; |
637 | $scope.proto = true; | 637 | $scope.proto = true; |
638 | // $scope.visitType = true; | 638 | // $scope.visitType = true; |
639 | $scope.prototyp = false; | 639 | $scope.prototyp = false; |
640 | $scope.protyp = false; | 640 | $scope.protyp = false; |
641 | $scope.market = false; | 641 | $scope.market = false; |
642 | $scope.risks = false; | 642 | $scope.risks = false; |
643 | $scope.team = false; | 643 | $scope.team = false; |
644 | $scope.pitch = false; | 644 | $scope.pitch = false; |
645 | $scope.financials = false; | 645 | $scope.financials = false; |
646 | $scope.businessmodel = true; | 646 | $scope.businessmodel = true; |
647 | $scope.data.stage = stage; | 647 | $scope.data.stage = stage; |
648 | // for right content | 648 | // for right content |
649 | $scope.Idea = true; | 649 | $scope.Idea = true; |
650 | $scope.Product = false; | 650 | $scope.Product = false; |
651 | $scope.Growth = false; | 651 | $scope.Growth = false; |
652 | // $scope.Visitor = false; | 652 | // $scope.Visitor = false; |
653 | } else if (stage == 'Product') { | 653 | } else if (stage == 'Product') { |
654 | $scope.Productshow = "no"; | 654 | $scope.Productshow = "no"; |
655 | $scope.current = 10; | 655 | $scope.current = 10; |
656 | $scope.proto = true; | 656 | $scope.proto = true; |
657 | // $scope.visitType = true; | 657 | // $scope.visitType = true; |
658 | $scope.prototyp = true; | 658 | $scope.prototyp = true; |
659 | $scope.protyp = true; | 659 | $scope.protyp = true; |
660 | $scope.market = true; | 660 | $scope.market = true; |
661 | $scope.risks = true; | 661 | $scope.risks = true; |
662 | $scope.team = true; | 662 | $scope.team = true; |
663 | $scope.pitch = true; | 663 | $scope.pitch = true; |
664 | $scope.financials = true; | 664 | $scope.financials = true; |
665 | $scope.businessmodel = false; | 665 | $scope.businessmodel = false; |
666 | $scope.data.stage = stage; | 666 | $scope.data.stage = stage; |
667 | // for right content | 667 | // for right content |
668 | $scope.Idea = false; | 668 | $scope.Idea = false; |
669 | $scope.Product = true; | 669 | $scope.Product = true; |
670 | $scope.Growth = false; | 670 | $scope.Growth = false; |
671 | // $scope.Visitor = false; | 671 | // $scope.Visitor = false; |
672 | } else if (stage == 'Growth') { | 672 | } else if (stage == 'Growth') { |
673 | $scope.Productshow = "yes"; | 673 | $scope.Productshow = "yes"; |
674 | $scope.current = 10; | 674 | $scope.current = 10; |
675 | $scope.proto = false; | 675 | $scope.proto = false; |
676 | // $scope.visitType = true; | 676 | // $scope.visitType = true; |
677 | $scope.prototyp = true; | 677 | $scope.prototyp = true; |
678 | $scope.protyp = false; | 678 | $scope.protyp = false; |
679 | $scope.market = true; | 679 | $scope.market = true; |
680 | $scope.risks = true; | 680 | $scope.risks = true; |
681 | $scope.team = true; | 681 | $scope.team = true; |
682 | $scope.pitch = true; | 682 | $scope.pitch = true; |
683 | $scope.financials = true; | 683 | $scope.financials = true; |
684 | $scope.businessmodel = false; | 684 | $scope.businessmodel = false; |
685 | // for right content | 685 | // for right content |
686 | $scope.Idea = false; | 686 | $scope.Idea = false; |
687 | $scope.Product = false; | 687 | $scope.Product = false; |
688 | $scope.Growth = true; | 688 | $scope.Growth = true; |
689 | // $scope.Visitor = false; | 689 | // $scope.Visitor = false; |
690 | // } else if (stage == 'Visitor') { | 690 | // } else if (stage == 'Visitor') { |
691 | // $scope.Productshow = "no"; | 691 | // $scope.Productshow = "no"; |
692 | // $scope.current = 10; | 692 | // $scope.current = 10; |
693 | // $scope.proto = false; | 693 | // $scope.proto = false; |
694 | // $scope.visitType = false; | 694 | // $scope.visitType = false; |
695 | // $scope.prototyp = false; | 695 | // $scope.prototyp = false; |
696 | // $scope.protyp = false; | 696 | // $scope.protyp = false; |
697 | // $scope.market = false; | 697 | // $scope.market = false; |
698 | // $scope.risks = false; | 698 | // $scope.risks = false; |
699 | // $scope.team = false; | 699 | // $scope.team = false; |
700 | // $scope.pitch = false; | 700 | // $scope.pitch = false; |
701 | // $scope.financials = false; | 701 | // $scope.financials = false; |
702 | // $scope.businessmodel = false; | 702 | // $scope.businessmodel = false; |
703 | // $scope.data.stage = stage; | 703 | // $scope.data.stage = stage; |
704 | // // for right content | 704 | // // for right content |
705 | // $scope.Idea = false; | 705 | // $scope.Idea = false; |
706 | // $scope.Product = false; | 706 | // $scope.Product = false; |
707 | // $scope.Growth = false; | 707 | // $scope.Growth = false; |
708 | // $scope.Visitor = true; | 708 | // $scope.Visitor = true; |
709 | $scope.data.stage = stage; | 709 | $scope.data.stage = stage; |
710 | } | 710 | } |
711 | 711 | ||
712 | } | 712 | } |
713 | 713 | ||
714 | $scope.emailTest = function(s){ | 714 | $scope.emailTest = function(s){ |
715 | $scope.space = /\s/g.test(s.delegateTarget.value); | 715 | $scope.space = /\s/g.test(s.delegateTarget.value); |
716 | console.log("space",$scope.space) | 716 | console.log("space",$scope.space) |
717 | 717 | ||
718 | } | 718 | } |
719 | // $scope.enterbusiness = function(business) { | 719 | // $scope.enterbusiness = function(business) { |
720 | // console.log("business", business); | 720 | // console.log("business", business); |
721 | // if (name == undefined) { | 721 | // if (name == undefined) { |
722 | // $scope.current = false; | 722 | // $scope.current = false; |
723 | 723 | ||
724 | // } else if (name != undefined) { | 724 | // } else if (name != undefined) { |
725 | // $scope.current = true; | 725 | // $scope.current = true; |
726 | // } | 726 | // } |
727 | // } | 727 | // } |
728 | /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ | 728 | /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ |
729 | $scope.stagekeyPress = function() { | 729 | $scope.stagekeyPress = function() { |
730 | $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); | 730 | $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); |
731 | } | 731 | } |
732 | $scope.sectorkeyPress = function() { | 732 | $scope.sectorkeyPress = function() { |
733 | $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); | 733 | $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); |
734 | } | 734 | } |
735 | 735 | ||
736 | $scope.productLaunchkeyPress = function() { | 736 | $scope.productLaunchkeyPress = function() { |
737 | $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); | 737 | $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); |
738 | } | 738 | } |
739 | 739 | ||
740 | $scope.launchPeriodkeyPress = function() { | 740 | $scope.launchPeriodkeyPress = function() { |
741 | $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)'); | 741 | $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)'); |
742 | } | 742 | } |
743 | 743 | ||
744 | $scope.industrykeyPress = function() { | 744 | $scope.industrykeyPress = function() { |
745 | $scope.addOther = false; | 745 | $scope.addOther = false; |
746 | $scope.hideSelectBox = true; | 746 | $scope.hideSelectBox = true; |
747 | $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)'); | 747 | $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)'); |
748 | var e = document.getElementById("dataIndustry"); | 748 | var e = document.getElementById("dataIndustry"); |
749 | var dataIndustry = e.options[e.selectedIndex].value; | 749 | var dataIndustry = e.options[e.selectedIndex].value; |
750 | if(dataIndustry == "others") { | 750 | if(dataIndustry == "others") { |
751 | $scope.addOther = true; | 751 | $scope.addOther = true; |
752 | $scope.hideSelectBox = false; | 752 | $scope.hideSelectBox = false; |
753 | } | 753 | } |
754 | } | 754 | } |
755 | 755 | ||
756 | $scope.industryNamekeyPress = function(firstName) { | 756 | $scope.industryNamekeyPress = function(firstName) { |
757 | console.log("lastName==", firstName); | 757 | console.log("lastName==", firstName); |
758 | if (firstName == undefined) { | 758 | if (firstName == undefined) { |
759 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 759 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
760 | } else { | 760 | } else { |
761 | $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); | 761 | $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); |
762 | } | 762 | } |
763 | } | 763 | } |
764 | 764 | ||
765 | $scope.amountkeyPress = function() { | 765 | $scope.amountkeyPress = function() { |
766 | $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)'); | 766 | $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)'); |
767 | } | 767 | } |
768 | 768 | ||
769 | $scope.firstNamekeyPress = function(name) { | 769 | $scope.firstNamekeyPress = function(name) { |
770 | console.log("lastName==", name); | 770 | console.log("lastName==", name); |
771 | if (name == undefined) { | 771 | if (name == undefined) { |
772 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); | 772 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); |
773 | } else { | 773 | } else { |
774 | $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); | 774 | $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); |
775 | } | 775 | } |
776 | } | 776 | } |
777 | 777 | ||
778 | $scope.emailkeyPress = function(email) { | 778 | $scope.emailkeyPress = function(email) { |
779 | console.log("email", email); | 779 | console.log("email", email); |
780 | if (email == undefined) { | 780 | if (email == undefined) { |
781 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); | 781 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); |
782 | } else { | 782 | } else { |
783 | $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); | 783 | $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); |
784 | } | 784 | } |
785 | } | 785 | } |
786 | 786 | ||
787 | $scope.textCheck = function(){ | 787 | $scope.textCheck = function(){ |
788 | console.log("Val1:::", $scope.textCheck); | 788 | console.log("Val1:::", $scope.textCheck); |
789 | var e = document.getElementById("fundingDiv"); | 789 | var e = document.getElementById("fundingDiv"); |
790 | var funding = e.options[e.selectedIndex].value; | 790 | var funding = e.options[e.selectedIndex].value; |
791 | $scope.Textshow = "no"; | 791 | $scope.Textshow = "no"; |
792 | if(funding == "yes") { | 792 | if(funding == "yes") { |
793 | $scope.Textshow = "yes"; | 793 | $scope.Textshow = "yes"; |
794 | console.log("Val:::", $scope.Textshow); | 794 | console.log("Val:::", $scope.Textshow); |
795 | } | 795 | } |
796 | 796 | ||
797 | } | 797 | } |
798 | 798 | ||
799 | $scope.productCheck = function(){ | 799 | $scope.productCheck = function(){ |
800 | console.log("Val2:::", $scope.productCheck); | 800 | console.log("Val2:::", $scope.productCheck); |
801 | var e = document.getElementById("productDiv"); | 801 | var e = document.getElementById("productDiv"); |
802 | var product = e.options[e.selectedIndex].value; | 802 | var product = e.options[e.selectedIndex].value; |
803 | $scope.Productshow = "no"; | 803 | $scope.Productshow = "no"; |
804 | if(product == "yes") { | 804 | if(product == "yes") { |
805 | $scope.Productshow = "yes"; | 805 | $scope.Productshow = "yes"; |
806 | console.log("Val1:::", $scope.Productshow); | 806 | console.log("Val1:::", $scope.Productshow); |
807 | } | 807 | } |
808 | 808 | ||
809 | } | 809 | } |
810 | 810 | ||
811 | $scope.phonekeyPress = function(number) { | 811 | $scope.phonekeyPress = function(number) { |
812 | console.log("number", number); | 812 | console.log("number", number); |
813 | if (number == undefined || number == '') { | 813 | if (number == undefined || number == '') { |
814 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); | 814 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); |
815 | } else { | 815 | } else { |
816 | $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); | 816 | $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); |
817 | } | 817 | } |
818 | } | 818 | } |
819 | 819 | ||
820 | $scope.citykeyPress = function(city) { | 820 | $scope.citykeyPress = function(city) { |
821 | console.log("city", city); | 821 | console.log("city", city); |
822 | if (city == undefined) { | 822 | if (city == undefined) { |
823 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); | 823 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); |
824 | } else { | 824 | } else { |
825 | $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); | 825 | $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); |
826 | } | 826 | } |
827 | } | 827 | } |
828 | 828 | ||
829 | $scope.lastNamekeyPress = function(q) { | 829 | $scope.lastNamekeyPress = function(q) { |
830 | if (q == undefined) { | 830 | if (q == undefined) { |
831 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); | 831 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); |
832 | } else { | 832 | } else { |
833 | $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); | 833 | $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); |
834 | } | 834 | } |
835 | } | 835 | } |
836 | 836 | ||
837 | $scope.linkedInkeyPress = function(technology) { | 837 | $scope.linkedInkeyPress = function(technology) { |
838 | if (technology == undefined || technology == '') { | 838 | if (technology == undefined || technology == '') { |
839 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); | 839 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); |
840 | } else { | 840 | } else { |
841 | $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); | 841 | $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); |
842 | } | 842 | } |
843 | } | 843 | } |
844 | $scope.companykeyPress = function(problem) { | 844 | $scope.companykeyPress = function(problem) { |
845 | if (problem == undefined) { | 845 | if (problem == undefined) { |
846 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); | 846 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); |
847 | } else { | 847 | } else { |
848 | $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); | 848 | $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); |
849 | } | 849 | } |
850 | } | 850 | } |
851 | $scope.productNamekeyPress = function(solution) { | 851 | $scope.productNamekeyPress = function(solution) { |
852 | if (solution == undefined) { | 852 | if (solution == undefined) { |
853 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); | 853 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); |
854 | } else { | 854 | } else { |
855 | $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); | 855 | $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); |
856 | } | 856 | } |
857 | } | 857 | } |
858 | $scope.businesskeyPress = function(business) { | 858 | $scope.businesskeyPress = function(business) { |
859 | $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); | 859 | $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); |
860 | } | 860 | } |
861 | 861 | ||
862 | $scope.websitekeyPress = function(prototype) { | 862 | $scope.websitekeyPress = function(prototype) { |
863 | if (prototype == undefined || prototype == '') { | 863 | if (prototype == undefined || prototype == '') { |
864 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); | 864 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); |
865 | } else { | 865 | } else { |
866 | $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); | 866 | $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); |
867 | } | 867 | } |
868 | } | 868 | } |
869 | 869 | ||
870 | $scope.employeekeyPress = function(market) { | 870 | $scope.employeekeyPress = function(market) { |
871 | if (market == undefined || market == '') { | 871 | if (market == undefined || market == '') { |
872 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); | 872 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); |
873 | } else { | 873 | } else { |
874 | $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); | 874 | $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); |
875 | } | 875 | } |
876 | } | 876 | } |
877 | 877 | ||
878 | $scope.annualkeyPress = function(risk) { | 878 | $scope.annualkeyPress = function(risk) { |
879 | if (risk == undefined || risk == '') { | 879 | if (risk == undefined || risk == '') { |
880 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); | 880 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); |
881 | } else { | 881 | } else { |
882 | $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); | 882 | $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); |
883 | } | 883 | } |
884 | } | 884 | } |
885 | 885 | ||
886 | $scope.revenuekeyPress = function(team) { | 886 | $scope.revenuekeyPress = function(team) { |
887 | if (team == undefined || team == '') { | 887 | if (team == undefined || team == '') { |
888 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); | 888 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); |
889 | } else { | 889 | } else { |
890 | $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); | 890 | $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); |
891 | } | 891 | } |
892 | } | 892 | } |
893 | 893 | ||
894 | $scope.descriptionkeyPress = function(pitch) { | 894 | $scope.descriptionkeyPress = function(pitch) { |
895 | if (pitch == undefined) { | 895 | if (pitch == undefined) { |
896 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); | 896 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); |
897 | } else { | 897 | } else { |
898 | $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); | 898 | $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); |
899 | } | 899 | } |
900 | } | 900 | } |
901 | 901 | ||
902 | $scope.removeNooError = function() { | 902 | $scope.removeNooError = function() { |
903 | $('#invalidIdea').css('display', 'block'); | 903 | $('#invalidIdea').css('display', 'block'); |
904 | $('#noExist').css('display', 'none'); | 904 | $('#noExist').css('display', 'none'); |
905 | }; | 905 | }; |
906 | 906 | ||
907 | $scope.ideakeyPress = function(financial) { | 907 | $scope.ideakeyPress = function(financial) { |
908 | console.log("financial", financial); | 908 | console.log("financial", financial); |
909 | if (financial == undefined) { | 909 | if (financial == undefined) { |
910 | $('#invalidIdea').css('display', 'block'); | 910 | $('#invalidIdea').css('display', 'block'); |
911 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); | 911 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); |
912 | } else { | 912 | } else { |
913 | $('#invalidIdea').css('display', 'none'); | 913 | $('#invalidIdea').css('display', 'none'); |
914 | $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); | 914 | $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); |
915 | } | 915 | } |
916 | } | 916 | } |
917 | 917 | ||
918 | $scope.fundkeyPress = function(financial) { | 918 | $scope.fundkeyPress = function(financial) { |
919 | console.log("financial", financial); | 919 | console.log("financial", financial); |
920 | if (financial == undefined) { | 920 | if (financial == undefined) { |
921 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); | 921 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); |
922 | } else { | 922 | } else { |
923 | $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)'); | 923 | $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)'); |
924 | } | 924 | } |
925 | } | 925 | } |
926 | 926 | ||
927 | $scope.changeReferalIconColor = function(referalToken){ | 927 | $scope.changeReferalIconColor = function(referalToken){ |
928 | if (referalToken == undefined || referalToken == '') { | 928 | if (referalToken == undefined || referalToken == '') { |
929 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); | 929 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); |
930 | }else { | 930 | }else { |
931 | $('.referel-icon').css('background-color', 'rgb(66, 181, 73)'); | 931 | $('.referel-icon').css('background-color', 'rgb(66, 181, 73)'); |
932 | } | 932 | } |
933 | } | 933 | } |
934 | 934 | ||
935 | }); | 935 | }); |
936 | 936 | ||
937 | scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) { | 937 | scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) { |
938 | $scope.pendingPaymentId = $route.current.params.id | 938 | $scope.pendingPaymentId = $route.current.params.id |
939 | $http({ | 939 | $http({ |
940 | method: "GET", | 940 | method: "GET", |
941 | url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, | 941 | url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, |
942 | }).then(function mySuccess(response) { | 942 | }).then(function mySuccess(response) { |
943 | $scope.data = response.data; | 943 | $scope.data = response.data; |
944 | console.log("response-1", response); | 944 | console.log("response-1", response); |
945 | $scope.pendingPaymentId = $route.current.params.id; | 945 | $scope.pendingPaymentId = $route.current.params.id; |
946 | 946 | ||
947 | $http({ | 947 | $http({ |
948 | method: "GET", | 948 | method: "GET", |
949 | url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', | 949 | url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', |
950 | }).then(function mySuccess(response) { | 950 | }).then(function mySuccess(response) { |
951 | $scope.paymentRecord = response.data; | 951 | $scope.paymentRecord = response.data; |
952 | }, function myError(response) { | 952 | }, function myError(response) { |
953 | }); | 953 | }); |
954 | }, function myError(response) { | 954 | }, function myError(response) { |
955 | $scope.myWelcome = response.statusText; | 955 | $scope.myWelcome = response.statusText; |
956 | }); | 956 | }); |
957 | 957 | ||
958 | $scope.checkView = false; | 958 | $scope.checkView = false; |
959 | $scope.verifyView = false; | 959 | $scope.verifyView = false; |
960 | 960 | ||
961 | $scope.pendingPaymentId = ''; | 961 | $scope.pendingPaymentId = ''; |
962 | 962 | ||
963 | $scope.update = function() { | 963 | $scope.update = function() { |
964 | 964 | ||
965 | $http({ | 965 | $http({ |
966 | method: 'GET', | 966 | method: 'GET', |
967 | url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', | 967 | url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', |
968 | headers: {} | 968 | headers: {} |
969 | }).then(function mySuccess(searchResult) { | 969 | }).then(function mySuccess(searchResult) { |
970 | if (searchResult.data[0].status == "created") { | 970 | if (searchResult.data[0].status == "created") { |
971 | //if (searchResult.data[0].status == "cancelled") { | 971 | //if (searchResult.data[0].status == "cancelled") { |
972 | $scope.checkView = true; | 972 | $scope.checkView = true; |
973 | $scope.verifyView = false; | 973 | $scope.verifyView = false; |
974 | $scope.amount = searchResult.data[0].amount; | 974 | $scope.amount = searchResult.data[0].amount; |
975 | $scope.searchResult = searchResult.data[0]; | 975 | $scope.searchResult = searchResult.data[0]; |
976 | console.log('====searchResult===', searchResult); | 976 | console.log('====searchResult===', searchResult); |
977 | console.log("searchResult=====",searchResult.data[0].razorOrderId) | 977 | console.log("searchResult=====",searchResult.data[0].razorOrderId) |
978 | var i = 0; | 978 | var i = 0; |
979 | $scope.amount = $scope.amount * 100; | 979 | $scope.amount = $scope.amount * 100; |
980 | var options = { | 980 | var options = { |
981 | "key": "rzp_live_mhSE1uOBlXvFyJ", | 981 | "key": "rzp_live_mhSE1uOBlXvFyJ", |
982 | //"key" : "rzp_test_YwHsVFiDIQ2WUQ", | 982 | //"key" : "rzp_test_YwHsVFiDIQ2WUQ", |
983 | "amount": $scope.amount, | 983 | "amount": $scope.amount, |
984 | 984 | ||
985 | "name": "Startup Jalsa", | 985 | "name": "Startup Jalsa", |
986 | "description": "amount", | 986 | "description": "amount", |
987 | "currency": "INR", | 987 | "currency": "INR", |
988 | "status": "done", | 988 | "status": "done", |
989 | 989 | ||
990 | "theme": { | 990 | "theme": { |
991 | "color": "#2196f3 ", | 991 | "color": "#2196f3 ", |
992 | "image_padding": "NO" | 992 | "image_padding": "NO" |
993 | }, | 993 | }, |
994 | "modal": { | 994 | "modal": { |
995 | "ondismiss": function() {} | 995 | "ondismiss": function() {} |
996 | }, | 996 | }, |
997 | "handler": function(response) { | 997 | "handler": function(response) { |
998 | createPayment(response); | 998 | createPayment(response); |
999 | } | 999 | } |
1000 | }; | 1000 | }; |
1001 | var rzp1 = new Razorpay(options); | 1001 | var rzp1 = new Razorpay(options); |
1002 | rzp1.open(); | 1002 | rzp1.open(); |
1003 | $scope.paymentResponse = {}; | 1003 | $scope.paymentResponse = {}; |
1004 | function createPayment(response) { | 1004 | function createPayment(response) { |
1005 | $scope.amount = $scope.amount / 100; | 1005 | $scope.amount = $scope.amount / 100; |
1006 | console.log("response======retepaymen",response); | 1006 | console.log("response======retepaymen",response); |
1007 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 1007 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
1008 | $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; | 1008 | $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; |
1009 | $scope.paymentResponse.amount = $scope.amount; | 1009 | $scope.paymentResponse.amount = $scope.amount; |
1010 | $scope.paymentResponse.currency = $scope.searchResult.currency; | 1010 | $scope.paymentResponse.currency = $scope.searchResult.currency; |
1011 | $scope.paymentResponse.status = $scope.searchResult.status; | 1011 | $scope.paymentResponse.status = $scope.searchResult.status; |
1012 | $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; | 1012 | $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; |
1013 | console.log("$scope.paymentResponse", $scope.paymentResponse) | 1013 | console.log("$scope.paymentResponse", $scope.paymentResponse) |
1014 | $http({ | 1014 | $http({ |
1015 | method: 'PUT', | 1015 | method: 'PUT', |
1016 | url: BASE_URL + '/payments/' + $scope.searchResult.id, | 1016 | url: BASE_URL + '/payments/' + $scope.searchResult.id, |
1017 | data: $scope.paymentResponse, | 1017 | data: $scope.paymentResponse, |
1018 | headers: {} | 1018 | headers: {} |
1019 | }).then(function mySuccess(searchResult) { | 1019 | }).then(function mySuccess(searchResult) { |
1020 | // if(paymentResult.data.status == "created"){ | 1020 | // if(paymentResult.data.status == "created"){ |
1021 | Analytics.trackEvent('payments', 'click', 'Thankyou'); | 1021 | Analytics.trackEvent('payments', 'click', 'Thankyou'); |
1022 | // } | 1022 | // } |
1023 | console.log("finalsearchResult",searchResult) | 1023 | console.log("finalsearchResult",searchResult) |
1024 | $location.path("/confirmation") | 1024 | $location.path("/confirmation") |
1025 | }, function myError(error) { | 1025 | }, function myError(error) { |
1026 | 1026 | ||
1027 | }); | 1027 | }); |
1028 | } | 1028 | } |
1029 | } else { | 1029 | } else { |
1030 | 1030 | ||
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | }, function myError(error) {}); | 1033 | }, function myError(error) {}); |
1034 | } | 1034 | } |
1035 | }); | 1035 | }); |
1036 | 1036 | ||
1037 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { | 1037 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { |
1038 | $scope.data = {}; | 1038 | $scope.data = {}; |
1039 | $scope.check = false; | 1039 | $scope.check = false; |
1040 | $scope.numberCheck = false; | 1040 | $scope.numberCheck = false; |
1041 | 1041 | ||
1042 | /*open videos in modal*/ | 1042 | /*open videos in modal*/ |
1043 | $scope.openyoutube16 = function(){ | 1043 | $scope.openyoutube16 = function(){ |
1044 | $('#videoModel').modal('show'); | 1044 | $('#videoModel').modal('show'); |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | $scope.openyoutube17 = function(){ | 1047 | $scope.openyoutube17 = function(){ |
1048 | $('#videoModels').modal('show'); | 1048 | $('#videoModels').modal('show'); |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | $scope.closeModal = function(){ | 1051 | $scope.closeModal = function(){ |
1052 | var url = $('#youtubePlayer').attr('src'); | 1052 | var url = $('#youtubePlayer').attr('src'); |
1053 | $('#youtubePlayer').attr('src', ''); | 1053 | $('#youtubePlayer').attr('src', ''); |
1054 | $('#youtubePlayer').attr('src', url); | 1054 | $('#youtubePlayer').attr('src', url); |
1055 | } | 1055 | } |
1056 | /*open videos ends here*/ | 1056 | /*open videos ends here*/ |
1057 | 1057 | ||
1058 | $scope.removeError = function() { | 1058 | $scope.removeError = function() { |
1059 | console.log("doooo") | 1059 | console.log("doooo") |
1060 | $('#invalidEmail').css('display', 'none'); | 1060 | $('#invalidEmail').css('display', 'none'); |
1061 | $('#alreadyExist').css('display', 'none'); | 1061 | $('#alreadyExist').css('display', 'none'); |
1062 | }; | 1062 | }; |
1063 | 1063 | ||
1064 | $scope.emailcheck = function(val) { | 1064 | $scope.emailcheck = function(val) { |
1065 | consol.log("kdsbd") | 1065 | consol.log("kdsbd") |
1066 | $scope.space = /\s/g.test(val); | 1066 | $scope.space = /\s/g.test(val); |
1067 | console.log("space",$scope.space) | 1067 | console.log("space",$scope.space) |
1068 | if (val == undefined) { | 1068 | if (val == undefined) { |
1069 | $('#invalidEmail').css('display', 'block'); | 1069 | $('#invalidEmail').css('display', 'block'); |
1070 | } else { | 1070 | } else { |
1071 | $http({ | 1071 | $http({ |
1072 | method: 'GET', | 1072 | method: 'GET', |
1073 | url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | 1073 | url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', |
1074 | headers: {} | 1074 | headers: {} |
1075 | }).then(function mySuccess(searchResult) { | 1075 | }).then(function mySuccess(searchResult) { |
1076 | console.log("searchResult1===>", searchResult) | 1076 | console.log("searchResult1===>", searchResult) |
1077 | if (searchResult.data.length == 0) { | 1077 | if (searchResult.data.length == 0) { |
1078 | $scope.check = false; | 1078 | $scope.check = false; |
1079 | } else { | 1079 | } else { |
1080 | $scope.check = true; | 1080 | $scope.check = true; |
1081 | $('#alreadyExist').css('display', 'block'); | 1081 | $('#alreadyExist').css('display', 'block'); |
1082 | } | 1082 | } |
1083 | }, function myError(error) {}); | 1083 | }, function myError(error) {}); |
1084 | } | 1084 | } |
1085 | }; | 1085 | }; |
1086 | 1086 | ||
1087 | $scope.removeNoError = function() { | 1087 | $scope.removeNoError = function() { |
1088 | $('#invalidNumber').css('display', 'none'); | 1088 | $('#invalidNumber').css('display', 'none'); |
1089 | $('#noExist').css('display', 'none'); | 1089 | $('#noExist').css('display', 'none'); |
1090 | }; | 1090 | }; |
1091 | 1091 | ||
1092 | $scope.numbercheck = function(number) { | 1092 | $scope.numbercheck = function(number) { |
1093 | // if (val == undefined) { | 1093 | // if (val == undefined) { |
1094 | // $('#invalidNumber').css('display', 'block'); | 1094 | // $('#invalidNumber').css('display', 'block'); |
1095 | // } else { | 1095 | // } else { |
1096 | $http({ | 1096 | $http({ |
1097 | method: 'GET', | 1097 | method: 'GET', |
1098 | url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}', | 1098 | url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}', |
1099 | data: $scope.data, | 1099 | data: $scope.data, |
1100 | headers: {} | 1100 | headers: {} |
1101 | }).then(function mySuccess(searchResult) { | 1101 | }).then(function mySuccess(searchResult) { |
1102 | console.log("searchResult===>", searchResult) | 1102 | console.log("searchResult===>", searchResult) |
1103 | if (searchResult.data.length == 0) { | 1103 | if (searchResult.data.length == 0) { |
1104 | $scope.numberCheck = false; | 1104 | $scope.numberCheck = false; |
1105 | } else { | 1105 | } else { |
1106 | $scope.numberCheck = true; | 1106 | $scope.numberCheck = true; |
1107 | $('#noExist').css('display', 'block'); | 1107 | $('#noExist').css('display', 'block'); |
1108 | } | 1108 | } |
1109 | }, function myError(error) {}); | 1109 | }, function myError(error) {}); |
1110 | //} | 1110 | //} |
1111 | 1111 | ||
1112 | }; | 1112 | }; |
1113 | 1113 | ||
1114 | $scope.submit = function() { | 1114 | $scope.submit = function() { |
1115 | console.log($scope.data.name) | 1115 | console.log($scope.data.name) |
1116 | var randomNumber = ""+Math.random(); | 1116 | var randomNumber = ""+Math.random(); |
1117 | var nameSpliced = $scope.data.name.slice(0,3); | 1117 | var nameSpliced = $scope.data.name.slice(0,3); |
1118 | var numberSpliced = randomNumber.slice(2,5); | 1118 | var numberSpliced = randomNumber.slice(2,5); |
1119 | $scope.data.referalToken = nameSpliced+numberSpliced; | 1119 | $scope.data.referalToken = nameSpliced+numberSpliced; |
1120 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 1120 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
1121 | 1121 | ||
1122 | $http({ | 1122 | $http({ |
1123 | method: 'POST', | 1123 | method: 'POST', |
1124 | url: BASE_URL + '/ambassadors', | 1124 | url: BASE_URL + '/ambassadors', |
1125 | data: $scope.data, | 1125 | data: $scope.data, |
1126 | headers: {} | 1126 | headers: {} |
1127 | }).then(function mySuccess(result) { | 1127 | }).then(function mySuccess(result) { |
1128 | console.log("result", result) | 1128 | console.log("result", result) |
1129 | $scope.detail = result; | 1129 | $scope.detail = result; |
1130 | $('#myModal').modal('show'); | 1130 | $('#myModal').modal('show'); |
1131 | $scope.data.name = ''; | 1131 | $scope.data.name = ''; |
1132 | $scope.data.email = ''; | 1132 | $scope.data.email = ''; |
1133 | $scope.data.mobile = ''; | 1133 | $scope.data.mobile = ''; |
1134 | 1134 | ||
1135 | }, function myError(error) { | 1135 | }, function myError(error) { |
1136 | console.log(error) | 1136 | console.log(error) |
1137 | console.log(error.data.error.message) | 1137 | console.log(error.data.error.message) |
1138 | }); | 1138 | }); |
1139 | console.log($scope.data) | 1139 | console.log($scope.data) |
1140 | } | 1140 | } |
1141 | }); | 1141 | }); |
1142 | 1142 | ||
1143 | 1143 | ||
1144 | 1144 | ||
1145 | 1145 |