Commit b1f6160d4dab7a6ad6f596b2ccb15085d5c01e6f
1 parent
d9a4800420
Exists in
master
add contact and and aircraft implemented
Showing
5 changed files
with
317 additions
and
125 deletions
Show diff stats
app/partials/customers/customers.controller.js
... | ... | @@ -103,7 +103,7 @@ |
103 | 103 | |
104 | 104 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { |
105 | 105 | console.log(result) |
106 | - if(result.success){ | |
106 | + if(result != null && result.success){ | |
107 | 107 | toastr.success(''+result.success+'', { |
108 | 108 | closeButton: true |
109 | 109 | }) | ... | ... |
app/partials/customers/customers.html
... | ... | @@ -367,8 +367,10 @@ |
367 | 367 | <div class="pull-left"> |
368 | 368 | <select required class="form-control" style="max-width: 250px;" ng-model="data.masterMargin"> |
369 | 369 | <option value="" disabled selected hidden>Select </option> |
370 | - <option value="good">Open when powered (most valves do this)</option> | |
371 | - <option value="perfect">Closed when powered, auto-opens when power is cut</option> | |
370 | + <option value="margin1">Margin1</option> | |
371 | + <option value="margin2">Margin2</option> | |
372 | + <option value="vendorsonly">Vendors Only</option> | |
373 | + <option value="margintenants">Margin Tenants</option> | |
372 | 374 | </select> |
373 | 375 | </div> |
374 | 376 | <div class="clearfix"></div> |
... | ... | @@ -380,8 +382,11 @@ |
380 | 382 | <div class="col-md-3 Airport"> |
381 | 383 | <select required class="form-control" ng-model="data.certificateType"> |
382 | 384 | <option value="" disabled selected hidden>Select </option> |
383 | - <option value="good">Open when powered (most valves do this)</option> | |
384 | - <option value="perfect">Closed when powered, auto-opens when power is cut</option> | |
385 | + <option value="corporate">Part 91 (Corporate)</option> | |
386 | + <option value="charter">Part 135 (Charter)</option> | |
387 | + <option value="scheduled">Part 121 (Scheduled)</option> | |
388 | + <option value="military">Military</option> | |
389 | + <option value="government">Government</option> | |
385 | 390 | </select> |
386 | 391 | </div> |
387 | 392 | </div> | ... | ... |
app/partials/viewCompany/viewCompany.controller.js
... | ... | @@ -4,17 +4,18 @@ |
4 | 4 | //Load controller |
5 | 5 | angular.module('acufuel') |
6 | 6 | |
7 | - .controller('viewCompanyController', ['$scope','$uibModal', '$stateParams', 'ViewCompanyService', function($scope , $uibModal, $stateParams, ViewCompanyService) { | |
7 | + .controller('viewCompanyController', ['$scope','$uibModal', '$stateParams', 'ViewCompanyService', 'CustomersService', function($scope , $uibModal, $stateParams, ViewCompanyService, CustomersService) { | |
8 | 8 | $scope.data = {}; |
9 | 9 | $scope.data.priceEmail = true; |
10 | + $scope.aircraft = {}; | |
11 | + // $scope.open = function(){ | |
12 | + // $scope.editSmsModal = $uibModal.open({ | |
13 | + // templateUrl: 'partials/NewCompany/NewCompany.html', | |
14 | + // backdrop: true, | |
15 | + // scope: $scope, | |
16 | + // }) | |
17 | + // } | |
10 | 18 | |
11 | - $scope.open = function(){ | |
12 | - $scope.editSmsModal = $uibModal.open({ | |
13 | - templateUrl: 'partials/NewCompany/NewCompany.html', | |
14 | - backdrop: true, | |
15 | - scope: $scope, | |
16 | - }) | |
17 | - } | |
18 | 19 | $(function() { |
19 | 20 | $('#toggle-one2').bootstrapToggle(); |
20 | 21 | }) |
... | ... | @@ -41,21 +42,27 @@ |
41 | 42 | }) |
42 | 43 | |
43 | 44 | var companyId = $stateParams.id; |
44 | - console.log(companyId) | |
45 | 45 | ViewCompanyService.getCompany(companyId).then(function(result) { |
46 | - $scope.aircraftMakeList = result; | |
46 | + $scope.companyData = result; | |
47 | 47 | }) |
48 | 48 | |
49 | 49 | ViewCompanyService.getContact(companyId).then(function(result) { |
50 | - $scope.aircraftMakeList = result; | |
50 | + $scope.companyContactList = result; | |
51 | 51 | }) |
52 | 52 | |
53 | + getAircraftList(); | |
54 | + function getAircraftList(){ | |
55 | + ViewCompanyService.getAircraft(companyId).then(function(result) { | |
56 | + $scope.contactAircraftList = result; | |
57 | + }) | |
58 | + } | |
59 | + | |
60 | + | |
53 | 61 | $scope.contactData = {}; |
54 | 62 | $scope.contactData.contactList = []; |
55 | 63 | $scope.addContact = function(){ |
56 | 64 | $scope.data.companyId = companyId; |
57 | 65 | $scope.contactData.contactList.push($scope.data); |
58 | - console.log($scope.contactData) | |
59 | 66 | ViewCompanyService.addContact($scope.contactData).then(function(result) { |
60 | 67 | if(result.success){ |
61 | 68 | toastr.success(''+result.success+'', { |
... | ... | @@ -70,4 +77,91 @@ |
70 | 77 | }) |
71 | 78 | } |
72 | 79 | |
80 | + getData(); | |
81 | + function getData(){ | |
82 | + CustomersService.getAircraftMake().then(function(result) { | |
83 | + $scope.aircraftMakeList = result; | |
84 | + }) | |
85 | + } | |
86 | + | |
87 | + $scope.aircraftDetails = [{ | |
88 | + 'tail':'', | |
89 | + 'make': '', | |
90 | + 'model': '', | |
91 | + 'size' : '' | |
92 | + }]; | |
93 | + | |
94 | + $scope.addNew = function(){ | |
95 | + $scope.aircraftDetails.push({ | |
96 | + 'tail':'', | |
97 | + 'make': '', | |
98 | + 'model': '', | |
99 | + 'size' : '' | |
100 | + }); | |
101 | + }; | |
102 | + | |
103 | + $scope.getModal = function(makeId, index){ | |
104 | + $scope.aircraft.make = makeId; | |
105 | + //var makeId = makeId; | |
106 | + CustomersService.getModal($scope.aircraft.make).then(function(result) { | |
107 | + $scope.aircraftDetails[index].aircraftModalList = result; | |
108 | + //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | |
109 | + }) | |
110 | + } | |
111 | + | |
112 | + $scope.getSize = function(model, index){ | |
113 | + CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | |
114 | + $scope.aircraftDetails[index].aircraftSizeList = result; | |
115 | + //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | |
116 | + }) | |
117 | + } | |
118 | + | |
119 | + $scope.aircraftListData = {}; | |
120 | + $scope.addData = []; | |
121 | + $scope.saveCompanyData = function(){ | |
122 | + for(var i=0; i<$scope.aircraftDetails.length;i++){ | |
123 | + $scope.addData.push({ | |
124 | + 'tail': $scope.aircraftDetails[i].tail, | |
125 | + 'make': $scope.aircraftDetails[i].make, | |
126 | + 'model': $scope.aircraftDetails[i].model, | |
127 | + 'size' : $scope.aircraftDetails[i].size | |
128 | + }); | |
129 | + } | |
130 | + $scope.aircraftListData.aircraftList = $scope.addData; | |
131 | + $scope.aircraftListData.accountId = companyId; | |
132 | + | |
133 | + CustomersService.addAircraft($scope.aircraftListData).then(function(result) { | |
134 | + if(result != null && result.success){ | |
135 | + toastr.success(''+result.success+'', { | |
136 | + closeButton: true | |
137 | + }) | |
138 | + $('#aircraft-modal-3').modal('hide'); | |
139 | + getAircraftList(); | |
140 | + }else{ | |
141 | + toastr.error(''+result.statusText+'', { | |
142 | + closeButton: true | |
143 | + }) | |
144 | + } | |
145 | + }); | |
146 | + | |
147 | + } | |
148 | + $scope.showNoteData = true; | |
149 | + $scope.showCompanyName = true; | |
150 | + $scope.showNote = function(){ | |
151 | + $scope.showNoteData = false; | |
152 | + } | |
153 | + | |
154 | + $scope.company = function(){ | |
155 | + $scope.showCompanyName = false; | |
156 | + } | |
157 | + | |
158 | + $scope.editData = function(inputName) { | |
159 | + if(inputName == 'showNoteData'){ | |
160 | + $scope.showNoteData = true; | |
161 | + }else if(inputName == 'showCompanyName'){ | |
162 | + $scope.showCompanyName = true; | |
163 | + } | |
164 | + | |
165 | + } | |
166 | + | |
73 | 167 | }]); |
74 | 168 | \ No newline at end of file | ... | ... |
app/partials/viewCompany/viewCompany.html
... | ... | @@ -50,6 +50,73 @@ |
50 | 50 | color: #999 !important; |
51 | 51 | cursor: pointer !important; |
52 | 52 | } |
53 | + | |
54 | + .button1 { | |
55 | + display: inline-block; | |
56 | + height: 35px; | |
57 | + line-height: 35px; | |
58 | + padding-right: 15px; | |
59 | + padding-left: 50px; | |
60 | + position: relative; | |
61 | + background-color:rgb(41,127,184); | |
62 | + color:rgb(255,255,255); | |
63 | + text-decoration: none; | |
64 | + text-transform: uppercase; | |
65 | + letter-spacing: 1px; | |
66 | + margin-bottom: 15px; | |
67 | + border: 0; | |
68 | + | |
69 | + | |
70 | + border-radius: 5px; | |
71 | + -moz-border-radius: 5px; | |
72 | + -webkit-border-radius: 5px; | |
73 | + text-shadow:0px 1px 0px rgba(0,0,0,0.5); | |
74 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | |
75 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | |
76 | + | |
77 | + -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
78 | + -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
79 | + box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
80 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | |
81 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | |
82 | + } | |
83 | + | |
84 | + .button1 span { | |
85 | + position: absolute; | |
86 | + left: 0; | |
87 | + top: 0; | |
88 | + width: 35px; | |
89 | + background-color:rgba(0,0,0,0.5); | |
90 | + | |
91 | + -webkit-border-top-left-radius: 5px; | |
92 | + -webkit-border-bottom-left-radius: 5px; | |
93 | + -moz-border-radius-topleft: 5px; | |
94 | + -moz-border-radius-bottomleft: 5px; | |
95 | + border-top-left-radius: 5px; | |
96 | + border-bottom-left-radius: 5px; | |
97 | + border-right: 1px solid rgba(0,0,0,0.15); | |
98 | + } | |
99 | + | |
100 | + .button1:hover span, .button1.active span { | |
101 | + background-color:rgb(0,102,26); | |
102 | + border-right: 1px solid rgba(0,0,0,0.3); | |
103 | + } | |
104 | + | |
105 | + .button1:active { | |
106 | + margin-top: 2px; | |
107 | + margin-bottom: 13px; | |
108 | + | |
109 | + -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
110 | + -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
111 | + box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
112 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | |
113 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | |
114 | + } | |
115 | + | |
116 | + .button1.turquoise { | |
117 | + background: #449d44; | |
118 | + } | |
119 | + | |
53 | 120 | </style> |
54 | 121 | <div class="col-xs-12 col-md-11"> |
55 | 122 | <div class="row" style="margin-left:0px"> |
... | ... | @@ -74,20 +141,21 @@ |
74 | 141 | </div> |
75 | 142 | </div> |
76 | 143 | <div class="widget-content"> |
77 | - <div class="row" style="margin-left:0px"> | |
144 | + <div class="row" style="margin-left:0px;"> | |
78 | 145 | <div class="col-md-8" style="padding-left: 0;"> |
79 | - <h3 style="color:#F90;"> | |
80 | - <b>Antioch Flight Department</b> | |
81 | - </h3> | |
146 | + <h4 ng-show="showCompanyName"> | |
147 | + <b style="color:#F90;">{{companyData.companyName}}</b> <i class="fa fa-pencil-square-o" ng-click="company()" style="font-size: 14px;" aria-hidden="true"></i> | |
148 | + </h4> | |
149 | + <input type="tel" ng-hide="showCompanyName" ng-model="companyData.companyName" class="form-control" ng-blur="editData('showCompanyName')"/> | |
82 | 150 | </div> |
83 | 151 | <div class="col-md-4"> |
84 | 152 | <select class="form-control" style="height:31px;background: #ebebeb;"> |
85 | 153 | <option class="optionclass" disabled selected>Certificate Type</option> |
86 | - <option class="optionclass">Part 91 (Corporate)</option> | |
87 | - <option class="optionclass">Part 135 (Charter)</option> | |
88 | - <option class="optionclass">Part 121 (Scheduled)</option> | |
89 | - <option class="optionclass">Military</option> | |
90 | - <option class="optionclass">Government</option> | |
154 | + <option class="Corporate">Part 91 (Corporate)</option> | |
155 | + <option class="Charter">Part 135 (Charter)</option> | |
156 | + <option class="Scheduled">Part 121 (Scheduled)</option> | |
157 | + <option class="Military">Military</option> | |
158 | + <option class="Government">Government</option> | |
91 | 159 | </select> |
92 | 160 | </div> |
93 | 161 | </div> |
... | ... | @@ -98,21 +166,26 @@ |
98 | 166 | <option>Margin1</option> |
99 | 167 | <option>Margin2</option> |
100 | 168 | </select> |
101 | - <span>See Aircrart List</span> | |
169 | + <span> See Aircrart List</span> | |
102 | 170 | <div class="clearfix"></div> |
103 | 171 | </p> |
104 | 172 | </div> |
105 | - <div> | |
106 | - <input type="checkbox" name=""> Tenant/Base Customer | |
173 | + <div class="row" style="margin-left:0px;"> | |
174 | + <div class="col-md-5" style="padding-left: 0;"> | |
175 | + <input type="checkbox" name="" ng-model="companyData.baseTenant"> Tenant/Base Customer | |
176 | + </div> | |
177 | + <div class="col-md-5" style="padding-left: 0;"> | |
178 | + <input type="checkbox" name="" ng-model="companyData.fuelerlinxCustomer"> FuelerLinx Customer | |
179 | + </div> | |
107 | 180 | </div> |
108 | 181 | <div> |
109 | - <input type="checkbox" name=""> CAA Member | |
182 | + <input type="checkbox" name="" ng-model="companyData.contractFuelVendor"> CAA Member | |
110 | 183 | </div> |
111 | 184 | </br> |
112 | 185 | <div class="new-address"> |
113 | - <p><i class="fa fa-map-marker"></i> Reviera State Rd32 <input type="checkbox"> </p> | |
114 | - <p><i class="fa fa-phone"></i> (310) 2342-3433 <input type="checkbox"></p> | |
115 | - <p><i class="fa fa-envelope"></i> freed@gmail.com <input type="checkbox"></p> | |
186 | + <p><i class="fa fa-map-marker"></i> Reviera State Rd32 <i class="fa fa-pencil-square-o" aria-hidden="true"></i> </p> | |
187 | + <p><i class="fa fa-phone"></i> (310) 2342-3433 <i class="fa fa-pencil-square-o" aria-hidden="true"></i></p> | |
188 | + <p><i class="fa fa-envelope"></i> freed@gmail.com <i class="fa fa-pencil-square-o" aria-hidden="true"></i></p> | |
116 | 189 | </div> |
117 | 190 | <div class="new-add-select"> |
118 | 191 | <select class="form-control" style="background: #ebebeb;"> |
... | ... | @@ -122,8 +195,9 @@ |
122 | 195 | </select> |
123 | 196 | </div> |
124 | 197 | <div> |
125 | - <p style="margin-bottom: 0;"><b>Company Notes</b> <input type="checkbox"></p> | |
126 | - <p>This is the test data. note will be written in this</p> | |
198 | + <p style="margin-bottom: 0;"><b>Company Notes</b> <i class="fa fa-pencil-square-o" ng-click="showNote()" aria-hidden="true"></i></p> | |
199 | + <p ng-show="showNoteData">{{companyData.internalNote}}</p> | |
200 | + <textarea name="message" ng-hide="showNoteData" style="margin-bottom: 6px;" class="form-control" ng-model="companyData.internalNote" ng-blur="editData('showNoteData')" rows="4" cols="34"></textarea> | |
127 | 201 | </div> |
128 | 202 | <div class="dis"> |
129 | 203 | <button type="button" class="btn btn-primary">Distribute Price to Company Contacts</button> |
... | ... | @@ -138,7 +212,7 @@ |
138 | 212 | <i class="fa fa-plane"></i> |
139 | 213 | <h3>Aircraft List</h3> |
140 | 214 | <div class="pull-right"> |
141 | - <button type="submit" class="btn btn-success btn-sm" ng-click="open()" style="margin-top: 4px; margin-right: 9px;"><i class="icon-ok"></i>+   Add Aircraft</button> | |
215 | + <button type="submit" class="btn btn-success btn-sm" data-toggle="modal" data-target="#aircraft-modal-3" style="margin-top: 4px; margin-right: 9px;"><i class="fa fa-plus" aria-hidden="true"></i> Add Aircraft</button> | |
142 | 216 | </div> |
143 | 217 | </div> |
144 | 218 | <div class="widget-content" style="padding:0px"> |
... | ... | @@ -146,7 +220,7 @@ |
146 | 220 | <table class="table table-bordered table-hover table-striped"> |
147 | 221 | <thead> |
148 | 222 | <tr> |
149 | - <th>Trial #</th> | |
223 | + <th>Tail #</th> | |
150 | 224 | <th>Make</th> |
151 | 225 | <th>Model</th> |
152 | 226 | <th>JET-A</th> |
... | ... | @@ -157,70 +231,10 @@ |
157 | 231 | </tr> |
158 | 232 | </thead> |
159 | 233 | <tbody> |
160 | - <tr> | |
161 | - <td>N817C6</td> | |
162 | - <td>Mark</td> | |
163 | - <td>V</td> | |
164 | - <td> | |
165 | - <select class="form-control" style="height:31px;"> | |
166 | - <option>Margin1</option> | |
167 | - <option>Margin2</option> | |
168 | - </select> | |
169 | - </td> | |
170 | - <td style="color:#55AF8B;">$3659</td> | |
171 | - <td> | |
172 | - <select class="form-control" style="height:31px;"> | |
173 | - <option>Margin1</option> | |
174 | - <option>Margin2</option> | |
175 | - </select> | |
176 | - </td> | |
177 | - <td style="color:#55AF8B;">$3659</td> | |
178 | - <td></td> | |
179 | - </tr> | |
180 | - <tr> | |
181 | - <td>N817C6</td> | |
182 | - <td>Mark</td> | |
183 | - <td>V</td> | |
184 | - <td> | |
185 | - <select class="form-control" style="height:31px;"> | |
186 | - <option>Margin1</option> | |
187 | - <option>Margin2</option> | |
188 | - </select> | |
189 | - </td> | |
190 | - <td style="color:#55AF8B;">$3659</td> | |
191 | - <td> | |
192 | - <select class="form-control" style="height:31px;"> | |
193 | - <option>Margin1</option> | |
194 | - <option>Margin2</option> | |
195 | - </select> | |
196 | - </td> | |
197 | - <td style="color:#55AF8B;">$3659</td> | |
198 | - <td></td> | |
199 | - </tr> | |
200 | - <tr> | |
201 | - <td>N817C6</td> | |
202 | - <td>Mark</td> | |
203 | - <td>V</td> | |
204 | - <td> | |
205 | - <select class="form-control" style="height:31px;"> | |
206 | - <option>Margin1</option> | |
207 | - <option>Margin2</option> | |
208 | - </select> | |
209 | - </td> | |
210 | - <td style="color:#55AF8B;">$3659</td> | |
211 | - <td> | |
212 | - <select class="form-control" style="height:31px;"> | |
213 | - <option>Margin1</option> | |
214 | - <option>Margin2</option> | |
215 | - </select> | |
216 | - </td> | |
217 | - <td style="color:#55AF8B;">$3659</td> | |
218 | - <td></td> | |
219 | - </tr> | |
220 | - <tr> | |
221 | - <td>N817C6</td> | |
222 | - <td>Mark</td> | |
223 | - <td>V</td> | |
234 | + <tr ng-repeat="aircraft in contactAircraftList"> | |
235 | + <td>{{aircraft.tail}}</td> | |
236 | + <td>{{aircraft.make}}</td> | |
237 | + <td>{{aircraft.model}}</td> | |
224 | 238 | <td> |
225 | 239 | <select class="form-control" style="height:31px;"> |
226 | 240 | <option>Margin1</option> |
... | ... | @@ -251,7 +265,7 @@ |
251 | 265 | <i class="fa fa-user"></i> |
252 | 266 | <h3>Contact List</h3> |
253 | 267 | <div class="pull-right"> |
254 | - <button type="submit" data-toggle="modal" data-target="#contact-modal-3" class="btn btn-success btn-sm" style="margin-top: 4px; margin-right: 9px;"><i class="icon-ok"></i>+   Add Contact</button> | |
268 | + <button type="submit" data-toggle="modal" data-target="#contact-modal-3" class="btn btn-success btn-sm" style="margin-top: 4px; margin-right: 9px;"><i class="fa fa-plus" aria-hidden="true"></i> Add Contact</button> | |
255 | 269 | </div> |
256 | 270 | </div> |
257 | 271 | <div class="widget-content" style="padding:0px"> |
... | ... | @@ -266,29 +280,11 @@ |
266 | 280 | </tr> |
267 | 281 | </thead> |
268 | 282 | <tbody> |
269 | - <tr> | |
270 | - <td><input id="toggle-one1" checked type="checkbox" data-size="mini" data-toggle="toggle"></td> | |
271 | - <td>Mark</td> | |
272 | - <td>Otto</td> | |
273 | - <td>Dispatcher</td> | |
274 | - </tr> | |
275 | - <tr> | |
276 | - <td><input id="toggle-two" checked type="checkbox" data-size="mini" data-toggle="toggle"></td> | |
277 | - <td>Mark</td> | |
278 | - <td>Otto</td> | |
279 | - <td>Dispatcher</td> | |
280 | - </tr> | |
281 | - <tr> | |
282 | - <td><input id="toggle-three" checked type="checkbox" data-size="mini" data-toggle="toggle"></td> | |
283 | - <td>Mark</td> | |
284 | - <td>Otto</td> | |
285 | - <td>Dispatcher</td> | |
286 | - </tr> | |
287 | - <tr> | |
288 | - <td><input id="toggle-four" checked type="checkbox" data-size="mini" data-toggle="toggle"></td> | |
289 | - <td>Mark</td> | |
290 | - <td>Otto</td> | |
291 | - <td>Dispatcher</td> | |
283 | + <tr ng-repeat="contact in companyContactList"> | |
284 | + <td><input id="toggle-one1" ng-model="contact.priceEmail" ng-true-value="true" ng-false-value="false" checked type="checkbox" data-size="mini" data-toggle="toggle"></td> | |
285 | + <td>{{contact.firstName}}</td> | |
286 | + <td>{{contact.lastName}}</td> | |
287 | + <td>{{contact.title}}</td> | |
292 | 288 | </tr> |
293 | 289 | </tbody> |
294 | 290 | </table> |
... | ... | @@ -525,6 +521,87 @@ |
525 | 521 | </div> |
526 | 522 | </form> |
527 | 523 | <div class="clearfix"></div> |
524 | + | |
525 | +<form class="modal multi-step" id="aircraft-modal-3" name="aircraftForm"> | |
526 | + <div class="modal-dialog modal-lg"> | |
527 | + <div class="modal-content"> | |
528 | + <div class="modal-body step-2" data-step="2" style="padding: 0;"> | |
529 | + <div> | |
530 | + <div class="row" style="margin: 0;"> | |
531 | + <div> | |
532 | + <div class="widget" style="margin-bottom: 0;box-shadow: none;"> | |
533 | + <div class="widget-header"> | |
534 | + <i class="icon-pencil"></i> | |
535 | + <i class="fa fa-tasks" aria-hidden="true"></i> | |
536 | + <h3>Add a New Aircraft</h3> | |
537 | + <div class="clearfix"></div> | |
538 | + </div> | |
539 | + <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | |
540 | + <div class="col-xs-12"> | |
541 | + <div class="widget-header"> | |
542 | + <i class="fa fa-list"></i> | |
543 | + <h3>Aircraft List</h3> | |
544 | + </div> | |
545 | + <div class="widget-content" style="padding:0px;border: 0px; padding: 0px !important;"> | |
546 | + <div class="table-responsive"> | |
547 | + <table class="table table-striped table-bordered"> | |
548 | + <thead> | |
549 | + <tr> | |
550 | + <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | |
551 | + <th>Tail</th> | |
552 | + <th>Make</th> | |
553 | + <th>Model</th> | |
554 | + <th>Size</th> | |
555 | + </tr> | |
556 | + </thead> | |
557 | + <tbody> | |
558 | + <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | |
559 | + <!-- <td> | |
560 | + <input type="checkbox" ng-model="aircraftData.selected"/> | |
561 | + </td> --> | |
562 | + <td style="width: 20%"> | |
563 | + <input type="tel" class="form-control" ng-model="aircraftData.tail" required/> | |
564 | + </td> | |
565 | + <td style="width: 20%"> | |
566 | + <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | |
567 | + <option ng-repeat="make in aircraftMakeList">{{make}}</option> | |
568 | + </select> | |
569 | + </td> | |
570 | + <td style="width: 20%"> | |
571 | + <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | |
572 | + <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> | |
573 | + </select> | |
574 | + </td> | |
575 | + <td style="width: 20%"> | |
576 | + <select class="form-control" ng-model="aircraftData.size"> | |
577 | + <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | |
578 | + </select> | |
579 | + </td> | |
580 | + </tr> | |
581 | + </tbody> | |
582 | + </table> | |
583 | + </div> | |
584 | + <div class="clearfix"></div> | |
585 | + </div> | |
586 | + </div> | |
587 | + <div class="clearfix"></div> | |
588 | + <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | |
589 | + <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | |
590 | + </div> | |
591 | + </div> | |
592 | + </div> | |
593 | + <div class="clearfix"></div> | |
594 | + </div> | |
595 | + </div> | |
596 | + </div> | |
597 | + </div> | |
598 | + <div class="modal-footer" style="border-top: 0;"> | |
599 | + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> | |
600 | + <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="saveCompanyData()">Save</button> | |
601 | + </div> | |
602 | + </div> | |
603 | + </div> | |
604 | +</form> | |
528 | 605 | <!-- Le javascript |
529 | 606 | ================================================== --> |
530 | 607 | <!-- Placed at the end of the document so the pages load faster --> | ... | ... |
app/partials/viewCompany/viewCompany.service.js
... | ... | @@ -53,6 +53,22 @@ |
53 | 53 | }) |
54 | 54 | return deferred.promise; |
55 | 55 | } |
56 | + | |
57 | + this.getAircraft = function(id) { | |
58 | + | |
59 | + var deferred = $q.defer(); | |
60 | + $http({ | |
61 | + method : 'GET', | |
62 | + url : BASE_URL.url +'/company/aircrafts/'+id, | |
63 | + headers : {'Content-Type': 'application/json'}, | |
64 | + }) | |
65 | + .then(function (result){ | |
66 | + deferred.resolve(result.data); | |
67 | + },function (result){ | |
68 | + deferred.resolve(result.data); | |
69 | + }) | |
70 | + return deferred.promise; | |
71 | + } | |
56 | 72 | |
57 | 73 | } |
58 | 74 | ... | ... |