Commit cfa5c93f538165a82145db01386321ffdabe130a

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

update time

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