Commit 16fa2ad104278f5ac69bc8253a0b2d06b1881301
1 parent
2d83813352
Exists in
master
adding aircraft on creating user, and size issue of aircraft solved
Showing
6 changed files
with
288 additions
and
95 deletions
Show diff stats
app/views/fbo-admin/dashboard.controller.js
app/views/fbo-flight/flight.html
1 | -</div> | |
2 | - <div class="row wrapper border-bottom white-bg page-heading"> | |
3 | - <div class="col-lg-8"> | |
4 | - <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> --> | |
5 | - <div style="margin-top: 20px;"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | |
6 | - </div> | |
7 | - <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> | |
8 | - <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> | |
9 | - <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> | |
10 | - </div> | |
1 | +<style> | |
2 | + .button1 { | |
3 | + display: inline-block; | |
4 | + height: 35px; | |
5 | + line-height: 35px; | |
6 | + padding-right: 15px; | |
7 | + padding-left: 50px; | |
8 | + position: relative; | |
9 | + background-color:rgb(41,127,184); | |
10 | + color:rgb(255,255,255); | |
11 | + text-decoration: none; | |
12 | + text-transform: uppercase; | |
13 | + letter-spacing: 1px; | |
14 | + margin-bottom: 15px; | |
15 | + border: 0; | |
16 | + | |
17 | + | |
18 | + border-radius: 5px; | |
19 | + -moz-border-radius: 5px; | |
20 | + -webkit-border-radius: 5px; | |
21 | + text-shadow:0px 1px 0px rgba(0,0,0,0.5); | |
22 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | |
23 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | |
24 | + | |
25 | + -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
26 | + -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
27 | + box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
28 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | |
29 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | |
30 | + } | |
31 | + | |
32 | + .button1 span { | |
33 | + position: absolute; | |
34 | + left: 0; | |
35 | + top: 0; | |
36 | + width: 35px; | |
37 | + background-color:rgba(0,0,0,0.5); | |
38 | + | |
39 | + -webkit-border-top-left-radius: 5px; | |
40 | + -webkit-border-bottom-left-radius: 5px; | |
41 | + -moz-border-radius-topleft: 5px; | |
42 | + -moz-border-radius-bottomleft: 5px; | |
43 | + border-top-left-radius: 5px; | |
44 | + border-bottom-left-radius: 5px; | |
45 | + border-right: 1px solid rgba(0,0,0,0.15); | |
46 | + } | |
47 | + | |
48 | + .button1:hover span, .button1.active span { | |
49 | + background-color:rgb(0,102,26); | |
50 | + border-right: 1px solid rgba(0,0,0,0.3); | |
51 | + } | |
52 | + | |
53 | + .button1:active { | |
54 | + margin-top: 2px; | |
55 | + margin-bottom: 13px; | |
56 | + | |
57 | + -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
58 | + -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
59 | + box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
60 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | |
61 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | |
62 | + } | |
63 | + | |
64 | + .button1.turquoise { | |
65 | + background: #449d44; | |
66 | + } | |
67 | + | |
68 | +</style> | |
69 | +<div class="row wrapper border-bottom white-bg page-heading"> | |
70 | + <div class="col-lg-8"> | |
71 | + <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> --> | |
72 | + <div style="margin-top: 20px;"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | |
73 | + </div> | |
74 | + <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> | |
75 | + <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> | |
76 | + <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> | |
11 | 77 | </div> |
12 | 78 | </div> |
13 | 79 | <div class="wrapper wrapper-content animated fadeInRight"> |
... | ... | @@ -80,7 +146,7 @@ |
80 | 146 | <div class="ibox float-e-margins"> |
81 | 147 | <div class="ibox-title"> |
82 | 148 | <h5>Aircraft List</h5> |
83 | - <div class="pull-right"> | |
149 | + <!-- <div class="pull-right"> | |
84 | 150 | <button type="button" class="btn btn-primary btn-sm" ng-click="openModal()">+ Add</button> |
85 | 151 | </div> |
86 | 152 | <div class="clearfix"></div> |
... | ... | @@ -89,9 +155,7 @@ |
89 | 155 | <div class="modal-content animated fadeIn"> |
90 | 156 | <div class="modal-header"> |
91 | 157 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
92 | - <!-- <i class="fa fa-clock-o modal-icon"></i> --> | |
93 | 158 | <h4 class="modal-title">Add Aircraft</h4> |
94 | - <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> | |
95 | 159 | </div> |
96 | 160 | <div class="modal-body" style="padding: 15px;"> |
97 | 161 | <table class="table table-bordered table-hover table-striped"> |
... | ... | @@ -133,11 +197,11 @@ |
133 | 197 | </div> |
134 | 198 | </div> |
135 | 199 | </div> |
136 | - </div> | |
200 | + </div> --> | |
137 | 201 | </div> |
138 | 202 | <div class="ibox-content"> |
139 | 203 | <div class="table-responsive"> |
140 | - <table class="table table-bordered table-hover table-striped"> | |
204 | + <!-- <table class="table table-bordered table-hover table-striped"> | |
141 | 205 | <thead> |
142 | 206 | <tr> |
143 | 207 | <th>Tail</th> |
... | ... | @@ -168,8 +232,48 @@ |
168 | 232 | </td> |
169 | 233 | </tr> |
170 | 234 | </tbody> |
235 | + </table> --> | |
236 | + <table class="table table-striped table-bordered"> | |
237 | + <thead> | |
238 | + <tr> | |
239 | + <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | |
240 | + <th>Tail</th> | |
241 | + <th>Make</th> | |
242 | + <th>Model</th> | |
243 | + <th>Size</th> | |
244 | + </tr> | |
245 | + </thead> | |
246 | + <tbody> | |
247 | + <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | |
248 | + <!-- <td> | |
249 | + <input type="checkbox" ng-model="aircraftData.selected"/> | |
250 | + </td> --> | |
251 | + <td style="width: 20%"> | |
252 | + <input type="text" class="form-control" ng-model="aircraftData.tail" required/> | |
253 | + </td> | |
254 | + <td style="width: 20%"> | |
255 | + <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | |
256 | + <option ng-repeat="make in aircraftMakeList">{{make}}</option> | |
257 | + </select> | |
258 | + </td> | |
259 | + <td style="width: 20%"> | |
260 | + <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | |
261 | + <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> | |
262 | + </select> | |
263 | + </td> | |
264 | + <td style="width: 20%"> | |
265 | + <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> | |
266 | + <!-- <select class="form-control" ng-model="aircraftData.size"> | |
267 | + <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | |
268 | + </select> --> | |
269 | + </td> | |
270 | + </tr> | |
271 | + </tbody> | |
171 | 272 | </table> |
172 | 273 | </div> |
274 | + <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | |
275 | + <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | |
276 | + </div> | |
173 | 277 | <div class="clearfix"></div> |
174 | 278 | </div> |
175 | 279 | </div> | ... | ... |
app/views/fbo-flight/flightDept.controller.js
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | //Load controller |
4 | 4 | angular.module('acuefuel') |
5 | 5 | |
6 | - .controller('FlightDeptController', function ($scope, $uibModal, FBOFlight) { | |
6 | + .controller('FlightDeptController', function ($scope, $uibModal, $state, FBOFlight) { | |
7 | 7 | $(document).ready(function(){ |
8 | 8 | $('.fboflight').addClass('active'); |
9 | 9 | }); |
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | $scope.user = {}; |
12 | 12 | $scope.aircraft = {}; |
13 | 13 | $scope.userData = function(){ |
14 | + | |
14 | 15 | if($scope.user.email == undefined || $scope.user.email == null){ |
15 | 16 | toastr.error('Please enter your email first', { |
16 | 17 | closeButton: true |
... | ... | @@ -33,12 +34,15 @@ |
33 | 34 | $scope.registerId = result; |
34 | 35 | $scope.data.accountId = $scope.registerId; |
35 | 36 | $scope.aircraft.accountId = $scope.registerId; |
37 | + if($scope.aircraft.accountId == $scope.registerId){ | |
38 | + $scope.saveCompanyData(); | |
39 | + } | |
36 | 40 | toastr.success('Created Successfully', { |
37 | 41 | closeButton: true |
38 | 42 | }) |
39 | 43 | $state.go('index.flightDept'); |
40 | 44 | }, function (err) { |
41 | - toastr.error('Error in registering', { | |
45 | + toastr.error('Error in registeration', { | |
42 | 46 | closeButton: true |
43 | 47 | }) |
44 | 48 | }); |
... | ... | @@ -68,81 +72,152 @@ |
68 | 72 | |
69 | 73 | getData(); |
70 | 74 | function getData(){ |
71 | - FBOFlight.getAircraftMake().then(function(result) { | |
75 | + FBOFlight.getAircraftMake().then(function(result) { | |
72 | 76 | $scope.aircraftMakeList = result; |
73 | - $scope.aircraft.make = $scope.aircraftMakeList[0]; | |
74 | - FBOFlight.getModal($scope.aircraft.make).then(function(result) { | |
75 | - $scope.aircraftModalList = result; | |
76 | - $scope.aircraft.model = $scope.aircraftModalList[0]; | |
77 | - FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
78 | - $scope.aircraftSizeList = result; | |
79 | - $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
80 | - }) | |
81 | - }) | |
82 | - | |
83 | 77 | }) |
84 | 78 | } |
85 | - | |
86 | 79 | |
87 | - $scope.getModal = function(){ | |
88 | - var makeId = $scope.aircraft.make; | |
89 | - FBOFlight.getModal(makeId).then(function(result) { | |
90 | - $scope.aircraftModalList = result; | |
91 | - $scope.aircraft.model = $scope.aircraftModalList[0]; | |
92 | - FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | |
93 | - $scope.aircraftSizeList = result; | |
94 | - $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
95 | - }) | |
80 | + $scope.aircraftDetails = [{ | |
81 | + 'tail':'', | |
82 | + 'make': '', | |
83 | + 'model': '', | |
84 | + 'sizeId' : '' | |
85 | + }]; | |
86 | + | |
87 | + $scope.addNew = function(){ | |
88 | + $scope.aircraftDetails.push({ | |
89 | + 'tail':'', | |
90 | + 'make': '', | |
91 | + 'model': '', | |
92 | + 'sizeId' : '' | |
93 | + }); | |
94 | + console.log($scope.aircraftDetails) | |
95 | + }; | |
96 | + | |
97 | + $scope.getModal = function(makeId, index){ | |
98 | + $scope.aircraft.make = makeId; | |
99 | + //var makeId = makeId; | |
100 | + FBOFlight.getModal($scope.aircraft.make).then(function(result) { | |
101 | + $scope.aircraftDetails[index].aircraftModalList = result; | |
102 | + //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | |
96 | 103 | }) |
97 | 104 | } |
98 | 105 | |
99 | - $scope.getSize = function(){ | |
100 | - FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
101 | - $scope.aircraftSizeList = result; | |
102 | - $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
106 | + $scope.getSize = function(model, index){ | |
107 | + FBOFlight.getAircraftSize($scope.aircraft.make, model).then(function(result) { | |
108 | + $scope.aircraftDetails[index].aircraftSizeList = result; | |
109 | + //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | |
110 | + console.log($scope.aircraftDetails[index]) | |
103 | 111 | }) |
104 | 112 | } |
105 | 113 | |
106 | - $scope.openModal = function(){ | |
107 | - if($scope.aircraft.accountId == undefined){ | |
108 | - toastr.error('Please Add Contact Information', { | |
109 | - closeButton: true | |
110 | - }) | |
111 | - $('#myModal4').modal('hide'); | |
112 | - }else{ | |
113 | - $('#myModal4').modal('show'); | |
114 | - } | |
115 | - | |
116 | - } | |
117 | - $scope.aircraftData = {}; | |
118 | - $scope.aircraftData.aircraftList = []; | |
119 | - $scope.getCraftList = []; | |
120 | - $scope.addAircraft = function(){ | |
121 | - $scope.aircraftData.aircraftList.push($scope.aircraft); | |
122 | - if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { | |
123 | - $scope.getCraftList.push($scope.aircraft); | |
114 | + $scope.aircraftListData = {}; | |
115 | + $scope.addData = []; | |
116 | + | |
117 | + $scope.saveCompanyData = function(){ | |
118 | + for(var i=0; i<$scope.aircraftDetails.length;i++){ | |
119 | + $scope.addData.push({ | |
120 | + 'tail': $scope.aircraftDetails[i].tail, | |
121 | + 'make': $scope.aircraftDetails[i].make, | |
122 | + 'model': $scope.aircraftDetails[i].model, | |
123 | + 'sizeId' : $scope.aircraftDetails[i].sizeId | |
124 | + }); | |
124 | 125 | } |
126 | + $scope.aircraftListData.aircraftList = $scope.addData; | |
127 | + $scope.aircraftListData.accountId = $scope.aircraft.accountId; | |
125 | 128 | |
126 | - FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | |
127 | - $('#myModal4').modal('hide'); | |
128 | - $scope.reset(); | |
129 | - toastr.success('Created Successfully', { | |
130 | - closeButton: true | |
131 | - }) | |
132 | - }, function (err) { | |
133 | - toastr.error('Error in Adding Aircraft', { | |
134 | - closeButton: true | |
135 | - }) | |
136 | - $('#myModal4').modal('hide'); | |
137 | - $scope.getCraftList.splice($scope.aircraft); | |
129 | + FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { | |
130 | + console.log(result) | |
131 | + if(result != null && result.success){ | |
132 | + toastr.success(''+result.success+'', { | |
133 | + closeButton: true | |
134 | + }) | |
135 | + }else{ | |
136 | + toastr.error(''+result.statusText+'', { | |
137 | + closeButton: true | |
138 | + }) | |
139 | + } | |
138 | 140 | }); |
139 | 141 | |
140 | 142 | } |
141 | 143 | |
142 | - $scope.reset = function() { | |
143 | - $scope.aircraft = {}; | |
144 | - $scope.aircraft.accountId = $scope.data.accountId; | |
145 | - $scope.aircraftData.aircraftList = []; | |
146 | - getData(); | |
147 | - } | |
144 | + // getData(); | |
145 | + // function getData(){ | |
146 | + // FBOFlight.getAircraftMake().then(function(result) { | |
147 | + // $scope.aircraftMakeList = result; | |
148 | + // $scope.aircraft.make = $scope.aircraftMakeList[0]; | |
149 | + // FBOFlight.getModal($scope.aircraft.make).then(function(result) { | |
150 | + // $scope.aircraftModalList = result; | |
151 | + // $scope.aircraft.model = $scope.aircraftModalList[0]; | |
152 | + // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
153 | + // $scope.aircraftSizeList = result; | |
154 | + // $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
155 | + // }) | |
156 | + // }) | |
157 | + | |
158 | + // }) | |
159 | + // } | |
160 | + | |
161 | + | |
162 | + // $scope.getModal = function(){ | |
163 | + // var makeId = $scope.aircraft.make; | |
164 | + // FBOFlight.getModal(makeId).then(function(result) { | |
165 | + // $scope.aircraftModalList = result; | |
166 | + // $scope.aircraft.model = $scope.aircraftModalList[0]; | |
167 | + // FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | |
168 | + // $scope.aircraftSizeList = result; | |
169 | + // $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
170 | + // }) | |
171 | + // }) | |
172 | + // } | |
173 | + | |
174 | + // $scope.getSize = function(){ | |
175 | + // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | |
176 | + // $scope.aircraftSizeList = result; | |
177 | + // $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
178 | + // }) | |
179 | + // } | |
180 | + | |
181 | + // $scope.openModal = function(){ | |
182 | + // if($scope.aircraft.accountId == undefined){ | |
183 | + // toastr.error('Please Add Contact Information', { | |
184 | + // closeButton: true | |
185 | + // }) | |
186 | + // $('#myModal4').modal('hide'); | |
187 | + // }else{ | |
188 | + // $('#myModal4').modal('show'); | |
189 | + // } | |
190 | + | |
191 | + // } | |
192 | + // $scope.aircraftData = {}; | |
193 | + // $scope.aircraftData.aircraftList = []; | |
194 | + // $scope.getCraftList = []; | |
195 | + // $scope.addAircraft = function(){ | |
196 | + // $scope.aircraftData.aircraftList.push($scope.aircraft); | |
197 | + // if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { | |
198 | + // $scope.getCraftList.push($scope.aircraft); | |
199 | + // } | |
200 | + | |
201 | + // FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | |
202 | + // $('#myModal4').modal('hide'); | |
203 | + // $scope.reset(); | |
204 | + // toastr.success('Created Successfully', { | |
205 | + // closeButton: true | |
206 | + // }) | |
207 | + // }, function (err) { | |
208 | + // toastr.error('Error in Adding Aircraft', { | |
209 | + // closeButton: true | |
210 | + // }) | |
211 | + // $('#myModal4').modal('hide'); | |
212 | + // $scope.getCraftList.splice($scope.aircraft); | |
213 | + // }); | |
214 | + | |
215 | + // } | |
216 | + | |
217 | + // $scope.reset = function() { | |
218 | + // $scope.aircraft = {}; | |
219 | + // $scope.aircraft.accountId = $scope.data.accountId; | |
220 | + // $scope.aircraftData.aircraftList = []; | |
221 | + // getData(); | |
222 | + // } | |
148 | 223 | }); |
149 | 224 | \ No newline at end of file | ... | ... |
app/views/updateAllFBO/updateAllFBO.html
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | <form role="form"> |
40 | 40 | <div class="col-sm-6 b-r"> |
41 | 41 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> |
42 | - <!-- <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> --> | |
42 | + <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> | |
43 | 43 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> |
44 | 44 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
45 | 45 | <!-- <div> |
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | |
50 | 50 | </div> |
51 | 51 | <div class="col-sm-6"> |
52 | - <!-- <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>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> | |
53 | 53 | <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div> |
54 | 54 | <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> |
55 | 55 | </div> | ... | ... |
app/views/updateFBODept/updateFBODept.controller.js
... | ... | @@ -33,6 +33,10 @@ |
33 | 33 | function getCrafts(){ |
34 | 34 | UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { |
35 | 35 | $scope.getCraftList = response; |
36 | + for(var i=0;i<$scope.getCraftList.length;i++){ | |
37 | + $scope.getCraftList[i].sizeId = $scope.getCraftList[i].userAircraftSize.id; | |
38 | + $scope.getCraftList[i].size = $scope.getCraftList[i].userAircraftSize.size; | |
39 | + } | |
36 | 40 | }) |
37 | 41 | } |
38 | 42 | |
... | ... | @@ -115,7 +119,7 @@ |
115 | 119 | |
116 | 120 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
117 | 121 | $scope.aircraftSizeList = result; |
118 | - $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
122 | + $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | |
119 | 123 | |
120 | 124 | }) |
121 | 125 | }) |
... | ... | @@ -131,7 +135,7 @@ |
131 | 135 | |
132 | 136 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { |
133 | 137 | $scope.aircraftSizeList = result; |
134 | - $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
138 | + $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | |
135 | 139 | }) |
136 | 140 | }) |
137 | 141 | } |
... | ... | @@ -139,13 +143,16 @@ |
139 | 143 | $scope.getSize = function(){ |
140 | 144 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
141 | 145 | $scope.aircraftSizeList = result; |
142 | - $scope.aircraft.size = $scope.aircraftSizeList[0]; | |
146 | + console.log($scope.aircraftSizeList) | |
147 | + $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | |
148 | + console.log($scope.aircraft.sizeId) | |
143 | 149 | }) |
144 | 150 | } |
145 | 151 | |
146 | 152 | $scope.aircraftData = {}; |
147 | 153 | $scope.aircraftData.aircraftList = []; |
148 | 154 | $scope.addAircraft = function(){ |
155 | + console.log($scope.aircraft) | |
149 | 156 | $scope.aircraftData.aircraftList.push($scope.aircraft); |
150 | 157 | |
151 | 158 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { |
... | ... | @@ -162,7 +169,7 @@ |
162 | 169 | $('#myModal4').modal('hide'); |
163 | 170 | $scope.getCraftList.splice($scope.aircraft); |
164 | 171 | }); |
165 | - } | |
172 | + } | |
166 | 173 | |
167 | 174 | $scope.closeModal = function(){ |
168 | 175 | $("#myModal5").modal('hide'); |
... | ... | @@ -179,7 +186,8 @@ |
179 | 186 | $scope.aircraftModalList = result; |
180 | 187 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
181 | 188 | $scope.aircraftSizeList = result; |
182 | - | |
189 | + console.log($scope.aircraftSizeList) | |
190 | + $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | |
183 | 191 | }) |
184 | 192 | }) |
185 | 193 | } |
... | ... | @@ -192,7 +200,7 @@ |
192 | 200 | $scope.updateAircraftData.id = updateAircraft.id; |
193 | 201 | $scope.updateAircraftData.make = updateAircraft.make; |
194 | 202 | $scope.updateAircraftData.model = updateAircraft.model; |
195 | - $scope.updateAircraftData.size = updateAircraft.size; | |
203 | + $scope.updateAircraftData.sizeId = updateAircraft.sizeId; | |
196 | 204 | $scope.updateAircraftData.tail = updateAircraft.tail; |
197 | 205 | $scope.updateAircraftData.accountId = updateAircraft.accountId; |
198 | 206 | console.log($scope.updateAircraftData) |
... | ... | @@ -203,6 +211,7 @@ |
203 | 211 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { |
204 | 212 | $('#myModal5').modal('hide'); |
205 | 213 | $scope.resetData(); |
214 | + getCrafts(); | |
206 | 215 | toastr.success('Updated Successfully', { |
207 | 216 | closeButton: true |
208 | 217 | }) | ... | ... |
app/views/updateFBODept/updateFBODept.html
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | <form role="form"> |
39 | 39 | <div class="col-sm-6 b-r"> |
40 | 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"></div> --> | |
41 | + <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> | |
42 | 42 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> |
43 | 43 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
44 | 44 | <!-- <div> |
... | ... | @@ -123,9 +123,11 @@ |
123 | 123 | </select> |
124 | 124 | </td> |
125 | 125 | <td style="width: 30%"> |
126 | - <select class="form-control" ng-model="aircraft.size"> | |
127 | - <option ng-repeat="size in aircraftSizeList">{{size}}</option> | |
128 | - </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 | + | |
128 | + <!-- <select class="form-control" ng-model="aircraft.size"> | |
129 | + <option ng-repeat="size in aircraftSizeList">{{size.aircraftSize.size}}</option> | |
130 | + </select> --> | |
129 | 131 | </td> |
130 | 132 | </tr> |
131 | 133 | </tbody> |
... | ... | @@ -167,8 +169,9 @@ |
167 | 169 | </select> |
168 | 170 | </td> |
169 | 171 | <td> |
170 | - <select class="form-control" ng-model="airData.size"> | |
171 | - <option>{{airData.size}}</option> | |
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"> | |
174 | + <option value="{{airData.sizeId}}">{{airData.size}}</option> | |
172 | 175 | </select> |
173 | 176 | </td> |
174 | 177 | <td> |
... | ... | @@ -218,9 +221,11 @@ |
218 | 221 | </select> |
219 | 222 | </td> |
220 | 223 | <td style="width: 30%"> |
221 | - <select class="form-control" ng-model="aircraft.size"> | |
224 | + <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> | |
225 | + | |
226 | + <!-- <select class="form-control" ng-model="aircraft.size"> | |
222 | 227 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> |
223 | - </select> | |
228 | + </select> --> | |
224 | 229 | </td> |
225 | 230 | </tr> |
226 | 231 | </tbody> | ... | ... |