Commit c2289f2522e3bd712e160e37793a02c87e562561

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

timer start

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