Commit 357b39122b142fe7fe94f62720fc75aa2425b8b9

Authored by Palak Handa
1 parent 21f0792621
Exists in master and in 1 other branch paytm

mainevent add

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