Commit 633deaba95ad79a5368972b9b73a8aaeee026a70

Authored by Palak Handa
1 parent 4a63ab0eba
Exists in master and in 1 other branch paytm

update date

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