Commit 07e435d2246b462228f7a0d5ba182db314ed4ab1

Authored by Palak Handa
1 parent 357b39122b
Exists in master and in 1 other branch paytm

rajorkey

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