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