Commit 47e72f4190b170522227965d35fad0032ec9f834
1 parent
20857569fd
Exists in
master
update aircraft, remove aircraft
Showing
3 changed files
with
147 additions
and
14 deletions
Show diff stats
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, UpdateAllFBODept, UpdateAllFBO, FBOFlight) { | 6 | .controller('updateFBODeptController', function($scope, $stateParams, UpdateAllFBODept, UpdateAllFBO, FBOFlight) { |
7 | $scope.showPayments = true; | 7 | $scope.showPayments = true; |
8 | $scope.aircraft = {}; | 8 | $scope.aircraft = {}; |
9 | $scope.updateData = {}; | ||
9 | var userProfileID = $stateParams.id; | 10 | var userProfileID = $stateParams.id; |
10 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { | 11 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { |
11 | console.log(result) | 12 | console.log(result) |
12 | $scope.user = result; | 13 | $scope.user = result; |
13 | $scope.aircraft.accountId = result.account.id; | 14 | $scope.aircraft.accountId = result.account.id; |
14 | $scope.user.userTypeId = result.userType.id; | 15 | $scope.user.userTypeId = result.userType.id; |
15 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { | 16 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { |
16 | $scope.user.clientNote = response[0].notes | 17 | $scope.user.clientNote = response[0].notes |
17 | $scope.user.userNoteId = response[0].id; | 18 | $scope.user.userNoteId = response[0].id; |
18 | }) | 19 | }) |
19 | // $scope.feature = result.accountFeatureControl; | 20 | // $scope.feature = result.accountFeatureControl; |
20 | // console.log($scope.feature,"dsdsdsds") | 21 | // console.log($scope.feature,"dsdsdsds") |
21 | if($scope.user.account.user.status == 'ACTIVE'){ | 22 | if($scope.user.account.user.status == 'ACTIVE'){ |
22 | $scope.status = true; | 23 | $scope.status = true; |
23 | }else { | 24 | }else { |
24 | $scope.status = false; | 25 | $scope.status = false; |
25 | } | 26 | } |
26 | }) | 27 | }) |
27 | 28 | ||
28 | UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { | 29 | getCrafts(); |
30 | function getCrafts(){ | ||
31 | UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { | ||
29 | $scope.getCraftList = response; | 32 | $scope.getCraftList = response; |
30 | }) | 33 | }) |
31 | 34 | } | |
35 | |||
32 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { | 36 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { |
33 | $scope.paymentList = response; | 37 | $scope.paymentList = response; |
34 | 38 | ||
35 | }) | 39 | }) |
36 | 40 | ||
37 | $scope.openCard = function(payment){ | 41 | $scope.openCard = function(payment){ |
38 | console.log(payment) | 42 | console.log(payment) |
39 | $scope.showPayments = false; | 43 | $scope.showPayments = false; |
40 | $scope.data = {}; | 44 | $scope.data = {}; |
41 | $scope.data.cardNumber = payment.cardNumber; | 45 | $scope.data.cardNumber = payment.cardNumber; |
42 | $scope.data.cardType = payment.cardType; | 46 | $scope.data.cardType = payment.cardType; |
43 | $scope.data.expiryDate = payment.expiryDate; | 47 | $scope.data.expiryDate = payment.expiryDate; |
44 | $scope.data.id = payment.id; | 48 | $scope.data.id = payment.id; |
45 | $scope.data.accountId = payment.user.account.id; | 49 | $scope.data.accountId = payment.user.account.id; |
46 | } | 50 | } |
47 | 51 | ||
48 | var cardData = {} | 52 | var cardData = {} |
49 | cardData.paymentMethodList = []; | 53 | cardData.paymentMethodList = []; |
50 | $scope.updateCard = function(){ | 54 | $scope.updateCard = function(){ |
51 | console.log($scope.data) | 55 | console.log($scope.data) |
52 | cardData.paymentMethodList.push($scope.data); | 56 | cardData.paymentMethodList.push($scope.data); |
53 | console.log("cardData", cardData); | 57 | console.log("cardData", cardData); |
54 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { | 58 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { |
55 | console.log(result) | 59 | console.log(result) |
56 | toastr.success('Updated Successfully', { | 60 | toastr.success('Updated Successfully', { |
57 | closeButton: true | 61 | closeButton: true |
58 | }) | 62 | }) |
59 | $scope.reset(); | 63 | $scope.reset(); |
60 | }) | 64 | }) |
61 | } | 65 | } |
62 | 66 | ||
63 | 67 | ||
64 | $scope.reset = function(){ | 68 | $scope.reset = function(){ |
65 | cardData.paymentMethodList = []; | 69 | cardData.paymentMethodList = []; |
66 | } | 70 | } |
67 | 71 | ||
68 | $scope.userData = function(){ | 72 | $scope.userData = function(){ |
69 | console.log($scope.user.userTypeId) | 73 | console.log($scope.user.userTypeId) |
70 | 74 | ||
71 | if($scope.user.account.user.status == 'ACTIVE'){ | 75 | if($scope.user.account.user.status == 'ACTIVE'){ |
72 | $scope.user.status = 'active'; | 76 | $scope.user.status = 'active'; |
73 | }else{ | 77 | }else{ |
74 | $scope.user.status = 'inactive'; | 78 | $scope.user.status = 'inactive'; |
75 | } | 79 | } |
76 | $scope.user.username = $scope.user.email; | 80 | $scope.user.username = $scope.user.email; |
77 | $scope.user.userType = 'flightDetp'; | 81 | $scope.user.userType = 'flightDetp'; |
78 | console.log($scope.user) | 82 | console.log($scope.user) |
79 | 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; | 83 | 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; |
80 | UpdateAllFBO.updateUser(updateData).then(function(result) { | 84 | UpdateAllFBO.updateUser(updateData).then(function(result) { |
81 | toastr.success(''+result.success+'', { | 85 | toastr.success(''+result.success+'', { |
82 | closeButton: true | 86 | closeButton: true |
83 | }) | 87 | }) |
84 | }) | 88 | }) |
85 | } | 89 | } |
86 | 90 | ||
87 | getData(); | 91 | getData(); |
88 | function getData(){ | 92 | function getData(){ |
89 | FBOFlight.getAircraftMake().then(function(result) { | 93 | FBOFlight.getAircraftMake().then(function(result) { |
90 | $scope.aircraftMakeList = result; | 94 | $scope.aircraftMakeList = result; |
91 | $scope.aircraft.make = $scope.aircraftMakeList[0]; | 95 | $scope.aircraft.make = $scope.aircraftMakeList[0]; |
92 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 96 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
93 | $scope.aircraftModalList = result; | 97 | $scope.aircraftModalList = result; |
94 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 98 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
95 | 99 | ||
96 | }) | 100 | }) |
97 | 101 | ||
98 | }) | 102 | }) |
99 | 103 | ||
100 | FBOFlight.getAircraftSize().then(function(result) { | 104 | FBOFlight.getAircraftSize().then(function(result) { |
101 | $scope.aircraftSizeList = result; | 105 | $scope.aircraftSizeList = result; |
102 | $scope.aircraft.size = $scope.aircraftSizeList[0]; | 106 | $scope.aircraft.size = $scope.aircraftSizeList[0]; |
103 | 107 | ||
104 | }) | 108 | }) |
105 | } | 109 | } |
106 | 110 | ||
107 | 111 | ||
108 | $scope.getModal = function(){ | 112 | $scope.getModal = function(){ |
109 | var modelId = $scope.aircraft.make | 113 | var modelId = $scope.aircraft.make |
110 | FBOFlight.getModal(modelId).then(function(result) { | 114 | FBOFlight.getModal(modelId).then(function(result) { |
111 | $scope.aircraftModalList = result; | 115 | $scope.aircraftModalList = result; |
112 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 116 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
113 | |||
114 | }) | 117 | }) |
115 | } | 118 | } |
116 | $scope.aircraftData = {}; | 119 | $scope.aircraftData = {}; |
117 | $scope.aircraftData.aircraftList = []; | 120 | $scope.aircraftData.aircraftList = []; |
118 | $scope.getCraftList = []; | ||
119 | $scope.addAircraft = function(){ | 121 | $scope.addAircraft = function(){ |
120 | $scope.aircraftData.aircraftList.push($scope.aircraft); | 122 | $scope.aircraftData.aircraftList.push($scope.aircraft); |
121 | console.log($scope.aircraftData.aircraftList) | ||
122 | if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { | ||
123 | $scope.getCraftList.push($scope.aircraft); | ||
124 | |||
125 | } | ||
126 | 123 | ||
127 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | 124 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { |
128 | $('#myModal4').modal('hide'); | 125 | $('#myModal4').modal('hide'); |
126 | getCrafts(); | ||
129 | $scope.resetData(); | 127 | $scope.resetData(); |
130 | toastr.success('Created Successfully', { | 128 | toastr.success('Created Successfully', { |
131 | closeButton: true | 129 | closeButton: true |
132 | }) | 130 | }) |
133 | }) | 131 | }) |
134 | } | 132 | } |
135 | 133 | ||
134 | $scope.closeModal = function(){ | ||
135 | $("#myModal5").modal('hide'); | ||
136 | $scope.resetData(); | ||
137 | } | ||
138 | |||
139 | $scope.update = function(airdata){ | ||
140 | console.log(airdata) | ||
141 | $scope.aircraft = airdata; | ||
142 | $scope.aircraft.accountId = $scope.user.account.id; | ||
143 | $("#myModal5").modal('show'); | ||
144 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | ||
145 | $scope.aircraftModalList = result; | ||
146 | |||
147 | }) | ||
148 | } | ||
149 | |||
150 | $scope.updatecraftData = {}; | ||
151 | $scope.updatecraftData.aircraftList = []; | ||
152 | $scope.updateAircraftData = {}; | ||
153 | |||
154 | $scope.updateAircraft = function(updateAircraft){ | ||
155 | $scope.updateAircraftData.id = updateAircraft.id; | ||
156 | $scope.updateAircraftData.make = updateAircraft.make; | ||
157 | $scope.updateAircraftData.model = updateAircraft.model; | ||
158 | $scope.updateAircraftData.size = updateAircraft.size; | ||
159 | $scope.updateAircraftData.tail = updateAircraft.tail; | ||
160 | $scope.updateAircraftData.accountId = updateAircraft.accountId; | ||
161 | console.log($scope.updateAircraftData) | ||
162 | |||
163 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); | ||
164 | console.log($scope.updatecraftData.aircraftList) | ||
165 | |||
166 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { | ||
167 | $('#myModal5').modal('hide'); | ||
168 | $scope.resetData(); | ||
169 | toastr.success('Updated Successfully', { | ||
170 | closeButton: true | ||
171 | }) | ||
172 | }) | ||
173 | } | ||
174 | |||
175 | $scope.remove = function(data){ | ||
176 | console.log(data) | ||
177 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { | ||
178 | toastr.success(''+result.success+'', { | ||
179 | closeButton: true | ||
180 | }) | ||
181 | getCrafts(); | ||
182 | }) | ||
183 | } | ||
184 | |||
136 | $scope.resetData = function() { | 185 | $scope.resetData = function() { |
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-2"> | 3 | <div class="col-lg-2"> |
4 | <h2>{{user.companyName}}</h2> | 4 | <h2>{{user.companyName}}</h2> |
5 | </div> | 5 | </div> |
6 | <div class="col-lg-4" style="margin-top: 20px;"> | 6 | <div class="col-lg-4" style="margin-top: 20px;"> |
7 | <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> | 7 | <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> |
8 | </div> | 8 | </div> |
9 | <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> | 9 | <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> |
10 | <button type="button" class="btn btn-default btn-sm">Cancel</button> | 10 | <button type="button" class="btn btn-default btn-sm">Cancel</button> |
11 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> | 11 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> |
12 | </div> | 12 | </div> |
13 | </div> | 13 | </div> |
14 | <div class="wrapper wrapper-content animated fadeInRight"> | 14 | <div class="wrapper wrapper-content animated fadeInRight"> |
15 | <div class="row"> | 15 | <div class="row"> |
16 | <div class="col-lg-7"> | 16 | <div class="col-lg-7"> |
17 | <div class="ibox float-e-margins"> | 17 | <div class="ibox float-e-margins"> |
18 | <div class="ibox-title"> | 18 | <div class="ibox-title"> |
19 | <div class="pull-left"> | 19 | <div class="pull-left"> |
20 | <h5>Contact Information</h5> | 20 | <h5>Contact Information</h5> |
21 | </div> | 21 | </div> |
22 | <div class="pull-right my-toggle-switch"> | 22 | <div class="pull-right my-toggle-switch"> |
23 | <div class="switch"> | 23 | <div class="switch"> |
24 | <div class="onoffswitch"> | 24 | <div class="onoffswitch"> |
25 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> | 25 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> |
26 | <label class="onoffswitch-label" for="example1"> | 26 | <label class="onoffswitch-label" for="example1"> |
27 | <span class="onoffswitch-inner"></span> | 27 | <span class="onoffswitch-inner"></span> |
28 | <span class="onoffswitch-switch"></span> | 28 | <span class="onoffswitch-switch"></span> |
29 | </label> | 29 | </label> |
30 | </div> | 30 | </div> |
31 | </div> | 31 | </div> |
32 | </div> | 32 | </div> |
33 | <div class="clearfix"></div> | 33 | <div class="clearfix"></div> |
34 | </div> | 34 | </div> |
35 | <div class="ibox-content"> | 35 | <div class="ibox-content"> |
36 | <div class="row"> | 36 | <div class="row"> |
37 | <form role="form"> | 37 | <form role="form"> |
38 | <div class="col-sm-6 b-r"> | 38 | <div class="col-sm-6 b-r"> |
39 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> | 39 | <!-- <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>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> --> | 40 | <!-- <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> --> |
41 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> | 41 | <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>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> | 42 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
43 | <!-- <div> | 43 | <!-- <div> |
44 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> | 44 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> |
45 | <label> <input type="checkbox" class="i-checks"> Remember me </label> | 45 | <label> <input type="checkbox" class="i-checks"> Remember me </label> |
46 | </div> --> | 46 | </div> --> |
47 | 47 | ||
48 | </div> | 48 | </div> |
49 | <div class="col-sm-6"> | 49 | <div class="col-sm-6"> |
50 | <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> --> | 50 | <!-- <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>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div> | 51 | <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>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> | 52 | <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> |
53 | </div> | 53 | </div> |
54 | </form> | 54 | </form> |
55 | </div> | 55 | </div> |
56 | </div> | 56 | </div> |
57 | </div> | 57 | </div> |
58 | </div> | 58 | </div> |
59 | <div class="col-lg-5"> | 59 | <div class="col-lg-5"> |
60 | <div class="ibox float-e-margins"> | 60 | <div class="ibox float-e-margins"> |
61 | <div class="ibox-title"> | 61 | <div class="ibox-title"> |
62 | <h5>Client Notes</h5> | 62 | <h5>Client Notes</h5> |
63 | 63 | ||
64 | </div> | 64 | </div> |
65 | <div class="ibox-content"> | 65 | <div class="ibox-content"> |
66 | <div class="row"> | 66 | <div class="row"> |
67 | <form role="form"> | 67 | <form role="form"> |
68 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> | 68 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> |
69 | </form> | 69 | </form> |
70 | </div> | 70 | </div> |
71 | </div> | 71 | </div> |
72 | 72 | ||
73 | </div> | 73 | </div> |
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | </div> | 76 | </div> |
77 | 77 | ||
78 | <div> | 78 | <div> |
79 | <div class="row"> | 79 | <div class="row"> |
80 | <div class="col-lg-7"> | 80 | <div class="col-lg-7"> |
81 | <div class="ibox float-e-margins"> | 81 | <div class="ibox float-e-margins"> |
82 | <div class="ibox-title"> | 82 | <div class="ibox-title"> |
83 | <div> | 83 | <div> |
84 | <h3 style="float: left;">Aircraft List</h3> | 84 | <h3 style="float: left;">Aircraft List</h3> |
85 | </div> | 85 | </div> |
86 | <div class="pull-right"> | 86 | <div class="pull-right"> |
87 | <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal4">+ Add</button> | 87 | <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal4">+ Add</button> |
88 | </div> | 88 | </div> |
89 | <div class="clearfix"></div> | 89 | <div class="clearfix"></div> |
90 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> | 90 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> |
91 | <div class="modal-dialog"> | 91 | <div class="modal-dialog"> |
92 | <div class="modal-content animated fadeIn"> | 92 | <div class="modal-content animated fadeIn"> |
93 | <div class="modal-header"> | 93 | <div class="modal-header"> |
94 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | 94 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
95 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> | 95 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> |
96 | <h4 class="modal-title">Add Aircraft</h4> | 96 | <h4 class="modal-title">Add Aircraft</h4> |
97 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> | 97 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> |
98 | </div> | 98 | </div> |
99 | <div class="modal-body" style="padding: 15px;"> | 99 | <div class="modal-body" style="padding: 15px;"> |
100 | <table class="table table-bordered table-hover table-striped"> | 100 | <table class="table table-bordered table-hover table-striped"> |
101 | <thead> | 101 | <thead> |
102 | <tr> | 102 | <tr> |
103 | <th>Tail</th> | 103 | <th>Tail</th> |
104 | <th>Make</th> | 104 | <th>Make</th> |
105 | <th>Model</th> | 105 | <th>Model</th> |
106 | <th>Size</th> | 106 | <th>Size</th> |
107 | </tr> | 107 | </tr> |
108 | </thead> | 108 | </thead> |
109 | <tbody> | 109 | <tbody> |
110 | <tr> | 110 | <tr> |
111 | <td> | 111 | <td> |
112 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | 112 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> |
113 | </td> | 113 | </td> |
114 | <td style="width: 30%"> | 114 | <td style="width: 30%"> |
115 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | 115 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> |
116 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 116 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
117 | </select> | 117 | </select> |
118 | </td> | 118 | </td> |
119 | <td style="width: 30%"> | 119 | <td style="width: 30%"> |
120 | <select class="form-control"> | 120 | <select class="form-control" ng-model="aircraft.model"> |
121 | <option ng-repeat="model in aircraftModalList" ng-model="aircraft.model">{{model}}</option> | 121 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
122 | </select> | 122 | </select> |
123 | </td> | 123 | </td> |
124 | <td style="width: 30%"> | 124 | <td style="width: 30%"> |
125 | <select class="form-control"> | 125 | <select class="form-control" ng-model="aircraft.size"> |
126 | <option ng-repeat="size in aircraftSizeList" ng-model="aircraft.size">{{size}}</option> | 126 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> |
127 | </select> | 127 | </select> |
128 | </td> | 128 | </td> |
129 | </tr> | 129 | </tr> |
130 | </tbody> | 130 | </tbody> |
131 | </table> | 131 | </table> |
132 | </div> | 132 | </div> |
133 | <div class="modal-footer"> | 133 | <div class="modal-footer"> |
134 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> | 134 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> |
135 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> | 135 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> |
136 | </div> | 136 | </div> |
137 | </div> | 137 | </div> |
138 | </div> | 138 | </div> |
139 | </div> | 139 | </div> |
140 | </div> | 140 | </div> |
141 | <div class="ibox-content"> | 141 | <div class="ibox-content"> |
142 | <div class="table-responsive"> | 142 | <div class="table-responsive"> |
143 | <table class="table table-bordered table-hover table-striped"> | 143 | <table class="table table-bordered table-hover table-striped"> |
144 | <thead> | 144 | <thead> |
145 | <tr> | 145 | <tr> |
146 | <th>Tail</th> | 146 | <th>Tail</th> |
147 | <th>Make</th> | 147 | <th>Make</th> |
148 | <th>Model</th> | 148 | <th>Model</th> |
149 | <th>Size</th> | 149 | <th>Size</th> |
150 | <th>Actions</th> | ||
150 | </tr> | 151 | </tr> |
151 | </thead> | 152 | </thead> |
152 | <tbody> | 153 | <tbody> |
153 | <tr ng-repeat="airData in getCraftList track by $index"> | 154 | <tr ng-repeat="airData in getCraftList track by $index"> |
154 | <td> | 155 | <td> |
155 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> | 156 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> |
156 | </td> | 157 | </td> |
157 | <td> | 158 | <td> |
158 | <select class="form-control" ng-model="airData.make"> | 159 | <select class="form-control" ng-model="airData.make"> |
159 | <option>{{airData.make}}</option> | 160 | <option>{{airData.make}}</option> |
160 | </select> | 161 | </select> |
161 | </td> | 162 | </td> |
162 | <td> | 163 | <td> |
163 | <select class="form-control" ng-model="airData.model"> | 164 | <select class="form-control" ng-model="airData.model"> |
164 | <option>{{airData.model}}</option> | 165 | <option>{{airData.model}}</option> |
165 | </select> | 166 | </select> |
166 | </td> | 167 | </td> |
167 | <td> | 168 | <td> |
168 | <select class="form-control" ng-model="airData.size"> | 169 | <select class="form-control" ng-model="airData.size"> |
169 | <option>{{airData.size}}</option> | 170 | <option>{{airData.size}}</option> |
170 | </select> | 171 | </select> |
171 | </td> | 172 | </td> |
173 | <td> | ||
174 | <i style="margin-top: 10px;" class="fa fa-pencil" ng-click="update(airData)"></i> | ||
175 | <i class="fa fa-trash" ng-click="remove(airData)"></i> | ||
176 | </td> | ||
172 | </tr> | 177 | </tr> |
173 | </tbody> | 178 | </tbody> |
174 | </table> | 179 | </table> |
175 | </div> | 180 | </div> |
176 | <div class="clearfix"></div> | 181 | <div class="clearfix"></div> |
177 | </div> | 182 | </div> |
178 | </div> | 183 | </div> |
179 | </div> | 184 | </div> |
185 | <div class="modal inmodal" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true"> | ||
186 | <div class="modal-dialog"> | ||
187 | <div class="modal-content animated fadeIn"> | ||
188 | <div class="modal-header"> | ||
189 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | ||
190 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> | ||
191 | <h4 class="modal-title">Update Aircraft</h4> | ||
192 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> | ||
193 | </div> | ||
194 | <div class="modal-body" style="padding: 15px;"> | ||
195 | <table class="table table-bordered table-hover table-striped"> | ||
196 | <thead> | ||
197 | <tr> | ||
198 | <th>Tail</th> | ||
199 | <th>Make</th> | ||
200 | <th>Model</th> | ||
201 | <th>Size</th> | ||
202 | </tr> | ||
203 | </thead> | ||
204 | <tbody> | ||
205 | <tr> | ||
206 | <td> | ||
207 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | ||
208 | </td> | ||
209 | <td style="width: 30%"> | ||
210 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | ||
211 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | ||
212 | </select> | ||
213 | </td> | ||
214 | <td style="width: 30%"> | ||
215 | <select class="form-control" ng-model="aircraft.model"> | ||
216 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | ||
217 | </select> | ||
218 | </td> | ||
219 | <td style="width: 30%"> | ||
220 | <select class="form-control" ng-model="aircraft.size"> | ||
221 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> | ||
222 | </select> | ||
223 | </td> | ||
224 | </tr> | ||
225 | </tbody> | ||
226 | </table> | ||
227 | </div> | ||
228 | <div class="modal-footer"> | ||
229 | <button type="button" class="btn btn-white" ng-click="closeModal()">Close</button> | ||
230 | <button type="button" class="btn btn-primary" ng-click="updateAircraft(aircraft)">Save changes</button> | ||
231 | </div> | ||
232 | </div> | ||
233 | </div> | ||
234 | </div> | ||
180 | <div class="col-lg-5"> | 235 | <div class="col-lg-5"> |
181 | <div class="ibox float-e-margins"> | 236 | <div class="ibox float-e-margins"> |
182 | <div class="ibox-title"> | 237 | <div class="ibox-title"> |
183 | <h5>Account Authenticatio & Payment Method</h5> | 238 | <h5>Account Authenticatio & Payment Method</h5> |
184 | 239 | ||
185 | </div> | 240 | </div> |
186 | <div class="ibox-content"> | 241 | <div class="ibox-content"> |
187 | <div class="row" ng-repeat="payment in paymentList" ng-click="openCard(payment)" style="cursor: pointer;" ng-show="showPayments"> | 242 | <div class="row" ng-repeat="payment in paymentList" ng-click="openCard(payment)" style="cursor: pointer;" ng-show="showPayments"> |
188 | <div class="col-md-3"> | 243 | <div class="col-md-3"> |
189 | <img src="images/master.png"> | 244 | <img src="images/master.png"> |
190 | </div> | 245 | </div> |
191 | <div class="col-md-9"> | 246 | <div class="col-md-9"> |
192 | <div class="col"> | 247 | <div class="col"> |
193 | <span style="font-size: large; color: #909394;">**** **** **** {{payment.cardNumber | limitTo: -4}}</span> | 248 | <span style="font-size: large; color: #909394;">**** **** **** {{payment.cardNumber | limitTo: -4}}</span> |
194 | </div> | 249 | </div> |
195 | <div class="col"> | 250 | <div class="col"> |
196 | <span><strong>Expiry Date: </strong>{{payment.expiryDate}}</span> | 251 | <span><strong>Expiry Date: </strong>{{payment.expiryDate}}</span> |
197 | </div> | 252 | </div> |
198 | </div> | 253 | </div> |
199 | <div class="clearfix"></div> | 254 | <div class="clearfix"></div> |
200 | <!-- <br> | 255 | <!-- <br> |
201 | 256 | ||
202 | <div class="col-md-3"> | 257 | <div class="col-md-3"> |
203 | <img src="images/visa1.png"> | 258 | <img src="images/visa1.png"> |
204 | </div> | 259 | </div> |
205 | <div class="col-md-9"> | 260 | <div class="col-md-9"> |
206 | <div class="col"> | 261 | <div class="col"> |
207 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> | 262 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> |
208 | </div> | 263 | </div> |
209 | <div class="col"> | 264 | <div class="col"> |
210 | <span><strong>Expiry Date:</strong>10/16</span> | 265 | <span><strong>Expiry Date:</strong>10/16</span> |
211 | </div> | 266 | </div> |
212 | </div> | 267 | </div> |
213 | <div class="clearfix"></div> --> | 268 | <div class="clearfix"></div> --> |
214 | </div> | 269 | </div> |
215 | <div class="row" ng-hide="showPayments"> | 270 | <div class="row" ng-hide="showPayments"> |
216 | <div class="container"> | 271 | <div class="container"> |
217 | <div class="row"> | 272 | <div class="row"> |
218 | <div class="col-xs-12 col-md-4"> | 273 | <div class="col-xs-12 col-md-4"> |
219 | <div class="panel panel-default credit-card-box"> | 274 | <div class="panel panel-default credit-card-box"> |
220 | <div class="panel-heading display-table" > | 275 | <div class="panel-heading display-table" > |
221 | <div class="row display-tr" > | 276 | <div class="row display-tr" > |
222 | <h3 class="panel-title display-td" >Payment Details</h3> | 277 | <h3 class="panel-title display-td" >Payment Details</h3> |
223 | <div class="display-td" > | 278 | <div class="display-td" > |
224 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> | 279 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> |
225 | </div> | 280 | </div> |
226 | </div> | 281 | </div> |
227 | </div> | 282 | </div> |
228 | <div class="panel-body"> | 283 | <div class="panel-body"> |
229 | <form role="form" id="payment-form"> | 284 | <form role="form" id="payment-form"> |
230 | <div class="row"> | 285 | <div class="row"> |
231 | <div class="col-xs-12"> | 286 | <div class="col-xs-12"> |
232 | <div class="form-group"> | 287 | <div class="form-group"> |
233 | <label for="cardNumber">CARD NUMBER</label> | 288 | <label for="cardNumber">CARD NUMBER</label> |
234 | <div class="input-group"> | 289 | <div class="input-group"> |
235 | <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> | 290 | <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> |
236 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> | 291 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> |
237 | </div> | 292 | </div> |
238 | </div> | 293 | </div> |
239 | </div> | 294 | </div> |
240 | </div> | 295 | </div> |
241 | <div class="row"> | 296 | <div class="row"> |
242 | <div class="col-xs-7 col-md-7"> | 297 | <div class="col-xs-7 col-md-7"> |
243 | <div class="form-group"> | 298 | <div class="form-group"> |
244 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> | 299 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> |
245 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" | 300 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" |
246 | required> | 301 | required> |
247 | </div> | 302 | </div> |
248 | </div> | 303 | </div> |
249 | <div class="col-xs-5 col-md-5 pull-right"> | 304 | <div class="col-xs-5 col-md-5 pull-right"> |
250 | <div class="form-group"> | 305 | <div class="form-group"> |
251 | <label for="cardCVC">CVV CODE</label> | 306 | <label for="cardCVC">CVV CODE</label> |
252 | <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" | 307 | <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" |
253 | required> | 308 | required> |
254 | </div> | 309 | </div> |
255 | </div> | 310 | </div> |
256 | </div> | 311 | </div> |
257 | <div class="row"> | 312 | <div class="row"> |
258 | <div class="col-xs-12"> | 313 | <div class="col-xs-12"> |
259 | <div class="form-group"> | 314 | <div class="form-group"> |
260 | <label for="name">Card Type</label> | 315 | <label for="name">Card Type</label> |
261 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> | 316 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> |
262 | <option value="creditCard" selected>Credit Card</option> | 317 | <option value="creditCard" selected>Credit Card</option> |
263 | <option value="debitCard">Debit Card</option> | 318 | <option value="debitCard">Debit Card</option> |
264 | </select> | 319 | </select> |
265 | </div> | 320 | </div> |
266 | </div> | 321 | </div> |
267 | </div> | 322 | </div> |
268 | <div class="row"> | 323 | <div class="row"> |
269 | <div class="col-xs-12"> | 324 | <div class="col-xs-12"> |
270 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="updateCard()">Update Card</button> | 325 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="updateCard()">Update Card</button> |
271 | </div> | 326 | </div> |
272 | </div> | 327 | </div> |
273 | <div class="row" style="display:none;"> | 328 | <div class="row" style="display:none;"> |
274 | <div class="col-xs-12"> | 329 | <div class="col-xs-12"> |
275 | <p class="payment-errors"></p> | 330 | <p class="payment-errors"></p> |
276 | </div> | 331 | </div> |
277 | </div> | 332 | </div> |
278 | </form> | 333 | </form> |
279 | </div> | 334 | </div> |
280 | </div> | 335 | </div> |
281 | </div> | 336 | </div> |
282 | </div> | 337 | </div> |
283 | </div> | 338 | </div> |
284 | </div> | 339 | </div> |
285 | </div> | 340 | </div> |
286 | </div> | 341 | </div> |
287 | </div> | 342 | </div> |
288 | </div> | 343 | </div> |
289 | </div> | 344 | </div> |
290 | </div> | 345 | </div> |
291 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> | 346 | <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.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.getAircrafts = function(id) { | 37 | this.getAircrafts = 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 + '/airCrafts', | 42 | url : BE.url +'/account/user/'+id + '/airCrafts', |
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.getPaymentMethod = function(id) { | 51 | this.getPaymentMethod = 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 + '/paymentMethods', | 56 | url : BE.url +'/account/user/'+id + '/paymentMethods', |
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.updatePaymentMethod = function(data) { | 65 | this.updatePaymentMethod = function(data) { |
66 | 66 | ||
67 | var deferred = $q.defer(); | 67 | var deferred = $q.defer(); |
68 | $http({ | 68 | $http({ |
69 | method : 'POST', | 69 | method : 'POST', |
70 | url : BE.url +'/account/user/updatePaymentMethods', | 70 | url : BE.url +'/account/user/updatePaymentMethods', |
71 | headers : {'Content-Type': 'application/json'}, | 71 | headers : {'Content-Type': 'application/json'}, |
72 | data: data | 72 | data: data |
73 | }) | 73 | }) |
74 | .success(function(result) { | 74 | .success(function(result) { |
75 | deferred.resolve(result); | 75 | deferred.resolve(result); |
76 | }) | 76 | }) |
77 | return deferred.promise; | 77 | return deferred.promise; |
78 | } | 78 | } |
79 | 79 | ||
80 | this.updateAircraft = function(data) { | ||
81 | |||
82 | var deferred = $q.defer(); | ||
83 | $http({ | ||
84 | method : 'PUT', | ||
85 | url : BE.url +'/account/user/updateAircraft', | ||
86 | headers : {'Content-Type': 'application/json'}, | ||
87 | data: data | ||
88 | }) | ||
89 | .success(function(result) { | ||
90 | deferred.resolve(result); | ||
91 | }) | ||
92 | return deferred.promise; | ||
93 | } | ||
94 | |||
95 | this.removeAircraft = function(id) { | ||
96 | |||
97 | var deferred = $q.defer(); | ||
98 | $http({ | ||
99 | method : 'DELETE', | ||
100 | url : BE.url +'/account/user/airCraft/'+id, | ||
101 | headers : {'Content-Type': 'application/json'}, | ||
102 | }) | ||
103 | .success(function(result) { | ||
104 | deferred.resolve(result); | ||
105 | }) | ||
106 | return deferred.promise; | ||
107 | } | ||
108 | |||
80 | } | 109 | } |
81 | 110 | ||
82 | })(); | 111 | })(); |