Commit fc9af94cb03b5b6c27a29e4cc6699203855074fc
1 parent
3459bcf483
Exists in
master
modify module
Showing
3 changed files
with
84 additions
and
19 deletions
Show diff stats
src/app/components/authentication/authentication.controller.js
... | ... | @@ -6,19 +6,82 @@ |
6 | 6 | |
7 | 7 | function loginCtrl($scope, $rootScope, $state, $mdDialog,$log, AUTH_EVENTS, LoginService ,toaster) { |
8 | 8 | $scope.data={} |
9 | + var checkData=0; | |
9 | 10 | $scope.create = function() { |
10 | 11 | LoginService.createForm().save($scope.data).$promise.then(function(result) { |
11 | 12 | if(result != null){ |
12 | - toaster.success("form successfully created"); | |
13 | - // $state.go('app.awards'); | |
13 | + toaster.success("Registration done successfully"); | |
14 | 14 | } |
15 | - }, function error(error) { | |
16 | - if(error){ | |
17 | - toaster.error("Server error"); | |
18 | - } | |
19 | - }); | |
20 | 15 | |
21 | - } | |
16 | + if(checkData != 0){ | |
17 | + $mdToast.show( | |
18 | + $mdToast.simple() | |
19 | + .textContent('Please verify your form again') | |
20 | + .position($scope.getToastPosition()) | |
21 | + .hideDelay(3000) | |
22 | + ); | |
23 | + checkData++; | |
24 | + }else{ | |
25 | + | |
26 | + var i = 0; | |
27 | + var applicationFees = 100; | |
28 | + $scope.applicationFees = applicationFees*100; | |
29 | + var options = { | |
30 | + "key": "rzp_test_TxoEstU3hr7Ltw", | |
31 | + "amount": $scope.applicationFees, | |
32 | + "currency": "INR", | |
33 | + "status": "done", | |
34 | + | |
35 | + | |
36 | + "theme": { | |
37 | + "color": "#2196f3 ", | |
38 | + "image_padding":"NO" | |
39 | + }, | |
40 | + "modal": { | |
41 | + "ondismiss": function(){ | |
42 | + console.log("===ondismiss===="); | |
43 | + } | |
44 | + }, | |
45 | + "handler": function (response){ | |
46 | + console.log("response===",response) | |
47 | + createPayment(response) | |
48 | + } | |
49 | + }; | |
50 | + var rzp1 = new Razorpay(options); | |
51 | + rzp1.open(); | |
52 | + | |
53 | + function createPayment(response){ | |
54 | + // var date= new Date(); | |
55 | + // $scope.registration.paymentId = response.razorpay_payment_id; | |
56 | + // $scope.registration.paymentDate = date.toISOString(); | |
57 | + // $scope.registration.amount = $scope.registrationFees/100; | |
58 | + // $scope.registration.paymentType = "registration fees"; | |
59 | + // var setDate = $scope.registrationDate.setMonth($scope.registrationDate.getMonth()); | |
60 | + // var registrationDate = new Date(setDate).getMonth() + 1; | |
61 | + // $scope.registration.dob = $scope.registrationDate.getFullYear() +"-"+ registrationDate +"-"+$scope.registrationDate.getDate(); | |
62 | + | |
63 | + console.log("$scope.registration",$scope.registration); | |
64 | + | |
65 | + | |
66 | + } | |
67 | + } | |
68 | + | |
69 | + | |
70 | + | |
71 | + | |
72 | + | |
73 | + | |
74 | + | |
75 | + | |
76 | + | |
77 | + | |
78 | + | |
79 | + | |
80 | + | |
81 | + | |
82 | + // } | |
83 | + }) | |
84 | + } | |
22 | 85 | |
23 | 86 | } |
24 | 87 | ... | ... |
src/app/components/authentication/authentication.service.js
... | ... | @@ -7,11 +7,16 @@ |
7 | 7 | function LoginService($q, $http, $rootScope, $resource, BASE_URL, USER_ROLES) { |
8 | 8 | |
9 | 9 | this.createForm = function(){ |
10 | - return $resource(BASE_URL+'/userProfiles', | |
10 | + return $resource(BASE_URL+'/applicants', | |
11 | 11 | {}); |
12 | 12 | |
13 | 13 | } |
14 | + | |
15 | + // this.createForm = function(){ | |
16 | + // return $resource(BASE_URL+'/applicants', | |
17 | + // {}); | |
18 | + | |
19 | + // } | |
14 | 20 | |
15 | 21 | } |
16 | - | |
17 | 22 | })(); |
18 | 23 | \ No newline at end of file | ... | ... |
src/app/components/authentication/template/login.html
1 | +<script src="https://checkout.razorpay.com/v1/checkout.js"></script> | |
2 | +<a id="top"></a> | |
1 | 3 | <md-content class="md-padding" layout="row" layout-wrap layout-align="center start" style="width: 100%;background-color: #F1F1F1;"> |
2 | 4 | <md-card style="padding: 20px 40px;width: 70%;"> |
3 | 5 | <md-card-title> |
... | ... | @@ -13,8 +15,8 @@ |
13 | 15 | </md-input-container> |
14 | 16 | <md-input-container class="md-block md-icon-float"> |
15 | 17 | <label>Email</label> |
16 | - <md-icon md-svg-src="assets/images/ic_email_black_24px.svg" class="password"></md-icon> | |
17 | - <input type="text" ng-model="data.password"> | |
18 | + <md-icon md-svg-src="assets/images/ic_email_black_24px.svg"></md-icon> | |
19 | + <input type="text" ng-model="data.email"> | |
18 | 20 | </md-input-container> |
19 | 21 | <md-input-container class="md-block md-icon-float"> |
20 | 22 | <label>Mobile No.</label> |
... | ... | @@ -22,14 +24,9 @@ |
22 | 24 | <input type="number" ng-model="data.phone"> |
23 | 25 | </md-input-container> |
24 | 26 | <md-input-container class="md-block md-icon-float"> |
25 | - <label>City</label> | |
27 | + <label>Address</label> | |
26 | 28 | <md-icon <i class="material-icons">place</i></md-icon> |
27 | - <input type="text" ng-model="data.city"> | |
28 | - </md-input-container> | |
29 | - <md-input-container class="md-block md-icon-float"> | |
30 | - <label>Monthly Income</label> | |
31 | - <md-icon <i class="material-icons">payment</i></md-icon> | |
32 | - <input type="text" ng-model="data.monthlyIncome"> | |
29 | + <input type="text" ng-model="data.address"> | |
33 | 30 | </md-input-container> |
34 | 31 | <div layout="row" layout-align="center center"> |
35 | 32 | <md-button class="md-raised md-primary" id="createPass" ng-disabled="loginForm.$invalid" ng-click="create()">submit</md-button> | ... | ... |