Commit f0315ea9be83baf1a1861abc6b6e8fa1f123ed3a
1 parent
a19001fdd3
Exists in
master
FBO admin and Flight dept admin UI
Showing
7 changed files
with
235 additions
and
29 deletions
Show diff stats
app/index.html
1 | 1 | ||
2 | <!DOCTYPE html> | 2 | <!DOCTYPE html> |
3 | <html ng-app="acuefuel"> | 3 | <html ng-app="acuefuel"> |
4 | 4 | ||
5 | <head> | 5 | <head> |
6 | 6 | ||
7 | <meta charset="utf-8"> | 7 | <meta charset="utf-8"> |
8 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 8 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
9 | 9 | ||
10 | <!-- Page title set in pageTitle directive --> | 10 | <!-- Page title set in pageTitle directive --> |
11 | <title page-title></title> | 11 | <title page-title></title> |
12 | 12 | ||
13 | <!-- Google Open Sans --> | 13 | <!-- Google Open Sans --> |
14 | <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'> | 14 | <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'> |
15 | 15 | ||
16 | <!-- build:css(.) styles/vendor.css --> | 16 | <!-- build:css(.) styles/vendor.css --> |
17 | <!-- bower:css --> | 17 | <!-- bower:css --> |
18 | <!-- Font awesome --> | 18 | <!-- Font awesome --> |
19 | <link href="bower_components/fontawesome/css/font-awesome.min.css" rel="stylesheet"> | 19 | <link href="bower_components/fontawesome/css/font-awesome.min.css" rel="stylesheet"> |
20 | 20 | ||
21 | <!-- Bootstrap --> | 21 | <!-- Bootstrap --> |
22 | <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> | 22 | <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> |
23 | <link href="styles/plugins/jQueryUI/jquery-ui-1.10.4.custom.min.css" rel="stylesheet"> | 23 | <link href="styles/plugins/jQueryUI/jquery-ui-1.10.4.custom.min.css" rel="stylesheet"> |
24 | <link href="bower_components/jqGrid/css/ui.jqgrid.css" rel="stylesheet"> | 24 | <link href="bower_components/jqGrid/css/ui.jqgrid.css" rel="stylesheet"> |
25 | <link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.min.css" type="text/css"> | 25 | <link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.min.css" type="text/css"> |
26 | 26 | ||
27 | <!-- Toastr --> | 27 | <!-- Toastr --> |
28 | <link href="bower_components/toastr/toastr.min.css" rel="stylesheet"> | 28 | <link href="bower_components/toastr/toastr.min.css" rel="stylesheet"> |
29 | 29 | ||
30 | <!-- Main Acuefuel CSS files --> | 30 | <!-- Main Acuefuel CSS files --> |
31 | <!-- endbower --> | 31 | <!-- endbower --> |
32 | <!-- endbuild --> | 32 | <!-- endbuild --> |
33 | 33 | ||
34 | <!-- build:css({.tmp,app}) styles/style.css --> | 34 | <!-- build:css({.tmp,app}) styles/style.css --> |
35 | <link href="styles/animate.css" rel="stylesheet"> | 35 | <link href="styles/animate.css" rel="stylesheet"> |
36 | <link href="styles/style.css" rel="stylesheet"> | 36 | <link href="styles/style.css" rel="stylesheet"> |
37 | <link rel="stylesheet" type="text/css" href="plugins/iCheck/custom.css"> | 37 | <link rel="stylesheet" type="text/css" href="plugins/iCheck/custom.css"> |
38 | <link rel="stylesheet" type="text/css" href="plugins/dataTables/datatables.min.css"> | 38 | <link rel="stylesheet" type="text/css" href="plugins/dataTables/datatables.min.css"> |
39 | <!-- endbuild --> | 39 | <!-- endbuild --> |
40 | 40 | ||
41 | <style type="text/css"> | ||
42 | /* my custom modal */ | ||
43 | |||
44 | .customBackdrop{ | ||
45 | position: fixed; | ||
46 | background-color: rgba(0, 0, 0, 0.15); | ||
47 | top: 0; | ||
48 | left: 0; | ||
49 | width: 100%; | ||
50 | height: 100%; | ||
51 | z-index: 999; | ||
52 | } | ||
53 | .customModalInner{ | ||
54 | width: 100%; | ||
55 | max-width: 500px; | ||
56 | height: 200px; | ||
57 | top: 15%; | ||
58 | position: relative; | ||
59 | margin: auto; | ||
60 | } | ||
61 | .customModelHead, .customModelFooter{ | ||
62 | width: 100%; | ||
63 | background-color: #fafafa; | ||
64 | border-bottom: 1px solid #ccc; | ||
65 | color: #333; | ||
66 | padding: 10px; | ||
67 | } | ||
68 | .customModelFooter{ | ||
69 | border-top: 1px solid #ccc; | ||
70 | } | ||
71 | .customModelBody{ | ||
72 | width: 100%; | ||
73 | height: auto; | ||
74 | background-color: #fff; | ||
75 | color: #333; | ||
76 | padding: 10px; | ||
77 | } | ||
78 | .customModelHead p{ | ||
79 | margin-bottom: 0; | ||
80 | font-size: 14px; | ||
81 | } | ||
82 | .customModelFooter button{ | ||
83 | border: 1px solid #ccc; | ||
84 | } | ||
85 | .customModelFooter input[type="submit"]{ | ||
86 | background-color: #6ad46a; | ||
87 | border: 1px solid #ccc; | ||
88 | } | ||
89 | |||
90 | |||
91 | /* custom confirmation model */ | ||
92 | |||
93 | |||
94 | .customConfirmPopBackdrop{ | ||
95 | position: fixed; | ||
96 | background-color: rgba(0, 0, 0, 0.3); | ||
97 | top: 0; | ||
98 | left: 0; | ||
99 | width: 100%; | ||
100 | height: 100%; | ||
101 | z-index: 999999999; | ||
102 | display: none; | ||
103 | } | ||
104 | .customConfirmPopBackdrop .customModalInner{ | ||
105 | top: 30%; | ||
106 | } | ||
107 | |||
108 | </style> | ||
109 | |||
41 | 110 | ||
42 | 111 | ||
43 | </head> | 112 | </head> |
44 | 113 | ||
45 | <!-- ControllerAs syntax --> | 114 | <!-- ControllerAs syntax --> |
46 | <!-- Main controller with serveral data used in Acuefuel theme on diferent view --> | 115 | <!-- Main controller with serveral data used in Acuefuel theme on diferent view --> |
47 | <body> | 116 | <body> |
48 | 117 | ||
49 | <!-- Main view --> | 118 | <!-- Main view --> |
50 | <div ui-view></div> | 119 | <div ui-view></div> |
51 | 120 | ||
52 | 121 | ||
53 | <!-- build:js(.) scripts/vendor.js --> | 122 | <!-- build:js(.) scripts/vendor.js --> |
54 | 123 | ||
55 | <!-- jQuery and Bootstrap --> | 124 | <!-- jQuery and Bootstrap --> |
56 | <script src="bower_components/jquery/dist/jquery.min.js"></script> | 125 | <script src="bower_components/jquery/dist/jquery.min.js"></script> |
57 | <script src="bower_components/jquery-ui/jquery-ui.min.js"></script> | 126 | <script src="bower_components/jquery-ui/jquery-ui.min.js"></script> |
58 | <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> | 127 | <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> |
59 | 128 | ||
60 | <!-- MetsiMenu --> | 129 | <!-- MetsiMenu --> |
61 | <script src="bower_components/metisMenu/dist/metisMenu.min.js"></script> | 130 | <script src="bower_components/metisMenu/dist/metisMenu.min.js"></script> |
62 | 131 | ||
63 | <!-- SlimScroll --> | 132 | <!-- SlimScroll --> |
64 | <script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script> | 133 | <script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script> |
65 | 134 | ||
66 | <!-- inspinia --> | 135 | <!-- inspinia --> |
67 | <script src="scripts/inspinia.js"></script> | 136 | <script src="scripts/inspinia.js"></script> |
68 | 137 | ||
69 | <!-- Peace JS --> | 138 | <!-- Peace JS --> |
70 | <script src="bower_components/pace/pace.min.js"></script> | 139 | <script src="bower_components/pace/pace.min.js"></script> |
71 | 140 | ||
72 | <!-- Angular scripts--> | 141 | <!-- Angular scripts--> |
73 | <script src="bower_components/angular/angular.min.js"></script> | 142 | <script src="bower_components/angular/angular.min.js"></script> |
74 | <script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script> | 143 | <script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script> |
75 | <script src="bower_components/angular-cookies/angular-cookies.min.js"></script> | 144 | <script src="bower_components/angular-cookies/angular-cookies.min.js"></script> |
76 | <script src="bower_components/angular-resource/angular-resource.min.js"></script> | 145 | <script src="bower_components/angular-resource/angular-resource.min.js"></script> |
77 | <script src="bower_components/angular-animate/angular-animate.min.js"></script> | 146 | <script src="bower_components/angular-animate/angular-animate.min.js"></script> |
78 | <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> | 147 | <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> |
79 | <script src="bower_components/jqGrid/js/i18n/grid.locale-en.js"></script> | 148 | <script src="bower_components/jqGrid/js/i18n/grid.locale-en.js"></script> |
80 | <script src="bower_components/jqGrid/js/jquery.jqGrid.min.js"></script> | 149 | <script src="bower_components/jqGrid/js/jquery.jqGrid.min.js"></script> |
81 | <script src="bower_components/ng-file-upload/ng-file-upload-shim.min.js"></script> | 150 | <script src="bower_components/ng-file-upload/ng-file-upload-shim.min.js"></script> |
82 | <script src="bower_components/ng-file-upload/ng-file-upload.min.js"></script> | 151 | <script src="bower_components/ng-file-upload/ng-file-upload.min.js"></script> |
83 | <script src="bower_components/angular-loading-bar/build/loading-bar.min.js"></script> | 152 | <script src="bower_components/angular-loading-bar/build/loading-bar.min.js"></script> |
84 | 153 | ||
85 | 154 | ||
86 | <!-- Toastr scripts--> | 155 | <!-- Toastr scripts--> |
87 | <script src="bower_components/toastr/toastr.min.js"></script> | 156 | <script src="bower_components/toastr/toastr.min.js"></script> |
88 | 157 | ||
89 | <!-- Angular Dependiences --> | 158 | <!-- Angular Dependiences --> |
90 | <!-- --> | 159 | <!-- --> |
91 | <!-- --> | 160 | <!-- --> |
92 | <!-- --> | 161 | <!-- --> |
93 | 162 | ||
94 | <!-- endbuild --> | 163 | <!-- endbuild --> |
95 | 164 | ||
96 | <!-- build:js({.tmp,app}) scripts/scripts.js --> | 165 | <!-- build:js({.tmp,app}) scripts/scripts.js --> |
97 | <!-- Custom and plugin javascript --> | 166 | <!-- Custom and plugin javascript --> |
98 | 167 | ||
99 | <script src="plugins/iCheck/icheck.min.js"></script> | 168 | <script src="plugins/iCheck/icheck.min.js"></script> |
100 | <script src="plugins/dataTables/datatables.min.js"></script> | 169 | <script src="plugins/dataTables/datatables.min.js"></script> |
101 | 170 | ||
102 | <!-- Anglar App Script --> | 171 | <!-- Anglar App Script --> |
103 | <script src="scripts/app.js"></script> | 172 | <script src="scripts/app.js"></script> |
104 | <script src="scripts/constant.js"></script> | 173 | <script src="scripts/constant.js"></script> |
105 | <script src="scripts/config.js"></script> | 174 | <script src="scripts/config.js"></script> |
106 | <script src="scripts/directives.js"></script> | 175 | <script src="scripts/directives.js"></script> |
107 | <script src="scripts/controllers.js"></script> | 176 | <script src="scripts/controllers.js"></script> |
108 | <script src="views/fbo-admin/dashboard.controller.js"></script> | 177 | <script src="views/fbo-admin/dashboard.controller.js"></script> |
109 | <script src="views/fbo-admin/dashboard.service.js"></script> | 178 | <script src="views/fbo-admin/dashboard.service.js"></script> |
110 | <script src="views/fbo-flight/flightDept.controller.js"></script> | 179 | <script src="views/fbo-flight/flightDept.controller.js"></script> |
111 | <script src="views/fbo-flight/flightDeptService.js"></script> | 180 | <script src="views/fbo-flight/flightDeptService.js"></script> |
112 | <script src="views/update-airports/updateAirportController.js"></script> | 181 | <script src="views/update-airports/updateAirportController.js"></script> |
113 | <script src="views/flightDept/flightDeptController.js"></script> | 182 | <script src="views/flightDept/flightDeptController.js"></script> |
114 | <script src="views/update-airports/updateAirportService.js"></script> | 183 | <script src="views/update-airports/updateAirportService.js"></script> |
115 | <script src="views/login/login.service.js"></script> | 184 | <script src="views/login/login.service.js"></script> |
116 | <script src="views/login/login.controller.js"></script> | 185 | <script src="views/login/login.controller.js"></script> |
117 | <script src="views/updateAllFBO/updateAllFBO.controller.js"></script> | 186 | <script src="views/updateAllFBO/updateAllFBO.controller.js"></script> |
118 | <script src="views/updateAllFBO/updateAllFBO.service.js"></script> | 187 | <script src="views/updateAllFBO/updateAllFBO.service.js"></script> |
119 | <script src="views/fbo-Clients/fboClient.controller.js"></script> | 188 | <script src="views/fbo-Clients/fboClient.controller.js"></script> |
120 | <script src="views/fbo-Clients/fboClient.service.js"></script> | 189 | <script src="views/fbo-Clients/fboClient.service.js"></script> |
121 | <script src="views/updateFBODept/updateFBODept.controller.js"></script> | 190 | <script src="views/updateFBODept/updateFBODept.controller.js"></script> |
122 | <script src="views/updateFBODept/updateFBODept.service.js"></script> | 191 | <script src="views/updateFBODept/updateFBODept.service.js"></script> |
123 | <!-- endbuild --> | 192 | <!-- endbuild --> |
124 | 193 | ||
125 | </body> | 194 | </body> |
126 | </html> | 195 | </html> |
127 | 196 |
app/views/updateAllFBO/updateAllFBO.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('updateAllFBOController', function($scope, $stateParams, $state, UpdateAllFBO, FBOAdmin) { | 6 | .controller('updateAllFBOController', function($scope, $stateParams, $state, UpdateAllFBO, 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 | }); | 14 | }); |
15 | 15 | ||
16 | $scope.feature = {}; | 16 | $scope.feature = {}; |
17 | var userProfileID = $stateParams.id; | 17 | var userProfileID = $stateParams.id; |
18 | UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { | 18 | UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { |
19 | console.log(result) | 19 | // console.log(result) |
20 | $scope.user = result; | 20 | $scope.user = result; |
21 | $scope.user.userTypeId = result.userType.id; | 21 | $scope.user.userTypeId = result.userType.id; |
22 | 22 | ||
23 | if(result.accountFeatureControl != null){ | 23 | if(result.accountFeatureControl != null){ |
24 | $scope.feature = result.accountFeatureControl; | 24 | $scope.feature = result.accountFeatureControl; |
25 | $scope.feature.accountId = result.account.id; | 25 | $scope.feature.accountId = result.account.id; |
26 | console.log($scope.feature) | 26 | // console.log($scope.feature) |
27 | if($scope.feature.essintaPosSystem == true){ | 27 | if($scope.feature.essintaPosSystem == true){ |
28 | $scope.essAccountId = false; | 28 | $scope.essAccountId = false; |
29 | $("#esAccId").css({ opacity: 1 }); | 29 | $("#esAccId").css({ opacity: 1 }); |
30 | }else{ | 30 | }else{ |
31 | $scope.essAccountId = true; | 31 | $scope.essAccountId = true; |
32 | delete $scope.feature.essintaAccountUid; | 32 | delete $scope.feature.essintaAccountUid; |
33 | $("#esAccId").css({ opacity: 0.5 }); | 33 | $("#esAccId").css({ opacity: 0.5 }); |
34 | } | 34 | } |
35 | }else{ | 35 | }else{ |
36 | $scope.feature.accountId = result.account.id; | 36 | $scope.feature.accountId = result.account.id; |
37 | } | 37 | } |
38 | 38 | ||
39 | UpdateAllFBO.getNotes(userProfileID).then(function(response) { | 39 | UpdateAllFBO.getNotes(userProfileID).then(function(response) { |
40 | $scope.user.clientNote = response[0].notes | 40 | $scope.user.clientNote = response[0].notes |
41 | $scope.user.userNoteId = response[0].id; | 41 | $scope.user.userNoteId = response[0].id; |
42 | }) | 42 | }) |
43 | console.log($scope.feature,"dsdsdsds") | 43 | //console.log($scope.feature,"dsdsdsds") |
44 | if($scope.user.account.user.status == 'ACTIVE'){ | 44 | if($scope.user.account.user.status == 'ACTIVE'){ |
45 | $scope.status = true; | 45 | $scope.status = true; |
46 | }else { | 46 | }else { |
47 | $scope.status = false; | 47 | $scope.status = false; |
48 | } | 48 | } |
49 | }) | 49 | }) |
50 | 50 | ||
51 | $scope.enableEssId = function(){ | 51 | $scope.enableEssId = function(){ |
52 | if($scope.feature.essintaPosSystem == true){ | 52 | if($scope.feature.essintaPosSystem == true){ |
53 | $scope.essAccountId = false; | 53 | $scope.essAccountId = false; |
54 | $("#esAccId").css({ opacity: 1 }); | 54 | $("#esAccId").css({ opacity: 1 }); |
55 | }else{ | 55 | }else{ |
56 | $scope.essAccountId = true; | 56 | $scope.essAccountId = true; |
57 | delete $scope.feature.essintaAccountUid; | 57 | delete $scope.feature.essintaAccountUid; |
58 | $("#esAccId").css({ opacity: 0.5 }); | 58 | $("#esAccId").css({ opacity: 0.5 }); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | $scope.checkUsername = function(){ | 62 | $scope.checkUsername = function(){ |
63 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | 63 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { |
64 | console.log(status) | 64 | // console.log(status) |
65 | if(status != 200){ | 65 | if(status != 200){ |
66 | toastr.error('This email has alreay taken', { | 66 | toastr.error('This email has alreay taken', { |
67 | closeButton: true | 67 | closeButton: true |
68 | }) | 68 | }) |
69 | } | 69 | } |
70 | }) | 70 | }) |
71 | } | 71 | } |
72 | 72 | ||
73 | $scope.userData = function(){ | 73 | $scope.userData = function(){ |
74 | console.log($scope.user.userTypeId) | 74 | // console.log($scope.user.userTypeId) |
75 | if($scope.user.email == undefined || $scope.user.email == null){ | 75 | if($scope.user.email == undefined || $scope.user.email == null){ |
76 | toastr.error('Please enter your email first', { | 76 | toastr.error('Please enter your email first', { |
77 | closeButton: true | 77 | closeButton: true |
78 | }) | 78 | }) |
79 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 79 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
80 | toastr.error('Please enter your First Name', { | 80 | toastr.error('Please enter your First Name', { |
81 | closeButton: true | 81 | closeButton: true |
82 | }) | 82 | }) |
83 | }else if($scope.user.companyName == undefined || $scope.user.companyName == null){ | 83 | }else if($scope.user.companyName == undefined || $scope.user.companyName == null){ |
84 | toastr.error('Please enter your Company Name', { | 84 | toastr.error('Please enter your Company Name', { |
85 | closeButton: true | 85 | closeButton: true |
86 | }) | 86 | }) |
87 | }else if($scope.user.icao == undefined || $scope.user.icao == null){ | 87 | }else if($scope.user.icao == undefined || $scope.user.icao == null){ |
88 | toastr.error('Please enter your ICAO', { | 88 | toastr.error('Please enter your ICAO', { |
89 | closeButton: true | 89 | closeButton: true |
90 | }) | 90 | }) |
91 | }else{ | 91 | }else{ |
92 | if($scope.status == true){ | 92 | if($scope.status == true){ |
93 | $scope.user.status = 'active'; | 93 | $scope.user.status = 'active'; |
94 | }else{ | 94 | }else{ |
95 | $scope.user.status = 'inactive'; | 95 | $scope.user.status = 'inactive'; |
96 | } | 96 | } |
97 | $scope.user.username = $scope.user.email; | 97 | $scope.user.username = $scope.user.email; |
98 | $scope.user.userType = 'fbo'; | 98 | $scope.user.userType = 'fbo'; |
99 | console.log($scope.user) | 99 | // console.log($scope.user) |
100 | // if($scope.user.userNoteId == undefined){ | 100 | // if($scope.user.userNoteId == undefined){ |
101 | // $scope.user.userNoteId = null; | 101 | // $scope.user.userNoteId = null; |
102 | // } | 102 | // } |
103 | var updateData = "companyName=" + $scope.user.companyName + "&icao=" + $scope.user.icao + "&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; | 103 | var updateData = "companyName=" + $scope.user.companyName + "&icao=" + $scope.user.icao + "&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; |
104 | UpdateAllFBO.updateUser(updateData).then(function(result) { | 104 | UpdateAllFBO.updateUser(updateData).then(function(result) { |
105 | toastr.success(''+result.success+'', { | 105 | toastr.success(''+result.success+'', { |
106 | closeButton: true | 106 | closeButton: true |
107 | }) | 107 | }) |
108 | var updatefeatureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem | 108 | var updatefeatureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem |
109 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" | 109 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" |
110 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration | 110 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration |
111 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id; | 111 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id; |
112 | 112 | ||
113 | UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) { | 113 | UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) { |
114 | console.log(response) | 114 | // console.log(response) |
115 | }) | 115 | }) |
116 | $state.go('index.fboAdmin'); | 116 | $state.go('index.fboAdmin'); |
117 | }) | 117 | }) |
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | var deleteUserId = ""; | ||
122 | $scope.deleteData = function(userid){ | ||
123 | $('#delete2').css('display', 'block'); | ||
124 | // console.log("kd user id--",userid) | ||
125 | // $state.go('index.fboAdmin') | ||
126 | deleteUserId = userid; | ||
127 | } | ||
128 | |||
129 | $scope.deleteUserData = function(){ | ||
130 | // console.log("api hit") | ||
131 | UpdateAllFBO.deleteUser(deleteUserId).then(function(result) { | ||
132 | $('#delete2').css('display', 'none'); | ||
133 | if(result.success){ | ||
134 | toastr.success(''+result.success+'', { | ||
135 | closeButton: true | ||
136 | |||
137 | }) | ||
138 | }else{ | ||
139 | toastr.error(''+result.statusText+'', { | ||
140 | closeButton: true | ||
141 | |||
142 | }) | ||
143 | } | ||
144 | $state.go('index.fboAdmin') | ||
145 | }) | ||
146 | } | ||
147 | $scope.cancelDelete = function(){ | ||
148 | $('#delete2').css('display', 'none'); | ||
149 | } | ||
150 | |||
151 | |||
121 | }); | 152 | }); |
app/views/updateAllFBO/updateAllFBO.html
1 | </div> | 1 | </div> |
2 | <div class="row wrapper border-bottom white-bg page-heading"> | 2 | <div class="row wrapper border-bottom white-bg page-heading"> |
3 | <div class="col-lg-3"> | 3 | <div class="col-lg-3"> |
4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> --> | 4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> --> |
5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | 5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> |
6 | </div> | 6 | </div> |
7 | <div class="col-lg-2"> | 7 | <div class="col-lg-2"> |
8 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter ICAO" ng-model="user.icao" class="form-control"></div> | 8 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter ICAO" ng-model="user.icao" class="form-control"></div> |
9 | </div> | 9 | </div> |
10 | <div class="col-lg-3" style="margin-top: 20px;"> | 10 | <div class="col-lg-3" style="margin-top: 20px;"> |
11 | <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> | 11 | <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData(user.id)">Delete Account</button> |
12 | </div> | 12 | </div> |
13 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> | 13 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> |
14 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.fboAdmin">Cancel</button> | 14 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.fboAdmin">Cancel</button> |
15 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> | 15 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
18 | </div> | 18 | </div> |
19 | <div class="wrapper wrapper-content animated fadeInRight"> | 19 | <div class="wrapper wrapper-content animated fadeInRight"> |
20 | <div class="row"> | 20 | <div class="row"> |
21 | <div class="col-lg-7"> | 21 | <div class="col-lg-7"> |
22 | <div class="ibox float-e-margins"> | 22 | <div class="ibox float-e-margins"> |
23 | <div class="ibox-title"> | 23 | <div class="ibox-title"> |
24 | <div class="pull-left"> | 24 | <div class="pull-left"> |
25 | <h5>Contact Information</h5> | 25 | <h5>Contact Information</h5> |
26 | </div> | 26 | </div> |
27 | <div class="pull-right my-toggle-switch"> | 27 | <div class="pull-right my-toggle-switch"> |
28 | <div class="switch"> | 28 | <div class="switch"> |
29 | <div class="onoffswitch"> | 29 | <div class="onoffswitch"> |
30 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> | 30 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> |
31 | <label class="onoffswitch-label" for="example1"> | 31 | <label class="onoffswitch-label" for="example1"> |
32 | <span class="onoffswitch-inner"></span> | 32 | <span class="onoffswitch-inner"></span> |
33 | <span class="onoffswitch-switch"></span> | 33 | <span class="onoffswitch-switch"></span> |
34 | </label> | 34 | </label> |
35 | </div> | 35 | </div> |
36 | </div> | 36 | </div> |
37 | </div> | 37 | </div> |
38 | <div class="clearfix"></div> | 38 | <div class="clearfix"></div> |
39 | </div> | 39 | </div> |
40 | <div class="ibox-content"> | 40 | <div class="ibox-content"> |
41 | <div class="row"> | 41 | <div class="row"> |
42 | <form role="form"> | 42 | <form role="form"> |
43 | <div class="col-sm-6 b-r"> | 43 | <div class="col-sm-6 b-r"> |
44 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> | 44 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> |
45 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control" ng-blur="checkUsername()"></div> | 45 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control" ng-blur="checkUsername()"></div> |
46 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> | 46 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> |
47 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> | 47 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
48 | <!-- <div> | 48 | <!-- <div> |
49 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> | 49 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> |
50 | <label> <input type="checkbox" class="i-checks"> Remember me </label> | 50 | <label> <input type="checkbox" class="i-checks"> Remember me </label> |
51 | </div> --> | 51 | </div> --> |
52 | 52 | ||
53 | </div> | 53 | </div> |
54 | <div class="col-sm-6"> | 54 | <div class="col-sm-6"> |
55 | <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> | 55 | <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> |
56 | <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div> | 56 | <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div> |
57 | <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> | 57 | <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> |
58 | </div> | 58 | </div> |
59 | </form> | 59 | </form> |
60 | </div> | 60 | </div> |
61 | </div> | 61 | </div> |
62 | </div> | 62 | </div> |
63 | </div> | 63 | </div> |
64 | <div class="col-lg-5"> | 64 | <div class="col-lg-5"> |
65 | <div class="ibox float-e-margins"> | 65 | <div class="ibox float-e-margins"> |
66 | <div class="ibox-title"> | 66 | <div class="ibox-title"> |
67 | <h5>Client Notes</h5> | 67 | <h5>Client Notes</h5> |
68 | 68 | ||
69 | </div> | 69 | </div> |
70 | <div class="ibox-content"> | 70 | <div class="ibox-content"> |
71 | <div class="row"> | 71 | <div class="row"> |
72 | <form role="form"> | 72 | <form role="form"> |
73 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> | 73 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> |
74 | </form> | 74 | </form> |
75 | </div> | 75 | </div> |
76 | </div> | 76 | </div> |
77 | 77 | ||
78 | </div> | 78 | </div> |
79 | </div> | 79 | </div> |
80 | </div> | 80 | </div> |
81 | </div> | 81 | </div> |
82 | 82 | ||
83 | <div class="wrapper wrapper-content animated fadeInRight"> | 83 | <div class="wrapper wrapper-content animated fadeInRight"> |
84 | <div class="row"> | 84 | <div class="row"> |
85 | <div class="col-lg-12"> | 85 | <div class="col-lg-12"> |
86 | <div class="ibox float-e-margins"> | 86 | <div class="ibox float-e-margins"> |
87 | <div class="ibox-title" style="padding: 5px 15px 5px 15px;"> | 87 | <div class="ibox-title" style="padding: 5px 15px 5px 15px;"> |
88 | <div class="col-lg-8"> | 88 | <div class="col-lg-8"> |
89 | <h5 style="line-height: 34px;margin-bottom: 0;">Feature Account Control</h5> | 89 | <h5 style="line-height: 34px;margin-bottom: 0;">Feature Account Control</h5> |
90 | </div> | 90 | </div> |
91 | <div class="col-lg-4"> | 91 | <div class="col-lg-4"> |
92 | <div class="form-group"> | 92 | <div class="form-group"> |
93 | <label class="col-sm-2 control-label" style="line-height: 34px;margin-bottom: 0;">Level</label> | 93 | <label class="col-sm-2 control-label" style="line-height: 34px;margin-bottom: 0;">Level</label> |
94 | <div class="col-sm-10"> | 94 | <div class="col-sm-10"> |
95 | <select class="form-control m-b" name="account" ng-model="feature.level" style="margin-bottom: 0;"> | 95 | <select class="form-control m-b" name="account" ng-model="feature.level" style="margin-bottom: 0;"> |
96 | <option value="silver" selected>Silver</option> | 96 | <option value="silver" selected>Silver</option> |
97 | <option value="gold">Gold</option> | 97 | <option value="gold">Gold</option> |
98 | </select> | 98 | </select> |
99 | </div> | 99 | </div> |
100 | </div> | 100 | </div> |
101 | </div> | 101 | </div> |
102 | <div class="clearfix"></div> | 102 | <div class="clearfix"></div> |
103 | </div> | 103 | </div> |
104 | <div class="ibox-content"> | 104 | <div class="ibox-content"> |
105 | <div class="row"> | 105 | <div class="row"> |
106 | <form role="form"> | 106 | <form role="form"> |
107 | 107 | ||
108 | <div class="col-lg-3"> | 108 | <div class="col-lg-3"> |
109 | <label style="color: #1ab394;">Modularized</label> | 109 | <label style="color: #1ab394;">Modularized</label> |
110 | <div> | 110 | <div> |
111 | <label> <input type="checkbox" class="i-checks" ng-change="enableEssId()" ng-model="feature.essintaPosSystem" icheck> Essinta POS system </label> | 111 | <label> <input type="checkbox" class="i-checks" ng-change="enableEssId()" ng-model="feature.essintaPosSystem" icheck> Essinta POS system </label> |
112 | </div> | 112 | </div> |
113 | <div> | 113 | <div> |
114 | <label> <input type="checkbox" class="i-checks" ng-model="feature.acuQuote" icheck> AcuQuote </label> | 114 | <label> <input type="checkbox" class="i-checks" ng-model="feature.acuQuote" icheck> AcuQuote </label> |
115 | </div> | 115 | </div> |
116 | <div> | 116 | <div> |
117 | <label> <input type="checkbox" class="i-checks" ng-model="feature.acuTrack" icheck> AcuTrack </label> | 117 | <label> <input type="checkbox" class="i-checks" ng-model="feature.acuTrack" icheck> AcuTrack </label> |
118 | </div> | 118 | </div> |
119 | <div> | 119 | <div> |
120 | <label> <input type="checkbox" class="i-checks" ng-model="feature.fuelProgram" icheck> Fuel Program </label> | 120 | <label> <input type="checkbox" class="i-checks" ng-model="feature.fuelProgram" icheck> Fuel Program </label> |
121 | </div> | 121 | </div> |
122 | <div> | 122 | <div> |
123 | <label> <input type="checkbox" class="i-checks" ng-model="feature.amstatIntegration" icheck> AMSTAT Integration </label> | 123 | <label> <input type="checkbox" class="i-checks" ng-model="feature.amstatIntegration" icheck> AMSTAT Integration </label> |
124 | </div> | 124 | </div> |
125 | <div> | 125 | <div> |
126 | <label> <input type="checkbox" class="i-checks" ng-model="feature.posAccountingIntegration" icheck> POS Accounting Integration </label> | 126 | <label> <input type="checkbox" class="i-checks" ng-model="feature.posAccountingIntegration" icheck> POS Accounting Integration </label> |
127 | </div> | 127 | </div> |
128 | <div> | 128 | <div> |
129 | <label> <input type="checkbox" class="i-checks" ng-model="feature.posVeederRootIntegration" icheck> POS VeederRoot Integration </label> | 129 | <label> <input type="checkbox" class="i-checks" ng-model="feature.posVeederRootIntegration" icheck> POS VeederRoot Integration </label> |
130 | </div> | 130 | </div> |
131 | </div> | 131 | </div> |
132 | <div class="col-lg-9" style="padding: 0;"> | 132 | <div class="col-lg-9" style="padding: 0;"> |
133 | <div class="col-lg-6"> | 133 | <div class="col-lg-6"> |
134 | <div class="form-group" style="margin-top: 18px;" id="esAccId"> | 134 | <div class="form-group" style="margin-top: 18px;" id="esAccId"> |
135 | <label class="control-label pull-left" style="color: #1ab394;line-height: 34px;">Essinta Account UID</label> | 135 | <label class="control-label pull-left" style="color: #1ab394;line-height: 34px;">Essinta Account UID</label> |
136 | <div class="col-lg-6"> | 136 | <div class="col-lg-6"> |
137 | <input type="text" placeholder="" ng-disabled="essAccountId" style="border-color: #1ab394;" class="form-control" ng-model="feature.essintaAccountUid"> | 137 | <input type="text" placeholder="" ng-disabled="essAccountId" style="border-color: #1ab394;" class="form-control" ng-model="feature.essintaAccountUid"> |
138 | </div> | 138 | </div> |
139 | </div> | 139 | </div> |
140 | </div> | 140 | </div> |
141 | <div class="col-lg-6"> | 141 | <div class="col-lg-6"> |
142 | <div class="form-group" style="margin-top: 18px;"> | 142 | <div class="form-group" style="margin-top: 18px;"> |
143 | <label class="control-label pull-left" style="color: #ffa149;line-height: 34px;">Additional Device Licences</label> | 143 | <label class="control-label pull-left" style="color: #ffa149;line-height: 34px;">Additional Device Licences</label> |
144 | <div class="col-lg-6"> | 144 | <div class="col-lg-6"> |
145 | <input type="text" placeholder="" style="border-color: #ffa149 !important;" ng-model="feature.additionalLicences" class="form-control"> | 145 | <input type="text" placeholder="" style="border-color: #ffa149 !important;" ng-model="feature.additionalLicences" class="form-control"> |
146 | </div> | 146 | </div> |
147 | </div> | 147 | </div> |
148 | </div> | 148 | </div> |
149 | </div> | 149 | </div> |
150 | 150 | ||
151 | </form> | 151 | </form> |
152 | </div> | 152 | </div> |
153 | </div> | 153 | </div> |
154 | </div> | 154 | </div> |
155 | </div> | 155 | </div> |
156 | </div> | 156 | </div> |
157 | </div> | ||
157 | <!--Delete model--> | ||
158 | </div> | ||
159 | <div class="customConfirmPopBackdrop" id="delete2"> | ||
160 | <div class="customModalInner" style="max-width: 400px;"> | ||
161 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | ||
162 | <table> | ||
163 | <tr> | ||
164 | <td> | ||
165 | <img src="images/info.png" style="width: 50px;"> | ||
166 | </td> | ||
167 | <td> | ||
168 | <p style="padding: 5px 10px; margin-bottom: 0;">Please confirm! Are you sure you want to DELETE this User & its related data?</p> | ||
169 | </td> | ||
170 | </tr> | ||
171 | </table> | ||
172 | </div> | ||
173 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | ||
174 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="deleteUserData()">Accept</button> | ||
175 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDelete()">Cancel</button> | ||
176 | </div> | ||
177 | </div> | ||
178 | </div> | ||
179 |
app/views/updateAllFBO/updateAllFBO.service.js
1 | (function() { | 1 | (function() { |
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | .service('UpdateAllFBO', ['$rootScope', '$q', '$http', 'BE', UpdateAllFBO]) | 5 | .service('UpdateAllFBO', ['$rootScope', '$q', '$http', 'BE', UpdateAllFBO]) |
6 | 6 | ||
7 | function UpdateAllFBO($rootScope, $q, $http, BE) { | 7 | function UpdateAllFBO($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 | 22 | ||
23 | this.getNotes = function(id) { | 23 | this.getNotes = function(id) { |
24 | 24 | ||
25 | var deferred = $q.defer(); | 25 | var deferred = $q.defer(); |
26 | $http({ | 26 | $http({ |
27 | method : 'GET', | 27 | method : 'GET', |
28 | url : BE.url +'/account/user/'+id + '/notes', | 28 | url : BE.url +'/account/user/'+id + '/notes', |
29 | headers : {'Content-Type': 'application/json'}, | 29 | headers : {'Content-Type': 'application/json'}, |
30 | }) | 30 | }) |
31 | .success(function(result) { | 31 | .success(function(result) { |
32 | deferred.resolve(result); | 32 | deferred.resolve(result); |
33 | }) | 33 | }) |
34 | return deferred.promise; | 34 | return deferred.promise; |
35 | } | 35 | } |
36 | 36 | ||
37 | this.updateUser = function(data) { | 37 | this.updateUser = function(data) { |
38 | 38 | ||
39 | var deferred = $q.defer(); | 39 | var deferred = $q.defer(); |
40 | $http({ | 40 | $http({ |
41 | method : 'PUT', | 41 | method : 'PUT', |
42 | url : BE.url +'/account/updateProfile', | 42 | url : BE.url +'/account/updateProfile', |
43 | headers : {'Content-Type': 'application/x-www-form-urlencoded'}, | 43 | headers : {'Content-Type': 'application/x-www-form-urlencoded'}, |
44 | data: data | 44 | data: data |
45 | }) | 45 | }) |
46 | .success(function(result) { | 46 | .success(function(result) { |
47 | deferred.resolve(result); | 47 | deferred.resolve(result); |
48 | }) | 48 | }) |
49 | return deferred.promise; | 49 | return deferred.promise; |
50 | } | 50 | } |
51 | 51 | ||
52 | this.updatefeatureControl = function(data) { | 52 | this.updatefeatureControl = function(data) { |
53 | 53 | ||
54 | var deferred = $q.defer(); | 54 | var deferred = $q.defer(); |
55 | $http({ | 55 | $http({ |
56 | method : 'PUT', | 56 | method : 'PUT', |
57 | url : BE.url +'/account/user/updateAccountFeatureControl', | 57 | url : BE.url +'/account/user/updateAccountFeatureControl', |
58 | headers : {'Content-Type': 'application/json'}, | 58 | headers : {'Content-Type': 'application/json'}, |
59 | data: data | 59 | data: data |
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 | /* Delete API service for FBO Admin (In AccountResource.java)*/ | ||
68 | this.deleteUser = function(id) { | ||
69 | var deferred = $q.defer(); | ||
70 | $http({ | ||
71 | method : 'DELETE', | ||
72 | url : BE.url +'/account/deleteUser/'+id, | ||
73 | headers : {'Content-Type': 'application/json'}, | ||
74 | }) | ||
75 | .success(function(result) { | ||
76 | deferred.resolve(result); | ||
77 | }) | ||
78 | return deferred.promise; | ||
79 | } | ||
80 | |||
67 | } | 81 | } |
68 | 82 | ||
69 | })(); | 83 | })(); |
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; | 14 | $scope.companyId; |
15 | 15 | ||
16 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { | 16 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { |
17 | console.log(result) | 17 | // console.log(result) |
18 | $scope.user = result; | 18 | $scope.user = result; |
19 | // $scope.aircraft.accountId = result.account.id; | 19 | // $scope.aircraft.accountId = result.account.id; |
20 | $scope.user.userTypeId = result.userType.id; | 20 | $scope.user.userTypeId = result.userType.id; |
21 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { | 21 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { |
22 | $scope.user.clientNote = response[0].notes | 22 | $scope.user.clientNote = response[0].notes |
23 | $scope.user.userNoteId = response[0].id; | 23 | $scope.user.userNoteId = response[0].id; |
24 | }) | 24 | }) |
25 | // $scope.feature = result.accountFeatureControl; | 25 | // $scope.feature = result.accountFeatureControl; |
26 | // console.log($scope.feature,"dsdsdsds") | 26 | // console.log($scope.feature,"dsdsdsds") |
27 | if($scope.user.account.user.status == 'ACTIVE'){ | 27 | if($scope.user.account.user.status == 'ACTIVE'){ |
28 | $scope.status = true; | 28 | $scope.status = true; |
29 | }else { | 29 | }else { |
30 | $scope.status = false; | 30 | $scope.status = false; |
31 | } | 31 | } |
32 | }) | 32 | }) |
33 | 33 | ||
34 | UpdateAllFBODept.getAssociatedCompany(userProfileID).then(function(result) { | 34 | UpdateAllFBODept.getAssociatedCompany(userProfileID).then(function(result) { |
35 | console.log('=======q===',result) | 35 | // console.log('=======q===',result) |
36 | $scope.companyId = result.id; | 36 | $scope.companyId = result.id; |
37 | getCrafts(result.id); | 37 | getCrafts(result.id); |
38 | $scope.aircraft.accountId = result.id; | 38 | $scope.aircraft.accountId = result.id; |
39 | }) | 39 | }) |
40 | 40 | ||
41 | 41 | ||
42 | function getCrafts(id){ | 42 | function getCrafts(id){ |
43 | UpdateAllFBODept.getAircrafts(id).then(function(response) { | 43 | UpdateAllFBODept.getAircrafts(id).then(function(response) { |
44 | $scope.getCraftList = response; | 44 | $scope.getCraftList = response; |
45 | for(var i=0;i<$scope.getCraftList.length;i++){ | 45 | for(var i=0;i<$scope.getCraftList.length;i++){ |
46 | $scope.getCraftList[i].sizeId = $scope.getCraftList[i].compAircraftSize.id; | 46 | $scope.getCraftList[i].sizeId = $scope.getCraftList[i].compAircraftSize.id; |
47 | $scope.getCraftList[i].size = $scope.getCraftList[i].compAircraftSize.size; | 47 | $scope.getCraftList[i].size = $scope.getCraftList[i].compAircraftSize.size; |
48 | } | 48 | } |
49 | }) | 49 | }) |
50 | } | 50 | } |
51 | 51 | ||
52 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { | 52 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { |
53 | $scope.paymentList = response; | 53 | $scope.paymentList = response; |
54 | 54 | ||
55 | }) | 55 | }) |
56 | 56 | ||
57 | $scope.openCard = function(payment){ | 57 | $scope.openCard = function(payment){ |
58 | console.log(payment) | 58 | //console.log(payment) |
59 | $scope.showPayments = false; | 59 | $scope.showPayments = false; |
60 | $scope.data = {}; | 60 | $scope.data = {}; |
61 | $scope.data.cardNumber = payment.cardNumber; | 61 | $scope.data.cardNumber = payment.cardNumber; |
62 | $scope.data.cardType = payment.cardType; | 62 | $scope.data.cardType = payment.cardType; |
63 | $scope.data.expiryDate = payment.expiryDate; | 63 | $scope.data.expiryDate = payment.expiryDate; |
64 | $scope.data.id = payment.id; | 64 | $scope.data.id = payment.id; |
65 | $scope.data.accountId = payment.user.account.id; | 65 | $scope.data.accountId = payment.user.account.id; |
66 | } | 66 | } |
67 | 67 | ||
68 | var cardData = {} | 68 | var cardData = {} |
69 | cardData.paymentMethodList = []; | 69 | cardData.paymentMethodList = []; |
70 | $scope.updateCard = function(){ | 70 | $scope.updateCard = function(){ |
71 | console.log($scope.data) | 71 | // console.log($scope.data) |
72 | cardData.paymentMethodList.push($scope.data); | 72 | cardData.paymentMethodList.push($scope.data); |
73 | console.log("cardData", cardData); | 73 | // console.log("cardData", cardData); |
74 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { | 74 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { |
75 | console.log(result) | 75 | // console.log(result) |
76 | toastr.success('Updated Successfully', { | 76 | toastr.success('Updated Successfully', { |
77 | closeButton: true | 77 | closeButton: true |
78 | }) | 78 | }) |
79 | $scope.reset(); | 79 | $scope.reset(); |
80 | }) | 80 | }) |
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | $scope.reset = function(){ | 84 | $scope.reset = function(){ |
85 | cardData.paymentMethodList = []; | 85 | cardData.paymentMethodList = []; |
86 | } | 86 | } |
87 | 87 | ||
88 | $scope.checkUsername = function(){ | 88 | $scope.checkUsername = function(){ |
89 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | 89 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { |
90 | console.log(status) | 90 | // console.log(status) |
91 | if(status != 200){ | 91 | if(status != 200){ |
92 | toastr.error('This email has alreay taken', { | 92 | toastr.error('This email has alreay taken', { |
93 | closeButton: true | 93 | closeButton: true |
94 | }) | 94 | }) |
95 | } | 95 | } |
96 | }) | 96 | }) |
97 | } | 97 | } |
98 | 98 | ||
99 | $scope.userData = function(){ | 99 | $scope.userData = function(){ |
100 | console.log($scope.user.userTypeId) | 100 | // console.log($scope.user.userTypeId) |
101 | if($scope.user.email == undefined || $scope.user.email == null){ | 101 | if($scope.user.email == undefined || $scope.user.email == null){ |
102 | toastr.error('Please enter your email first', { | 102 | toastr.error('Please enter your email first', { |
103 | closeButton: true | 103 | closeButton: true |
104 | }) | 104 | }) |
105 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 105 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
106 | toastr.error('Please enter your First Name', { | 106 | toastr.error('Please enter your First Name', { |
107 | closeButton: true | 107 | closeButton: true |
108 | }) | 108 | }) |
109 | }else{ | 109 | }else{ |
110 | if($scope.status == true){ | 110 | if($scope.status == true){ |
111 | $scope.user.status = 'active'; | 111 | $scope.user.status = 'active'; |
112 | }else{ | 112 | }else{ |
113 | $scope.user.status = 'inactive'; | 113 | $scope.user.status = 'inactive'; |
114 | } | 114 | } |
115 | $scope.user.username = $scope.user.email; | 115 | $scope.user.username = $scope.user.email; |
116 | $scope.user.userType = 'flightDetp'; | 116 | $scope.user.userType = 'flightDetp'; |
117 | console.log($scope.user) | 117 | // console.log($scope.user) |
118 | // if($scope.user.userNoteId == undefined){ | 118 | // if($scope.user.userNoteId == undefined){ |
119 | // $scope.user.userNoteId = null; | 119 | // $scope.user.userNoteId = null; |
120 | // } | 120 | // } |
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; | 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; |
122 | UpdateAllFBO.updateUser(updateData).then(function(result) { | 122 | UpdateAllFBO.updateUser(updateData).then(function(result) { |
123 | toastr.success(''+result.success+'', { | 123 | toastr.success(''+result.success+'', { |
124 | closeButton: true | 124 | closeButton: true |
125 | }) | 125 | }) |
126 | }) | 126 | }) |
127 | $state.go('index.flightDept'); | 127 | $state.go('index.flightDept'); |
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | getData(); | 131 | getData(); |
132 | function getData(){ | 132 | function getData(){ |
133 | FBOFlight.getAircraftMake().then(function(result) { | 133 | FBOFlight.getAircraftMake().then(function(result) { |
134 | $scope.aircraftMakeList = result; | 134 | $scope.aircraftMakeList = result; |
135 | $scope.aircraft.make = $scope.aircraftMakeList[0]; | 135 | $scope.aircraft.make = $scope.aircraftMakeList[0]; |
136 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 136 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
137 | $scope.aircraftModalList = result; | 137 | $scope.aircraftModalList = result; |
138 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 138 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
139 | 139 | ||
140 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 140 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
141 | $scope.aircraftSizeList = result; | 141 | $scope.aircraftSizeList = result; |
142 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 142 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
143 | 143 | ||
144 | }) | 144 | }) |
145 | }) | 145 | }) |
146 | 146 | ||
147 | }) | 147 | }) |
148 | } | 148 | } |
149 | 149 | ||
150 | $scope.getModal = function(){ | 150 | $scope.getModal = function(){ |
151 | var makeId = $scope.aircraft.make | 151 | var makeId = $scope.aircraft.make |
152 | FBOFlight.getModal(makeId).then(function(result) { | 152 | FBOFlight.getModal(makeId).then(function(result) { |
153 | $scope.aircraftModalList = result; | 153 | $scope.aircraftModalList = result; |
154 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 154 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
155 | 155 | ||
156 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | 156 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { |
157 | $scope.aircraftSizeList = result; | 157 | $scope.aircraftSizeList = result; |
158 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 158 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
159 | }) | 159 | }) |
160 | }) | 160 | }) |
161 | } | 161 | } |
162 | 162 | ||
163 | $scope.getSize = function(){ | 163 | $scope.getSize = function(){ |
164 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 164 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
165 | $scope.aircraftSizeList = result; | 165 | $scope.aircraftSizeList = result; |
166 | console.log($scope.aircraftSizeList) | 166 | // console.log($scope.aircraftSizeList) |
167 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 167 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
168 | console.log($scope.aircraft.sizeId) | 168 | // console.log($scope.aircraft.sizeId) |
169 | }) | 169 | }) |
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | $scope.addAircraft = function(){ | 174 | $scope.addAircraft = function(){ |
175 | $scope.aircraftListData = {}; | 175 | $scope.aircraftListData = {}; |
176 | $scope.addData = []; | 176 | $scope.addData = []; |
177 | $scope.aircraftListData.aircraftList= []; | 177 | $scope.aircraftListData.aircraftList= []; |
178 | 178 | ||
179 | $scope.addData.push({ | 179 | $scope.addData.push({ |
180 | 'tail': $scope.aircraft.tail, | 180 | 'tail': $scope.aircraft.tail, |
181 | 'make': $scope.aircraft.make, | 181 | 'make': $scope.aircraft.make, |
182 | 'model': $scope.aircraft.model, | 182 | 'model': $scope.aircraft.model, |
183 | 'sizeId' : $scope.aircraft.sizeId | 183 | 'sizeId' : $scope.aircraft.sizeId |
184 | }); | 184 | }); |
185 | console.log('$scope.addData',$scope.addData); | 185 | // console.log('$scope.addData',$scope.addData); |
186 | 186 | ||
187 | $scope.aircraftListData.aircraftList = $scope.addData; | 187 | $scope.aircraftListData.aircraftList = $scope.addData; |
188 | $scope.aircraftListData.accountId = $scope.companyId; | 188 | $scope.aircraftListData.accountId = $scope.companyId; |
189 | console.log($scope.aircraft) | 189 | // console.log($scope.aircraft) |
190 | //$scope.aircraftData.aircraftList.push($scope.aircraft); | 190 | //$scope.aircraftData.aircraftList.push($scope.aircraft); |
191 | 191 | ||
192 | FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { | 192 | FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { |
193 | $('#myModal4').modal('hide'); | 193 | $('#myModal4').modal('hide'); |
194 | getCrafts($scope.companyId); | 194 | getCrafts($scope.companyId); |
195 | $scope.resetData(); | 195 | $scope.resetData(); |
196 | toastr.success('Created Successfully', { | 196 | toastr.success('Created Successfully', { |
197 | closeButton: true | 197 | closeButton: true |
198 | }) | 198 | }) |
199 | }, function (err) { | 199 | }, function (err) { |
200 | toastr.error('Error in Adding Aircraft', { | 200 | toastr.error('Error in Adding Aircraft', { |
201 | closeButton: true | 201 | closeButton: true |
202 | }) | 202 | }) |
203 | $('#myModal4').modal('hide'); | 203 | $('#myModal4').modal('hide'); |
204 | $scope.getCraftList.splice($scope.aircraft); | 204 | // console.log("aircraf---",$scope.aircraft) |
205 | // $scope.getCraftList.splice($scope.aircraft); | ||
205 | }); | 206 | }); |
206 | } | 207 | } |
207 | 208 | ||
208 | $scope.closeModal = function(){ | 209 | $scope.closeModal = function(){ |
209 | $("#myModal5").modal('hide'); | 210 | $("#myModal5").modal('hide'); |
210 | $scope.resetData(); | 211 | $scope.resetData(); |
211 | } | 212 | } |
212 | 213 | ||
213 | $scope.update = function(airdata){ | 214 | $scope.update = function(airdata){ |
214 | $("#myModal5").modal('show'); | 215 | $("#myModal5").modal('show'); |
215 | $scope.aircraft = airdata; | 216 | $scope.aircraft = airdata; |
216 | console.log('--------$scope.companyId---',$scope.companyId); | 217 | // console.log('--------$scope.companyId---',$scope.companyId); |
217 | $scope.aircraft.accountId = $scope.companyId; | 218 | $scope.aircraft.accountId = $scope.companyId; |
218 | 219 | ||
219 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 220 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
220 | $scope.aircraftModalList = result; | 221 | $scope.aircraftModalList = result; |
221 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 222 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
222 | $scope.aircraftSizeList = result; | 223 | $scope.aircraftSizeList = result; |
223 | console.log($scope.aircraftSizeList) | 224 | // console.log($scope.aircraftSizeList) |
224 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 225 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
225 | }) | 226 | }) |
226 | }) | 227 | }) |
227 | } | 228 | } |
228 | 229 | ||
229 | $scope.updatecraftData = {}; | 230 | $scope.updatecraftData = {}; |
230 | $scope.updatecraftData.aircraftList = []; | 231 | $scope.updatecraftData.aircraftList = []; |
231 | $scope.updateAircraftData = {}; | 232 | $scope.updateAircraftData = {}; |
232 | 233 | ||
233 | $scope.updateAircraft = function(updateAircraft){ | 234 | $scope.updateAircraft = function(updateAircraft){ |
234 | $scope.updateAircraftData.id = updateAircraft.id; | 235 | $scope.updateAircraftData.id = updateAircraft.id; |
235 | $scope.updateAircraftData.make = updateAircraft.make; | 236 | $scope.updateAircraftData.make = updateAircraft.make; |
236 | $scope.updateAircraftData.model = updateAircraft.model; | 237 | $scope.updateAircraftData.model = updateAircraft.model; |
237 | $scope.updateAircraftData.sizeId = updateAircraft.sizeId; | 238 | $scope.updateAircraftData.sizeId = updateAircraft.sizeId; |
238 | $scope.updateAircraftData.tail = updateAircraft.tail; | 239 | $scope.updateAircraftData.tail = updateAircraft.tail; |
239 | $scope.updateAircraftData.accountId = $scope.companyId; | 240 | $scope.updateAircraftData.accountId = $scope.companyId; |
240 | console.log($scope.updateAircraftData) | 241 | // console.log($scope.updateAircraftData) |
241 | 242 | ||
242 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); | 243 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); |
243 | console.log($scope.updatecraftData.aircraftList) | 244 | // console.log($scope.updatecraftData.aircraftList) |
244 | 245 | ||
245 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { | 246 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { |
246 | $('#myModal5').modal('hide'); | 247 | $('#myModal5').modal('hide'); |
247 | $scope.resetData(); | 248 | $scope.resetData(); |
248 | getCrafts($scope.companyId); | 249 | getCrafts($scope.companyId); |
249 | toastr.success('Updated Successfully', { | 250 | toastr.success('Updated Successfully', { |
250 | closeButton: true | 251 | closeButton: true |
251 | }) | 252 | }) |
252 | }, function (err) { | 253 | }, function (err) { |
253 | toastr.error('Error in Updating Aircraft', { | 254 | toastr.error('Error in Updating Aircraft', { |
254 | closeButton: true | 255 | closeButton: true |
255 | }) | 256 | }) |
256 | $('#myModal5').modal('hide'); | 257 | $('#myModal5').modal('hide'); |
257 | $scope.getCraftList.splice($scope.aircraft); | 258 | $scope.getCraftList.splice($scope.aircraft); |
258 | }); | 259 | }); |
259 | } | 260 | } |
260 | 261 | ||
261 | $scope.remove = function(data){ | 262 | $scope.remove = function(data){ |
262 | console.log(data) | 263 | //console.log(data) |
263 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { | 264 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { |
264 | toastr.success(''+result.success+'', { | 265 | toastr.success(''+result.success+'', { |
265 | closeButton: true | 266 | closeButton: true |
266 | }) | 267 | }) |
267 | getCrafts($scope.companyId); | 268 | getCrafts($scope.companyId); |
268 | }) | 269 | }) |
269 | } | 270 | } |
270 | 271 | ||
271 | $scope.resetData = function() { | 272 | $scope.resetData = function() { |
272 | $scope.aircraft = {}; | 273 | $scope.aircraft = {}; |
273 | $scope.aircraft.accountId = $scope.companyId; | 274 | $scope.aircraft.accountId = $scope.companyId; |
274 | $scope.aircraftListData.aircraftList = []; | 275 | $scope.aircraftListData.aircraftList = []; |
275 | getData(); | 276 | getData(); |
276 | } | 277 | } |
277 | 278 | ||
279 | |||
280 | var deleteFlightDeptUserId = ""; | ||
281 | $scope.deleteData = function(userid){ | ||
282 | $('#delete2').css('display', 'block'); | ||
283 | //console.log("kd user id--",userid) | ||
284 | deleteFlightDeptUserId = userid; | ||
285 | |||
286 | } | ||
287 | |||
288 | $scope.deleteUserData = function(){ | ||
289 | // console.log("api hit") | ||
290 | UpdateAllFBODept.deleteUser(deleteFlightDeptUserId).then(function(result) { | ||
291 | $('#delete2').css('display', 'none'); | ||
292 | if(result.success){ | ||
293 | toastr.success(''+result.success+'', { | ||
294 | closeButton: true | ||
295 | |||
296 | }) | ||
297 | }else{ | ||
298 | toastr.error(''+result.statusText+'', { | ||
299 | closeButton: true | ||
300 | |||
301 | }) | ||
302 | } | ||
303 | $state.go('index.flightDept') | ||
304 | }) | ||
305 | } | ||
306 | $scope.cancelDelete = function(){ | ||
307 | $('#delete2').css('display', 'none'); | ||
308 | } | ||
309 | |||
278 | }); | 310 | }); |
app/views/updateFBODept/updateFBODept.html
1 | 1 | ||
2 | <div class="row wrapper border-bottom white-bg page-heading"> | 2 | <div class="row wrapper border-bottom white-bg page-heading"> |
3 | <div class="col-lg-3"> | 3 | <div class="col-lg-3"> |
4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> --> | 4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> --> |
5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | 5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> |
6 | </div> | 6 | </div> |
7 | <div class="col-lg-3" style="margin-top: 20px;"> | 7 | <div class="col-lg-3" style="margin-top: 20px;"> |
8 | <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> | 8 | <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData(user.id)">Delete Account</button> |
9 | </div> | 9 | </div> |
10 | <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> | 10 | <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> |
11 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> | 11 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> |
12 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> | 12 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> |
13 | </div> | 13 | </div> |
14 | </div> | 14 | </div> |
15 | <div class="wrapper wrapper-content animated fadeInRight"> | 15 | <div class="wrapper wrapper-content animated fadeInRight"> |
16 | <div class="row"> | 16 | <div class="row"> |
17 | <div class="col-lg-7"> | 17 | <div class="col-lg-7"> |
18 | <div class="ibox float-e-margins"> | 18 | <div class="ibox float-e-margins"> |
19 | <div class="ibox-title"> | 19 | <div class="ibox-title"> |
20 | <div class="pull-left"> | 20 | <div class="pull-left"> |
21 | <h5>Contact Information</h5> | 21 | <h5>Contact Information</h5> |
22 | </div> | 22 | </div> |
23 | <div class="pull-right my-toggle-switch"> | 23 | <div class="pull-right my-toggle-switch"> |
24 | <div class="switch"> | 24 | <div class="switch"> |
25 | <div class="onoffswitch"> | 25 | <div class="onoffswitch"> |
26 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> | 26 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> |
27 | <label class="onoffswitch-label" for="example1"> | 27 | <label class="onoffswitch-label" for="example1"> |
28 | <span class="onoffswitch-inner"></span> | 28 | <span class="onoffswitch-inner"></span> |
29 | <span class="onoffswitch-switch"></span> | 29 | <span class="onoffswitch-switch"></span> |
30 | </label> | 30 | </label> |
31 | </div> | 31 | </div> |
32 | </div> | 32 | </div> |
33 | </div> | 33 | </div> |
34 | <div class="clearfix"></div> | 34 | <div class="clearfix"></div> |
35 | </div> | 35 | </div> |
36 | <div class="ibox-content"> | 36 | <div class="ibox-content"> |
37 | <div class="row"> | 37 | <div class="row"> |
38 | <form role="form"> | 38 | <form role="form"> |
39 | <div class="col-sm-6 b-r"> | 39 | <div class="col-sm-6 b-r"> |
40 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> | 40 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> |
41 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control" ng-blur="checkUsername()"></div> | 41 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control" ng-blur="checkUsername()"></div> |
42 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> | 42 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> |
43 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> | 43 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
44 | <!-- <div> | 44 | <!-- <div> |
45 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> | 45 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> |
46 | <label> <input type="checkbox" class="i-checks"> Remember me </label> | 46 | <label> <input type="checkbox" class="i-checks"> Remember me </label> |
47 | </div> --> | 47 | </div> --> |
48 | 48 | ||
49 | </div> | 49 | </div> |
50 | <div class="col-sm-6"> | 50 | <div class="col-sm-6"> |
51 | <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> --> | 51 | <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> --> |
52 | <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div> | 52 | <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div> |
53 | <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> | 53 | <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> |
54 | </div> | 54 | </div> |
55 | </form> | 55 | </form> |
56 | </div> | 56 | </div> |
57 | </div> | 57 | </div> |
58 | </div> | 58 | </div> |
59 | </div> | 59 | </div> |
60 | <div class="col-lg-5"> | 60 | <div class="col-lg-5"> |
61 | <div class="ibox float-e-margins"> | 61 | <div class="ibox float-e-margins"> |
62 | <div class="ibox-title"> | 62 | <div class="ibox-title"> |
63 | <h5>Client Notes</h5> | 63 | <h5>Client Notes</h5> |
64 | 64 | ||
65 | </div> | 65 | </div> |
66 | <div class="ibox-content"> | 66 | <div class="ibox-content"> |
67 | <div class="row"> | 67 | <div class="row"> |
68 | <form role="form"> | 68 | <form role="form"> |
69 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> | 69 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> |
70 | </form> | 70 | </form> |
71 | </div> | 71 | </div> |
72 | </div> | 72 | </div> |
73 | 73 | ||
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | </div> | 76 | </div> |
77 | </div> | 77 | </div> |
78 | 78 | ||
79 | <div> | 79 | <div> |
80 | <div class="row"> | 80 | <div class="row"> |
81 | <div class="col-lg-7"> | 81 | <div class="col-lg-7"> |
82 | <div class="ibox float-e-margins"> | 82 | <div class="ibox float-e-margins"> |
83 | <div class="ibox-title"> | 83 | <div class="ibox-title"> |
84 | <div> | 84 | <div> |
85 | <h3 style="float: left;">Aircraft List</h3> | 85 | <h3 style="float: left;">Aircraft List</h3> |
86 | </div> | 86 | </div> |
87 | <div class="pull-right"> | 87 | <div class="pull-right"> |
88 | <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal4">+ Add</button> | 88 | <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal4">+ Add</button> |
89 | </div> | 89 | </div> |
90 | <div class="clearfix"></div> | 90 | <div class="clearfix"></div> |
91 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> | 91 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> |
92 | <div class="modal-dialog"> | 92 | <div class="modal-dialog"> |
93 | <div class="modal-content animated fadeIn"> | 93 | <div class="modal-content animated fadeIn"> |
94 | <div class="modal-header"> | 94 | <div class="modal-header"> |
95 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | 95 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
96 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> | 96 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> |
97 | <h4 class="modal-title">Add Aircraft</h4> | 97 | <h4 class="modal-title">Add Aircraft</h4> |
98 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> | 98 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> |
99 | </div> | 99 | </div> |
100 | <div class="modal-body" style="padding: 15px;"> | 100 | <div class="modal-body" style="padding: 15px;"> |
101 | <table class="table table-bordered table-hover table-striped"> | 101 | <table class="table table-bordered table-hover table-striped"> |
102 | <thead> | 102 | <thead> |
103 | <tr> | 103 | <tr> |
104 | <th>Tail</th> | 104 | <th>Tail</th> |
105 | <th>Make</th> | 105 | <th>Make</th> |
106 | <th>Model</th> | 106 | <th>Model</th> |
107 | <th>Size</th> | 107 | <th>Size</th> |
108 | </tr> | 108 | </tr> |
109 | </thead> | 109 | </thead> |
110 | <tbody> | 110 | <tbody> |
111 | <tr> | 111 | <tr> |
112 | <td> | 112 | <td> |
113 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | 113 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> |
114 | </td> | 114 | </td> |
115 | <td style="width: 30%"> | 115 | <td style="width: 30%"> |
116 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | 116 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> |
117 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 117 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
118 | </select> | 118 | </select> |
119 | </td> | 119 | </td> |
120 | <td style="width: 30%"> | 120 | <td style="width: 30%"> |
121 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | 121 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> |
122 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | 122 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
123 | </select> | 123 | </select> |
124 | </td> | 124 | </td> |
125 | <td style="width: 30%"> | 125 | <td style="width: 30%"> |
126 | <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> | 126 | <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> |
127 | 127 | ||
128 | <!-- <select class="form-control" ng-model="aircraft.size"> | 128 | <!-- <select class="form-control" ng-model="aircraft.size"> |
129 | <option ng-repeat="size in aircraftSizeList">{{size.aircraftSize.size}}</option> | 129 | <option ng-repeat="size in aircraftSizeList">{{size.aircraftSize.size}}</option> |
130 | </select> --> | 130 | </select> --> |
131 | </td> | 131 | </td> |
132 | </tr> | 132 | </tr> |
133 | </tbody> | 133 | </tbody> |
134 | </table> | 134 | </table> |
135 | </div> | 135 | </div> |
136 | <div class="modal-footer"> | 136 | <div class="modal-footer"> |
137 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> | 137 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> |
138 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> | 138 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> |
139 | </div> | 139 | </div> |
140 | </div> | 140 | </div> |
141 | </div> | 141 | </div> |
142 | </div> | 142 | </div> |
143 | </div> | 143 | </div> |
144 | <div class="ibox-content"> | 144 | <div class="ibox-content"> |
145 | <div class="table-responsive"> | 145 | <div class="table-responsive"> |
146 | <table class="table table-bordered table-hover table-striped"> | 146 | <table class="table table-bordered table-hover table-striped"> |
147 | <thead> | 147 | <thead> |
148 | <tr> | 148 | <tr> |
149 | <th>Tail</th> | 149 | <th>Tail</th> |
150 | <th>Make</th> | 150 | <th>Make</th> |
151 | <th>Model</th> | 151 | <th>Model</th> |
152 | <th>Size</th> | 152 | <th>Size</th> |
153 | <th>Actions</th> | 153 | <th>Actions</th> |
154 | </tr> | 154 | </tr> |
155 | </thead> | 155 | </thead> |
156 | <tbody> | 156 | <tbody> |
157 | <tr ng-repeat="airData in getCraftList track by $index"> | 157 | <tr ng-repeat="airData in getCraftList track by $index"> |
158 | <td> | 158 | <td> |
159 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> | 159 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> |
160 | </td> | 160 | </td> |
161 | <td> | 161 | <td> |
162 | <select class="form-control" ng-model="airData.make"> | 162 | <select class="form-control" ng-model="airData.make"> |
163 | <option>{{airData.make}}</option> | 163 | <option>{{airData.make}}</option> |
164 | </select> | 164 | </select> |
165 | </td> | 165 | </td> |
166 | <td> | 166 | <td> |
167 | <select class="form-control" ng-model="airData.model"> | 167 | <select class="form-control" ng-model="airData.model"> |
168 | <option>{{airData.model}}</option> | 168 | <option>{{airData.model}}</option> |
169 | </select> | 169 | </select> |
170 | </td> | 170 | </td> |
171 | <td> | 171 | <td> |
172 | <!-- <select class="form-control" ng-model="airData.sizeId" ng-options="airData.userAircraftSize.id as airData.userAircraftSize.size for airData in getCraftList"></select> --> | 172 | <!-- <select class="form-control" ng-model="airData.sizeId" ng-options="airData.userAircraftSize.id as airData.userAircraftSize.size for airData in getCraftList"></select> --> |
173 | <select class="form-control" ng-model="airData.sizeId"> | 173 | <select class="form-control" ng-model="airData.sizeId"> |
174 | <option value="{{airData.sizeId}}">{{airData.size}}</option> | 174 | <option value="{{airData.sizeId}}">{{airData.size}}</option> |
175 | </select> | 175 | </select> |
176 | </td> | 176 | </td> |
177 | <td> | 177 | <td> |
178 | <i style="margin-top: 10px;" class="fa fa-pencil" ng-click="update(airData)"></i> | 178 | <i style="margin-top: 10px;" class="fa fa-pencil" ng-click="update(airData)"></i> |
179 | <i class="fa fa-trash" ng-click="remove(airData)"></i> | 179 | <i class="fa fa-trash" ng-click="remove(airData)"></i> |
180 | </td> | 180 | </td> |
181 | </tr> | 181 | </tr> |
182 | </tbody> | 182 | </tbody> |
183 | </table> | 183 | </table> |
184 | </div> | 184 | </div> |
185 | <div class="clearfix"></div> | 185 | <div class="clearfix"></div> |
186 | </div> | 186 | </div> |
187 | </div> | 187 | </div> |
188 | </div> | 188 | </div> |
189 | <div class="modal inmodal" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true"> | 189 | <div class="modal inmodal" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true"> |
190 | <div class="modal-dialog"> | 190 | <div class="modal-dialog"> |
191 | <div class="modal-content animated fadeIn"> | 191 | <div class="modal-content animated fadeIn"> |
192 | <div class="modal-header"> | 192 | <div class="modal-header"> |
193 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | 193 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
194 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> | 194 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> |
195 | <h4 class="modal-title">Update Aircraft</h4> | 195 | <h4 class="modal-title">Update Aircraft</h4> |
196 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> | 196 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> |
197 | </div> | 197 | </div> |
198 | <div class="modal-body" style="padding: 15px;"> | 198 | <div class="modal-body" style="padding: 15px;"> |
199 | <table class="table table-bordered table-hover table-striped"> | 199 | <table class="table table-bordered table-hover table-striped"> |
200 | <thead> | 200 | <thead> |
201 | <tr> | 201 | <tr> |
202 | <th>Tail</th> | 202 | <th>Tail</th> |
203 | <th>Make</th> | 203 | <th>Make</th> |
204 | <th>Model</th> | 204 | <th>Model</th> |
205 | <th>Size</th> | 205 | <th>Size</th> |
206 | </tr> | 206 | </tr> |
207 | </thead> | 207 | </thead> |
208 | <tbody> | 208 | <tbody> |
209 | <tr> | 209 | <tr> |
210 | <td> | 210 | <td> |
211 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | 211 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> |
212 | </td> | 212 | </td> |
213 | <td style="width: 30%"> | 213 | <td style="width: 30%"> |
214 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | 214 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> |
215 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 215 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
216 | </select> | 216 | </select> |
217 | </td> | 217 | </td> |
218 | <td style="width: 30%"> | 218 | <td style="width: 30%"> |
219 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | 219 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> |
220 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | 220 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
221 | </select> | 221 | </select> |
222 | </td> | 222 | </td> |
223 | <td style="width: 30%"> | 223 | <td style="width: 30%"> |
224 | <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> | 224 | <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> |
225 | 225 | ||
226 | <!-- <select class="form-control" ng-model="aircraft.size"> | 226 | <!-- <select class="form-control" ng-model="aircraft.size"> |
227 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> | 227 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> |
228 | </select> --> | 228 | </select> --> |
229 | </td> | 229 | </td> |
230 | </tr> | 230 | </tr> |
231 | </tbody> | 231 | </tbody> |
232 | </table> | 232 | </table> |
233 | </div> | 233 | </div> |
234 | <div class="modal-footer"> | 234 | <div class="modal-footer"> |
235 | <button type="button" class="btn btn-white" ng-click="closeModal()">Close</button> | 235 | <button type="button" class="btn btn-white" ng-click="closeModal()">Close</button> |
236 | <button type="button" class="btn btn-primary" ng-click="updateAircraft(aircraft)">Save changes</button> | 236 | <button type="button" class="btn btn-primary" ng-click="updateAircraft(aircraft)">Save changes</button> |
237 | </div> | 237 | </div> |
238 | </div> | 238 | </div> |
239 | </div> | 239 | </div> |
240 | </div> | 240 | </div> |
241 | <div class="col-lg-5"> | 241 | <div class="col-lg-5"> |
242 | <div class="ibox float-e-margins"> | 242 | <div class="ibox float-e-margins"> |
243 | <div class="ibox-title"> | 243 | <div class="ibox-title"> |
244 | <h5>Account Authenticatio & Payment Method</h5> | 244 | <h5>Account Authenticatio & Payment Method</h5> |
245 | 245 | ||
246 | </div> | 246 | </div> |
247 | <div class="ibox-content"> | 247 | <div class="ibox-content"> |
248 | <div class="row" ng-repeat="payment in paymentList" ng-click="openCard(payment)" style="cursor: pointer;" ng-show="showPayments"> | 248 | <div class="row" ng-repeat="payment in paymentList" ng-click="openCard(payment)" style="cursor: pointer;" ng-show="showPayments"> |
249 | <div class="col-md-3"> | 249 | <div class="col-md-3"> |
250 | <img src="images/master.png"> | 250 | <img src="images/master.png"> |
251 | </div> | 251 | </div> |
252 | <div class="col-md-9"> | 252 | <div class="col-md-9"> |
253 | <div class="col"> | 253 | <div class="col"> |
254 | <span style="font-size: large; color: #909394;">**** **** **** {{payment.cardNumber | limitTo: -4}}</span> | 254 | <span style="font-size: large; color: #909394;">**** **** **** {{payment.cardNumber | limitTo: -4}}</span> |
255 | </div> | 255 | </div> |
256 | <div class="col"> | 256 | <div class="col"> |
257 | <span><strong>Expiry Date: </strong>{{payment.expiryDate}}</span> | 257 | <span><strong>Expiry Date: </strong>{{payment.expiryDate}}</span> |
258 | </div> | 258 | </div> |
259 | </div> | 259 | </div> |
260 | <div class="clearfix"></div> | 260 | <div class="clearfix"></div> |
261 | <!-- <br> | 261 | <!-- <br> |
262 | 262 | ||
263 | <div class="col-md-3"> | 263 | <div class="col-md-3"> |
264 | <img src="images/visa1.png"> | 264 | <img src="images/visa1.png"> |
265 | </div> | 265 | </div> |
266 | <div class="col-md-9"> | 266 | <div class="col-md-9"> |
267 | <div class="col"> | 267 | <div class="col"> |
268 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> | 268 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> |
269 | </div> | 269 | </div> |
270 | <div class="col"> | 270 | <div class="col"> |
271 | <span><strong>Expiry Date:</strong>10/16</span> | 271 | <span><strong>Expiry Date:</strong>10/16</span> |
272 | </div> | 272 | </div> |
273 | </div> | 273 | </div> |
274 | <div class="clearfix"></div> --> | 274 | <div class="clearfix"></div> --> |
275 | </div> | 275 | </div> |
276 | <div class="row" ng-hide="showPayments"> | 276 | <div class="row" ng-hide="showPayments"> |
277 | <div class="container"> | 277 | <div class="container"> |
278 | <div class="row"> | 278 | <div class="row"> |
279 | <div class="col-xs-12 col-md-4"> | 279 | <div class="col-xs-12 col-md-4"> |
280 | <div class="panel panel-default credit-card-box"> | 280 | <div class="panel panel-default credit-card-box"> |
281 | <div class="panel-heading display-table" > | 281 | <div class="panel-heading display-table" > |
282 | <div class="row display-tr" > | 282 | <div class="row display-tr" > |
283 | <h3 class="panel-title display-td" >Payment Details</h3> | 283 | <h3 class="panel-title display-td" >Payment Details</h3> |
284 | <div class="display-td" > | 284 | <div class="display-td" > |
285 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> | 285 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> |
286 | </div> | 286 | </div> |
287 | </div> | 287 | </div> |
288 | </div> | 288 | </div> |
289 | <div class="panel-body"> | 289 | <div class="panel-body"> |
290 | <form role="form" id="payment-form"> | 290 | <form role="form" id="payment-form"> |
291 | <div class="row"> | 291 | <div class="row"> |
292 | <div class="col-xs-12"> | 292 | <div class="col-xs-12"> |
293 | <div class="form-group"> | 293 | <div class="form-group"> |
294 | <label for="cardNumber">CARD NUMBER</label> | 294 | <label for="cardNumber">CARD NUMBER</label> |
295 | <div class="input-group"> | 295 | <div class="input-group"> |
296 | <input type="tel" 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> | 296 | <input type="tel" 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> |
297 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> | 297 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> |
298 | </div> | 298 | </div> |
299 | </div> | 299 | </div> |
300 | </div> | 300 | </div> |
301 | </div> | 301 | </div> |
302 | <div class="row"> | 302 | <div class="row"> |
303 | <div class="col-xs-7 col-md-7"> | 303 | <div class="col-xs-7 col-md-7"> |
304 | <div class="form-group"> | 304 | <div class="form-group"> |
305 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> | 305 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> |
306 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" | 306 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" |
307 | required> | 307 | required> |
308 | </div> | 308 | </div> |
309 | </div> | 309 | </div> |
310 | <div class="col-xs-5 col-md-5 pull-right"> | 310 | <div class="col-xs-5 col-md-5 pull-right"> |
311 | <div class="form-group"> | 311 | <div class="form-group"> |
312 | <label for="cardCVC">CVV CODE</label> | 312 | <label for="cardCVC">CVV CODE</label> |
313 | <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" | 313 | <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" |
314 | required> | 314 | required> |
315 | </div> | 315 | </div> |
316 | </div> | 316 | </div> |
317 | </div> | 317 | </div> |
318 | <div class="row"> | 318 | <div class="row"> |
319 | <div class="col-xs-12"> | 319 | <div class="col-xs-12"> |
320 | <div class="form-group"> | 320 | <div class="form-group"> |
321 | <label for="name">Card Type</label> | 321 | <label for="name">Card Type</label> |
322 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> | 322 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> |
323 | <option value="creditCard" selected>Credit Card</option> | 323 | <option value="creditCard" selected>Credit Card</option> |
324 | <option value="debitCard">Debit Card</option> | 324 | <option value="debitCard">Debit Card</option> |
325 | </select> | 325 | </select> |
326 | </div> | 326 | </div> |
327 | </div> | 327 | </div> |
328 | </div> | 328 | </div> |
329 | <div class="row"> | 329 | <div class="row"> |
330 | <div class="col-xs-12"> | 330 | <div class="col-xs-12"> |
331 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="updateCard()">Update Card</button> | 331 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="updateCard()">Update Card</button> |
332 | </div> | 332 | </div> |
333 | </div> | 333 | </div> |
334 | <div class="row" style="display:none;"> | 334 | <div class="row" style="display:none;"> |
335 | <div class="col-xs-12"> | 335 | <div class="col-xs-12"> |
336 | <p class="payment-errors"></p> | 336 | <p class="payment-errors"></p> |
337 | </div> | 337 | </div> |
338 | </div> | 338 | </div> |
339 | </form> | 339 | </form> |
340 | </div> | 340 | </div> |
341 | </div> | 341 | </div> |
342 | </div> | 342 | </div> |
343 | </div> | 343 | </div> |
344 | </div> | 344 | </div> |
345 | </div> | 345 | </div> |
346 | </div> | 346 | </div> |
347 | </div> | 347 | </div> |
348 | </div> | 348 | </div> |
349 | </div> | 349 | </div> |
350 | </div> | 350 | </div> |
351 | </div> | 351 | </div> |
352 | <!--Delete model--> | ||
353 | </div> | ||
354 | <div class="customConfirmPopBackdrop" id="delete2"> | ||
355 | <div class="customModalInner" style="max-width: 400px;"> | ||
356 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | ||
357 | <table> | ||
358 | <tr> | ||
359 | <td> | ||
360 | <img src="images/info.png" style="width: 50px;"> | ||
361 | </td> | ||
362 | <td> | ||
363 | <p style="padding: 5px 10px; margin-bottom: 0;">Please confirm! Are you sure you want to DELETE this User & its related data?</p> | ||
364 | </td> | ||
365 | </tr> | ||
366 | </table> | ||
367 | </div> | ||
368 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | ||
369 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="deleteUserData()">Accept</button> | ||
370 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDelete()">Cancel</button> | ||
371 | </div> | ||
372 | </div> | ||
373 | </div> | ||
352 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> | 374 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> |
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 | 22 | ||
23 | this.getAssociatedCompany = function(id) { | 23 | this.getAssociatedCompany = function(id) { |
24 | 24 | ||
25 | var deferred = $q.defer(); | 25 | var deferred = $q.defer(); |
26 | $http({ | 26 | $http({ |
27 | method : 'GET', | 27 | method : 'GET', |
28 | url : BE.url +'/account/user/getFlightDeptCompany/'+id, | 28 | url : BE.url +'/account/user/getFlightDeptCompany/'+id, |
29 | headers : {'Content-Type': 'application/json'}, | 29 | headers : {'Content-Type': 'application/json'}, |
30 | }) | 30 | }) |
31 | .success(function(result) { | 31 | .success(function(result) { |
32 | deferred.resolve(result); | 32 | deferred.resolve(result); |
33 | }) | 33 | }) |
34 | return deferred.promise; | 34 | return deferred.promise; |
35 | } | 35 | } |
36 | 36 | ||
37 | this.getNotes = function(id) { | 37 | this.getNotes = function(id) { |
38 | 38 | ||
39 | var deferred = $q.defer(); | 39 | var deferred = $q.defer(); |
40 | $http({ | 40 | $http({ |
41 | method : 'GET', | 41 | method : 'GET', |
42 | url : BE.url +'/account/user/'+id + '/notes', | 42 | url : BE.url +'/account/user/'+id + '/notes', |
43 | headers : {'Content-Type': 'application/json'}, | 43 | headers : {'Content-Type': 'application/json'}, |
44 | }) | 44 | }) |
45 | .success(function(result) { | 45 | .success(function(result) { |
46 | deferred.resolve(result); | 46 | deferred.resolve(result); |
47 | }) | 47 | }) |
48 | return deferred.promise; | 48 | return deferred.promise; |
49 | } | 49 | } |
50 | 50 | ||
51 | this.getAircrafts = function(id) { | 51 | this.getAircrafts = function(id) { |
52 | 52 | ||
53 | var deferred = $q.defer(); | 53 | var deferred = $q.defer(); |
54 | $http({ | 54 | $http({ |
55 | method : 'GET', | 55 | method : 'GET', |
56 | url : BE.url +'/account/user/'+id + '/airCrafts', | 56 | url : BE.url +'/account/user/'+id + '/airCrafts', |
57 | headers : {'Content-Type': 'application/json'}, | 57 | headers : {'Content-Type': 'application/json'}, |
58 | }) | 58 | }) |
59 | .success(function(result) { | 59 | .success(function(result) { |
60 | deferred.resolve(result); | 60 | deferred.resolve(result); |
61 | }) | 61 | }) |
62 | return deferred.promise; | 62 | return deferred.promise; |
63 | } | 63 | } |
64 | 64 | ||
65 | this.getPaymentMethod = function(id) { | 65 | this.getPaymentMethod = function(id) { |
66 | 66 | ||
67 | var deferred = $q.defer(); | 67 | var deferred = $q.defer(); |
68 | $http({ | 68 | $http({ |
69 | method : 'GET', | 69 | method : 'GET', |
70 | url : BE.url +'/account/user/'+id + '/paymentMethods', | 70 | url : BE.url +'/account/user/'+id + '/paymentMethods', |
71 | headers : {'Content-Type': 'application/json'}, | 71 | headers : {'Content-Type': 'application/json'}, |
72 | }) | 72 | }) |
73 | .success(function(result) { | 73 | .success(function(result) { |
74 | deferred.resolve(result); | 74 | deferred.resolve(result); |
75 | }) | 75 | }) |
76 | return deferred.promise; | 76 | return deferred.promise; |
77 | } | 77 | } |
78 | 78 | ||
79 | this.updatePaymentMethod = function(data) { | 79 | this.updatePaymentMethod = function(data) { |
80 | 80 | ||
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/updatePaymentMethods', | 84 | url : BE.url +'/account/user/updatePaymentMethods', |
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 | }) | 90 | }) |
91 | return deferred.promise; | 91 | return deferred.promise; |
92 | } | 92 | } |
93 | 93 | ||
94 | this.updateAircraft = function(data) { | 94 | this.updateAircraft = function(data) { |
95 | 95 | ||
96 | var deferred = $q.defer(); | 96 | var deferred = $q.defer(); |
97 | $http({ | 97 | $http({ |
98 | method : 'PUT', | 98 | method : 'PUT', |
99 | url : BE.url +'/account/user/updateAircraft', | 99 | url : BE.url +'/account/user/updateAircraft', |
100 | headers : {'Content-Type': 'application/json'}, | 100 | headers : {'Content-Type': 'application/json'}, |
101 | data: data | 101 | data: data |
102 | }) | 102 | }) |
103 | .success(function(result) { | 103 | .success(function(result) { |
104 | deferred.resolve(result); | 104 | deferred.resolve(result); |
105 | }).error(function(error) { | 105 | }).error(function(error) { |
106 | deferred.reject(error); | 106 | deferred.reject(error); |
107 | }) | 107 | }) |
108 | return deferred.promise; | 108 | return deferred.promise; |
109 | } | 109 | } |
110 | 110 | ||
111 | this.removeAircraft = function(id) { | 111 | this.removeAircraft = function(id) { |
112 | 112 | ||
113 | var deferred = $q.defer(); | 113 | var deferred = $q.defer(); |
114 | $http({ | 114 | $http({ |
115 | method : 'DELETE', | 115 | method : 'DELETE', |
116 | url : BE.url +'/account/user/airCraft/'+id, | 116 | url : BE.url +'/account/user/airCraft/'+id, |
117 | headers : {'Content-Type': 'application/json'}, | 117 | headers : {'Content-Type': 'application/json'}, |
118 | }) | 118 | }) |
119 | .success(function(result) { | 119 | .success(function(result) { |
120 | deferred.resolve(result); | 120 | deferred.resolve(result); |
121 | }) | 121 | }) |
122 | return deferred.promise; | 122 | return deferred.promise; |
123 | } | 123 | } |
124 | 124 | ||
125 | /* Delete API service for Flight Dept Admin (In AccountUserResource.java) */ | ||
126 | this.deleteUser = function(id) { | ||
127 | var deferred = $q.defer(); | ||
128 | $http({ | ||
129 | method : 'DELETE', | ||
130 | url : BE.url +'/account/user/deleteUser/'+id, | ||
131 | headers : {'Content-Type': 'application/json'}, | ||
132 | }) | ||
133 | .success(function(result) { | ||
134 | deferred.resolve(result); | ||
135 | }) | ||
136 | return deferred.promise; | ||
137 | } | ||
138 | |||
139 | |||
140 | |||
125 | } | 141 | } |
126 | 142 | ||
127 | })(); | 143 | })(); |