Commit a19001fdd33b6b2b391590a4b6df1312b025d609
1 parent
ec74ee75dd
Exists in
master
new code added
Showing
6 changed files
with
99 additions
and
37 deletions
Show diff stats
app/views/fbo-admin/dashboard.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('DashboardController', function($scope, $state, FBOAdmin) { | 6 | .controller('DashboardController', function($scope, $state, FBOAdmin) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.i-checks').iCheck({ | 8 | $('.i-checks').iCheck({ |
9 | checkboxClass: 'icheckbox_square-green', | 9 | checkboxClass: 'icheckbox_square-green', |
10 | radioClass: 'iradio_square-green', | 10 | radioClass: 'iradio_square-green', |
11 | }); | 11 | }); |
12 | $('.fboadmin').addClass('active'); | 12 | $('.fboadmin').addClass('active'); |
13 | }); | 13 | }); |
14 | $scope.userName = 'Dylan Goodwin'; | 14 | $scope.userName = 'Dylan Goodwin'; |
15 | $scope.essAccountId = true; | 15 | $scope.essAccountId = true; |
16 | $("#esAccId").css({ opacity: 0.5 }); | 16 | $("#esAccId").css({ opacity: 0.5 }); |
17 | $scope.user = {}; | 17 | $scope.user = {}; |
18 | $scope.user.companyName = ''; | 18 | $scope.user.companyName = ''; |
19 | $scope.user.email = ''; | 19 | $scope.user.email = ''; |
20 | $scope.user.password = ''; | 20 | $scope.user.password = ''; |
21 | $scope.user.icao = ''; | 21 | $scope.user.icao = ''; |
22 | $scope.feature = {}; | 22 | $scope.feature = {}; |
23 | $scope.feature.level = 'silver'; | 23 | $scope.feature.level = 'silver'; |
24 | $scope.feature.essintaPosSystem = false; | 24 | $scope.feature.essintaPosSystem = false; |
25 | $scope.feature.acuQuote = false; | 25 | $scope.feature.acuQuote = false; |
26 | $scope.feature.acuTrack = false; | 26 | $scope.feature.acuTrack = false; |
27 | $scope.feature.fuelProgram = false; | 27 | $scope.feature.fuelProgram = false; |
28 | $scope.feature.amstatIntegration = false; | 28 | $scope.feature.amstatIntegration = false; |
29 | $scope.feature.posAccountingIntegration = false; | 29 | $scope.feature.posAccountingIntegration = false; |
30 | $scope.feature.posVeederRootIntegration = false; | 30 | $scope.feature.posVeederRootIntegration = false; |
31 | 31 | ||
32 | $scope.checkUsername = function(){ | 32 | $scope.checkUsername = function(){ |
33 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | 33 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { |
34 | console.log(status) | 34 | console.log(status) |
35 | if(status != 200){ | 35 | if(status != 200){ |
36 | toastr.error('This email has alreay taken', { | 36 | toastr.error('This email has alreay taken', { |
37 | closeButton: true | 37 | closeButton: true |
38 | }) | 38 | }) |
39 | } | 39 | } |
40 | }) | 40 | }) |
41 | } | 41 | } |
42 | $scope.comnayNameInvalid = false; | 42 | $scope.comnayNameInvalid = false; |
43 | $scope.emailInvalid = false; | 43 | $scope.emailInvalid = false; |
44 | $scope.passwordInvalid = false; | 44 | $scope.passwordInvalid = false; |
45 | $scope.icaoInvalid = false; | 45 | $scope.icaoInvalid = false; |
46 | 46 | ||
47 | $scope.companyNameValid = function(){ | 47 | $scope.companyNameValid = function(){ |
48 | $scope.comnayNameInvalid = false; | 48 | $scope.comnayNameInvalid = false; |
49 | $('.companyNameError').removeClass('customErrorInput'); | 49 | $('.companyNameError').removeClass('customErrorInput'); |
50 | } | 50 | } |
51 | $scope.emailValid = function(){ | 51 | $scope.emailValid = function(){ |
52 | $scope.emailInvalid = false; | 52 | $scope.emailInvalid = false; |
53 | $('.emailIdError').removeClass('customErrorInput'); | 53 | $('.emailIdError').removeClass('customErrorInput'); |
54 | } | 54 | } |
55 | $scope.passwordValid = function(){ | 55 | $scope.passwordValid = function(){ |
56 | $scope.passwordInvalid = false; | 56 | $scope.passwordInvalid = false; |
57 | $('.invalidPassword').removeClass('customErrorInput'); | 57 | $('.invalidPassword').removeClass('customErrorInput'); |
58 | } | 58 | } |
59 | $scope.icaoValid = function(){ | 59 | $scope.icaoValid = function(){ |
60 | $scope.icaoInvalid = false; | 60 | $scope.icaoInvalid = false; |
61 | $('.icaoNameError').removeClass('customErrorInput'); | 61 | $('.icaoNameError').removeClass('customErrorInput'); |
62 | } | 62 | } |
63 | 63 | ||
64 | $scope.userData = function(){ | 64 | $scope.userData = function(){ |
65 | console.log('$scope.user', $scope.user); | 65 | console.log('$scope.user', $scope.user); |
66 | if ($scope.user.companyName == '') { | 66 | if ($scope.user.companyName == '') { |
67 | $scope.comnayNameInvalid = true; | 67 | $scope.comnayNameInvalid = true; |
68 | $('.companyNameError').addClass('customErrorInput'); | 68 | $('.companyNameError').addClass('customErrorInput'); |
69 | }else if ($scope.user.icao == '') { | 69 | }else if ($scope.user.icao == '') { |
70 | $scope.icaoInvalid = true; | 70 | $scope.icaoInvalid = true; |
71 | $('.icaoNameError').addClass('customErrorInput'); | 71 | $('.icaoNameError').addClass('customErrorInput'); |
72 | }else if ($scope.user.email == '') { | 72 | }else if ($scope.user.email == '') { |
73 | $scope.emailInvalid = true; | 73 | $scope.emailInvalid = true; |
74 | $('.emailIdError').addClass('customErrorInput'); | 74 | $('.emailIdError').addClass('customErrorInput'); |
75 | }else if ($scope.user.password == '') { | 75 | }else if ($scope.user.password == '') { |
76 | $scope.passwordInvalid = true; | 76 | $scope.passwordInvalid = true; |
77 | $('.invalidPassword').addClass('customErrorInput'); | 77 | $('.invalidPassword').addClass('customErrorInput'); |
78 | }else{ | 78 | }else{ |
79 | if($scope.status == true){ | 79 | if($scope.status == true){ |
80 | $scope.user.status = 'active'; | 80 | $scope.user.status = 'active'; |
81 | }else{ | 81 | }else{ |
82 | $scope.user.status = 'inactive'; | 82 | $scope.user.status = 'inactive'; |
83 | } | 83 | } |
84 | $scope.user.username = $scope.user.email; | 84 | $scope.user.username = $scope.user.email; |
85 | $scope.user.userType = 'fbo'; | 85 | $scope.user.userType = 'fbo'; |
86 | console.log($scope.user) | 86 | console.log($scope.user) |
87 | var formdata = "companyName=" + $scope.user.companyName + "&icao=" + $scope.user.icao + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; | 87 | var formdata = "companyName=" + $scope.user.companyName + "&icao=" + $scope.user.icao + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; |
88 | FBOAdmin.registerUser(formdata).then(function(result) { | 88 | FBOAdmin.registerUser(formdata).then(function(result) { |
89 | toastr.success('Created Successfully', { | 89 | toastr.success('Created Successfully', { |
90 | closeButton: true | 90 | closeButton: true |
91 | }) | 91 | }) |
92 | $scope.feature.accountId = result; | 92 | $scope.feature.accountId = result.id; |
93 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem | 93 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem |
94 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" | 94 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" |
95 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration | 95 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration |
96 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; | 96 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; |
97 | 97 | ||
98 | FBOAdmin.featureControl(featureControlData).then(function(response) { | 98 | FBOAdmin.featureControl(featureControlData).then(function(response) { |
99 | console.log(response) | 99 | console.log(response) |
100 | 100 | ||
101 | }) | 101 | }) |
102 | $state.go('index.fboAdmin'); | 102 | $state.go('index.fboAdmin'); |
103 | }, function (err) { | 103 | }, function (err) { |
104 | toastr.error('Error in registeration', { | 104 | toastr.error('Error in registeration', { |
105 | closeButton: true | 105 | closeButton: true |
106 | }) | 106 | }) |
107 | }); | 107 | }); |
108 | } | 108 | } |
109 | /*if($scope.user.email == ''){ | 109 | /*if($scope.user.email == ''){ |
110 | toastr.error('Please enter your email first', { | 110 | toastr.error('Please enter your email first', { |
111 | closeButton: true | 111 | closeButton: true |
112 | }) | 112 | }) |
113 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 113 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
114 | toastr.error('Please enter your First Name', { | 114 | toastr.error('Please enter your First Name', { |
115 | closeButton: true | 115 | closeButton: true |
116 | }) | 116 | }) |
117 | }else{ | 117 | }else{ |
118 | if($scope.status == true){ | 118 | if($scope.status == true){ |
119 | $scope.user.status = 'active'; | 119 | $scope.user.status = 'active'; |
120 | }else{ | 120 | }else{ |
121 | $scope.user.status = 'inactive'; | 121 | $scope.user.status = 'inactive'; |
122 | } | 122 | } |
123 | $scope.user.username = $scope.user.email; | 123 | $scope.user.username = $scope.user.email; |
124 | $scope.user.userType = 'fbo'; | 124 | $scope.user.userType = 'fbo'; |
125 | console.log($scope.user) | 125 | console.log($scope.user) |
126 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; | 126 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; |
127 | FBOAdmin.registerUser(formdata).then(function(result) { | 127 | FBOAdmin.registerUser(formdata).then(function(result) { |
128 | toastr.success('Created Successfully', { | 128 | toastr.success('Created Successfully', { |
129 | closeButton: true | 129 | closeButton: true |
130 | }) | 130 | }) |
131 | $scope.feature.accountId = result; | 131 | $scope.feature.accountId = result; |
132 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem | 132 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem |
133 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" | 133 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" |
134 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration | 134 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration |
135 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; | 135 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; |
136 | 136 | ||
137 | FBOAdmin.featureControl(featureControlData).then(function(response) { | 137 | FBOAdmin.featureControl(featureControlData).then(function(response) { |
138 | console.log(response) | 138 | console.log(response) |
139 | 139 | ||
140 | }) | 140 | }) |
141 | $state.go('index.fboAdmin'); | 141 | $state.go('index.fboAdmin'); |
142 | }, function (err) { | 142 | }, function (err) { |
143 | toastr.error('Error in registeration', { | 143 | toastr.error('Error in registeration', { |
144 | closeButton: true | 144 | closeButton: true |
145 | }) | 145 | }) |
146 | }); | 146 | }); |
147 | }*/ | 147 | }*/ |
148 | 148 | ||
149 | } | 149 | } |
150 | 150 | ||
151 | $scope.enableEssId = function(){ | 151 | $scope.enableEssId = function(){ |
152 | if($scope.feature.essintaPosSystem == true){ | 152 | if($scope.feature.essintaPosSystem == true){ |
153 | $scope.essAccountId = false; | 153 | $scope.essAccountId = false; |
154 | $("#esAccId").css({ opacity: 1 }); | 154 | $("#esAccId").css({ opacity: 1 }); |
155 | }else{ | 155 | }else{ |
156 | $scope.essAccountId = true; | 156 | $scope.essAccountId = true; |
157 | delete $scope.feature.essintaAccountUid; | 157 | delete $scope.feature.essintaAccountUid; |
158 | $("#esAccId").css({ opacity: 0.5 }); | 158 | $("#esAccId").css({ opacity: 0.5 }); |
159 | } | 159 | } |
160 | } | 160 | } |
161 | 161 | ||
162 | }); | 162 | }); |
app/views/fbo-flight/flight.html
1 | <style> | 1 | <style> |
2 | .button1 { | 2 | .button1 { |
3 | display: inline-block; | 3 | display: inline-block; |
4 | height: 35px; | 4 | height: 35px; |
5 | line-height: 35px; | 5 | line-height: 35px; |
6 | padding-right: 15px; | 6 | padding-right: 15px; |
7 | padding-left: 50px; | 7 | padding-left: 50px; |
8 | position: relative; | 8 | position: relative; |
9 | background-color:rgb(41,127,184); | 9 | background-color:rgb(41,127,184); |
10 | color:rgb(255,255,255); | 10 | color:rgb(255,255,255); |
11 | text-decoration: none; | 11 | text-decoration: none; |
12 | text-transform: uppercase; | 12 | text-transform: uppercase; |
13 | letter-spacing: 1px; | 13 | letter-spacing: 1px; |
14 | margin-bottom: 15px; | 14 | margin-bottom: 15px; |
15 | border: 0; | 15 | border: 0; |
16 | 16 | ||
17 | 17 | ||
18 | border-radius: 5px; | 18 | border-radius: 5px; |
19 | -moz-border-radius: 5px; | 19 | -moz-border-radius: 5px; |
20 | -webkit-border-radius: 5px; | 20 | -webkit-border-radius: 5px; |
21 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); | 21 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); |
22 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | 22 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; |
23 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | 23 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); |
24 | 24 | ||
25 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 25 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
26 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 26 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
27 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 27 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
28 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | 28 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; |
29 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | 29 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); |
30 | } | 30 | } |
31 | 31 | ||
32 | .button1 span { | 32 | .button1 span { |
33 | position: absolute; | 33 | position: absolute; |
34 | left: 0; | 34 | left: 0; |
35 | top: 0; | 35 | top: 0; |
36 | width: 35px; | 36 | width: 35px; |
37 | background-color:rgba(0,0,0,0.5); | 37 | background-color:rgba(0,0,0,0.5); |
38 | 38 | ||
39 | -webkit-border-top-left-radius: 5px; | 39 | -webkit-border-top-left-radius: 5px; |
40 | -webkit-border-bottom-left-radius: 5px; | 40 | -webkit-border-bottom-left-radius: 5px; |
41 | -moz-border-radius-topleft: 5px; | 41 | -moz-border-radius-topleft: 5px; |
42 | -moz-border-radius-bottomleft: 5px; | 42 | -moz-border-radius-bottomleft: 5px; |
43 | border-top-left-radius: 5px; | 43 | border-top-left-radius: 5px; |
44 | border-bottom-left-radius: 5px; | 44 | border-bottom-left-radius: 5px; |
45 | border-right: 1px solid rgba(0,0,0,0.15); | 45 | border-right: 1px solid rgba(0,0,0,0.15); |
46 | } | 46 | } |
47 | 47 | ||
48 | .button1:hover span, .button1.active span { | 48 | .button1:hover span, .button1.active span { |
49 | background-color:rgb(0,102,26); | 49 | background-color:rgb(0,102,26); |
50 | border-right: 1px solid rgba(0,0,0,0.3); | 50 | border-right: 1px solid rgba(0,0,0,0.3); |
51 | } | 51 | } |
52 | 52 | ||
53 | .button1:active { | 53 | .button1:active { |
54 | margin-top: 2px; | 54 | margin-top: 2px; |
55 | margin-bottom: 13px; | 55 | margin-bottom: 13px; |
56 | 56 | ||
57 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 57 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
58 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 58 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
59 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 59 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
60 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | 60 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; |
61 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | 61 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); |
62 | } | 62 | } |
63 | 63 | ||
64 | .button1.turquoise { | 64 | .button1.turquoise { |
65 | background: #449d44; | 65 | background: #449d44; |
66 | } | 66 | } |
67 | 67 | ||
68 | .customErrorMessage{ | 68 | .customErrorMessage{ |
69 | color: #8a1f11; | 69 | color: #8a1f11; |
70 | font-weight: bold; | 70 | font-weight: bold; |
71 | } | 71 | } |
72 | .customErrorInput{ | 72 | .customErrorInput{ |
73 | background-color: rgb(251, 227, 228); | 73 | background-color: rgb(251, 227, 228); |
74 | border: 1px solid #fbc2c4; | 74 | border: 1px solid #fbc2c4; |
75 | color: #8a1f11; | 75 | color: #8a1f11; |
76 | } | 76 | } |
77 | .redAstrick{ | 77 | .redAstrick{ |
78 | color: #8a1f11; | 78 | color: #8a1f11; |
79 | margin: 0 1px; | 79 | margin: 0 1px; |
80 | } | 80 | } |
81 | 81 | ||
82 | </style> | 82 | </style> |
83 | <div class="row wrapper border-bottom white-bg page-heading"> | 83 | <div class="row wrapper border-bottom white-bg page-heading"> |
84 | <div class="col-lg-8"> | 84 | <div class="col-lg-8"> |
85 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> --> | 85 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> --> |
86 | <div style="margin-top: 20px;"> | 86 | <div style="margin-top: 20px;"> |
87 | <input type="text" style="width:50%; float: left;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control companyNameError" ng-keyup="companyNameValid()"> | 87 | <input type="text" style="width:50%; float: left;" placeholder="Enter Company Name" ng-model="user.companyName" uib-typeahead="company.companyName for company in compNameList | filter:$viewValue | limitTo:8" class="form-control companyNameError"> |
88 | |||
88 | <span class="redAstrick" style="margin: 0 5px;">*</span> | 89 | <span class="redAstrick" style="margin: 0 5px;">*</span> |
89 | <label class="customErrorMessage" ng-show="comnayNameInvalid" style="margin-top: 7px;">This field is required.</label> | 90 | <label class="customErrorMessage" ng-show="comnayNameInvalid" style="margin-top: 7px;">This field is required.</label> |
90 | <div class="clearfix"></div> | 91 | <div class="clearfix"></div> |
91 | </div> | 92 | </div> |
92 | </div> | 93 | </div> |
93 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> | 94 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> |
94 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> | 95 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> |
95 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> | 96 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> |
96 | </div> | 97 | </div> |
97 | </div> | 98 | </div> |
98 | <div class="wrapper wrapper-content animated fadeInRight"> | 99 | <div class="wrapper wrapper-content animated fadeInRight"> |
99 | <div class="row"> | 100 | <div class="row"> |
100 | <div class="col-lg-7"> | 101 | <div class="col-lg-7"> |
101 | <div class="ibox float-e-margins"> | 102 | <div class="ibox float-e-margins"> |
102 | <div class="ibox-title"> | 103 | <div class="ibox-title"> |
103 | <div class="pull-left"> | 104 | <div class="pull-left"> |
104 | <h5>Contact Information</h5> | 105 | <h5>Contact Information</h5> |
105 | </div> | 106 | </div> |
106 | <div class="pull-right my-toggle-switch"> | 107 | <div class="pull-right my-toggle-switch"> |
107 | <div class="switch"> | 108 | <div class="switch"> |
108 | <div class="onoffswitch"> | 109 | <div class="onoffswitch"> |
109 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> | 110 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> |
110 | <label class="onoffswitch-label" for="example1"> | 111 | <label class="onoffswitch-label" for="example1"> |
111 | <span class="onoffswitch-inner"></span> | 112 | <span class="onoffswitch-inner"></span> |
112 | <span class="onoffswitch-switch"></span> | 113 | <span class="onoffswitch-switch"></span> |
113 | </label> | 114 | </label> |
114 | </div> | 115 | </div> |
115 | </div> | 116 | </div> |
116 | </div> | 117 | </div> |
117 | <div class="clearfix"></div> | 118 | <div class="clearfix"></div> |
118 | </div> | 119 | </div> |
119 | <div class="ibox-content"> | 120 | <div class="ibox-content"> |
120 | <div class="row"> | 121 | <div class="row"> |
121 | <form role="form"> | 122 | <form role="form"> |
122 | <div class="col-sm-6 b-r"> | 123 | <div class="col-sm-6 b-r"> |
123 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> | 124 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> |
124 | <div class="form-group"> | 125 | <div class="form-group"> |
125 | <label>Email Username <span class="redAstrick">*</span></label> | 126 | <label>Email Username <span class="redAstrick">*</span></label> |
126 | <label class="customErrorMessage" ng-show="emailInvalid">This field is required.</label> | 127 | <label class="customErrorMessage" ng-show="emailInvalid">This field is required.</label> |
127 | <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control emailIdError" ng-blur="checkUsername()" ng-keyup="emailValid()"> | 128 | <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control emailIdError" ng-blur="checkUsername()" ng-keyup="emailValid()"> |
128 | </div> | 129 | </div> |
129 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> | 130 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> |
130 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> | 131 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
131 | <!-- <div> | 132 | <!-- <div> |
132 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> | 133 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> |
133 | <label> <input type="checkbox" class="i-checks"> Remember me </label> | 134 | <label> <input type="checkbox" class="i-checks"> Remember me </label> |
134 | </div> --> | 135 | </div> --> |
135 | 136 | ||
136 | </div> | 137 | </div> |
137 | <div class="col-sm-6"> | 138 | <div class="col-sm-6"> |
138 | <div class="form-group"> | 139 | <div class="form-group"> |
139 | <label>Password <span class="redAstrick" style="margin: 0 5px;">*</span></label> | 140 | <label>Password <span class="redAstrick" style="margin: 0 5px;">*</span></label> |
140 | <label class="customErrorMessage" ng-show="passwordInvalid">This field is required.</label> | 141 | <label class="customErrorMessage" ng-show="passwordInvalid">This field is required.</label> |
141 | <input type="password" ng-model="user.password" placeholder="Password" class="form-control invalidPassword" ng-keyup="passwordValid()"> | 142 | <input type="password" ng-model="user.password" placeholder="Password" class="form-control invalidPassword" ng-keyup="passwordValid()"> |
142 | </div> | 143 | </div> |
143 | <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div> | 144 | <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div> |
144 | <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> | 145 | <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> |
145 | </div> | 146 | </div> |
146 | </form> | 147 | </form> |
147 | </div> | 148 | </div> |
148 | </div> | 149 | </div> |
149 | </div> | 150 | </div> |
150 | </div> | 151 | </div> |
151 | <div class="col-lg-5"> | 152 | <div class="col-lg-5"> |
152 | <div class="ibox float-e-margins"> | 153 | <div class="ibox float-e-margins"> |
153 | <div class="ibox-title"> | 154 | <div class="ibox-title"> |
154 | <h5>Client Notes</h5> | 155 | <h5>Client Notes</h5> |
155 | 156 | ||
156 | </div> | 157 | </div> |
157 | <div class="ibox-content"> | 158 | <div class="ibox-content"> |
158 | <div class="row"> | 159 | <div class="row"> |
159 | <form role="form"> | 160 | <form role="form"> |
160 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> | 161 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> |
161 | </form> | 162 | </form> |
162 | </div> | 163 | </div> |
163 | </div> | 164 | </div> |
164 | 165 | ||
165 | </div> | 166 | </div> |
166 | </div> | 167 | </div> |
167 | </div> | 168 | </div> |
168 | </div> | 169 | </div> |
169 | 170 | ||
170 | <div> | 171 | <div> |
171 | <div class="row"> | 172 | <div class="row"> |
172 | <div class="col-lg-7"> | 173 | <div class="col-lg-7"> |
173 | <div class="ibox float-e-margins"> | 174 | <div class="ibox float-e-margins"> |
174 | <div class="ibox-title"> | 175 | <div class="ibox-title"> |
175 | <h5>Aircraft List</h5> | 176 | <h5>Aircraft List</h5> |
176 | <!-- <div class="pull-right"> | 177 | <!-- <div class="pull-right"> |
177 | <button type="button" class="btn btn-primary btn-sm" ng-click="openModal()">+ Add</button> | 178 | <button type="button" class="btn btn-primary btn-sm" ng-click="openModal()">+ Add</button> |
178 | </div> | 179 | </div> |
179 | <div class="clearfix"></div> | 180 | <div class="clearfix"></div> |
180 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> | 181 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> |
181 | <div class="modal-dialog"> | 182 | <div class="modal-dialog"> |
182 | <div class="modal-content animated fadeIn"> | 183 | <div class="modal-content animated fadeIn"> |
183 | <div class="modal-header"> | 184 | <div class="modal-header"> |
184 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | 185 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
185 | <h4 class="modal-title">Add Aircraft</h4> | 186 | <h4 class="modal-title">Add Aircraft</h4> |
186 | </div> | 187 | </div> |
187 | <div class="modal-body" style="padding: 15px;"> | 188 | <div class="modal-body" style="padding: 15px;"> |
188 | <table class="table table-bordered table-hover table-striped"> | 189 | <table class="table table-bordered table-hover table-striped"> |
189 | <thead> | 190 | <thead> |
190 | <tr> | 191 | <tr> |
191 | <th>Tail</th> | 192 | <th>Tail</th> |
192 | <th>Make</th> | 193 | <th>Make</th> |
193 | <th>Model</th> | 194 | <th>Model</th> |
194 | <th>Size</th> | 195 | <th>Size</th> |
195 | </tr> | 196 | </tr> |
196 | </thead> | 197 | </thead> |
197 | <tbody> | 198 | <tbody> |
198 | <tr> | 199 | <tr> |
199 | <td> | 200 | <td> |
200 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | 201 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> |
201 | </td> | 202 | </td> |
202 | <td style="width: 30%"> | 203 | <td style="width: 30%"> |
203 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | 204 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> |
204 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 205 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
205 | </select> | 206 | </select> |
206 | </td> | 207 | </td> |
207 | <td style="width: 30%"> | 208 | <td style="width: 30%"> |
208 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | 209 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> |
209 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | 210 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
210 | </select> | 211 | </select> |
211 | </td> | 212 | </td> |
212 | <td style="width: 30%"> | 213 | <td style="width: 30%"> |
213 | <select class="form-control" ng-model="aircraft.size"> | 214 | <select class="form-control" ng-model="aircraft.size"> |
214 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> | 215 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> |
215 | </select> | 216 | </select> |
216 | </td> | 217 | </td> |
217 | </tr> | 218 | </tr> |
218 | </tbody> | 219 | </tbody> |
219 | </table> | 220 | </table> |
220 | </div> | 221 | </div> |
221 | <div class="modal-footer"> | 222 | <div class="modal-footer"> |
222 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> | 223 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> |
223 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> | 224 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> |
224 | </div> | 225 | </div> |
225 | </div> | 226 | </div> |
226 | </div> | 227 | </div> |
227 | </div> --> | 228 | </div> --> |
228 | </div> | 229 | </div> |
229 | <div class="ibox-content"> | 230 | <div class="ibox-content"> |
230 | <div class="table-responsive"> | 231 | <div class="table-responsive"> |
231 | <!-- <table class="table table-bordered table-hover table-striped"> | 232 | <!-- <table class="table table-bordered table-hover table-striped"> |
232 | <thead> | 233 | <thead> |
233 | <tr> | 234 | <tr> |
234 | <th>Tail</th> | 235 | <th>Tail</th> |
235 | <th>Make</th> | 236 | <th>Make</th> |
236 | <th>Model</th> | 237 | <th>Model</th> |
237 | <th>Size</th> | 238 | <th>Size</th> |
238 | </tr> | 239 | </tr> |
239 | </thead> | 240 | </thead> |
240 | <tbody> | 241 | <tbody> |
241 | <tr ng-repeat="airData in getCraftList track by $index"> | 242 | <tr ng-repeat="airData in getCraftList track by $index"> |
242 | <td> | 243 | <td> |
243 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> | 244 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> |
244 | </td> | 245 | </td> |
245 | <td> | 246 | <td> |
246 | <select class="form-control" ng-model="airData.make"> | 247 | <select class="form-control" ng-model="airData.make"> |
247 | <option>{{airData.make}}</option> | 248 | <option>{{airData.make}}</option> |
248 | </select> | 249 | </select> |
249 | </td> | 250 | </td> |
250 | <td> | 251 | <td> |
251 | <select class="form-control" ng-model="airData.model"> | 252 | <select class="form-control" ng-model="airData.model"> |
252 | <option>{{airData.model}}</option> | 253 | <option>{{airData.model}}</option> |
253 | </select> | 254 | </select> |
254 | </td> | 255 | </td> |
255 | <td> | 256 | <td> |
256 | <select class="form-control" ng-model="airData.size"> | 257 | <select class="form-control" ng-model="airData.size"> |
257 | <option>{{airData.size}}</option> | 258 | <option>{{airData.size}}</option> |
258 | </select> | 259 | </select> |
259 | </td> | 260 | </td> |
260 | </tr> | 261 | </tr> |
261 | </tbody> | 262 | </tbody> |
262 | </table> --> | 263 | </table> --> |
263 | <table class="table table-striped table-bordered"> | 264 | <table class="table table-striped table-bordered"> |
264 | <thead> | 265 | <thead> |
265 | <tr> | 266 | <tr> |
266 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | 267 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> |
267 | <th>Tail</th> | 268 | <th>Tail</th> |
268 | <th>Make</th> | 269 | <th>Make</th> |
269 | <th>Model</th> | 270 | <th>Model</th> |
270 | <th>Size</th> | 271 | <th>Size</th> |
271 | </tr> | 272 | </tr> |
272 | </thead> | 273 | </thead> |
273 | <tbody> | 274 | <tbody> |
274 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | 275 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> |
275 | <!-- <td> | 276 | <!-- <td> |
276 | <input type="checkbox" ng-model="aircraftData.selected"/> | 277 | <input type="checkbox" ng-model="aircraftData.selected"/> |
277 | </td> --> | 278 | </td> --> |
278 | <td style="width: 20%"> | 279 | <td style="width: 20%"> |
279 | <input type="text" class="form-control" ng-model="aircraftData.tail" required/> | 280 | <input type="text" class="form-control" ng-model="aircraftData.tail" required/> |
280 | </td> | 281 | </td> |
281 | <td style="width: 20%"> | 282 | <td style="width: 20%"> |
282 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | 283 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> |
283 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 284 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
284 | </select> | 285 | </select> |
285 | </td> | 286 | </td> |
286 | <td style="width: 20%"> | 287 | <td style="width: 20%"> |
287 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | 288 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> |
288 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> | 289 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> |
289 | </select> | 290 | </select> |
290 | </td> | 291 | </td> |
291 | <td style="width: 20%"> | 292 | <td style="width: 20%"> |
292 | <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> | 293 | <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> |
293 | <!-- <select class="form-control" ng-model="aircraftData.size"> | 294 | <!-- <select class="form-control" ng-model="aircraftData.size"> |
294 | <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | 295 | <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> |
295 | </select> --> | 296 | </select> --> |
296 | </td> | 297 | </td> |
297 | </tr> | 298 | </tr> |
298 | </tbody> | 299 | </tbody> |
299 | </table> | 300 | </table> |
300 | </div> | 301 | </div> |
301 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | 302 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> |
302 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | 303 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> |
303 | </div> | 304 | </div> |
304 | <div class="clearfix"></div> | 305 | <div class="clearfix"></div> |
305 | </div> | 306 | </div> |
306 | </div> | 307 | </div> |
307 | </div> | 308 | </div> |
308 | <div class="col-lg-5"> | 309 | <div class="col-lg-5"> |
309 | <div class="ibox float-e-margins"> | 310 | <div class="ibox float-e-margins"> |
310 | <div class="ibox-title"> | 311 | <div class="ibox-title"> |
311 | <h5>Account Authenticatio & Payment Method</h5> | 312 | <h5>Account Authentication & Payment Method</h5> |
312 | 313 | ||
313 | </div> | 314 | </div> |
314 | <div class="ibox-content"> | 315 | <div class="ibox-content"> |
315 | <!-- <div class="row"> | 316 | <!-- <div class="row"> |
316 | <div class="col-md-3"> | 317 | <div class="col-md-3"> |
317 | <img src="images/master.png"> | 318 | <img src="images/master.png"> |
318 | </div> | 319 | </div> |
319 | <div class="col-md-9"> | 320 | <div class="col-md-9"> |
320 | <div class="col"> | 321 | <div class="col"> |
321 | <span style="font-size: large; color: #909394;">**** **** **** 7002</span> | 322 | <span style="font-size: large; color: #909394;">**** **** **** 7002</span> |
322 | </div> | 323 | </div> |
323 | <div class="col"> | 324 | <div class="col"> |
324 | <span><strong>Expiry Date:</strong>10/16</span> | 325 | <span><strong>Expiry Date:</strong>10/16</span> |
325 | </div> | 326 | </div> |
326 | </div> | 327 | </div> |
327 | <div class="clearfix"></div> | 328 | <div class="clearfix"></div> |
328 | <br> | 329 | <br> |
329 | 330 | ||
330 | <div class="col-md-3"> | 331 | <div class="col-md-3"> |
331 | <img src="images/visa1.png"> | 332 | <img src="images/visa1.png"> |
332 | </div> | 333 | </div> |
333 | <div class="col-md-9"> | 334 | <div class="col-md-9"> |
334 | <div class="col"> | 335 | <div class="col"> |
335 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> | 336 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> |
336 | </div> | 337 | </div> |
337 | <div class="col"> | 338 | <div class="col"> |
338 | <span><strong>Expiry Date:</strong>10/16</span> | 339 | <span><strong>Expiry Date:</strong>10/16</span> |
339 | </div> | 340 | </div> |
340 | </div> | 341 | </div> |
341 | <div class="clearfix"></div> | 342 | <div class="clearfix"></div> |
342 | </div> --> | 343 | </div> --> |
343 | 344 | ||
344 | 345 | ||
345 | <div class="row"> | 346 | <div class="row"> |
346 | 347 | ||
347 | <!-- <form name="myForm"> | 348 | <!-- <form name="myForm"> |
348 | 349 | ||
349 | <div class="span3"> | 350 | <div class="span3"> |
350 | <label for="">Card number</label> | 351 | <label for="">Card number</label> |
351 | <input type="text" class="form-control" ng-model="number"> | 352 | <input type="text" class="form-control" ng-model="number"> |
352 | </div> | 353 | </div> |
353 | 354 | ||
354 | <div class="span3"> | 355 | <div class="span3"> |
355 | <label for="">Name on card </label> | 356 | <label for="">Name on card </label> |
356 | <input type="text" class="form-control"> | 357 | <input type="text" class="form-control"> |
357 | </div> | 358 | </div> |
358 | 359 | ||
359 | <div class="row"> | 360 | <div class="row"> |
360 | <div class="col-sm-6"> | 361 | <div class="col-sm-6"> |
361 | <label for="">Expiry</label> | 362 | <label for="">Expiry</label> |
362 | <input type="text" class="form-control" ng-model="expiry"> | 363 | <input type="text" class="form-control" ng-model="expiry"> |
363 | </div> | 364 | </div> |
364 | 365 | ||
365 | <div class="col-sm-6"> | 366 | <div class="col-sm-6"> |
366 | <label for="">CVV</label> | 367 | <label for="">CVV</label> |
367 | <input type="text" class="form-control" ng-model="cvc"> | 368 | <input type="text" class="form-control" ng-model="cvc"> |
368 | </div> | 369 | </div> |
369 | </div> | 370 | </div> |
370 | <div class="span4"> | 371 | <div class="span4"> |
371 | <button type="submit" class="btn btn-primary btn-large">Add</button> | 372 | <button type="submit" class="btn btn-primary btn-large">Add</button> |
372 | </div> | 373 | </div> |
373 | 374 | ||
374 | </form> --> | 375 | </form> --> |
375 | 376 | ||
376 | <div class="container"> | 377 | <div class="container"> |
377 | <div class="row"> | 378 | <div class="row"> |
378 | <div class="col-xs-12 col-md-4"> | 379 | <div class="col-xs-12 col-md-4"> |
379 | <div class="panel panel-default credit-card-box"> | 380 | <div class="panel panel-default credit-card-box"> |
380 | <div class="panel-heading display-table" > | 381 | <div class="panel-heading display-table" > |
381 | <div class="row display-tr" > | 382 | <div class="row display-tr" > |
382 | <h3 class="panel-title display-td" >Payment Details</h3> | 383 | <h3 class="panel-title display-td" >Payment Details</h3> |
383 | <div class="display-td" > | 384 | <div class="display-td" > |
384 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> | 385 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> |
385 | </div> | 386 | </div> |
386 | </div> | 387 | </div> |
387 | </div> | 388 | </div> |
388 | <div class="panel-body"> | 389 | <div class="panel-body"> |
389 | <form role="form" id="payment-form"> | 390 | <form role="form" id="payment-form"> |
390 | <div class="row"> | 391 | <div class="row"> |
391 | <div class="col-xs-12"> | 392 | <div class="col-xs-12"> |
392 | <div class="form-group"> | 393 | <div class="form-group"> |
393 | <label for="cardNumber">CARD NUMBER</label> | 394 | <label for="cardNumber">CARD NUMBER</label> |
394 | <div class="input-group"> | 395 | <div class="input-group"> |
395 | <input type="number" ng-model="data.cardNumber" maxlength="16" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardNumber" placeholder="Valid Card Number" autocomplete="cc-number" required autofocus> | 396 | <input type="number" ng-model="data.cardNumber" maxlength="16" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardNumber" placeholder="Valid Card Number" autocomplete="cc-number" required autofocus> |
396 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> | 397 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> |
397 | </div> | 398 | </div> |
398 | </div> | 399 | </div> |
399 | </div> | 400 | </div> |
400 | </div> | 401 | </div> |
401 | <div class="row"> | 402 | <div class="row"> |
402 | <div class="col-xs-7 col-md-7"> | 403 | <div class="col-xs-7 col-md-7"> |
403 | <div class="form-group"> | 404 | <div class="form-group"> |
404 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> | 405 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> |
405 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" | 406 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" |
406 | required> | 407 | required> |
407 | </div> | 408 | </div> |
408 | </div> | 409 | </div> |
409 | <div class="col-xs-5 col-md-5 pull-right"> | 410 | <div class="col-xs-5 col-md-5 pull-right"> |
410 | <div class="form-group"> | 411 | <div class="form-group"> |
411 | <label for="cardCVC">CVV CODE</label> | 412 | <label for="cardCVC">CVV CODE</label> |
412 | <input type="number" maxlength="3" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardCVC" placeholder="CVC" autocomplete="cc-csc" | 413 | <input type="number" maxlength="3" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardCVC" placeholder="CVC" autocomplete="cc-csc" |
413 | required> | 414 | required> |
414 | </div> | 415 | </div> |
415 | </div> | 416 | </div> |
416 | </div> | 417 | </div> |
417 | <div class="row"> | 418 | <div class="row"> |
418 | <div class="col-xs-12"> | 419 | <div class="col-xs-12"> |
419 | <div class="form-group"> | 420 | <div class="form-group"> |
420 | <label for="name">Card Type</label> | 421 | <label for="name">Card Type</label> |
421 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> | 422 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> |
422 | <option value="creditCard" selected>Credit Card</option> | 423 | <option value="creditCard" selected>Credit Card</option> |
423 | <option value="debitCard">Debit Card</option> | 424 | <option value="debitCard">Debit Card</option> |
424 | </select> | 425 | </select> |
425 | </div> | 426 | </div> |
426 | </div> | 427 | </div> |
427 | </div> | 428 | </div> |
428 | <div class="row"> | 429 | <div class="row"> |
429 | <div class="col-xs-12"> | 430 | <div class="col-xs-12"> |
430 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="addCard()">Add</button> | 431 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="addCard()">Add</button> |
431 | </div> | 432 | </div> |
432 | </div> | 433 | </div> |
433 | <div class="row" style="display:none;"> | 434 | <div class="row" style="display:none;"> |
434 | <div class="col-xs-12"> | 435 | <div class="col-xs-12"> |
435 | <p class="payment-errors"></p> | 436 | <p class="payment-errors"></p> |
436 | </div> | 437 | </div> |
437 | </div> | 438 | </div> |
438 | </form> | 439 | </form> |
439 | </div> | 440 | </div> |
440 | </div> | 441 | </div> |
441 | </div> | 442 | </div> |
442 | </div> | 443 | </div> |
443 | </div> | 444 | </div> |
444 | </div> | 445 | </div> |
445 | </div> | 446 | </div> |
446 | </div> | 447 | </div> |
447 | </div> | 448 | </div> |
448 | </div> | 449 | </div> |
449 | </div> | 450 | </div> |
450 | </div> | 451 | </div> |
451 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> | 452 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> |
app/views/fbo-flight/flightDept.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('FlightDeptController', function ($scope, $uibModal, $state, FBOFlight, FBOAdmin) { | 6 | .controller('FlightDeptController', function ($scope, $uibModal, $state, FBOFlight, FBOAdmin) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.fboflight').addClass('active'); | 8 | $('.fboflight').addClass('active'); |
9 | }); | 9 | }); |
10 | $scope.data = {}; | 10 | $scope.data = {}; |
11 | $scope.user = {}; | 11 | $scope.user = {}; |
12 | $scope.aircraft = {}; | 12 | $scope.aircraft = {}; |
13 | $scope.user.companyName = ''; | 13 | $scope.user.companyName = ''; |
14 | $scope.user.email = ''; | 14 | $scope.user.email = ''; |
15 | $scope.user.password = ''; | 15 | $scope.user.password = ''; |
16 | 16 | ||
17 | $scope.checkUsername = function(){ | 17 | $scope.checkUsername = function(){ |
18 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | 18 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { |
19 | console.log(status) | 19 | console.log(status) |
20 | if(status != 200){ | 20 | if(status != 200){ |
21 | toastr.error('This email has alreay taken', { | 21 | toastr.error('This email has alreay taken', { |
22 | closeButton: true | 22 | closeButton: true |
23 | }) | 23 | }) |
24 | } | 24 | } |
25 | }) | 25 | }) |
26 | } | 26 | } |
27 | 27 | ||
28 | $scope.comnayNameInvalid = false; | 28 | $scope.comnayNameInvalid = false; |
29 | $scope.emailInvalid = false; | 29 | $scope.emailInvalid = false; |
30 | $scope.passwordInvalid = false; | 30 | $scope.passwordInvalid = false; |
31 | 31 | ||
32 | $scope.companyNameValid = function(){ | 32 | $scope.companyNameValid = function(){ |
33 | $scope.comnayNameInvalid = false; | 33 | $scope.comnayNameInvalid = false; |
34 | $('.companyNameError').removeClass('customErrorInput'); | 34 | $('.companyNameError').removeClass('customErrorInput'); |
35 | } | 35 | } |
36 | $scope.emailValid = function(){ | 36 | $scope.emailValid = function(){ |
37 | $scope.emailInvalid = false; | 37 | $scope.emailInvalid = false; |
38 | $('.emailIdError').removeClass('customErrorInput'); | 38 | $('.emailIdError').removeClass('customErrorInput'); |
39 | } | 39 | } |
40 | $scope.passwordValid = function(){ | 40 | $scope.passwordValid = function(){ |
41 | $scope.passwordInvalid = false; | 41 | $scope.passwordInvalid = false; |
42 | $('.invalidPassword').removeClass('customErrorInput'); | 42 | $('.invalidPassword').removeClass('customErrorInput'); |
43 | } | 43 | } |
44 | 44 | ||
45 | $scope.userData = function(){ | 45 | $scope.userData = function(){ |
46 | 46 | ||
47 | if ($scope.user.companyName == '') { | 47 | if ($scope.user.companyName == '') { |
48 | $scope.comnayNameInvalid = true; | 48 | $scope.comnayNameInvalid = true; |
49 | $('.companyNameError').addClass('customErrorInput'); | 49 | $('.companyNameError').addClass('customErrorInput'); |
50 | }else if ($scope.user.email == '') { | 50 | }else if ($scope.user.email == '') { |
51 | $scope.emailInvalid = true; | 51 | $scope.emailInvalid = true; |
52 | $('.emailIdError').addClass('customErrorInput'); | 52 | $('.emailIdError').addClass('customErrorInput'); |
53 | }else if ($scope.user.password == '') { | 53 | }else if ($scope.user.password == '') { |
54 | $scope.passwordInvalid = true; | 54 | $scope.passwordInvalid = true; |
55 | $('.invalidPassword').addClass('customErrorInput'); | 55 | $('.invalidPassword').addClass('customErrorInput'); |
56 | }else{ | 56 | }else{ |
57 | if($scope.status == true){ | 57 | if($scope.status == true){ |
58 | $scope.user.status = 'active'; | 58 | $scope.user.status = 'active'; |
59 | }else{ | 59 | }else{ |
60 | $scope.user.status = 'inactive'; | 60 | $scope.user.status = 'inactive'; |
61 | } | 61 | } |
62 | $scope.user.username = $scope.user.email; | 62 | $scope.user.username = $scope.user.email; |
63 | $scope.user.userType = 'flightDetp'; | 63 | $scope.user.userType = 'flightDetp'; |
64 | console.log($scope.user) | 64 | console.log($scope.user) |
65 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; | 65 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; |
66 | FBOFlight.registerUser(formdata).then(function(result) { | 66 | FBOFlight.registerUser(formdata).then(function(result) { |
67 | $scope.registerId = result; | 67 | $scope.registerId = result.id; |
68 | $scope.companyId = result.companyId; | ||
68 | $scope.data.accountId = $scope.registerId; | 69 | $scope.data.accountId = $scope.registerId; |
69 | $scope.aircraft.accountId = $scope.registerId; | 70 | $scope.aircraft.accountId = $scope.companyId; |
70 | if($scope.aircraft.accountId == $scope.registerId){ | 71 | if($scope.aircraft.accountId == $scope.companyId){ |
71 | $scope.saveCompanyData(); | 72 | $scope.saveCompanyData(); |
72 | } | 73 | } |
73 | toastr.success('Created Successfully', { | 74 | toastr.success('Created Successfully', { |
74 | closeButton: true | 75 | closeButton: true |
75 | }) | 76 | }) |
76 | $state.go('index.flightDept'); | 77 | $state.go('index.flightDept'); |
77 | }, function (err) { | 78 | }, function (err) { |
78 | toastr.error('Error in registeration', { | 79 | toastr.error('Error in registeration', { |
79 | closeButton: true | 80 | closeButton: true |
80 | }) | 81 | }) |
81 | }); | 82 | }); |
82 | } | 83 | } |
83 | } | 84 | } |
84 | 85 | ||
85 | $scope.data.cardType = 'creditCard'; | 86 | $scope.data.cardType = 'creditCard'; |
86 | var cardData = {} | 87 | var cardData = {} |
87 | cardData.paymentMethodList = []; | 88 | cardData.paymentMethodList = []; |
88 | $scope.addCard = function(){ | 89 | $scope.addCard = function(){ |
89 | if($scope.aircraft.accountId == undefined){ | 90 | if($scope.aircraft.accountId == undefined){ |
90 | toastr.error('Please Add Contact Information', { | 91 | toastr.error('Please Add Contact Information', { |
91 | closeButton: true | 92 | closeButton: true |
92 | }) | 93 | }) |
93 | }else{ | 94 | }else{ |
94 | cardData.paymentMethodList.push($scope.data); | 95 | cardData.paymentMethodList.push($scope.data); |
95 | console.log("cardData", cardData); | 96 | console.log("cardData", cardData); |
96 | FBOFlight.addCardInformation(cardData).then(function(result) { | 97 | FBOFlight.addCardInformation(cardData).then(function(result) { |
97 | console.log(result) | 98 | console.log(result) |
98 | toastr.success('Created Successfully', { | 99 | toastr.success('Created Successfully', { |
99 | closeButton: true | 100 | closeButton: true |
100 | }) | 101 | }) |
101 | }) | 102 | }) |
102 | } | 103 | } |
103 | 104 | ||
104 | } | 105 | } |
105 | 106 | ||
106 | getData(); | 107 | getData(); |
107 | function getData(){ | 108 | function getData(){ |
108 | FBOFlight.getAircraftMake().then(function(result) { | 109 | FBOFlight.getAircraftMake().then(function(result) { |
109 | $scope.aircraftMakeList = result; | 110 | $scope.aircraftMakeList = result; |
110 | }) | 111 | }) |
111 | } | 112 | } |
112 | 113 | ||
113 | $scope.aircraftDetails = [{ | 114 | $scope.aircraftDetails = [{ |
114 | 'tail':'', | 115 | 'tail':'', |
115 | 'make': '', | 116 | 'make': '', |
116 | 'model': '', | 117 | 'model': '', |
117 | 'sizeId' : '' | 118 | 'sizeId' : '' |
118 | }]; | 119 | }]; |
119 | 120 | ||
120 | $scope.addNew = function(){ | 121 | $scope.addNew = function(){ |
121 | $scope.aircraftDetails.push({ | 122 | $scope.aircraftDetails.push({ |
122 | 'tail':'', | 123 | 'tail':'', |
123 | 'make': '', | 124 | 'make': '', |
124 | 'model': '', | 125 | 'model': '', |
125 | 'sizeId' : '' | 126 | 'sizeId' : '' |
126 | }); | 127 | }); |
127 | console.log($scope.aircraftDetails) | 128 | console.log($scope.aircraftDetails) |
128 | }; | 129 | }; |
129 | 130 | ||
130 | $scope.getModal = function(makeId, index){ | 131 | $scope.getModal = function(makeId, index){ |
131 | $scope.aircraft.make = makeId; | 132 | $scope.aircraft.make = makeId; |
132 | //var makeId = makeId; | 133 | //var makeId = makeId; |
133 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 134 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
134 | $scope.aircraftDetails[index].aircraftModalList = result; | 135 | $scope.aircraftDetails[index].aircraftModalList = result; |
135 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | 136 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; |
136 | }) | 137 | }) |
137 | } | 138 | } |
138 | 139 | ||
139 | $scope.getSize = function(model, index){ | 140 | $scope.getSize = function(model, index){ |
140 | FBOFlight.getAircraftSize($scope.aircraft.make, model).then(function(result) { | 141 | FBOFlight.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
141 | $scope.aircraftDetails[index].aircraftSizeList = result; | 142 | $scope.aircraftDetails[index].aircraftSizeList = result; |
142 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | 143 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; |
143 | console.log($scope.aircraftDetails[index]) | 144 | console.log($scope.aircraftDetails[index]) |
144 | }) | 145 | }) |
145 | } | 146 | } |
146 | 147 | ||
147 | $scope.aircraftListData = {}; | 148 | $scope.aircraftListData = {}; |
148 | $scope.addData = []; | 149 | $scope.addData = []; |
149 | 150 | ||
150 | $scope.saveCompanyData = function(){ | 151 | $scope.saveCompanyData = function(){ |
152 | console.log('=========2========',$scope.aircraftDetails); | ||
151 | for(var i=0; i<$scope.aircraftDetails.length;i++){ | 153 | for(var i=0; i<$scope.aircraftDetails.length;i++){ |
152 | $scope.addData.push({ | 154 | $scope.addData.push({ |
153 | 'tail': $scope.aircraftDetails[i].tail, | 155 | 'tail': $scope.aircraftDetails[i].tail, |
154 | 'make': $scope.aircraftDetails[i].make, | 156 | 'make': $scope.aircraftDetails[i].make, |
155 | 'model': $scope.aircraftDetails[i].model, | 157 | 'model': $scope.aircraftDetails[i].model, |
156 | 'sizeId' : $scope.aircraftDetails[i].sizeId | 158 | 'sizeId' : $scope.aircraftDetails[i].sizeId |
157 | }); | 159 | }); |
158 | } | 160 | } |
159 | $scope.aircraftListData.aircraftList = $scope.addData; | 161 | $scope.aircraftListData.aircraftList = $scope.addData; |
160 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; | 162 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; |
161 | 163 | ||
162 | FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { | 164 | FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { |
163 | console.log(result) | 165 | console.log(result) |
164 | if(result != null && result.success){ | 166 | if(result != null && result.success){ |
165 | toastr.success(''+result.success+'', { | 167 | toastr.success(''+result.success+'', { |
166 | closeButton: true | 168 | closeButton: true |
167 | }) | 169 | }) |
168 | }else{ | 170 | }else{ |
169 | toastr.error(''+result.statusText+'', { | 171 | toastr.error(''+result.statusText+'', { |
170 | closeButton: true | 172 | closeButton: true |
171 | }) | 173 | }) |
172 | } | 174 | } |
173 | }); | 175 | }); |
174 | 176 | ||
175 | } | 177 | } |
178 | getCompanyName(); | ||
179 | function getCompanyName(){ | ||
180 | $scope.showLoader = true; | ||
181 | FBOFlight.getCompanyName().then(function(result) { | ||
182 | $scope.compNameList = result; | ||
183 | }) | ||
184 | } | ||
176 | 185 | ||
177 | // getData(); | 186 | // getData(); |
178 | // function getData(){ | 187 | // function getData(){ |
179 | // FBOFlight.getAircraftMake().then(function(result) { | 188 | // FBOFlight.getAircraftMake().then(function(result) { |
180 | // $scope.aircraftMakeList = result; | 189 | // $scope.aircraftMakeList = result; |
181 | // $scope.aircraft.make = $scope.aircraftMakeList[0]; | 190 | // $scope.aircraft.make = $scope.aircraftMakeList[0]; |
182 | // FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 191 | // FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
183 | // $scope.aircraftModalList = result; | 192 | // $scope.aircraftModalList = result; |
184 | // $scope.aircraft.model = $scope.aircraftModalList[0]; | 193 | // $scope.aircraft.model = $scope.aircraftModalList[0]; |
185 | // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 194 | // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
186 | // $scope.aircraftSizeList = result; | 195 | // $scope.aircraftSizeList = result; |
187 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; | 196 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; |
188 | // }) | 197 | // }) |
189 | // }) | 198 | // }) |
190 | 199 | ||
191 | // }) | 200 | // }) |
192 | // } | 201 | // } |
193 | 202 | ||
194 | 203 | ||
195 | // $scope.getModal = function(){ | 204 | // $scope.getModal = function(){ |
196 | // var makeId = $scope.aircraft.make; | 205 | // var makeId = $scope.aircraft.make; |
197 | // FBOFlight.getModal(makeId).then(function(result) { | 206 | // FBOFlight.getModal(makeId).then(function(result) { |
198 | // $scope.aircraftModalList = result; | 207 | // $scope.aircraftModalList = result; |
199 | // $scope.aircraft.model = $scope.aircraftModalList[0]; | 208 | // $scope.aircraft.model = $scope.aircraftModalList[0]; |
200 | // FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | 209 | // FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { |
201 | // $scope.aircraftSizeList = result; | 210 | // $scope.aircraftSizeList = result; |
202 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; | 211 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; |
203 | // }) | 212 | // }) |
204 | // }) | 213 | // }) |
205 | // } | 214 | // } |
206 | 215 | ||
207 | // $scope.getSize = function(){ | 216 | // $scope.getSize = function(){ |
208 | // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 217 | // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
209 | // $scope.aircraftSizeList = result; | 218 | // $scope.aircraftSizeList = result; |
210 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; | 219 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; |
211 | // }) | 220 | // }) |
212 | // } | 221 | // } |
213 | 222 | ||
214 | // $scope.openModal = function(){ | 223 | // $scope.openModal = function(){ |
215 | // if($scope.aircraft.accountId == undefined){ | 224 | // if($scope.aircraft.accountId == undefined){ |
216 | // toastr.error('Please Add Contact Information', { | 225 | // toastr.error('Please Add Contact Information', { |
217 | // closeButton: true | 226 | // closeButton: true |
218 | // }) | 227 | // }) |
219 | // $('#myModal4').modal('hide'); | 228 | // $('#myModal4').modal('hide'); |
220 | // }else{ | 229 | // }else{ |
221 | // $('#myModal4').modal('show'); | 230 | // $('#myModal4').modal('show'); |
222 | // } | 231 | // } |
223 | 232 | ||
224 | // } | 233 | // } |
225 | // $scope.aircraftData = {}; | 234 | // $scope.aircraftData = {}; |
226 | // $scope.aircraftData.aircraftList = []; | 235 | // $scope.aircraftData.aircraftList = []; |
227 | // $scope.getCraftList = []; | 236 | // $scope.getCraftList = []; |
228 | // $scope.addAircraft = function(){ | 237 | // $scope.addAircraft = function(){ |
229 | // $scope.aircraftData.aircraftList.push($scope.aircraft); | 238 | // $scope.aircraftData.aircraftList.push($scope.aircraft); |
230 | // if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { | 239 | // if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { |
231 | // $scope.getCraftList.push($scope.aircraft); | 240 | // $scope.getCraftList.push($scope.aircraft); |
232 | // } | 241 | // } |
233 | 242 | ||
234 | // FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | 243 | // FBOFlight.addAircraft($scope.aircraftData).then(function(result) { |
235 | // $('#myModal4').modal('hide'); | 244 | // $('#myModal4').modal('hide'); |
236 | // $scope.reset(); | 245 | // $scope.reset(); |
237 | // toastr.success('Created Successfully', { | 246 | // toastr.success('Created Successfully', { |
238 | // closeButton: true | 247 | // closeButton: true |
239 | // }) | 248 | // }) |
240 | // }, function (err) { | 249 | // }, function (err) { |
241 | // toastr.error('Error in Adding Aircraft', { | 250 | // toastr.error('Error in Adding Aircraft', { |
242 | // closeButton: true | 251 | // closeButton: true |
243 | // }) | 252 | // }) |
244 | // $('#myModal4').modal('hide'); | 253 | // $('#myModal4').modal('hide'); |
245 | // $scope.getCraftList.splice($scope.aircraft); | 254 | // $scope.getCraftList.splice($scope.aircraft); |
246 | // }); | 255 | // }); |
247 | 256 | ||
248 | // } | 257 | // } |
249 | 258 | ||
250 | // $scope.reset = function() { | 259 | // $scope.reset = function() { |
251 | // $scope.aircraft = {}; | 260 | // $scope.aircraft = {}; |
252 | // $scope.aircraft.accountId = $scope.data.accountId; | 261 | // $scope.aircraft.accountId = $scope.data.accountId; |
253 | // $scope.aircraftData.aircraftList = []; | 262 | // $scope.aircraftData.aircraftList = []; |
254 | // getData(); | 263 | // getData(); |
255 | // } | 264 | // } |
256 | }); | 265 | }); |
app/views/fbo-flight/flightDeptService.js
1 | (function() { | 1 | (function() { |
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | .service('FBOFlight', ['$rootScope', '$q', '$http', 'BE', FBOFlight]) | 5 | .service('FBOFlight', ['$rootScope', '$q', '$http', 'BE', FBOFlight]) |
6 | 6 | ||
7 | function FBOFlight($rootScope, $q, $http, BE) { | 7 | function FBOFlight($rootScope, $q, $http, BE) { |
8 | 8 | ||
9 | this.registerUser = function(data) { | 9 | this.registerUser = function(data) { |
10 | 10 | ||
11 | var deferred = $q.defer(); | 11 | var deferred = $q.defer(); |
12 | $http({ | 12 | $http({ |
13 | method : 'POST', | 13 | method : 'POST', |
14 | url : BE.url +'/account/user/registration', | 14 | url : BE.url +'/account/user/registration', |
15 | headers : {'Content-Type': 'application/x-www-form-urlencoded'}, | 15 | headers : {'Content-Type': 'application/x-www-form-urlencoded'}, |
16 | data : data | 16 | data : data |
17 | }) | 17 | }) |
18 | .success(function(result) { | 18 | .success(function(result) { |
19 | deferred.resolve(result); | 19 | deferred.resolve(result); |
20 | }).error(function(error){ | 20 | }).error(function(error){ |
21 | deferred.reject(error); | 21 | deferred.reject(error); |
22 | }) | 22 | }) |
23 | return deferred.promise; | 23 | return deferred.promise; |
24 | } | 24 | } |
25 | 25 | ||
26 | this.addCardInformation = function(data) { | 26 | this.addCardInformation = function(data) { |
27 | 27 | ||
28 | var deferred = $q.defer(); | 28 | var deferred = $q.defer(); |
29 | $http({ | 29 | $http({ |
30 | method : 'POST', | 30 | method : 'POST', |
31 | url : BE.url +'/account/user/addPaymentMethods', | 31 | url : BE.url +'/account/user/addPaymentMethods', |
32 | headers : {'Content-Type': 'application/json'}, | 32 | headers : {'Content-Type': 'application/json'}, |
33 | data : data | 33 | data : data |
34 | }) | 34 | }) |
35 | .success(function(result) { | 35 | .success(function(result) { |
36 | deferred.resolve(result); | 36 | deferred.resolve(result); |
37 | }) | 37 | }) |
38 | return deferred.promise; | 38 | return deferred.promise; |
39 | } | 39 | } |
40 | 40 | ||
41 | this.getAircraftMake = function(){ | 41 | this.getAircraftMake = function(){ |
42 | var deferred = $q.defer(); | 42 | var deferred = $q.defer(); |
43 | $http({ | 43 | $http({ |
44 | method : 'GET', | 44 | method : 'GET', |
45 | url : BE.url +'/fuelerlinx/acufuel/getAircraftMake', | 45 | url : BE.url +'/fuelerlinx/acufuel/getAircraftMake', |
46 | headers : {'Content-Type': 'application/json'}, | 46 | headers : {'Content-Type': 'application/json'}, |
47 | }) | 47 | }) |
48 | .success(function(result) { | 48 | .success(function(result) { |
49 | deferred.resolve(result); | 49 | deferred.resolve(result); |
50 | }) | 50 | }) |
51 | return deferred.promise; | 51 | return deferred.promise; |
52 | } | 52 | } |
53 | 53 | ||
54 | this.getAircraftSize = function(makeId, modelId){ | 54 | this.getAircraftSize = function(makeId, modelId){ |
55 | var deferred = $q.defer(); | 55 | var deferred = $q.defer(); |
56 | $http({ | 56 | $http({ |
57 | method : 'GET', | 57 | method : 'GET', |
58 | url : BE.url +'/fuelerlinx/acufuel/getAircraftSize/' +makeId + '/' +modelId, | 58 | url : BE.url +'/fuelerlinx/acufuel/getAircraftSize/' +makeId + '/' +modelId, |
59 | headers : {'Content-Type': 'application/json'}, | 59 | headers : {'Content-Type': 'application/json'}, |
60 | }) | 60 | }) |
61 | .success(function(result) { | 61 | .success(function(result) { |
62 | deferred.resolve(result); | 62 | deferred.resolve(result); |
63 | }) | 63 | }) |
64 | return deferred.promise; | 64 | return deferred.promise; |
65 | } | 65 | } |
66 | 66 | ||
67 | this.getModal = function(id){ | 67 | this.getModal = function(id){ |
68 | var deferred = $q.defer(); | 68 | var deferred = $q.defer(); |
69 | $http({ | 69 | $http({ |
70 | method : 'GET', | 70 | method : 'GET', |
71 | url : BE.url +'/fuelerlinx/acufuel/getAircraftModel/' + id, | 71 | url : BE.url +'/fuelerlinx/acufuel/getAircraftModel/' + id, |
72 | headers : {'Content-Type': 'application/json'}, | 72 | headers : {'Content-Type': 'application/json'}, |
73 | }) | 73 | }) |
74 | .success(function(result) { | 74 | .success(function(result) { |
75 | deferred.resolve(result); | 75 | deferred.resolve(result); |
76 | }) | 76 | }) |
77 | return deferred.promise; | 77 | return deferred.promise; |
78 | } | 78 | } |
79 | 79 | ||
80 | this.addAircraft = function(data){ | 80 | this.addAircraft = function(data){ |
81 | var deferred = $q.defer(); | 81 | var deferred = $q.defer(); |
82 | $http({ | 82 | $http({ |
83 | method : 'POST', | 83 | method : 'POST', |
84 | url : BE.url +'/account/user/addAircraft', | 84 | url : BE.url +'/account/user/addAircraft', |
85 | headers : {'Content-Type': 'application/json'}, | 85 | headers : {'Content-Type': 'application/json'}, |
86 | data: data | 86 | data: data |
87 | }) | 87 | }) |
88 | .success(function(result) { | 88 | .success(function(result) { |
89 | deferred.resolve(result); | 89 | deferred.resolve(result); |
90 | }).error(function(error) { | 90 | }).error(function(error) { |
91 | deferred.reject(error); | 91 | deferred.reject(error); |
92 | }) | 92 | }) |
93 | return deferred.promise; | 93 | return deferred.promise; |
94 | } | 94 | } |
95 | |||
96 | this.getCompanyName = function() { | ||
97 | var deferred = $q.defer(); | ||
98 | $http({ | ||
99 | method : 'GET', | ||
100 | url : BE.url +'/company/searchName', | ||
101 | headers : {'Content-Type': 'application/json'}, | ||
102 | }) | ||
103 | .then(function (result){ | ||
104 | deferred.resolve(result.data); | ||
105 | },function (result){ | ||
106 | deferred.resolve(result.data); | ||
107 | }) | ||
108 | return deferred.promise; | ||
109 | } | ||
95 | } | 110 | } |
96 | 111 | ||
97 | })(); | 112 | })(); |
app/views/updateFBODept/updateFBODept.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('updateFBODeptController', function($scope, $stateParams, $state, UpdateAllFBODept, UpdateAllFBO, FBOFlight, FBOAdmin) { | 6 | .controller('updateFBODeptController', function($scope, $stateParams, $state, UpdateAllFBODept, UpdateAllFBO, FBOFlight, FBOAdmin) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.fboflight').addClass('active'); | 8 | $('.fboflight').addClass('active'); |
9 | }); | 9 | }); |
10 | $scope.showPayments = true; | 10 | $scope.showPayments = true; |
11 | $scope.aircraft = {}; | 11 | $scope.aircraft = {}; |
12 | $scope.updateData = {}; | 12 | $scope.updateData = {}; |
13 | var userProfileID = $stateParams.id; | 13 | var userProfileID = $stateParams.id; |
14 | $scope.companyId; | ||
15 | |||
14 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { | 16 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { |
15 | console.log(result) | 17 | console.log(result) |
16 | $scope.user = result; | 18 | $scope.user = result; |
17 | $scope.aircraft.accountId = result.account.id; | 19 | // $scope.aircraft.accountId = result.account.id; |
18 | $scope.user.userTypeId = result.userType.id; | 20 | $scope.user.userTypeId = result.userType.id; |
19 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { | 21 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { |
20 | $scope.user.clientNote = response[0].notes | 22 | $scope.user.clientNote = response[0].notes |
21 | $scope.user.userNoteId = response[0].id; | 23 | $scope.user.userNoteId = response[0].id; |
24 | }) | ||
25 | // $scope.feature = result.accountFeatureControl; | ||
26 | // console.log($scope.feature,"dsdsdsds") | ||
27 | if($scope.user.account.user.status == 'ACTIVE'){ | ||
28 | $scope.status = true; | ||
29 | }else { | ||
30 | $scope.status = false; | ||
31 | } | ||
22 | }) | 32 | }) |
23 | // $scope.feature = result.accountFeatureControl; | 33 | |
24 | // console.log($scope.feature,"dsdsdsds") | 34 | UpdateAllFBODept.getAssociatedCompany(userProfileID).then(function(result) { |
25 | if($scope.user.account.user.status == 'ACTIVE'){ | 35 | console.log('=======q===',result) |
26 | $scope.status = true; | 36 | $scope.companyId = result.id; |
27 | }else { | 37 | getCrafts(result.id); |
28 | $scope.status = false; | 38 | $scope.aircraft.accountId = result.id; |
29 | } | ||
30 | }) | 39 | }) |
31 | 40 | ||
32 | getCrafts(); | 41 | |
33 | function getCrafts(){ | 42 | function getCrafts(id){ |
34 | UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { | 43 | UpdateAllFBODept.getAircrafts(id).then(function(response) { |
35 | $scope.getCraftList = response; | 44 | $scope.getCraftList = response; |
36 | for(var i=0;i<$scope.getCraftList.length;i++){ | 45 | for(var i=0;i<$scope.getCraftList.length;i++){ |
37 | $scope.getCraftList[i].sizeId = $scope.getCraftList[i].userAircraftSize.id; | 46 | $scope.getCraftList[i].sizeId = $scope.getCraftList[i].compAircraftSize.id; |
38 | $scope.getCraftList[i].size = $scope.getCraftList[i].userAircraftSize.size; | 47 | $scope.getCraftList[i].size = $scope.getCraftList[i].compAircraftSize.size; |
39 | } | 48 | } |
40 | }) | 49 | }) |
41 | } | 50 | } |
42 | 51 | ||
43 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { | 52 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { |
44 | $scope.paymentList = response; | 53 | $scope.paymentList = response; |
45 | 54 | ||
46 | }) | 55 | }) |
47 | 56 | ||
48 | $scope.openCard = function(payment){ | 57 | $scope.openCard = function(payment){ |
49 | console.log(payment) | 58 | console.log(payment) |
50 | $scope.showPayments = false; | 59 | $scope.showPayments = false; |
51 | $scope.data = {}; | 60 | $scope.data = {}; |
52 | $scope.data.cardNumber = payment.cardNumber; | 61 | $scope.data.cardNumber = payment.cardNumber; |
53 | $scope.data.cardType = payment.cardType; | 62 | $scope.data.cardType = payment.cardType; |
54 | $scope.data.expiryDate = payment.expiryDate; | 63 | $scope.data.expiryDate = payment.expiryDate; |
55 | $scope.data.id = payment.id; | 64 | $scope.data.id = payment.id; |
56 | $scope.data.accountId = payment.user.account.id; | 65 | $scope.data.accountId = payment.user.account.id; |
57 | } | 66 | } |
58 | 67 | ||
59 | var cardData = {} | 68 | var cardData = {} |
60 | cardData.paymentMethodList = []; | 69 | cardData.paymentMethodList = []; |
61 | $scope.updateCard = function(){ | 70 | $scope.updateCard = function(){ |
62 | console.log($scope.data) | 71 | console.log($scope.data) |
63 | cardData.paymentMethodList.push($scope.data); | 72 | cardData.paymentMethodList.push($scope.data); |
64 | console.log("cardData", cardData); | 73 | console.log("cardData", cardData); |
65 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { | 74 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { |
66 | console.log(result) | 75 | console.log(result) |
67 | toastr.success('Updated Successfully', { | 76 | toastr.success('Updated Successfully', { |
68 | closeButton: true | 77 | closeButton: true |
69 | }) | 78 | }) |
70 | $scope.reset(); | 79 | $scope.reset(); |
71 | }) | 80 | }) |
72 | } | 81 | } |
73 | 82 | ||
74 | 83 | ||
75 | $scope.reset = function(){ | 84 | $scope.reset = function(){ |
76 | cardData.paymentMethodList = []; | 85 | cardData.paymentMethodList = []; |
77 | } | 86 | } |
78 | 87 | ||
79 | $scope.checkUsername = function(){ | 88 | $scope.checkUsername = function(){ |
80 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | 89 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { |
81 | console.log(status) | 90 | console.log(status) |
82 | if(status != 200){ | 91 | if(status != 200){ |
83 | toastr.error('This email has alreay taken', { | 92 | toastr.error('This email has alreay taken', { |
84 | closeButton: true | 93 | closeButton: true |
85 | }) | 94 | }) |
86 | } | 95 | } |
87 | }) | 96 | }) |
88 | } | 97 | } |
89 | 98 | ||
90 | $scope.userData = function(){ | 99 | $scope.userData = function(){ |
91 | console.log($scope.user.userTypeId) | 100 | console.log($scope.user.userTypeId) |
92 | if($scope.user.email == undefined || $scope.user.email == null){ | 101 | if($scope.user.email == undefined || $scope.user.email == null){ |
93 | toastr.error('Please enter your email first', { | 102 | toastr.error('Please enter your email first', { |
94 | closeButton: true | 103 | closeButton: true |
95 | }) | 104 | }) |
96 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 105 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
97 | toastr.error('Please enter your First Name', { | 106 | toastr.error('Please enter your First Name', { |
98 | closeButton: true | 107 | closeButton: true |
99 | }) | 108 | }) |
100 | }else{ | 109 | }else{ |
101 | if($scope.status == true){ | 110 | if($scope.status == true){ |
102 | $scope.user.status = 'active'; | 111 | $scope.user.status = 'active'; |
103 | }else{ | 112 | }else{ |
104 | $scope.user.status = 'inactive'; | 113 | $scope.user.status = 'inactive'; |
105 | } | 114 | } |
106 | $scope.user.username = $scope.user.email; | 115 | $scope.user.username = $scope.user.email; |
107 | $scope.user.userType = 'flightDetp'; | 116 | $scope.user.userType = 'flightDetp'; |
108 | console.log($scope.user) | 117 | console.log($scope.user) |
109 | // if($scope.user.userNoteId == undefined){ | 118 | // if($scope.user.userNoteId == undefined){ |
110 | // $scope.user.userNoteId = null; | 119 | // $scope.user.userNoteId = null; |
111 | // } | 120 | // } |
112 | var updateData = "companyName=" + $scope.user.companyName + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&userNote=" + $scope.user.clientNote + "&userNoteId=" + $scope.user.userNoteId + "&userTypeId=" + $scope.user.userTypeId + "&userProfileId=" + userProfileID; | 121 | var updateData = "companyName=" + $scope.user.companyName + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&userNote=" + $scope.user.clientNote + "&userNoteId=" + $scope.user.userNoteId + "&userTypeId=" + $scope.user.userTypeId + "&userProfileId=" + userProfileID; |
113 | UpdateAllFBO.updateUser(updateData).then(function(result) { | 122 | UpdateAllFBO.updateUser(updateData).then(function(result) { |
114 | toastr.success(''+result.success+'', { | 123 | toastr.success(''+result.success+'', { |
115 | closeButton: true | 124 | closeButton: true |
116 | }) | 125 | }) |
117 | }) | 126 | }) |
118 | $state.go('index.flightDept'); | 127 | $state.go('index.flightDept'); |
119 | } | 128 | } |
120 | } | 129 | } |
121 | 130 | ||
122 | getData(); | 131 | getData(); |
123 | function getData(){ | 132 | function getData(){ |
124 | FBOFlight.getAircraftMake().then(function(result) { | 133 | FBOFlight.getAircraftMake().then(function(result) { |
125 | $scope.aircraftMakeList = result; | 134 | $scope.aircraftMakeList = result; |
126 | $scope.aircraft.make = $scope.aircraftMakeList[0]; | 135 | $scope.aircraft.make = $scope.aircraftMakeList[0]; |
127 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 136 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
128 | $scope.aircraftModalList = result; | 137 | $scope.aircraftModalList = result; |
129 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 138 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
130 | 139 | ||
131 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 140 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
132 | $scope.aircraftSizeList = result; | 141 | $scope.aircraftSizeList = result; |
133 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 142 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
134 | 143 | ||
135 | }) | 144 | }) |
136 | }) | 145 | }) |
137 | 146 | ||
138 | }) | 147 | }) |
139 | } | 148 | } |
140 | 149 | ||
141 | $scope.getModal = function(){ | 150 | $scope.getModal = function(){ |
142 | var makeId = $scope.aircraft.make | 151 | var makeId = $scope.aircraft.make |
143 | FBOFlight.getModal(makeId).then(function(result) { | 152 | FBOFlight.getModal(makeId).then(function(result) { |
144 | $scope.aircraftModalList = result; | 153 | $scope.aircraftModalList = result; |
145 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 154 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
146 | 155 | ||
147 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | 156 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { |
148 | $scope.aircraftSizeList = result; | 157 | $scope.aircraftSizeList = result; |
149 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 158 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
150 | }) | 159 | }) |
151 | }) | 160 | }) |
152 | } | 161 | } |
153 | 162 | ||
154 | $scope.getSize = function(){ | 163 | $scope.getSize = function(){ |
155 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 164 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
156 | $scope.aircraftSizeList = result; | 165 | $scope.aircraftSizeList = result; |
157 | console.log($scope.aircraftSizeList) | 166 | console.log($scope.aircraftSizeList) |
158 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 167 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
159 | console.log($scope.aircraft.sizeId) | 168 | console.log($scope.aircraft.sizeId) |
160 | }) | 169 | }) |
161 | } | 170 | } |
162 | 171 | ||
163 | $scope.aircraftData = {}; | 172 | |
164 | $scope.aircraftData.aircraftList = []; | 173 | |
165 | $scope.addAircraft = function(){ | 174 | $scope.addAircraft = function(){ |
175 | $scope.aircraftListData = {}; | ||
176 | $scope.addData = []; | ||
177 | $scope.aircraftListData.aircraftList= []; | ||
178 | |||
179 | $scope.addData.push({ | ||
180 | 'tail': $scope.aircraft.tail, | ||
181 | 'make': $scope.aircraft.make, | ||
182 | 'model': $scope.aircraft.model, | ||
183 | 'sizeId' : $scope.aircraft.sizeId | ||
184 | }); | ||
185 | console.log('$scope.addData',$scope.addData); | ||
186 | |||
187 | $scope.aircraftListData.aircraftList = $scope.addData; | ||
188 | $scope.aircraftListData.accountId = $scope.companyId; | ||
166 | console.log($scope.aircraft) | 189 | console.log($scope.aircraft) |
167 | $scope.aircraftData.aircraftList.push($scope.aircraft); | 190 | //$scope.aircraftData.aircraftList.push($scope.aircraft); |
168 | 191 | ||
169 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | 192 | FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { |
170 | $('#myModal4').modal('hide'); | 193 | $('#myModal4').modal('hide'); |
171 | getCrafts(); | 194 | getCrafts($scope.companyId); |
172 | $scope.resetData(); | 195 | $scope.resetData(); |
173 | toastr.success('Created Successfully', { | 196 | toastr.success('Created Successfully', { |
174 | closeButton: true | 197 | closeButton: true |
175 | }) | 198 | }) |
176 | }, function (err) { | 199 | }, function (err) { |
177 | toastr.error('Error in Adding Aircraft', { | 200 | toastr.error('Error in Adding Aircraft', { |
178 | closeButton: true | 201 | closeButton: true |
179 | }) | 202 | }) |
180 | $('#myModal4').modal('hide'); | 203 | $('#myModal4').modal('hide'); |
181 | $scope.getCraftList.splice($scope.aircraft); | 204 | $scope.getCraftList.splice($scope.aircraft); |
182 | }); | 205 | }); |
183 | } | 206 | } |
184 | 207 | ||
185 | $scope.closeModal = function(){ | 208 | $scope.closeModal = function(){ |
186 | $("#myModal5").modal('hide'); | 209 | $("#myModal5").modal('hide'); |
187 | $scope.resetData(); | 210 | $scope.resetData(); |
188 | } | 211 | } |
189 | 212 | ||
190 | $scope.update = function(airdata){ | 213 | $scope.update = function(airdata){ |
191 | $("#myModal5").modal('show'); | 214 | $("#myModal5").modal('show'); |
192 | $scope.aircraft = airdata; | 215 | $scope.aircraft = airdata; |
193 | console.log($scope.aircraft) | 216 | console.log('--------$scope.companyId---',$scope.companyId); |
194 | $scope.aircraft.accountId = $scope.user.account.id; | 217 | $scope.aircraft.accountId = $scope.companyId; |
195 | 218 | ||
196 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 219 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
197 | $scope.aircraftModalList = result; | 220 | $scope.aircraftModalList = result; |
198 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 221 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
199 | $scope.aircraftSizeList = result; | 222 | $scope.aircraftSizeList = result; |
200 | console.log($scope.aircraftSizeList) | 223 | console.log($scope.aircraftSizeList) |
201 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 224 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
202 | }) | 225 | }) |
203 | }) | 226 | }) |
204 | } | 227 | } |
205 | 228 | ||
206 | $scope.updatecraftData = {}; | 229 | $scope.updatecraftData = {}; |
207 | $scope.updatecraftData.aircraftList = []; | 230 | $scope.updatecraftData.aircraftList = []; |
208 | $scope.updateAircraftData = {}; | 231 | $scope.updateAircraftData = {}; |
209 | 232 | ||
210 | $scope.updateAircraft = function(updateAircraft){ | 233 | $scope.updateAircraft = function(updateAircraft){ |
211 | $scope.updateAircraftData.id = updateAircraft.id; | 234 | $scope.updateAircraftData.id = updateAircraft.id; |
212 | $scope.updateAircraftData.make = updateAircraft.make; | 235 | $scope.updateAircraftData.make = updateAircraft.make; |
213 | $scope.updateAircraftData.model = updateAircraft.model; | 236 | $scope.updateAircraftData.model = updateAircraft.model; |
214 | $scope.updateAircraftData.sizeId = updateAircraft.sizeId; | 237 | $scope.updateAircraftData.sizeId = updateAircraft.sizeId; |
215 | $scope.updateAircraftData.tail = updateAircraft.tail; | 238 | $scope.updateAircraftData.tail = updateAircraft.tail; |
216 | $scope.updateAircraftData.accountId = updateAircraft.accountId; | 239 | $scope.updateAircraftData.accountId = $scope.companyId; |
217 | console.log($scope.updateAircraftData) | 240 | console.log($scope.updateAircraftData) |
218 | 241 | ||
219 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); | 242 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); |
220 | console.log($scope.updatecraftData.aircraftList) | 243 | console.log($scope.updatecraftData.aircraftList) |
221 | 244 | ||
222 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { | 245 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { |
223 | $('#myModal5').modal('hide'); | 246 | $('#myModal5').modal('hide'); |
224 | $scope.resetData(); | 247 | $scope.resetData(); |
225 | getCrafts(); | 248 | getCrafts($scope.companyId); |
226 | toastr.success('Updated Successfully', { | 249 | toastr.success('Updated Successfully', { |
227 | closeButton: true | 250 | closeButton: true |
228 | }) | 251 | }) |
229 | }, function (err) { | 252 | }, function (err) { |
230 | toastr.error('Error in Updating Aircraft', { | 253 | toastr.error('Error in Updating Aircraft', { |
231 | closeButton: true | 254 | closeButton: true |
232 | }) | 255 | }) |
233 | $('#myModal5').modal('hide'); | 256 | $('#myModal5').modal('hide'); |
234 | $scope.getCraftList.splice($scope.aircraft); | 257 | $scope.getCraftList.splice($scope.aircraft); |
235 | }); | 258 | }); |
236 | } | 259 | } |
237 | 260 | ||
238 | $scope.remove = function(data){ | 261 | $scope.remove = function(data){ |
239 | console.log(data) | 262 | console.log(data) |
240 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { | 263 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { |
241 | toastr.success(''+result.success+'', { | 264 | toastr.success(''+result.success+'', { |
242 | closeButton: true | 265 | closeButton: true |
243 | }) | 266 | }) |
244 | getCrafts(); | 267 | getCrafts($scope.companyId); |
245 | }) | 268 | }) |
246 | } | 269 | } |
247 | 270 | ||
248 | $scope.resetData = function() { | 271 | $scope.resetData = function() { |
249 | $scope.aircraft = {}; | 272 | $scope.aircraft = {}; |
250 | $scope.aircraft.accountId = $scope.user.account.id; | 273 | $scope.aircraft.accountId = $scope.companyId; |
251 | $scope.aircraftData.aircraftList = []; | 274 | $scope.aircraftListData.aircraftList = []; |
252 | getData(); | 275 | getData(); |
253 | } | 276 | } |
254 | 277 |
app/views/updateFBODept/updateFBODept.service.js
1 | (function() { | 1 | (function() { |
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | .service('UpdateAllFBODept', ['$rootScope', '$q', '$http', 'BE', UpdateAllFBODept]) | 5 | .service('UpdateAllFBODept', ['$rootScope', '$q', '$http', 'BE', UpdateAllFBODept]) |
6 | 6 | ||
7 | function UpdateAllFBODept($rootScope, $q, $http, BE) { | 7 | function UpdateAllFBODept($rootScope, $q, $http, BE) { |
8 | 8 | ||
9 | this.getALlFBOData = function(id) { | 9 | this.getALlFBOData = function(id) { |
10 | 10 | ||
11 | var deferred = $q.defer(); | 11 | var deferred = $q.defer(); |
12 | $http({ | 12 | $http({ |
13 | method : 'GET', | 13 | method : 'GET', |
14 | url : BE.url +'/account/user/'+id, | 14 | url : BE.url +'/account/user/'+id, |
15 | headers : {'Content-Type': 'application/json'}, | 15 | headers : {'Content-Type': 'application/json'}, |
16 | }) | 16 | }) |
17 | .success(function(result) { | 17 | .success(function(result) { |
18 | deferred.resolve(result); | 18 | deferred.resolve(result); |
19 | }) | 19 | }) |
20 | return deferred.promise; | 20 | return deferred.promise; |
21 | } | 21 | } |
22 | |||
23 | this.getAssociatedCompany = function(id) { | ||
24 | |||
25 | var deferred = $q.defer(); | ||
26 | $http({ | ||
27 | method : 'GET', | ||
28 | url : BE.url +'/account/user/getFlightDeptCompany/'+id, | ||
29 | headers : {'Content-Type': 'application/json'}, | ||
30 | }) | ||
31 | .success(function(result) { | ||
32 | deferred.resolve(result); | ||
33 | }) | ||
34 | return deferred.promise; | ||
35 | } | ||
22 | 36 | ||
23 | this.getNotes = function(id) { | 37 | this.getNotes = function(id) { |
24 | 38 | ||
25 | var deferred = $q.defer(); | 39 | var deferred = $q.defer(); |
26 | $http({ | 40 | $http({ |
27 | method : 'GET', | 41 | method : 'GET', |
28 | url : BE.url +'/account/user/'+id + '/notes', | 42 | url : BE.url +'/account/user/'+id + '/notes', |
29 | headers : {'Content-Type': 'application/json'}, | 43 | headers : {'Content-Type': 'application/json'}, |
30 | }) | 44 | }) |
31 | .success(function(result) { | 45 | .success(function(result) { |
32 | deferred.resolve(result); | 46 | deferred.resolve(result); |
33 | }) | 47 | }) |
34 | return deferred.promise; | 48 | return deferred.promise; |
35 | } | 49 | } |
36 | 50 | ||
37 | this.getAircrafts = function(id) { | 51 | this.getAircrafts = function(id) { |
38 | 52 | ||
39 | var deferred = $q.defer(); | 53 | var deferred = $q.defer(); |
40 | $http({ | 54 | $http({ |
41 | method : 'GET', | 55 | method : 'GET', |
42 | url : BE.url +'/account/user/'+id + '/airCrafts', | 56 | url : BE.url +'/account/user/'+id + '/airCrafts', |
43 | headers : {'Content-Type': 'application/json'}, | 57 | headers : {'Content-Type': 'application/json'}, |
44 | }) | 58 | }) |
45 | .success(function(result) { | 59 | .success(function(result) { |
46 | deferred.resolve(result); | 60 | deferred.resolve(result); |
47 | }) | 61 | }) |
48 | return deferred.promise; | 62 | return deferred.promise; |
49 | } | 63 | } |
50 | 64 | ||
51 | this.getPaymentMethod = function(id) { | 65 | this.getPaymentMethod = function(id) { |
52 | 66 | ||
53 | var deferred = $q.defer(); | 67 | var deferred = $q.defer(); |
54 | $http({ | 68 | $http({ |
55 | method : 'GET', | 69 | method : 'GET', |
56 | url : BE.url +'/account/user/'+id + '/paymentMethods', | 70 | url : BE.url +'/account/user/'+id + '/paymentMethods', |
57 | headers : {'Content-Type': 'application/json'}, | 71 | headers : {'Content-Type': 'application/json'}, |
58 | }) | 72 | }) |
59 | .success(function(result) { | 73 | .success(function(result) { |
60 | deferred.resolve(result); | 74 | deferred.resolve(result); |
61 | }) | 75 | }) |
62 | return deferred.promise; | 76 | return deferred.promise; |
63 | } | 77 | } |
64 | 78 | ||
65 | this.updatePaymentMethod = function(data) { | 79 | this.updatePaymentMethod = function(data) { |
66 | 80 | ||
67 | var deferred = $q.defer(); | 81 | var deferred = $q.defer(); |
68 | $http({ | 82 | $http({ |
69 | method : 'POST', | 83 | method : 'POST', |
70 | url : BE.url +'/account/user/updatePaymentMethods', | 84 | url : BE.url +'/account/user/updatePaymentMethods', |
71 | headers : {'Content-Type': 'application/json'}, | 85 | headers : {'Content-Type': 'application/json'}, |
72 | data: data | 86 | data: data |
73 | }) | 87 | }) |
74 | .success(function(result) { | 88 | .success(function(result) { |
75 | deferred.resolve(result); | 89 | deferred.resolve(result); |
76 | }) | 90 | }) |
77 | return deferred.promise; | 91 | return deferred.promise; |
78 | } | 92 | } |
79 | 93 | ||
80 | this.updateAircraft = function(data) { | 94 | this.updateAircraft = function(data) { |
81 | 95 | ||
82 | var deferred = $q.defer(); | 96 | var deferred = $q.defer(); |
83 | $http({ | 97 | $http({ |
84 | method : 'PUT', | 98 | method : 'PUT', |
85 | url : BE.url +'/account/user/updateAircraft', | 99 | url : BE.url +'/account/user/updateAircraft', |
86 | headers : {'Content-Type': 'application/json'}, | 100 | headers : {'Content-Type': 'application/json'}, |
87 | data: data | 101 | data: data |
88 | }) | 102 | }) |
89 | .success(function(result) { | 103 | .success(function(result) { |
90 | deferred.resolve(result); | 104 | deferred.resolve(result); |
91 | }).error(function(error) { | 105 | }).error(function(error) { |
92 | deferred.reject(error); | 106 | deferred.reject(error); |
93 | }) | 107 | }) |
94 | return deferred.promise; | 108 | return deferred.promise; |
95 | } | 109 | } |
96 | 110 | ||
97 | this.removeAircraft = function(id) { | 111 | this.removeAircraft = function(id) { |
98 | 112 | ||
99 | var deferred = $q.defer(); | 113 | var deferred = $q.defer(); |
100 | $http({ | 114 | $http({ |
101 | method : 'DELETE', | 115 | method : 'DELETE', |
102 | url : BE.url +'/account/user/airCraft/'+id, | 116 | url : BE.url +'/account/user/airCraft/'+id, |
103 | headers : {'Content-Type': 'application/json'}, | 117 | headers : {'Content-Type': 'application/json'}, |
104 | }) | 118 | }) |
105 | .success(function(result) { | 119 | .success(function(result) { |
106 | deferred.resolve(result); | 120 | deferred.resolve(result); |
107 | }) | 121 | }) |
108 | return deferred.promise; | 122 | return deferred.promise; |
109 | } | 123 | } |
110 | 124 | ||
111 | } | 125 | } |
112 | 126 | ||
113 | })(); | 127 | })(); |