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