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
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | angular.module('sbAdminApp') | 4 | angular.module('sbAdminApp') |
5 | .controller('LoginCtrl', ['$scope', '$rootScope', '$state','$mdDialog','$log', 'AUTH_EVENTS', 'LoginService', 'toaster', loginCtrl]); | 5 | .controller('LoginCtrl', ['$scope', '$rootScope', '$state','$mdDialog','$log', 'AUTH_EVENTS', 'LoginService', 'toaster', loginCtrl]); |
6 | 6 | ||
7 | function loginCtrl($scope, $rootScope, $state, $mdDialog,$log, AUTH_EVENTS, LoginService ,toaster) { | 7 | function loginCtrl($scope, $rootScope, $state, $mdDialog,$log, AUTH_EVENTS, LoginService ,toaster) { |
8 | $scope.data={} | 8 | $scope.data={} |
9 | var checkData=0; | ||
9 | $scope.create = function() { | 10 | $scope.create = function() { |
10 | LoginService.createForm().save($scope.data).$promise.then(function(result) { | 11 | LoginService.createForm().save($scope.data).$promise.then(function(result) { |
11 | if(result != null){ | 12 | if(result != null){ |
12 | toaster.success("form successfully created"); | 13 | toaster.success("Registration done successfully"); |
13 | // $state.go('app.awards'); | ||
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 | // } |
src/app/components/authentication/authentication.service.js
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | angular.module('sbAdminApp') | 4 | angular.module('sbAdminApp') |
5 | .service('LoginService', ['$q', '$http', '$rootScope', '$resource', 'BASE_URL', 'USER_ROLES', LoginService]); | 5 | .service('LoginService', ['$q', '$http', '$rootScope', '$resource', 'BASE_URL', 'USER_ROLES', LoginService]); |
6 | 6 | ||
7 | function LoginService($q, $http, $rootScope, $resource, BASE_URL, USER_ROLES) { | 7 | function LoginService($q, $http, $rootScope, $resource, BASE_URL, USER_ROLES) { |
8 | 8 | ||
9 | this.createForm = function(){ | 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 |
src/app/components/authentication/template/login.html
1 | <script src="https://checkout.razorpay.com/v1/checkout.js"></script> | ||
2 | <a id="top"></a> | ||
1 | <md-content class="md-padding" layout="row" layout-wrap layout-align="center start" style="width: 100%;background-color: #F1F1F1;"> | 3 | <md-content class="md-padding" layout="row" layout-wrap layout-align="center start" style="width: 100%;background-color: #F1F1F1;"> |
2 | <md-card style="padding: 20px 40px;width: 70%;"> | 4 | <md-card style="padding: 20px 40px;width: 70%;"> |
3 | <md-card-title> | 5 | <md-card-title> |
4 | <md-card-title-text style="text-align: center;color: black"> | 6 | <md-card-title-text style="text-align: center;color: black"> |
5 | <span class="md-headline">Start Up Jalsa</span> | 7 | <span class="md-headline">Start Up Jalsa</span> |
6 | </md-card-title-text> | 8 | </md-card-title-text> |
7 | </md-card-title> | 9 | </md-card-title> |
8 | <form name="loginForm"> | 10 | <form name="loginForm"> |
9 | <md-input-container class="md-block md-icon-float"> | 11 | <md-input-container class="md-block md-icon-float"> |
10 | <label>Name</label> | 12 | <label>Name</label> |
11 | <md-icon md-svg-src="assets/images/ic_person_black_24px.svg"></md-icon> | 13 | <md-icon md-svg-src="assets/images/ic_person_black_24px.svg"></md-icon> |
12 | <input type="text" ng-model="data.name"> | 14 | <input type="text" ng-model="data.name"> |
13 | </md-input-container> | 15 | </md-input-container> |
14 | <md-input-container class="md-block md-icon-float"> | 16 | <md-input-container class="md-block md-icon-float"> |
15 | <label>Email</label> | 17 | <label>Email</label> |
16 | <md-icon md-svg-src="assets/images/ic_email_black_24px.svg" class="password"></md-icon> | 18 | <md-icon md-svg-src="assets/images/ic_email_black_24px.svg"></md-icon> |
17 | <input type="text" ng-model="data.password"> | 19 | <input type="text" ng-model="data.email"> |
18 | </md-input-container> | 20 | </md-input-container> |
19 | <md-input-container class="md-block md-icon-float"> | 21 | <md-input-container class="md-block md-icon-float"> |
20 | <label>Mobile No.</label> | 22 | <label>Mobile No.</label> |
21 | <md-icon md-svg-src="assets/images/ic_phone_black_24px.svg"></md-icon> | 23 | <md-icon md-svg-src="assets/images/ic_phone_black_24px.svg"></md-icon> |
22 | <input type="number" ng-model="data.phone"> | 24 | <input type="number" ng-model="data.phone"> |
23 | </md-input-container> | 25 | </md-input-container> |
24 | <md-input-container class="md-block md-icon-float"> | 26 | <md-input-container class="md-block md-icon-float"> |
25 | <label>City</label> | 27 | <label>Address</label> |
26 | <md-icon <i class="material-icons">place</i></md-icon> | 28 | <md-icon <i class="material-icons">place</i></md-icon> |
27 | <input type="text" ng-model="data.city"> | 29 | <input type="text" ng-model="data.address"> |
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"> | ||
33 | </md-input-container> | 30 | </md-input-container> |
34 | <div layout="row" layout-align="center center"> | 31 | <div layout="row" layout-align="center center"> |
35 | <md-button class="md-raised md-primary" id="createPass" ng-disabled="loginForm.$invalid" ng-click="create()">submit</md-button> | 32 | <md-button class="md-raised md-primary" id="createPass" ng-disabled="loginForm.$invalid" ng-click="create()">submit</md-button> |
36 | </div> | 33 | </div> |
37 | </form> | 34 | </form> |
38 | </md-card> | 35 | </md-card> |