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