Blame view
script.js
13.5 KB
53b83aa9e
|
1 |
// create the module and name it scotchApp |
f263889f0
|
2 |
var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); |
53b83aa9e
|
3 4 5 |
// configure our routes scotchApp.config(function($routeProvider) { |
6ae8d3cdd
|
6 |
$routeProvider |
dcb703070
|
7 |
// route for the Home page |
6ae8d3cdd
|
8 |
.when('/', { |
dcb703070
|
9 10 11 12 13 |
templateUrl: 'pages/Home.html', controller: 'mainController' }) // route for the registration page |
e856f2161
|
14 |
.when('/caricatures', { |
dcb703070
|
15 |
templateUrl: 'pages/registration.html', |
6ae8d3cdd
|
16 17 |
controller: 'mainController' }) |
317a80571
|
18 19 20 21 22 |
// // route for the paymentVerify page // .when('/pendingPayment/:id', { // templateUrl: 'pages/verify.html', // controller: 'verifyController' // }) |
6ae8d3cdd
|
23 24 |
// route for the ambassador page |
e856f2161
|
25 |
.when('/registration', { |
6ae8d3cdd
|
26 27 28 |
templateUrl: 'pages/ambassador.html', controller: 'ambassadorController' }) |
5348de778
|
29 30 31 32 |
// route for the confirmation page .when('/confirmation', { templateUrl: 'pages/confirmation.html', |
5e3b90de3
|
33 |
controller: 'ambassadorController' |
5348de778
|
34 |
}) |
6ae8d3cdd
|
35 |
}); |
53b83aa9e
|
36 |
|
f263889f0
|
37 38 |
scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { // Add configuration code as desired |
61b69ada0
|
39 |
AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code |
f263889f0
|
40 41 42 43 44 45 46 47 |
// Track all routes (default is true). AnalyticsProvider.trackPages(true); // Track all URL query params (default is false). AnalyticsProvider.trackUrlParams(true); }]).run(['Analytics', function(Analytics) { }]); |
124f7528f
|
48 49 |
scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") |
6ae8d3cdd
|
50 |
|
2d6a9fbea
|
51 |
// create the controller and inject Angular's $scope |
f263889f0
|
52 |
scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { |
6ae8d3cdd
|
53 54 55 56 57 58 |
$scope.data = { show: true, hide: false }; $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
e847b36f8
|
59 |
$scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
c62079487
|
60 |
// $scope.Textshow = "yes" |
6ae8d3cdd
|
61 |
$scope.max = 100; |
88dd26b3d
|
62 |
$scope.formPage = false; |
6ae8d3cdd
|
63 64 |
$scope.current = 0; $scope.payingAmnt = 0; |
6ae8d3cdd
|
65 |
$scope.data = {}; |
ea3c31126
|
66 |
$scope.discountAmount = 0; |
7b2bef227
|
67 |
// $scope.data.quantity = "1"; |
6ae8d3cdd
|
68 69 |
$scope.check = false; $scope.numberCheck = false; |
6ae8d3cdd
|
70 |
$scope.paymentResult = {}; |
6ae8d3cdd
|
71 72 73 74 75 |
var data = { "amount": $scope.payingAmnt, "currency": "INR", "status": "pending" } |
53b83aa9e
|
76 |
|
dcb703070
|
77 |
$scope.apply = function() { |
317a80571
|
78 |
//Analytics.trackEvent('register', 'click', 'Registration'); |
e856f2161
|
79 |
$location.path("/caricatures") |
dcb703070
|
80 |
} |
629cc1f8f
|
81 |
|
317a80571
|
82 83 84 85 86 87 |
$scope.data.city = ''; $scope.watch = function(value){ console.log("cllll",value) $scope.data.city = value; localStorage.setItem("city" ,value); //$location.path('/registration').search({city: value}); |
9d4fa776e
|
88 |
$location.path('/registration'); |
317a80571
|
89 |
//$state.go('registration', { 'city': value}) |
163c5adae
|
90 |
} |
e847b36f8
|
91 |
|
6ae8d3cdd
|
92 |
$scope.stagekeyPress = function() { |
f8b43c6f8
|
93 |
$('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
94 95 |
} $scope.sectorkeyPress = function() { |
f8b43c6f8
|
96 |
$('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
97 |
} |
163c5adae
|
98 |
$scope.productLaunchkeyPress = function() { |
f8b43c6f8
|
99 |
$('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
100 |
} |
163c5adae
|
101 |
$scope.launchPeriodkeyPress = function() { |
f8b43c6f8
|
102 |
$('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
103 |
} |
7b2bef227
|
104 105 |
$scope.industrykeyPress = function(quantity) { console.log("fghj",quantity) |
f8b43c6f8
|
106 |
$('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
107 |
} |
204302c02
|
108 109 110 111 112 |
$scope.industryNamekeyPress = function(firstName) { console.log("lastName==", firstName); if (firstName == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
113 |
$('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
204302c02
|
114 115 |
} } |
c62079487
|
116 |
$scope.amountkeyPress = function() { |
f8b43c6f8
|
117 |
$('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
118 |
} |
2321f803a
|
119 120 121 |
$scope.firstNamekeyPress = function(name) { console.log("lastName==", name); if (name == undefined) { |
6ae8d3cdd
|
122 123 |
$('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
124 |
$('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
125 126 |
} } |
dcb703070
|
127 |
|
6ae8d3cdd
|
128 129 130 131 132 |
$scope.emailkeyPress = function(email) { console.log("email", email); if (email == undefined) { $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
133 |
$('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); |
8ddc94e00
|
134 |
} |
6ae8d3cdd
|
135 |
} |
6ae8d3cdd
|
136 137 |
$scope.phonekeyPress = function(number) { console.log("number", number); |
204302c02
|
138 |
if (number == undefined || number == '') { |
6ae8d3cdd
|
139 140 |
$('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
141 |
$('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
142 143 144 145 146 147 148 149 |
} } $scope.citykeyPress = function(city) { console.log("city", city); if (city == undefined) { $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
150 |
$('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
151 152 |
} } |
7e3bb1018
|
153 |
$scope.startupNamekeyPress = function(q) { |
6ae8d3cdd
|
154 155 156 |
if (q == undefined) { $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
157 |
$('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
158 159 |
} } |
dcb703070
|
160 |
$scope.linkedInkeyPress = function(technology) { |
204302c02
|
161 |
if (technology == undefined || technology == '') { |
6ae8d3cdd
|
162 163 |
$('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
164 |
$('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
165 166 |
} } |
dcb703070
|
167 |
$scope.companykeyPress = function(problem) { |
6ae8d3cdd
|
168 169 170 |
if (problem == undefined) { $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
171 |
$('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
172 173 |
} } |
dcb703070
|
174 |
$scope.productNamekeyPress = function(solution) { |
6ae8d3cdd
|
175 176 177 |
if (solution == undefined) { $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
178 |
$('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
179 180 181 |
} } $scope.businesskeyPress = function(business) { |
58efec61e
|
182 183 184 185 186 |
if (business == undefined) { $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); } else { $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); } |
6ae8d3cdd
|
187 |
} |
dcb703070
|
188 |
$scope.websitekeyPress = function(prototype) { |
204302c02
|
189 |
if (prototype == undefined || prototype == '') { |
6ae8d3cdd
|
190 191 |
$('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
192 |
$('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
193 194 |
} } |
dcb703070
|
195 |
$scope.employeekeyPress = function(market) { |
204302c02
|
196 |
if (market == undefined || market == '') { |
6ae8d3cdd
|
197 198 |
$('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
199 |
$('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
200 201 |
} } |
dcb703070
|
202 |
$scope.annualkeyPress = function(risk) { |
204302c02
|
203 |
if (risk == undefined || risk == '') { |
6ae8d3cdd
|
204 205 |
$('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
206 |
$('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
207 208 |
} } |
dcb703070
|
209 |
$scope.revenuekeyPress = function(team) { |
81526b56d
|
210 |
if (team == undefined) { |
6ae8d3cdd
|
211 212 |
$('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
213 |
$('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
214 215 |
} } |
dcb703070
|
216 |
$scope.descriptionkeyPress = function(pitch) { |
6ae8d3cdd
|
217 218 219 |
if (pitch == undefined) { $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
220 |
$('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
221 222 |
} } |
e284785e4
|
223 |
$scope.discountkeyPress = function(discount) { |
e284785e4
|
224 225 226 |
if (discount == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
227 |
$('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
e284785e4
|
228 229 |
} } |
91eeb4455
|
230 231 232 233 |
$scope.removeNooError = function() { $('#invalidIdea').css('display', 'block'); $('#noExist').css('display', 'none'); }; |
c62079487
|
234 |
$scope.ideakeyPress = function(financial) { |
6ae8d3cdd
|
235 236 237 238 |
console.log("financial", financial); if (financial == undefined) { $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
239 |
$('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
240 241 |
} } |
c62079487
|
242 243 244 245 246 247 |
$scope.fundkeyPress = function(financial) { console.log("financial", financial); if (financial == undefined) { $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
248 |
$('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
249 250 |
} } |
2d6a9fbea
|
251 252 253 254 |
$scope.changeReferalIconColor = function(referalToken){ if (referalToken == undefined || referalToken == '') { $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); }else { |
f8b43c6f8
|
255 |
$('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); |
2d6a9fbea
|
256 257 |
} } |
6ae8d3cdd
|
258 |
|
53b83aa9e
|
259 |
}); |
2d6a9fbea
|
260 |
scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { |
6ae8d3cdd
|
261 |
$scope.data = {}; |
8e25d825b
|
262 263 |
$scope.check = false; $scope.numberCheck = false; |
e856f2161
|
264 265 |
$scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
e856f2161
|
266 267 268 269 |
$scope.max = 100; $scope.formPage = false; $scope.current = 0; $scope.payingAmnt = 0; |
e856f2161
|
270 271 272 273 274 275 276 277 278 279 |
$scope.discountAmount = 0; // $scope.data.quantity = "1"; $scope.check = false; $scope.numberCheck = false; $scope.paymentResult = {}; var data = { "amount": $scope.payingAmnt, "currency": "INR", "status": "pending" } |
8e25d825b
|
280 |
|
5348de778
|
281 282 283 284 |
$scope.removeError = function() { $('#invalidEmail').css('display', 'none'); $('#alreadyExist').css('display', 'none'); }; |
248bd9b7c
|
285 286 287 288 289 |
$scope.emailcheck = function(val) { if (val == undefined) { $('#invalidEmail').css('display', 'block'); } else { $('#alreadyExist').css('display', 'block'); |
248bd9b7c
|
290 291 |
} }; |
b678502c9
|
292 |
|
317a80571
|
293 |
// $scope.$on('city', function (event, value) { |
9d4fa776e
|
294 295 |
$scope.data.city = localStorage.getItem("city"); console.log("HERE===",$scope.data.city ); |
317a80571
|
296 |
// }); |
6ae8d3cdd
|
297 |
$scope.submit = function() { |
321ed3c51
|
298 |
$scope.payingAmnt = 50000; |
e856f2161
|
299 300 |
if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { var x = document.getElementById("snackbar") |
e856f2161
|
301 |
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
317a80571
|
302 |
}else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
e856f2161
|
303 |
$scope.infoForm = true; |
e856f2161
|
304 305 306 307 308 309 310 311 312 |
$scope.detail = {}; $scope.data.phone = "+91"+$scope.data.number; $http({ method: 'POST', url: BASE_URL+'/applicants', data: $scope.data, headers: {} }).then(function mySuccess(result) { console.log("=====result=====",result) |
e856f2161
|
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
$scope.detail = result; data.applicantId = result.data.id; $scope.userId = result.data.id; console.log("=====data=====",data) data.amount = $scope.payingAmnt /100; if($scope.detail != null){ $http({ method: 'POST', url: BASE_URL+'/payments', data: data, headers: {} }).then(function mySuccess(paymentResult) { $scope.paymentResult = paymentResult; }, function myError(error) { }); } var i = 0; var options = { |
321ed3c51
|
331 332 |
//"key": "rzp_test_YwHsVFiDIQ2WUQ", "key": "rzp_live_mkmCb4FkstuWaS", |
e856f2161
|
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
"amount": $scope.payingAmnt, "name": "Startup Jalsa", "description":"amount", "currency": "INR", "status": "done", "prefill": { "email": $scope.detail.email, "contact": $scope.detail.phone }, "theme": { "color": "#2196f3 ", "image_padding":"NO" }, "modal": { "ondismiss": function(){ } }, "handler": function (response){ createPayment(response); } }; var rzp1 = new Razorpay(options); rzp1.open(); $scope.paymentResponse = {}; function createPayment(response){ console.log("response12333333",response) $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; $scope.paymentResponse.amount = data.amount; $scope.paymentResponse.currency = "INR"; $scope.paymentResponse.status = $scope.paymentResult.data.status; $http({ method: 'PUT', url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, data: $scope.paymentResponse, headers: {} }).then(function mySuccess(searchResult) { console.log("searchResult",searchResult) |
5e3b90de3
|
374 |
$location.path("/confirmation") |
e856f2161
|
375 376 377 378 379 |
}, function myError(error) { }); } }, function myError(error) { |
317a80571
|
380 |
|
e856f2161
|
381 |
}); |
317a80571
|
382 |
|
e856f2161
|
383 |
} |
e856f2161
|
384 |
|
317a80571
|
385 386 387 |
} }); |
53b83aa9e
|
388 |
|
96991e0c1
|
389 |