Commit 19074e2511781538a53f276c5d27ae3566e77e77

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

dshf

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