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