Commit f57ff334ec72bab404f387d1380fcd0906fc49b4
1 parent
bb56da0f04
Exists in
master
and in
1 other branch
update the code
Showing
1 changed file
with
11 additions
and
8 deletions
Show diff stats
script.js
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('/ambassador', { | 27 | .when('/ambassador', { |
28 | templateUrl: 'pages/ambassador.html', | 28 | templateUrl: 'pages/ambassador.html', |
29 | controller: 'ambassadorController' | 29 | controller: 'ambassadorController' |
30 | }) | 30 | }) |
31 | 31 | ||
32 | // route for the confirmation page | 32 | // route for the confirmation page |
33 | .when('/confirmation', { | 33 | .when('/confirmation', { |
34 | templateUrl: 'pages/confirmation.html', | 34 | templateUrl: 'pages/confirmation.html', |
35 | controller: 'mainController' | 35 | controller: 'mainController' |
36 | }) | 36 | }) |
37 | 37 | ||
38 | }); | 38 | }); |
39 | 39 | ||
40 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { | 40 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { |
41 | // Add configuration code as desired | 41 | // Add configuration code as desired |
42 | AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code | 42 | AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code |
43 | 43 | ||
44 | // Track all routes (default is true). | 44 | // Track all routes (default is true). |
45 | AnalyticsProvider.trackPages(true); | 45 | AnalyticsProvider.trackPages(true); |
46 | 46 | ||
47 | // Track all URL query params (default is false). | 47 | // Track all URL query params (default is false). |
48 | AnalyticsProvider.trackUrlParams(true); | 48 | AnalyticsProvider.trackUrlParams(true); |
49 | 49 | ||
50 | }]).run(['Analytics', function(Analytics) { }]); | 50 | }]).run(['Analytics', function(Analytics) { }]); |
51 | 51 | ||
52 | scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/api") | 52 | scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/api") |
53 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/api") | 53 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/api") |
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 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 62 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
63 | // $scope.Textshow = "yes" | 63 | // $scope.Textshow = "yes" |
64 | $scope.max = 100; | 64 | $scope.max = 100; |
65 | $scope.current = 0; | 65 | $scope.current = 0; |
66 | $scope.payingAmnt = 0; | 66 | $scope.payingAmnt = 0; |
67 | if ($scope.data.stage == 'select') { | 67 | if ($scope.data.stage == 'select') { |
68 | 68 | ||
69 | } | 69 | } |
70 | 70 | ||
71 | //$scope.author = 'Swarn Singh'; | 71 | //$scope.author = 'Swarn Singh'; |
72 | $scope.data = {}; | 72 | $scope.data = {}; |
73 | $scope.data.stage = 'Idea'; | 73 | $scope.data.stage = 'Idea'; |
74 | $scope.discountAmount = 0; | 74 | $scope.discountAmount = 0; |
75 | $scope.check = false; | 75 | $scope.check = false; |
76 | $scope.numberCheck = false; | 76 | $scope.numberCheck = false; |
77 | $scope.paymentResult = {}; | 77 | $scope.paymentResult = {}; |
78 | var data = { | 78 | var data = { |
79 | "amount": $scope.payingAmnt, | 79 | "amount": $scope.payingAmnt, |
80 | "currency": "INR", | 80 | "currency": "INR", |
81 | "status": "pending" | 81 | "status": "pending" |
82 | } | 82 | } |
83 | 83 | ||
84 | /*open videos in modal*/ | 84 | /*open videos in modal*/ |
85 | // $scope.openyoutube16 = function(){ | 85 | // $scope.openyoutube16 = function(){ |
86 | // $('#videoModel').modal('show'); | 86 | // $('#videoModel').modal('show'); |
87 | // } | 87 | // } |
88 | 88 | ||
89 | // $scope.openyoutube17 = function(){ | 89 | // $scope.openyoutube17 = function(){ |
90 | // $('#videoModels').modal('show'); | 90 | // $('#videoModels').modal('show'); |
91 | // } | 91 | // } |
92 | 92 | ||
93 | // $scope.closeModal = function(){ | 93 | // $scope.closeModal = function(){ |
94 | // var url = $('#youtubePlayer').attr('src'); | 94 | // var url = $('#youtubePlayer').attr('src'); |
95 | // $('#youtubePlayer').attr('src', ''); | 95 | // $('#youtubePlayer').attr('src', ''); |
96 | // $('#youtubePlayer').attr('src', url); | 96 | // $('#youtubePlayer').attr('src', url); |
97 | // } | 97 | // } |
98 | 98 | ||
99 | 99 | ||
100 | // $scope.closed = function(){ | 100 | // $scope.closed = function(){ |
101 | // var url = $('#youtubePlayersss').attr('src'); | 101 | // var url = $('#youtubePlayersss').attr('src'); |
102 | // $('#youtubePlayersss').attr('src', ''); | 102 | // $('#youtubePlayersss').attr('src', ''); |
103 | // $('#youtubePlayersss').attr('src', url); | 103 | // $('#youtubePlayersss').attr('src', url); |
104 | // } | 104 | // } |
105 | /*open videos ends here*/ | 105 | /*open videos ends here*/ |
106 | $scope.apply = function() { | 106 | $scope.apply = function() { |
107 | Analytics.trackEvent('register', 'click', 'django.mp4'); | 107 | Analytics.trackEvent('register', 'click', 'django.mp4'); |
108 | $location.path("/registration") | 108 | $location.path("/registration") |
109 | } | 109 | } |
110 | 110 | ||
111 | $scope.removeError = function() { | 111 | $scope.removeError = function() { |
112 | $('#invalidEmail').css('display', 'none'); | 112 | $('#invalidEmail').css('display', 'none'); |
113 | $('#alreadyExist').css('display', 'none'); | 113 | $('#alreadyExist').css('display', 'none'); |
114 | }; | 114 | }; |
115 | 115 | ||
116 | $scope.emailcheck = function(val) { | 116 | $scope.emailcheck = function(val) { |
117 | if (val == undefined) { | 117 | if (val == undefined) { |
118 | $('#invalidEmail').css('display', 'block'); | 118 | $('#invalidEmail').css('display', 'block'); |
119 | } else { | 119 | } else { |
120 | $http({ | 120 | $http({ |
121 | method: 'GET', | 121 | method: 'GET', |
122 | url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | 122 | url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', |
123 | headers: {} | 123 | headers: {} |
124 | }).then(function mySuccess(searchResult) { | 124 | }).then(function mySuccess(searchResult) { |
125 | console.log("searchResult1===>", searchResult) | 125 | console.log("searchResult1===>", searchResult) |
126 | if (searchResult.data.length == 0) { | 126 | if (searchResult.data.length == 0) { |
127 | $scope.check = false; | 127 | $scope.check = false; |
128 | } else { | 128 | } else { |
129 | $scope.check = true; | 129 | $scope.check = true; |
130 | $('#alreadyExist').css('display', 'block'); | 130 | $('#alreadyExist').css('display', 'block'); |
131 | } | 131 | } |
132 | }, function myError(error) {}); | 132 | }, function myError(error) {}); |
133 | } | 133 | } |
134 | }; | 134 | }; |
135 | 135 | ||
136 | $scope.removeNoError = function() { | 136 | $scope.removeNoError = function() { |
137 | $('#noExist').css('display', 'none'); | 137 | $('#noExist').css('display', 'none'); |
138 | }; | 138 | }; |
139 | 139 | ||
140 | $scope.numbercheck = function(number) { | 140 | $scope.numbercheck = function(number) { |
141 | $http({ | 141 | $http({ |
142 | method: 'GET', | 142 | method: 'GET', |
143 | url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}', | 143 | url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}', |
144 | data: $scope.data, | 144 | data: $scope.data, |
145 | headers: {} | 145 | headers: {} |
146 | }).then(function mySuccess(searchResult) { | 146 | }).then(function mySuccess(searchResult) { |
147 | console.log("searchResult===>", searchResult) | 147 | console.log("searchResult===>", searchResult) |
148 | if (searchResult.data.length == 0) { | 148 | if (searchResult.data.length == 0) { |
149 | $scope.numberCheck = false; | 149 | $scope.numberCheck = false; |
150 | 150 | ||
151 | } else { | 151 | } else { |
152 | $scope.numberCheck = true; | 152 | $scope.numberCheck = true; |
153 | $('#noExist').css('display', 'block'); | 153 | $('#noExist').css('display', 'block'); |
154 | } | 154 | } |
155 | }, function myError(error) {}); | 155 | }, function myError(error) {}); |
156 | }; | 156 | }; |
157 | 157 | ||
158 | // $scope.removeNooError = function() { | ||
159 | // $('#invalidIdea').css('display', 'block'); | ||
160 | // $('#noExist').css('display', 'none'); | ||
161 | // }; | ||
162 | // $scope.valCheck = function(value){ | ||
163 | // if (value!= undefined) { | ||
164 | // $('#invalidIdea').css('display', 'block'); | ||
165 | // } | ||
166 | // } | ||
167 | |||
158 | $rootScope.tokenCall = function(val) { | 168 | $rootScope.tokenCall = function(val) { |
159 | console.log('val-------->', val); | 169 | console.log('val-------->', val); |
160 | if (val == undefined) { | 170 | if (val == undefined) { |
161 | $('#invalidEmail').css('display', 'block'); | 171 | $('#invalidEmail').css('display', 'block'); |
162 | } else { | 172 | } else { |
163 | val = val.toUpperCase(); | 173 | val = val.toUpperCase(); |
164 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}') | 174 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}') |
165 | .then(function(searchResult) { | 175 | .then(function(searchResult) { |
166 | if (searchResult.data.length == 0) { | 176 | if (searchResult.data.length == 0) { |
167 | $scope.tokencheck = false; | 177 | $scope.tokencheck = false; |
168 | $scope.discountAmount = 0; | 178 | $scope.discountAmount = 0; |
169 | } else { | 179 | } else { |
170 | $scope.tokencheck = true; | 180 | $scope.tokencheck = true; |
171 | } | 181 | } |
172 | },function(err){ | 182 | },function(err){ |
173 | console.log(err) | 183 | console.log(err) |
174 | }); | 184 | }); |
175 | 185 | ||
176 | } | 186 | } |
177 | }; | 187 | }; |
178 | 188 | ||
179 | 189 | ||
180 | /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ | 190 | /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ |
181 | $(document).ready( | 191 | $(document).ready( |
182 | function() { | 192 | function() { |
183 | $('input:submit').attr('disabled', true); | 193 | $('input:submit').attr('disabled', true); |
184 | $('input:file').change( | 194 | $('input:file').change( |
185 | function() { | 195 | function() { |
186 | if ($("#picture").val()) { | 196 | if ($("#picture").val()) { |
187 | $('input:submit').removeAttr('disabled'); | 197 | $('input:submit').removeAttr('disabled'); |
188 | } else { | 198 | } else { |
189 | $('input:submit').attr('disabled', true); | 199 | $('input:submit').attr('disabled', true); |
190 | } | 200 | } |
191 | }); | 201 | }); |
192 | }); | 202 | }); |
193 | 203 | ||
194 | /*****THIS IS FOR STEP ONE FORM ******/ | 204 | /*****THIS IS FOR STEP ONE FORM ******/ |
195 | // $scope.next = function() { | 205 | // $scope.next = function() { |
196 | // $scope.data.status = null | 206 | // $scope.data.status = null |
197 | // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { | 207 | // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { |
198 | // var x = document.getElementById("snackbar") | 208 | // var x = document.getElementById("snackbar") |
199 | // x.className = "show"; | 209 | // x.className = "show"; |
200 | // setTimeout(function() { | 210 | // setTimeout(function() { |
201 | // x.className = x.className.replace("show", ""); | 211 | // x.className = x.className.replace("show", ""); |
202 | // }, 3000); | 212 | // }, 3000); |
203 | // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { | 213 | // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { |
204 | // $scope.infoForm = true; | 214 | // $scope.infoForm = true; |
205 | // console.log("sdasdasdsa"); | 215 | // console.log("sdasdasdsa"); |
206 | // $scope.data.stage = $scope.data.stage; | 216 | // $scope.data.stage = $scope.data.stage; |
207 | // $scope.detail = {}; | 217 | // $scope.detail = {}; |
208 | // $scope.data.phone = "+91" + $scope.data.number; | 218 | // $scope.data.phone = "+91" + $scope.data.number; |
209 | // $http({ | 219 | // $http({ |
210 | // method: 'POST', | 220 | // method: 'POST', |
211 | // url: BASE_URL + '/information', | 221 | // url: BASE_URL + '/information', |
212 | // data: $scope.data, | 222 | // data: $scope.data, |
213 | // headers: {} | 223 | // headers: {} |
214 | // }).then(function mySuccess(result) { | 224 | // }).then(function mySuccess(result) { |
215 | // Analytics.trackEvent('information', 'click', 'django.mp4'); | 225 | // Analytics.trackEvent('information', 'click', 'django.mp4'); |
216 | // console.log("result", result) | 226 | // console.log("result", result) |
217 | // $scope.detail = result; | 227 | // $scope.detail = result; |
218 | // data.applicantId = result.data.id; | 228 | // data.applicantId = result.data.id; |
219 | // $scope.userId = result.data.id; | 229 | // $scope.userId = result.data.id; |
220 | 230 | ||
221 | // }, function myError(error) {}); | 231 | // }, function myError(error) {}); |
222 | 232 | ||
223 | // } | 233 | // } |
224 | 234 | ||
225 | // } | 235 | // } |
226 | 236 | ||
227 | $scope.calculateAmount = function(){ | 237 | $scope.calculateAmount = function(){ |
228 | if ($scope.data.stage == undefined || $scope.data.firstName == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { | 238 | if ($scope.data.stage == undefined || $scope.data.firstName == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { |
229 | var x = document.getElementById("snackbar") | 239 | var x = document.getElementById("snackbar") |
230 | x.className = "show"; | 240 | x.className = "show"; |
231 | setTimeout(function() { | 241 | setTimeout(function() { |
232 | x.className = x.className.replace("show", ""); | 242 | x.className = x.className.replace("show", ""); |
233 | }, 3000); | 243 | }, 3000); |
234 | } else if ($scope.data.stage != undefined && $scope.data.firstName != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { | 244 | } else if ($scope.data.stage != undefined && $scope.data.firstName != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { |
235 | $scope.infoForm = true; | 245 | $scope.infoForm = true; |
236 | console.log("sdasdasdsa"); | 246 | console.log("sdasdasdsa"); |
237 | $scope.data.stage = $scope.data.stage; | 247 | $scope.data.stage = $scope.data.stage; |
238 | $scope.detail = {}; | 248 | $scope.detail = {}; |
239 | $scope.data.phone = "+91" + $scope.data.number; | 249 | $scope.data.phone = "+91" + $scope.data.number; |
240 | $http({ | 250 | $http({ |
241 | method: 'POST', | 251 | method: 'POST', |
242 | url: BASE_URL + '/applicants', | 252 | url: BASE_URL + '/applicants', |
243 | data: $scope.data, | 253 | data: $scope.data, |
244 | headers: {} | 254 | headers: {} |
245 | }).then(function mySuccess(result) { | 255 | }).then(function mySuccess(result) { |
246 | Analytics.trackEvent('applicants', 'click', 'django.mp4'); | 256 | Analytics.trackEvent('applicants', 'click', 'django.mp4'); |
247 | console.log("result", result) | 257 | console.log("result", result) |
248 | $scope.detail = result; | 258 | $scope.detail = result; |
249 | data.applicantId = result.data.id; | 259 | data.applicantId = result.data.id; |
250 | //$scope.userId = result.data.id; | 260 | //$scope.userId = result.data.id; |
251 | 261 | ||
252 | if ($scope.data.stage == "Idea") { | 262 | if ($scope.data.stage == "Idea") { |
253 | console.log("$scope.data", $scope.data) | 263 | console.log("$scope.data", $scope.data) |
254 | $scope.ticketAmnt = 500; | 264 | $scope.ticketAmnt = 500; |
255 | } | 265 | } |
256 | 266 | ||
257 | if ($scope.data.stage == "Product") { | 267 | if ($scope.data.stage == "Product") { |
258 | $scope.ticketAmnt = 1000; | 268 | $scope.ticketAmnt = 1000; |
259 | } | 269 | } |
260 | 270 | ||
261 | if ($scope.data.stage == "Growth") { | 271 | if ($scope.data.stage == "Growth") { |
262 | $scope.ticketAmnt = 1000; | 272 | $scope.ticketAmnt = 1000; |
263 | } | 273 | } |
264 | var amount = $scope.ticketAmnt * 100 | 274 | var amount = $scope.ticketAmnt * 100 |
265 | if($scope.tokencheck == true){ | 275 | if($scope.tokencheck == true){ |
266 | var amount = $scope.ticketAmnt | 276 | var amount = $scope.ticketAmnt |
267 | // $scope.discountAmount = (amount * 10)/100 | 277 | // $scope.discountAmount = (amount * 10)/100 |
268 | console.log("finalAmount====>",$scope.payingAmnt) | 278 | console.log("finalAmount====>",$scope.payingAmnt) |
269 | } | 279 | } |
270 | 280 | ||
271 | var taxAmount = $scope.ticketAmnt | 281 | var taxAmount = $scope.ticketAmnt |
272 | // $scope.taxTotal = (taxAmount * 18)/100 | 282 | // $scope.taxTotal = (taxAmount * 18)/100 |
273 | $scope.payingAmnt = taxAmount | 283 | $scope.payingAmnt = taxAmount |
274 | console.log("taxincludedamount----", $scope.payingAmnt) | 284 | console.log("taxincludedamount----", $scope.payingAmnt) |
275 | // } | 285 | // } |
276 | 286 | ||
277 | /*****THIS IS FOR STEP THREE FORM ******/ | 287 | /*****THIS IS FOR STEP THREE FORM ******/ |
278 | // $scope.create = function() { | 288 | // $scope.create = function() { |
279 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 289 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
280 | // var x = document.getElementById("snackbar") | 290 | // var x = document.getElementById("snackbar") |
281 | // x.className = "show"; | 291 | // x.className = "show"; |
282 | // setTimeout(function() { | 292 | // setTimeout(function() { |
283 | // x.className = x.className.replace("show", ""); | 293 | // x.className = x.className.replace("show", ""); |
284 | // }, 3000); | 294 | // }, 3000); |
285 | // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 295 | // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
286 | // $scope.infoForm = true; | 296 | // $scope.infoForm = true; |
287 | // console.log("sdasdasdsa"); | 297 | // console.log("sdasdasdsa"); |
288 | // $scope.data.stage = $scope.data.stage; | 298 | // $scope.data.stage = $scope.data.stage; |
289 | // $scope.detail = {}; | 299 | // $scope.detail = {}; |
290 | // $scope.data.phone = "+91" + $scope.data.number; | 300 | // $scope.data.phone = "+91" + $scope.data.number; |
291 | // $http({ | 301 | // $http({ |
292 | // method: 'POST', | 302 | // method: 'POST', |
293 | // url: BASE_URL + '/applicants', | 303 | // url: BASE_URL + '/applicants', |
294 | // data: $scope.data, | 304 | // data: $scope.data, |
295 | // headers: {} | 305 | // headers: {} |
296 | // }).then(function mySuccess(result) { | 306 | // }).then(function mySuccess(result) { |
297 | 307 | ||
298 | // console.log("=====result=====", result) | 308 | // console.log("=====result=====", result) |
299 | // $scope.detail = result; | 309 | // $scope.detail = result; |
300 | // data.applicantId = result.data.id; | 310 | // data.applicantId = result.data.id; |
301 | // $scope.userId = result.data.id; | 311 | // $scope.userId = result.data.id; |
302 | // console.log("=====data=====", data) | 312 | // console.log("=====data=====", data) |
303 | data.amount = $scope.payingAmnt; | 313 | data.amount = $scope.payingAmnt; |
304 | if ($scope.detail != null) { | 314 | if ($scope.detail != null) { |
305 | $http({ | 315 | $http({ |
306 | method: 'POST', | 316 | method: 'POST', |
307 | url: BASE_URL + '/payments', | 317 | url: BASE_URL + '/payments', |
308 | data: data, | 318 | data: data, |
309 | headers: {} | 319 | headers: {} |
310 | }).then(function mySuccess(paymentResult) { | 320 | }).then(function mySuccess(paymentResult) { |
311 | Analytics.trackEvent('payments', 'click', 'django.mp4'); | 321 | Analytics.trackEvent('payments', 'click', 'django.mp4'); |
312 | console.log("paymentResult",paymentResult) | 322 | console.log("paymentResult",paymentResult) |
313 | $scope.paymentResult = paymentResult; | 323 | $scope.paymentResult = paymentResult; |
314 | }, function myError(error) {}); | 324 | }, function myError(error) {}); |
315 | } | 325 | } |
316 | var i = 0; | 326 | var i = 0; |
317 | $scope.payingAmnt = $scope.payingAmnt * 100; | 327 | $scope.payingAmnt = $scope.payingAmnt * 100; |
318 | var options = { | 328 | var options = { |
319 | "key": "rzp_test_YwHsVFiDIQ2WUQ", | 329 | "key": "rzp_live_mhSE1uOBlXvFyJ", |
320 | "amount": $scope.payingAmnt, | 330 | "amount": $scope.payingAmnt, |
321 | 331 | ||
322 | "name": "Startup Jalsa", | 332 | "name": "Startup Jalsa", |
323 | "description": "amount", | 333 | "description": "amount", |
324 | "currency": "INR", | 334 | "currency": "INR", |
325 | "status": "done", | 335 | "status": "done", |
326 | 336 | ||
327 | "theme": { | 337 | "theme": { |
328 | "color": "#2196f3 ", | 338 | "color": "#2196f3 ", |
329 | "image_padding": "NO" | 339 | "image_padding": "NO" |
330 | }, | 340 | }, |
331 | "modal": { | 341 | "modal": { |
332 | "ondismiss": function() {} | 342 | "ondismiss": function() {} |
333 | }, | 343 | }, |
334 | "handler": function(response) { | 344 | "handler": function(response) { |
335 | createPayment(response); | 345 | createPayment(response); |
336 | } | 346 | } |
337 | }; | 347 | }; |
338 | var rzp1 = new Razorpay(options); | 348 | var rzp1 = new Razorpay(options); |
339 | rzp1.open(); | 349 | rzp1.open(); |
340 | $scope.paymentResponse = {}; | 350 | $scope.paymentResponse = {}; |
341 | 351 | ||
342 | function createPayment(response) { | 352 | function createPayment(response) { |
343 | Analytics.trackEvent('payments', 'click', 'django.mp4'); | 353 | Analytics.trackEvent('payments', 'click', 'django.mp4'); |
344 | console.log("response====from===razorpay",response) | 354 | console.log("response====from===razorpay",response) |
345 | $route.reload(); | 355 | $route.reload(); |
346 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 356 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
347 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 357 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
348 | $scope.paymentResponse.amount = data.amount; | 358 | $scope.paymentResponse.amount = data.amount; |
349 | $scope.paymentResponse.currency = "INR"; | 359 | $scope.paymentResponse.currency = "INR"; |
350 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 360 | $scope.paymentResponse.status = $scope.paymentResult.data.status; |
351 | $http({ | 361 | $http({ |
352 | method: 'PUT', | 362 | method: 'PUT', |
353 | url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, | 363 | url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, |
354 | data: $scope.paymentResponse, | 364 | data: $scope.paymentResponse, |
355 | headers: {} | 365 | headers: {} |
356 | }).then(function mySuccess(searchResult) { | 366 | }).then(function mySuccess(searchResult) { |
357 | Analytics.trackEvent('payments', 'click', 'django.mp4'); | 367 | Analytics.trackEvent('payments', 'click', 'django.mp4'); |
358 | console.log("searchResult", searchResult) | 368 | console.log("searchResult", searchResult) |
359 | $location.path("/confirmation") | 369 | $location.path("/confirmation") |
360 | //$scope.showToastr() | 370 | //$scope.showToastr() |
361 | //toaster.success("Registration done successfully"); | 371 | //toaster.success("Registration done successfully"); |
362 | 372 | ||
363 | }, function myError(error) {}); | 373 | }, function myError(error) {}); |
364 | } | 374 | } |
365 | }, function myError(error) {}); | 375 | }, function myError(error) {}); |
366 | } | 376 | } |
367 | 377 | ||
368 | } | 378 | } |
369 | 379 | ||
370 | //}, function myError(error) {}); | 380 | //}, function myError(error) {}); |
371 | //} | 381 | //} |
372 | 382 | ||
373 | //} | 383 | //} |
374 | 384 | ||
375 | // $scope.showToastr = function() { | 385 | // $scope.showToastr = function() { |
376 | // console.log("called toast") | 386 | // console.log("called toast") |
377 | // var x = document.getElementById("snacsskbar") | 387 | // var x = document.getElementById("snacsskbar") |
378 | // x.className = "show"; | 388 | // x.className = "show"; |
379 | // setTimeout(function() { | 389 | // setTimeout(function() { |
380 | // x.className = x.className.replace("show", ""); | 390 | // x.className = x.className.replace("show", ""); |
381 | // }, 3000); | 391 | // }, 3000); |
382 | // } | 392 | // } |
383 | 393 | ||
384 | /*kk***This code for change data when click to chooses stages***/ | 394 | /*kk***This code for change data when click to chooses stages***/ |
385 | $scope.proto = true; | 395 | $scope.proto = true; |
386 | $scope.businessmodel = true; | 396 | $scope.businessmodel = true; |
387 | $scope.Idea = true; | 397 | $scope.Idea = true; |
388 | $scope.current = true; | 398 | $scope.current = true; |
389 | 399 | ||
390 | $scope.stage = function(stage) { | 400 | $scope.stage = function(stage) { |
391 | $scope.stagekeyPress(); | 401 | $scope.stagekeyPress(); |
392 | console.log("stage--2",stage) | 402 | console.log("stage--2",stage) |
393 | if (stage == 'Idea') { | 403 | if (stage == 'Idea') { |
394 | $scope.current = 10; | 404 | $scope.current = 10; |
395 | $scope.proto = true; | 405 | $scope.proto = true; |
396 | $scope.prototyp = false; | 406 | $scope.prototyp = false; |
397 | $scope.market = false; | 407 | $scope.market = false; |
398 | $scope.risks = false; | 408 | $scope.risks = false; |
399 | $scope.team = false; | 409 | $scope.team = false; |
400 | $scope.pitch = false; | 410 | $scope.pitch = false; |
401 | $scope.financials = false; | 411 | $scope.financials = false; |
402 | $scope.businessmodel = true; | 412 | $scope.businessmodel = true; |
403 | $scope.data.stage = stage; | 413 | $scope.data.stage = stage; |
404 | // for right content | 414 | // for right content |
405 | $scope.Idea = true; | 415 | $scope.Idea = true; |
406 | $scope.Product = false; | 416 | $scope.Product = false; |
407 | $scope.Growth = false; | 417 | $scope.Growth = false; |
408 | } else if (stage == 'Product') { | 418 | } else if (stage == 'Product') { |
409 | $scope.current = 10; | 419 | $scope.current = 10; |
410 | $scope.proto = true; | 420 | $scope.proto = true; |
411 | $scope.prototyp = true; | 421 | $scope.prototyp = true; |
412 | $scope.market = true; | 422 | $scope.market = true; |
413 | $scope.risks = true; | 423 | $scope.risks = true; |
414 | $scope.team = true; | 424 | $scope.team = true; |
415 | $scope.pitch = true; | 425 | $scope.pitch = true; |
416 | $scope.financials = true; | 426 | $scope.financials = true; |
417 | $scope.businessmodel = false; | 427 | $scope.businessmodel = false; |
418 | $scope.data.stage = stage; | 428 | $scope.data.stage = stage; |
419 | // for right content | 429 | // for right content |
420 | $scope.Idea = false; | 430 | $scope.Idea = false; |
421 | $scope.Product = true; | 431 | $scope.Product = true; |
422 | $scope.Growth = false; | 432 | $scope.Growth = false; |
423 | } else if (stage == 'Growth') { | 433 | } else if (stage == 'Growth') { |
424 | $scope.current = 10; | 434 | $scope.current = 10; |
425 | $scope.proto = false; | 435 | $scope.proto = false; |
426 | $scope.prototyp = true; | 436 | $scope.prototyp = true; |
427 | $scope.market = true; | 437 | $scope.market = true; |
428 | $scope.risks = true; | 438 | $scope.risks = true; |
429 | $scope.team = true; | 439 | $scope.team = true; |
430 | $scope.pitch = true; | 440 | $scope.pitch = true; |
431 | $scope.financials = true; | 441 | $scope.financials = true; |
432 | $scope.businessmodel = false; | 442 | $scope.businessmodel = false; |
433 | // for right content | 443 | // for right content |
434 | $scope.Idea = false; | 444 | $scope.Idea = false; |
435 | $scope.Product = false; | 445 | $scope.Product = false; |
436 | $scope.Growth = true; | 446 | $scope.Growth = true; |
437 | $scope.data.stage = stage; | 447 | $scope.data.stage = stage; |
438 | } | 448 | } |
439 | } | 449 | } |
440 | // $scope.enterbusiness = function(business) { | 450 | // $scope.enterbusiness = function(business) { |
441 | // console.log("business", business); | 451 | // console.log("business", business); |
442 | // if (name == undefined) { | 452 | // if (name == undefined) { |
443 | // $scope.current = false; | 453 | // $scope.current = false; |
444 | 454 | ||
445 | // } else if (name != undefined) { | 455 | // } else if (name != undefined) { |
446 | // $scope.current = true; | 456 | // $scope.current = true; |
447 | // } | 457 | // } |
448 | // } | 458 | // } |
449 | /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ | 459 | /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ |
450 | $scope.stagekeyPress = function() { | 460 | $scope.stagekeyPress = function() { |
451 | $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); | 461 | $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); |
452 | } | 462 | } |
453 | $scope.sectorkeyPress = function() { | 463 | $scope.sectorkeyPress = function() { |
454 | $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); | 464 | $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); |
455 | } | 465 | } |
456 | 466 | ||
457 | $scope.productLaunchkeyPress = function() { | 467 | $scope.productLaunchkeyPress = function() { |
458 | $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); | 468 | $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); |
459 | } | 469 | } |
460 | 470 | ||
461 | $scope.launchPeriodkeyPress = function() { | 471 | $scope.launchPeriodkeyPress = function() { |
462 | $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)'); | 472 | $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)'); |
463 | } | 473 | } |
464 | 474 | ||
465 | $scope.industrykeyPress = function() { | 475 | $scope.industrykeyPress = function() { |
466 | $scope.addOther = false; | 476 | $scope.addOther = false; |
467 | $scope.hideSelectBox = true; | 477 | $scope.hideSelectBox = true; |
468 | $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)'); | 478 | $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)'); |
469 | var e = document.getElementById("dataIndustry"); | 479 | var e = document.getElementById("dataIndustry"); |
470 | var dataIndustry = e.options[e.selectedIndex].value; | 480 | var dataIndustry = e.options[e.selectedIndex].value; |
471 | if(dataIndustry == "others") { | 481 | if(dataIndustry == "others") { |
472 | $scope.addOther = true; | 482 | $scope.addOther = true; |
473 | $scope.hideSelectBox = false; | 483 | $scope.hideSelectBox = false; |
474 | } | 484 | } |
475 | } | 485 | } |
476 | 486 | ||
477 | $scope.industryNamekeyPress = function(firstName) { | 487 | $scope.industryNamekeyPress = function(firstName) { |
478 | console.log("lastName==", firstName); | 488 | console.log("lastName==", firstName); |
479 | if (firstName == undefined) { | 489 | if (firstName == undefined) { |
480 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 490 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
481 | } else { | 491 | } else { |
482 | $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); | 492 | $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); |
483 | } | 493 | } |
484 | } | 494 | } |
485 | 495 | ||
486 | $scope.amountkeyPress = function() { | 496 | $scope.amountkeyPress = function() { |
487 | $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)'); | 497 | $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)'); |
488 | } | 498 | } |
489 | 499 | ||
490 | $scope.firstNamekeyPress = function(firstName) { | 500 | $scope.firstNamekeyPress = function(firstName) { |
491 | console.log("lastName==", firstName); | 501 | console.log("lastName==", firstName); |
492 | if (firstName == undefined) { | 502 | if (firstName == undefined) { |
493 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); | 503 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); |
494 | } else { | 504 | } else { |
495 | $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); | 505 | $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); |
496 | } | 506 | } |
497 | } | 507 | } |
498 | 508 | ||
499 | $scope.emailkeyPress = function(email) { | 509 | $scope.emailkeyPress = function(email) { |
500 | console.log("email", email); | 510 | console.log("email", email); |
501 | if (email == undefined) { | 511 | if (email == undefined) { |
502 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); | 512 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); |
503 | } else { | 513 | } else { |
504 | $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); | 514 | $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); |
505 | } | 515 | } |
506 | } | 516 | } |
507 | 517 | ||
508 | $scope.textCheck = function(){ | 518 | $scope.textCheck = function(){ |
509 | console.log("Val1:::", $scope.textCheck); | 519 | console.log("Val1:::", $scope.textCheck); |
510 | var e = document.getElementById("fundingDiv"); | 520 | var e = document.getElementById("fundingDiv"); |
511 | var funding = e.options[e.selectedIndex].value; | 521 | var funding = e.options[e.selectedIndex].value; |
512 | $scope.Textshow = "no"; | 522 | $scope.Textshow = "no"; |
513 | if(funding == "yes") { | 523 | if(funding == "yes") { |
514 | $scope.Textshow = "yes"; | 524 | $scope.Textshow = "yes"; |
515 | console.log("Val:::", $scope.Textshow); | 525 | console.log("Val:::", $scope.Textshow); |
516 | } | 526 | } |
517 | 527 | ||
518 | } | 528 | } |
519 | 529 | ||
520 | $scope.productCheck = function(){ | 530 | $scope.productCheck = function(){ |
521 | console.log("Val2:::", $scope.productCheck); | 531 | console.log("Val2:::", $scope.productCheck); |
522 | var e = document.getElementById("productDiv"); | 532 | var e = document.getElementById("productDiv"); |
523 | var product = e.options[e.selectedIndex].value; | 533 | var product = e.options[e.selectedIndex].value; |
524 | $scope.Productshow = "no"; | 534 | $scope.Productshow = "no"; |
525 | if(product == "yes") { | 535 | if(product == "yes") { |
526 | $scope.Productshow = "yes"; | 536 | $scope.Productshow = "yes"; |
527 | console.log("Val1:::", $scope.Productshow); | 537 | console.log("Val1:::", $scope.Productshow); |
528 | } | 538 | } |
529 | 539 | ||
530 | } | 540 | } |
531 | 541 | ||
532 | $scope.phonekeyPress = function(number) { | 542 | $scope.phonekeyPress = function(number) { |
533 | console.log("number", number); | 543 | console.log("number", number); |
534 | if (number == undefined || number == '') { | 544 | if (number == undefined || number == '') { |
535 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); | 545 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); |
536 | } else { | 546 | } else { |
537 | $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); | 547 | $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); |
538 | } | 548 | } |
539 | } | 549 | } |
540 | 550 | ||
541 | $scope.citykeyPress = function(city) { | 551 | $scope.citykeyPress = function(city) { |
542 | console.log("city", city); | 552 | console.log("city", city); |
543 | if (city == undefined) { | 553 | if (city == undefined) { |
544 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); | 554 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); |
545 | } else { | 555 | } else { |
546 | $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); | 556 | $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); |
547 | } | 557 | } |
548 | } | 558 | } |
549 | 559 | ||
550 | $scope.lastNamekeyPress = function(q) { | 560 | $scope.lastNamekeyPress = function(q) { |
551 | if (q == undefined) { | 561 | if (q == undefined) { |
552 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); | 562 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); |
553 | } else { | 563 | } else { |
554 | $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); | 564 | $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); |
555 | } | 565 | } |
556 | } | 566 | } |
557 | 567 | ||
558 | $scope.linkedInkeyPress = function(technology) { | 568 | $scope.linkedInkeyPress = function(technology) { |
559 | if (technology == undefined || technology == '') { | 569 | if (technology == undefined || technology == '') { |
560 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); | 570 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); |
561 | } else { | 571 | } else { |
562 | $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); | 572 | $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); |
563 | } | 573 | } |
564 | } | 574 | } |
565 | $scope.companykeyPress = function(problem) { | 575 | $scope.companykeyPress = function(problem) { |
566 | if (problem == undefined) { | 576 | if (problem == undefined) { |
567 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); | 577 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); |
568 | } else { | 578 | } else { |
569 | $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); | 579 | $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); |
570 | } | 580 | } |
571 | } | 581 | } |
572 | $scope.productNamekeyPress = function(solution) { | 582 | $scope.productNamekeyPress = function(solution) { |
573 | if (solution == undefined) { | 583 | if (solution == undefined) { |
574 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); | 584 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); |
575 | } else { | 585 | } else { |
576 | $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); | 586 | $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); |
577 | } | 587 | } |
578 | } | 588 | } |
579 | $scope.businesskeyPress = function(business) { | 589 | $scope.businesskeyPress = function(business) { |
580 | $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); | 590 | $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); |
581 | } | 591 | } |
582 | 592 | ||
583 | $scope.websitekeyPress = function(prototype) { | 593 | $scope.websitekeyPress = function(prototype) { |
584 | if (prototype == undefined || prototype == '') { | 594 | if (prototype == undefined || prototype == '') { |
585 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); | 595 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); |
586 | } else { | 596 | } else { |
587 | $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); | 597 | $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); |
588 | } | 598 | } |
589 | } | 599 | } |
590 | 600 | ||
591 | $scope.employeekeyPress = function(market) { | 601 | $scope.employeekeyPress = function(market) { |
592 | if (market == undefined || market == '') { | 602 | if (market == undefined || market == '') { |
593 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); | 603 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); |
594 | } else { | 604 | } else { |
595 | $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); | 605 | $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); |
596 | } | 606 | } |
597 | } | 607 | } |
598 | 608 | ||
599 | $scope.annualkeyPress = function(risk) { | 609 | $scope.annualkeyPress = function(risk) { |
600 | if (risk == undefined || risk == '') { | 610 | if (risk == undefined || risk == '') { |
601 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); | 611 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); |
602 | } else { | 612 | } else { |
603 | $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); | 613 | $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); |
604 | } | 614 | } |
605 | } | 615 | } |
606 | 616 | ||
607 | $scope.revenuekeyPress = function(team) { | 617 | $scope.revenuekeyPress = function(team) { |
608 | if (team == undefined || team == '') { | 618 | if (team == undefined || team == '') { |
609 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); | 619 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); |
610 | } else { | 620 | } else { |
611 | $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); | 621 | $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); |
612 | } | 622 | } |
613 | } | 623 | } |
614 | 624 | ||
615 | $scope.descriptionkeyPress = function(pitch) { | 625 | $scope.descriptionkeyPress = function(pitch) { |
616 | if (pitch == undefined) { | 626 | if (pitch == undefined) { |
617 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); | 627 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); |
618 | } else { | 628 | } else { |
619 | $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); | 629 | $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); |
620 | } | 630 | } |
621 | } | 631 | } |
622 | 632 | ||
623 | $scope.ideakeyPress = function(financial) { | 633 | $scope.ideakeyPress = function(financial) { |
624 | console.log("financial", financial); | 634 | console.log("financial", financial); |
625 | if (financial == undefined) { | 635 | if (financial == undefined) { |
626 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); | 636 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); |
627 | } else { | 637 | } else { |
628 | $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); | 638 | $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); |
629 | } | 639 | } |
630 | } | 640 | } |
631 | 641 | ||
632 | $scope.fundkeyPress = function(financial) { | 642 | $scope.fundkeyPress = function(financial) { |
633 | console.log("financial", financial); | 643 | console.log("financial", financial); |
634 | if (financial == undefined) { | 644 | if (financial == undefined) { |
635 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); | 645 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); |
636 | } else { | 646 | } else { |
637 | $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)'); | 647 | $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)'); |
638 | } | 648 | } |
639 | } | 649 | } |
640 | 650 | ||
641 | $scope.changeReferalIconColor = function(referalToken){ | 651 | $scope.changeReferalIconColor = function(referalToken){ |
642 | if (referalToken == undefined || referalToken == '') { | 652 | if (referalToken == undefined || referalToken == '') { |
643 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); | 653 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); |
644 | }else { | 654 | }else { |
645 | $('.referel-icon').css('background-color', 'rgb(66, 181, 73)'); | 655 | $('.referel-icon').css('background-color', 'rgb(66, 181, 73)'); |
646 | } | 656 | } |
647 | } | 657 | } |
648 | 658 | ||
649 | }); | 659 | }); |
650 | 660 | ||
651 | scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) { | 661 | scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) { |
652 | $scope.pendingPaymentId = $route.current.params.id | 662 | $scope.pendingPaymentId = $route.current.params.id |
653 | $http({ | 663 | $http({ |
654 | method: "GET", | 664 | method: "GET", |
655 | url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, | 665 | url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, |
656 | }).then(function mySuccess(response) { | 666 | }).then(function mySuccess(response) { |
657 | $scope.data = response.data; | 667 | $scope.data = response.data; |
658 | console.log("response-1", response); | 668 | console.log("response-1", response); |
659 | $scope.pendingPaymentId = $route.current.params.id; | 669 | $scope.pendingPaymentId = $route.current.params.id; |
660 | 670 | ||
661 | $http({ | 671 | $http({ |
662 | method: "GET", | 672 | method: "GET", |
663 | url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', | 673 | url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', |
664 | }).then(function mySuccess(response) { | 674 | }).then(function mySuccess(response) { |
665 | $scope.paymentRecord = response.data; | 675 | $scope.paymentRecord = response.data; |
666 | }, function myError(response) { | 676 | }, function myError(response) { |
667 | }); | 677 | }); |
668 | }, function myError(response) { | 678 | }, function myError(response) { |
669 | $scope.myWelcome = response.statusText; | 679 | $scope.myWelcome = response.statusText; |
670 | }); | 680 | }); |
671 | 681 | ||
672 | $scope.checkView = false; | 682 | $scope.checkView = false; |
673 | $scope.verifyView = false; | 683 | $scope.verifyView = false; |
674 | 684 | ||
675 | $scope.pendingPaymentId = ''; | 685 | $scope.pendingPaymentId = ''; |
676 | 686 | ||
677 | $scope.update = function() { | 687 | $scope.update = function() { |
678 | 688 | ||
679 | $http({ | 689 | $http({ |
680 | method: 'GET', | 690 | method: 'GET', |
681 | url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', | 691 | url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', |
682 | headers: {} | 692 | headers: {} |
683 | }).then(function mySuccess(searchResult) { | 693 | }).then(function mySuccess(searchResult) { |
684 | if (searchResult.data[0].status == "created") { | 694 | if (searchResult.data[0].status == "created") { |
685 | $scope.checkView = true; | 695 | $scope.checkView = true; |
686 | $scope.verifyView = false; | 696 | $scope.verifyView = false; |
687 | $scope.amount = searchResult.data[0].amount; | 697 | $scope.amount = searchResult.data[0].amount; |
688 | $scope.searchResult = searchResult.data[0]; | 698 | $scope.searchResult = searchResult.data[0]; |
689 | console.log('====searchResult===', searchResult); | 699 | console.log('====searchResult===', searchResult); |
690 | console.log("searchResult=====",searchResult.data[0].razorOrderId) | 700 | console.log("searchResult=====",searchResult.data[0].razorOrderId) |
691 | var i = 0; | 701 | var i = 0; |
692 | $scope.amount = $scope.amount * 100; | 702 | $scope.amount = $scope.amount * 100; |
693 | var options = { | 703 | var options = { |
694 | "key": "rzp_live_mhSE1uOBlXvFyJ", | 704 | "key": "rzp_live_mhSE1uOBlXvFyJ", |
695 | //"key" : "rzp_test_YwHsVFiDIQ2WUQ", | 705 | //"key" : "rzp_test_YwHsVFiDIQ2WUQ", |
696 | "amount": $scope.amount, | 706 | "amount": $scope.amount, |
697 | 707 | ||
698 | "name": "Startup Jalsa", | 708 | "name": "Startup Jalsa", |
699 | "description": "amount", | 709 | "description": "amount", |
700 | "currency": "INR", | 710 | "currency": "INR", |
701 | "status": "done", | 711 | "status": "done", |
702 | 712 | ||
703 | "theme": { | 713 | "theme": { |
704 | "color": "#2196f3 ", | 714 | "color": "#2196f3 ", |
705 | "image_padding": "NO" | 715 | "image_padding": "NO" |
706 | }, | 716 | }, |
707 | "modal": { | 717 | "modal": { |
708 | "ondismiss": function() {} | 718 | "ondismiss": function() {} |
709 | }, | 719 | }, |
710 | "handler": function(response) { | 720 | "handler": function(response) { |
711 | createPayment(response); | 721 | createPayment(response); |
712 | } | 722 | } |
713 | }; | 723 | }; |
714 | var rzp1 = new Razorpay(options); | 724 | var rzp1 = new Razorpay(options); |
715 | rzp1.open(); | 725 | rzp1.open(); |
716 | $scope.paymentResponse = {}; | 726 | $scope.paymentResponse = {}; |
717 | function createPayment(response) { | 727 | function createPayment(response) { |
718 | $scope.amount = $scope.amount / 100; | 728 | $scope.amount = $scope.amount / 100; |
719 | console.log("response======retepaymen",response); | 729 | console.log("response======retepaymen",response); |
720 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 730 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
721 | $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; | 731 | $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; |
722 | $scope.paymentResponse.amount = $scope.amount; | 732 | $scope.paymentResponse.amount = $scope.amount; |
723 | $scope.paymentResponse.currency = $scope.searchResult.currency; | 733 | $scope.paymentResponse.currency = $scope.searchResult.currency; |
724 | $scope.paymentResponse.status = $scope.searchResult.status; | 734 | $scope.paymentResponse.status = $scope.searchResult.status; |
725 | $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; | 735 | $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; |
726 | console.log("$scope.paymentResponse", $scope.paymentResponse) | 736 | console.log("$scope.paymentResponse", $scope.paymentResponse) |
727 | $http({ | 737 | $http({ |
728 | method: 'PUT', | 738 | method: 'PUT', |
729 | url: BASE_URL + '/payments/' + $scope.searchResult.id, | 739 | url: BASE_URL + '/payments/' + $scope.searchResult.id, |
730 | data: $scope.paymentResponse, | 740 | data: $scope.paymentResponse, |
731 | headers: {} | 741 | headers: {} |
732 | }).then(function mySuccess(searchResult) { | 742 | }).then(function mySuccess(searchResult) { |
733 | console.log("finalsearchResult",searchResult) | 743 | console.log("finalsearchResult",searchResult) |
734 | $location.path("/confirmation") | 744 | $location.path("/confirmation") |
735 | }, function myError(error) { | 745 | }, function myError(error) { |
736 | 746 | ||
737 | }); | 747 | }); |
738 | } | 748 | } |
739 | } else { | 749 | } else { |
740 | 750 | ||
741 | } | 751 | } |
742 | 752 | ||
743 | }, function myError(error) {}); | 753 | }, function myError(error) {}); |
744 | } | 754 | } |
745 | }); | 755 | }); |
746 | 756 | ||
747 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { | 757 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { |
748 | $scope.data = {}; | 758 | $scope.data = {}; |
749 | $scope.check = false; | 759 | $scope.check = false; |
750 | $scope.numberCheck = false; | 760 | $scope.numberCheck = false; |
751 | 761 | ||
752 | /*open videos in modal*/ | 762 | /*open videos in modal*/ |
753 | $scope.openyoutube16 = function(){ | 763 | $scope.openyoutube16 = function(){ |
754 | $('#videoModel').modal('show'); | 764 | $('#videoModel').modal('show'); |
755 | } | 765 | } |
756 | 766 | ||
757 | $scope.openyoutube17 = function(){ | 767 | $scope.openyoutube17 = function(){ |
758 | $('#videoModels').modal('show'); | 768 | $('#videoModels').modal('show'); |
759 | } | 769 | } |
760 | 770 | ||
761 | $scope.closeModal = function(){ | 771 | $scope.closeModal = function(){ |
762 | var url = $('#youtubePlayer').attr('src'); | 772 | var url = $('#youtubePlayer').attr('src'); |
763 | $('#youtubePlayer').attr('src', ''); | 773 | $('#youtubePlayer').attr('src', ''); |
764 | $('#youtubePlayer').attr('src', url); | 774 | $('#youtubePlayer').attr('src', url); |
765 | } | 775 | } |
766 | /*open videos ends here*/ | 776 | /*open videos ends here*/ |
767 | 777 | ||
768 | $scope.removeError = function() { | 778 | $scope.removeError = function() { |
769 | $('#invalidEmail').css('display', 'none'); | 779 | $('#invalidEmail').css('display', 'none'); |
770 | $('#alreadyExist').css('display', 'none'); | 780 | $('#alreadyExist').css('display', 'none'); |
771 | }; | 781 | }; |
772 | 782 | ||
773 | $scope.emailcheck = function(val) { | 783 | $scope.emailcheck = function(val) { |
774 | if (val == undefined) { | 784 | if (val == undefined) { |
775 | $('#invalidEmail').css('display', 'block'); | 785 | $('#invalidEmail').css('display', 'block'); |
776 | } else { | 786 | } else { |
777 | $http({ | 787 | $http({ |
778 | method: 'GET', | 788 | method: 'GET', |
779 | url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | 789 | url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', |
780 | headers: {} | 790 | headers: {} |
781 | }).then(function mySuccess(searchResult) { | 791 | }).then(function mySuccess(searchResult) { |
782 | console.log("searchResult1===>", searchResult) | 792 | console.log("searchResult1===>", searchResult) |
783 | if (searchResult.data.length == 0) { | 793 | if (searchResult.data.length == 0) { |
784 | $scope.check = false; | 794 | $scope.check = false; |
785 | } else { | 795 | } else { |
786 | $scope.check = true; | 796 | $scope.check = true; |
787 | $('#alreadyExist').css('display', 'block'); | 797 | $('#alreadyExist').css('display', 'block'); |
788 | } | 798 | } |
789 | }, function myError(error) {}); | 799 | }, function myError(error) {}); |
790 | } | 800 | } |
791 | }; | 801 | }; |
792 | 802 | ||
793 | $scope.removeNoError = function() { | 803 | $scope.removeNoError = function() { |
794 | $('#invalidNumber').css('display', 'none'); | 804 | $('#invalidNumber').css('display', 'none'); |
795 | $('#noExist').css('display', 'none'); | 805 | $('#noExist').css('display', 'none'); |
796 | }; | 806 | }; |
797 | 807 | ||
798 | $scope.numbercheck = function(number) { | 808 | $scope.numbercheck = function(number) { |
799 | // if (val == undefined) { | 809 | // if (val == undefined) { |
800 | // $('#invalidNumber').css('display', 'block'); | 810 | // $('#invalidNumber').css('display', 'block'); |
801 | // } else { | 811 | // } else { |
802 | $http({ | 812 | $http({ |
803 | method: 'GET', | 813 | method: 'GET', |
804 | url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}', | 814 | url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}', |
805 | data: $scope.data, | 815 | data: $scope.data, |
806 | headers: {} | 816 | headers: {} |
807 | }).then(function mySuccess(searchResult) { | 817 | }).then(function mySuccess(searchResult) { |
808 | console.log("searchResult===>", searchResult) | 818 | console.log("searchResult===>", searchResult) |
809 | if (searchResult.data.length == 0) { | 819 | if (searchResult.data.length == 0) { |
810 | $scope.numberCheck = false; | 820 | $scope.numberCheck = false; |
811 | } else { | 821 | } else { |
812 | $scope.numberCheck = true; | 822 | $scope.numberCheck = true; |
813 | $('#noExist').css('display', 'block'); | 823 | $('#noExist').css('display', 'block'); |
814 | } | 824 | } |
815 | }, function myError(error) {}); | 825 | }, function myError(error) {}); |
816 | //} | 826 | //} |
817 | 827 | ||
818 | }; | 828 | }; |
819 | $scope.removeNoError = function() { | ||
820 | $('#invalidIdea').css('display', 'none'); | ||
821 | $('#noExist').css('display', 'none'); | ||
822 | }; | ||
823 | |||
824 | // if (val == undefined) { | ||
825 | // $('#invalidIdea').css('display', 'block'); | ||
826 | 829 | ||
827 | $scope.submit = function() { | 830 | $scope.submit = function() { |
828 | console.log($scope.data.name) | 831 | console.log($scope.data.name) |
829 | var randomNumber = ""+Math.random(); | 832 | var randomNumber = ""+Math.random(); |
830 | var nameSpliced = $scope.data.name.slice(0,3); | 833 | var nameSpliced = $scope.data.name.slice(0,3); |
831 | var numberSpliced = randomNumber.slice(2,5); | 834 | var numberSpliced = randomNumber.slice(2,5); |
832 | $scope.data.referalToken = nameSpliced+numberSpliced; | 835 | $scope.data.referalToken = nameSpliced+numberSpliced; |
833 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 836 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
834 | 837 | ||
835 | $http({ | 838 | $http({ |
836 | method: 'POST', | 839 | method: 'POST', |
837 | url: BASE_URL + '/ambassadors', | 840 | url: BASE_URL + '/ambassadors', |
838 | data: $scope.data, | 841 | data: $scope.data, |
839 | headers: {} | 842 | headers: {} |
840 | }).then(function mySuccess(result) { | 843 | }).then(function mySuccess(result) { |
841 | console.log("result", result) | 844 | console.log("result", result) |
842 | $scope.detail = result; | 845 | $scope.detail = result; |
843 | $('#myModal').modal('show'); | 846 | $('#myModal').modal('show'); |
844 | $scope.data.name = ''; | 847 | $scope.data.name = ''; |
845 | $scope.data.email = ''; | 848 | $scope.data.email = ''; |
846 | $scope.data.mobile = ''; | 849 | $scope.data.mobile = ''; |
847 | 850 | ||
848 | }, function myError(error) { | 851 | }, function myError(error) { |
849 | console.log(error) | 852 | console.log(error) |