Commit 07328f4420c2e25cbb808ea5de3c58615bef14ac
1 parent
52439a6d77
Exists in
master
new code added for aircrafts
Showing
4 changed files
with
77 additions
and
20 deletions
Show diff stats
app/partials/customers/customers.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | .controller('customersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', '$state', 'CustomersService', 'ViewCompanyService', 'NgTableParams', customersController]); | 5 | .controller('customersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', '$state', 'CustomersService', 'ViewCompanyService', 'NgTableParams', customersController]); |
6 | 6 | ||
7 | function customersController($scope, $rootScope, $uibModal, $filter, $http, $state, CustomersService, ViewCompanyService, NgTableParams) { | 7 | function customersController($scope, $rootScope, $uibModal, $filter, $http, $state, CustomersService, ViewCompanyService, NgTableParams) { |
8 | $(document).ready(function() { | 8 | $(document).ready(function() { |
9 | // $('#example').DataTable(); | 9 | // $('#example').DataTable(); |
10 | }); | 10 | }); |
11 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) | 11 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) |
12 | $scope.reset2 = function(){ | 12 | $scope.reset2 = function(){ |
13 | $("input").val(""); | 13 | $("input").val(""); |
14 | $scope.removeMarginValidation(); | 14 | $scope.removeMarginValidation(); |
15 | } | 15 | } |
16 | 16 | ||
17 | 17 | ||
18 | $scope.data = {}; | 18 | $scope.data = {}; |
19 | $scope.aircraft = {}; | 19 | $scope.aircraft = {}; |
20 | $scope.data.activate = true; | 20 | $scope.data.activate = true; |
21 | $scope.showLoader = true; | 21 | $scope.showLoader = true; |
22 | getAllCompanies(); | 22 | getAllCompanies(); |
23 | 23 | ||
24 | /*function getAllCompanies(){ | 24 | /*function getAllCompanies(){ |
25 | CustomersService.getAllCompanies().then(function(result) { | 25 | CustomersService.getAllCompanies().then(function(result) { |
26 | $scope.companyList = result; | 26 | $scope.companyList = result; |
27 | for(var i=0; i<$scope.companyList.length; i++){ | 27 | for(var i=0; i<$scope.companyList.length; i++){ |
28 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 28 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
29 | } | 29 | } |
30 | }) | 30 | }) |
31 | 31 | ||
32 | }*/ | 32 | }*/ |
33 | 33 | ||
34 | $scope.statusFilter = [ | 34 | $scope.statusFilter = [ |
35 | {id: "", title: "Show All"}, | 35 | {id: "", title: "Show All"}, |
36 | {id: "true", title: "Active"}, | 36 | {id: "true", title: "Active"}, |
37 | {id: "false", title: "Inactive"} | 37 | {id: "false", title: "Inactive"} |
38 | ] | 38 | ] |
39 | 39 | ||
40 | function getAllCompanies(){ | 40 | function getAllCompanies(){ |
41 | CustomersService.getAllCompanies().then(function(result) { | 41 | CustomersService.getAllCompanies().then(function(result) { |
42 | console.log('log', result); | 42 | console.log('log', result); |
43 | $scope.companyList = result; | 43 | $scope.companyList = result; |
44 | for (var i = 0; i < $scope.companyList.length; i++) { | 44 | for (var i = 0; i < $scope.companyList.length; i++) { |
45 | if ($scope.companyList[i].companyContact != null) { | 45 | if ($scope.companyList[i].companyContact != null) { |
46 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { | 46 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { |
47 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; | 47 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | if ($scope.companyList[i].primaryContact != null) { | 50 | if ($scope.companyList[i].primaryContact != null) { |
51 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { | 51 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { |
52 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; | 52 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; |
53 | } | 53 | } |
54 | } | 54 | } |
55 | if ($scope.companyList[i].margin != null) { | 55 | if ($scope.companyList[i].margin != null) { |
56 | if ($scope.companyList[i].margin.marginName != null) { | 56 | if ($scope.companyList[i].margin.marginName != null) { |
57 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 57 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | } | 60 | } |
61 | $scope.displayCompanyList = new NgTableParams({ | 61 | $scope.displayCompanyList = new NgTableParams({ |
62 | page: 1, | 62 | page: 1, |
63 | count: 10, | 63 | count: 10, |
64 | }, { | 64 | }, { |
65 | data: $scope.companyList | 65 | data: $scope.companyList |
66 | }); | 66 | }); |
67 | $scope.showLoader = false; | 67 | $scope.showLoader = false; |
68 | }) | 68 | }) |
69 | } | 69 | } |
70 | 70 | ||
71 | $scope.editMargin = function(customer){ | 71 | $scope.editMargin = function(customer){ |
72 | console.log('customer', customer); | 72 | console.log('customer', customer); |
73 | $scope.showLoader = true; | 73 | $scope.showLoader = true; |
74 | event.stopPropagation(); | 74 | event.stopPropagation(); |
75 | 75 | ||
76 | var companyMargin = "companyName=" + customer.companyName + "&masterMargin=" + customer.masterMargin | 76 | var companyMargin = "companyName=" + customer.companyName + "&masterMargin=" + customer.masterMargin |
77 | + "&addressOne=" + customer.addressOne + "&addressTwo=" + customer.addressTwo + "&city=" + customer.city + "&state=" | 77 | + "&addressOne=" + customer.addressOne + "&addressTwo=" + customer.addressTwo + "&city=" + customer.city + "&state=" |
78 | + customer.state + "&country=" + customer.country + "&zipcode=" + customer.zipcode + "&internalNote=" | 78 | + customer.state + "&country=" + customer.country + "&zipcode=" + customer.zipcode + "&internalNote=" |
79 | + customer.internalNote + "&certificateType=" + customer.certificateType + "&baseTenant=" + customer.baseTenant | 79 | + customer.internalNote + "&certificateType=" + customer.certificateType + "&baseTenant=" + customer.baseTenant |
80 | + "&fuelerlinxCustomer=" + customer.fuelerlinxCustomer + "&contractFuelVendor=" + customer.contractFuelVendor | 80 | + "&fuelerlinxCustomer=" + customer.fuelerlinxCustomer + "&contractFuelVendor=" + customer.contractFuelVendor |
81 | + "&activate=" + customer.activate + "&baseIcao=" + customer.baseIcao + "&companyId=" + customer.id; | 81 | + "&activate=" + customer.activate + "&baseIcao=" + customer.baseIcao + "&companyId=" + customer.id; |
82 | 82 | ||
83 | ViewCompanyService.updateCompany(companyMargin).then(function(result) { | 83 | ViewCompanyService.updateCompany(companyMargin).then(function(result) { |
84 | if(result != null && result.success){ | 84 | if(result != null && result.success){ |
85 | $scope.showLoader = false; | 85 | $scope.showLoader = false; |
86 | toastr.success(''+result.success+'', { | 86 | toastr.success(''+result.success+'', { |
87 | closeButton: true | 87 | closeButton: true |
88 | }) | 88 | }) |
89 | }else{ | 89 | }else{ |
90 | $scope.showLoader = false; | 90 | $scope.showLoader = false; |
91 | toastr.error(''+result.statusText+'', { | 91 | toastr.error(''+result.statusText+'', { |
92 | closeButton: true | 92 | closeButton: true |
93 | }) | 93 | }) |
94 | } | 94 | } |
95 | }) | 95 | }) |
96 | } | 96 | } |
97 | 97 | ||
98 | getData(); | 98 | getData(); |
99 | function getData(){ | 99 | function getData(){ |
100 | $scope.showLoader = true; | 100 | $scope.showLoader = true; |
101 | CustomersService.getAircraftMake().then(function(result) { | 101 | CustomersService.getAircraftMake().then(function(result) { |
102 | $scope.aircraftMakeList = result; | 102 | $scope.aircraftMakeList = result; |
103 | $scope.showLoader = false; | 103 | $scope.showLoader = false; |
104 | }) | 104 | }) |
105 | } | 105 | } |
106 | 106 | ||
107 | 107 | ||
108 | // CustomersService.getMargin().then(function(result) { | 108 | // CustomersService.getMargin().then(function(result) { |
109 | // $scope.marginList = result; | 109 | // $scope.marginList = result; |
110 | // }) | 110 | // }) |
111 | $scope.marginFilterOptions = []; | 111 | $scope.marginFilterOptions = []; |
112 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 112 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
113 | $scope.showLoader = true; | 113 | $scope.showLoader = true; |
114 | $scope.jetMarginList = result; | 114 | $scope.jetMarginList = result; |
115 | $scope.marginFilterOptions.push({ | 115 | $scope.marginFilterOptions.push({ |
116 | 'id': '', 'title': 'Show All' | 116 | 'id': '', 'title': 'Show All' |
117 | }); | 117 | }); |
118 | for (var i = 0; i < result.length; i++) { | 118 | for (var i = 0; i < result.length; i++) { |
119 | $scope.marginFilterOptions.push({ | 119 | $scope.marginFilterOptions.push({ |
120 | 'id': result[i].id, | 120 | 'id': result[i].id, |
121 | 'title': result[i].marginName | 121 | 'title': result[i].marginName |
122 | }) | 122 | }) |
123 | } | 123 | } |
124 | $scope.showLoader = false; | 124 | $scope.showLoader = false; |
125 | }) | 125 | }) |
126 | 126 | ||
127 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | 127 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { |
128 | $scope.avgsMarginList = result; | 128 | $scope.avgsMarginList = result; |
129 | }) | 129 | }) |
130 | 130 | ||
131 | 131 | ||
132 | $scope.showCompanyError = false; | 132 | $scope.showCompanyError = false; |
133 | $scope.showMarginError = false; | 133 | $scope.showMarginError = false; |
134 | 134 | ||
135 | $scope.removeValidation = function(){ | 135 | $scope.removeValidation = function(){ |
136 | $scope.showCompanyError = false; | 136 | $scope.showCompanyError = false; |
137 | $('.companyNameInput').removeClass('customErrorInput'); | 137 | $('.companyNameInput').removeClass('customErrorInput'); |
138 | if($scope.data.companyName == 'undefined' || $scope.data.companyName == '') { | 138 | if($scope.data.companyName == 'undefined' || $scope.data.companyName == '') { |
139 | $('.companyNameInput').addClass('customErrorInput'); | 139 | $('.companyNameInput').addClass('customErrorInput'); |
140 | $scope.showCompanyError = true; | 140 | $scope.showCompanyError = true; |
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | $scope.removeMarginValidation = function(){ | 144 | $scope.removeMarginValidation = function(){ |
145 | $scope.showMarginError = false; | 145 | $scope.showMarginError = false; |
146 | $('.marginSelectBox').removeClass('customErrorInput'); | 146 | $('.marginSelectBox').removeClass('customErrorInput'); |
147 | } | 147 | } |
148 | 148 | ||
149 | var companyData; | 149 | var companyData; |
150 | $scope.addFirstData = function(sel, step){ | 150 | $scope.addFirstData = function(sel, step){ |
151 | $scope.showLoader = true; | 151 | $scope.showLoader = true; |
152 | if($scope.data.companyName == undefined){ | 152 | if($scope.data.companyName == undefined){ |
153 | $scope.showCompanyError = true; | 153 | $scope.showCompanyError = true; |
154 | $('.companyNameInput').addClass('customErrorInput'); | 154 | $('.companyNameInput').addClass('customErrorInput'); |
155 | }else if($scope.data.masterMargin == undefined){ | 155 | }else if($scope.data.masterMargin == undefined){ |
156 | $scope.showMarginError = true; | 156 | $scope.showMarginError = true; |
157 | $('.marginSelectBox').addClass('customErrorInput'); | 157 | $('.marginSelectBox').addClass('customErrorInput'); |
158 | }else{ | 158 | }else{ |
159 | $scope.aircraftDetails = [{ | 159 | $scope.aircraftDetails = [{ |
160 | 'tail':'', | 160 | 'tail':'', |
161 | 'make': '', | 161 | 'make': '', |
162 | 'model': '', | 162 | 'model': '', |
163 | 'sizeId' : '', | 163 | 'sizeId' : '', |
164 | 'marginId': $scope.data.masterMargin, | 164 | 'marginId': $scope.data.masterMargin, |
165 | 'avgasMarginId': $scope.data.avgasMargin | 165 | 'avgasMarginId': $scope.data.avgasMargin |
166 | }]; | 166 | }]; |
167 | 167 | ||
168 | $(sel).trigger('next.m.' + step); | 168 | $(sel).trigger('next.m.' + step); |
169 | getData(); | 169 | getData(); |
170 | } | 170 | } |
171 | $scope.showLoader = false; | 171 | $scope.showLoader = false; |
172 | } | 172 | } |
173 | $scope.addNew = function(){ | 173 | $scope.addNew = function(){ |
174 | $scope.showLoader = true; | 174 | $scope.showLoader = true; |
175 | $scope.aircraftDetails.push({ | 175 | $scope.aircraftDetails.push({ |
176 | 'tail':'', | 176 | 'tail':'', |
177 | 'make': '', | 177 | 'make': '', |
178 | 'model': '', | 178 | 'model': '', |
179 | 'sizeId' : '', | 179 | 'sizeId' : '', |
180 | 'marginId': $scope.data.masterMargin, | 180 | 'marginId': $scope.data.masterMargin, |
181 | 'avgasMarginId': $scope.data.avgasMargin | 181 | 'avgasMarginId': $scope.data.avgasMargin |
182 | }); | 182 | }); |
183 | $scope.showLoader = false; | 183 | $scope.showLoader = false; |
184 | }; | 184 | }; |
185 | 185 | ||
186 | $scope.getModal = function(makeId, index){ | 186 | $scope.getModal = function(makeId, index){ |
187 | $scope.showLoader = true; | 187 | $scope.showLoader = true; |
188 | $scope.aircraft.make = makeId; | 188 | $scope.aircraft.make = makeId; |
189 | //var makeId = makeId; | 189 | //var makeId = makeId; |
190 | CustomersService.getModal($scope.aircraft.make).then(function(result) { | 190 | CustomersService.getModal($scope.aircraft.make).then(function(result) { |
191 | $scope.showLoader = false; | 191 | $scope.showLoader = false; |
192 | $scope.aircraftDetails[index].aircraftModalList = result; | 192 | $scope.aircraftDetails[index].aircraftModalList = result; |
193 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | 193 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; |
194 | }) | 194 | }) |
195 | } | 195 | } |
196 | 196 | ||
197 | $scope.getSize = function(model, index){ | 197 | $scope.getSize = function(model, index){ |
198 | $scope.showLoader = true; | 198 | $scope.showLoader = true; |
199 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | 199 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
200 | $scope.showLoader = false; | 200 | $scope.showLoader = false; |
201 | $scope.aircraftDetails[index].aircraftSizeList = result; | 201 | $scope.aircraftDetails[index].aircraftSizeList = result; |
202 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | 202 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; |
203 | }) | 203 | }) |
204 | } | 204 | } |
205 | 205 | ||
206 | $scope.aircraftListData = {}; | 206 | $scope.aircraftListData = {}; |
207 | $scope.addData = []; | 207 | $scope.addData = []; |
208 | $scope.saveCompanyData = function(){ | 208 | $scope.saveCompanyData = function(){ |
209 | CustomersService.addCompany($scope.data).then(function(result) { | 209 | CustomersService.addCompany($scope.data).then(function(result) { |
210 | $scope.accountId = result; | 210 | $scope.accountId = result; |
211 | $scope.aircraft.accountId = $scope.accountId; | 211 | $scope.aircraft.accountId = $scope.accountId; |
212 | 212 | ||
213 | for(var i=0; i<$scope.aircraftDetails.length;i++){ | 213 | for(var i=0; i<$scope.aircraftDetails.length;i++){ |
214 | $scope.addData.push({ | 214 | $scope.addData.push({ |
215 | 'tail': $scope.aircraftDetails[i].tail, | 215 | 'tail': $scope.aircraftDetails[i].tail, |
216 | 'make': $scope.aircraftDetails[i].make, | 216 | 'make': $scope.aircraftDetails[i].make, |
217 | 'model': $scope.aircraftDetails[i].model, | 217 | 'model': $scope.aircraftDetails[i].model, |
218 | 'sizeId' : $scope.aircraftDetails[i].sizeId, | 218 | 'sizeId' : $scope.aircraftDetails[i].sizeId, |
219 | 'marginId': $scope.aircraftDetails[i].marginId, | 219 | 'marginId': $scope.aircraftDetails[i].marginId, |
220 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId | 220 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId |
221 | }); | 221 | }); |
222 | } | 222 | } |
223 | $scope.aircraftListData.aircraftList = $scope.addData; | 223 | $scope.aircraftListData.aircraftList = $scope.addData; |
224 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; | 224 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; |
225 | 225 | ||
226 | if($scope.aircraftListData.aircraftList[0].tail == "" || $scope.aircraftListData.aircraftList[0].make == null || $scope.aircraftListData.aircraftList[0].model == null){ | 226 | if($scope.aircraftListData.aircraftList[0].tail == "" || $scope.aircraftListData.aircraftList[0].make == null || $scope.aircraftListData.aircraftList[0].model == null){ |
227 | $scope.aircraftListData.aircraftList = []; | 227 | $scope.aircraftListData.aircraftList = []; |
228 | } | 228 | } |
229 | 229 | ||
230 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { | 230 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { |
231 | 231 | ||
232 | if(result != null && result.success){ | 232 | if(result != null && result.success){ |
233 | toastr.success(''+result.success+'', { | 233 | toastr.success(''+result.success+'', { |
234 | closeButton: true | 234 | closeButton: true |
235 | }) | 235 | }) |
236 | $('#demo-modal-3').modal('hide'); | 236 | $('#demo-modal-3').modal('hide'); |
237 | getAllCompanies(); | 237 | getAllCompanies(); |
238 | }else{ | 238 | }else{ |
239 | toastr.error(''+result.statusText+'', { | 239 | toastr.error(''+result.statusText+'', { |
240 | closeButton: true | 240 | closeButton: true |
241 | }) | 241 | }) |
242 | } | 242 | } |
243 | }); | 243 | }); |
244 | 244 | ||
245 | }) | 245 | }) |
246 | 246 | ||
247 | 247 | ||
248 | } | 248 | } |
249 | 249 | ||
250 | // $scope.appendText = function() { | 250 | // $scope.appendText = function() { |
251 | // getData(); | 251 | // getData(); |
252 | // var newRow = $('<tr> <td> <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> </td> <td style="width: 25%;"> <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> <option ng-repeat="make in aircraftMakeList">{{make}}</option> </select> </td> <td style="width: 20%;"> <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> <option ng-repeat="model in aircraftModalList">{{model}}</option> </select> </td> <td style="width: 25%;"> <select class="form-control" ng-model="aircraft.size"> <option ng-repeat="size in aircraftSizeList">{{size}}</option> </select> </td> <td> <select class="form-control"> <option>Margin1</option> <option>Margin2</option> </select> </td> </tr>'); | 252 | // var newRow = $('<tr> <td> <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> </td> <td style="width: 25%;"> <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> <option ng-repeat="make in aircraftMakeList">{{make}}</option> </select> </td> <td style="width: 20%;"> <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> <option ng-repeat="model in aircraftModalList">{{model}}</option> </select> </td> <td style="width: 25%;"> <select class="form-control" ng-model="aircraft.size"> <option ng-repeat="size in aircraftSizeList">{{size}}</option> </select> </td> <td> <select class="form-control"> <option>Margin1</option> <option>Margin2</option> </select> </td> </tr>'); |
253 | // $('table.addRow').append(newRow); | 253 | // $('table.addRow').append(newRow); |
254 | // } | 254 | // } |
255 | 255 | ||
256 | $scope.setFuel = function(){ | 256 | $scope.setFuel = function(){ |
257 | event.stopPropagation(); | 257 | event.stopPropagation(); |
258 | $state.go('app.updateFuelManager'); | 258 | $state.go('app.updateFuelManager'); |
259 | } | 259 | } |
260 | 260 | ||
261 | /* ng table */ | 261 | /* ng table */ |
262 | 262 | ||
263 | $scope.exportCompany = function() { | 263 | $scope.exportCompany = function() { |
264 | $scope.showLoader = true; | 264 | $scope.showLoader = true; |
265 | var fileName = "companies.csv"; | 265 | var fileName = "companies.csv"; |
266 | var a = document.createElement("a"); | 266 | var a = document.createElement("a"); |
267 | document.body.appendChild(a); | 267 | document.body.appendChild(a); |
268 | CustomersService.exportCompany().then(function(result) { | 268 | CustomersService.exportCompany().then(function(result) { |
269 | var file = new Blob([result], {type: 'application/csv'}); | 269 | var file = new Blob([result], {type: 'application/csv'}); |
270 | var fileURL = URL.createObjectURL(file); | 270 | var fileURL = URL.createObjectURL(file); |
271 | a.href = fileURL; | 271 | a.href = fileURL; |
272 | a.download = fileName; | 272 | a.download = fileName; |
273 | a.click(); | 273 | a.click(); |
274 | $scope.showLoader = false; | 274 | $scope.showLoader = false; |
275 | }) | 275 | }) |
276 | } | 276 | } |
277 | getCompanyName(); | 277 | getCompanyName(); |
278 | function getCompanyName(){ | 278 | function getCompanyName(){ |
279 | CustomersService.getCompanyName().then(function(result) { | 279 | CustomersService.getCompanyName().then(function(result) { |
280 | $scope.compNameList = result; | 280 | $scope.compNameList = result; |
281 | }) | 281 | }) |
282 | } | 282 | } |
283 | 283 | ||
284 | 284 | ||
285 | } | 285 | } |
app/partials/viewCompany/viewCompany.controller.js
1 | 1 | ||
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | //Load controller | 4 | //Load controller |
5 | angular.module('acufuel') | 5 | angular.module('acufuel') |
6 | 6 | ||
7 | .controller('viewCompanyController', ['$scope','$uibModal', '$stateParams', 'ViewCompanyService', 'CustomersService', 'updateFuelManagerService', 'ViewFuelVendorService', 'ViewcontactService', function($scope , $uibModal, $stateParams, ViewCompanyService, CustomersService, updateFuelManagerService, ViewFuelVendorService, ViewcontactService) { | 7 | .controller('viewCompanyController', ['$scope','$uibModal', '$stateParams', 'ViewCompanyService', 'CustomersService', 'updateFuelManagerService', 'ViewFuelVendorService', 'ViewcontactService', function($scope , $uibModal, $stateParams, ViewCompanyService, CustomersService, updateFuelManagerService, ViewFuelVendorService, ViewcontactService) { |
8 | $scope.data = {}; | 8 | $scope.data = {}; |
9 | $scope.data.priceEmail = true; | 9 | $scope.data.priceEmail = true; |
10 | $scope.aircraft = {}; | 10 | $scope.aircraft = {}; |
11 | $scope.primayData = {}; | 11 | $scope.primayData = {}; |
12 | $scope.showLoader = false; | 12 | $scope.showLoader = false; |
13 | $scope.showUpdateBtn = false; | 13 | $scope.showUpdateBtn = false; |
14 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')); | 14 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')); |
15 | $scope.selected = []; | 15 | $scope.selected = []; |
16 | $scope.jetShow = []; | ||
17 | $scope.marginShow = []; | ||
18 | |||
19 | $scope.jetShow[0] = true; | ||
20 | $scope.marginShow[0] = true; | ||
16 | 21 | ||
17 | $(document).ready(function() { | 22 | $(document).ready(function() { |
18 | $("#reset").click(function() { | 23 | $("#reset").click(function() { |
19 | $("input").val(""); | 24 | $("input").val(""); |
20 | }); | 25 | }); |
21 | }); | 26 | }); |
22 | 27 | ||
23 | $scope.values = [ | 28 | $scope.values = [ |
24 | {'id': 1, 'first': 'Tenant/Base Customer'}, | 29 | {'id': 1, 'first': 'Tenant/Base Customer'}, |
25 | {'id': 2, 'first': 'FuelerLinx Customer'}, | 30 | {'id': 2, 'first': 'FuelerLinx Customer'}, |
26 | {'id': 3, 'first': 'CAA Member'} | 31 | {'id': 3, 'first': 'CAA Member'} |
27 | ]; | 32 | ]; |
28 | 33 | ||
29 | $scope.changeValue = function(selected){ | 34 | $scope.changeValue = function(selected){ |
30 | $scope.showUpdateBtn = true; | 35 | $scope.showUpdateBtn = true; |
31 | console.log("data to be true", selected); | 36 | console.log("data to be true", selected); |
32 | for (var i=0;i<selected.length;i++){ | 37 | for (var i=0;i<selected.length;i++){ |
33 | console.log(selected[i]) | 38 | console.log(selected[i]) |
34 | if(selected[i] == 'Tenant/Base Customer'){ | 39 | if(selected[i] == 'Tenant/Base Customer'){ |
35 | $scope.companyData.baseTenant = true; | 40 | $scope.companyData.baseTenant = true; |
36 | }else{ | 41 | }else{ |
37 | $scope.companyData.baseTenant = false; | 42 | $scope.companyData.baseTenant = false; |
38 | } | 43 | } |
39 | if(selected[i] == 'FuelerLinx Customer'){ | 44 | if(selected[i] == 'FuelerLinx Customer'){ |
40 | $scope.companyData.fuelerlinxCustomer = true; | 45 | $scope.companyData.fuelerlinxCustomer = true; |
41 | }else{ | 46 | }else{ |
42 | $scope.companyData.fuelerlinxCustomer = false; | 47 | $scope.companyData.fuelerlinxCustomer = false; |
43 | } | 48 | } |
44 | 49 | ||
45 | if(selected[i] == 'CAA Member'){ | 50 | if(selected[i] == 'CAA Member'){ |
46 | $scope.companyData.contractFuelVendor = true; | 51 | $scope.companyData.contractFuelVendor = true; |
47 | }else{ | 52 | }else{ |
48 | $scope.companyData.contractFuelVendor = false; | 53 | $scope.companyData.contractFuelVendor = false; |
49 | } | 54 | } |
50 | 55 | ||
51 | console.log($scope.companyData) | 56 | console.log($scope.companyData) |
52 | 57 | ||
53 | } | 58 | } |
54 | 59 | ||
55 | } | 60 | } |
56 | 61 | ||
57 | // $scope.selected =[ | 62 | // $scope.selected =[ |
58 | // {'id': 1, 'first': 'Tenant/Base Customer'}, | 63 | // {'id': 1, 'first': 'Tenant/Base Customer'}, |
59 | // {'id': 2, 'first': 'FuelerLinx Customer'}, | 64 | // {'id': 2, 'first': 'FuelerLinx Customer'}, |
60 | // {'id': 3, 'first': 'CAA Member'} | 65 | // {'id': 3, 'first': 'CAA Member'} |
61 | // ]; | 66 | // ]; |
62 | 67 | ||
63 | // CustomersService.getMargin().then(function(result) { | 68 | // CustomersService.getMargin().then(function(result) { |
64 | // $scope.marginList = result; | 69 | // $scope.marginList = result; |
65 | // }) | 70 | // }) |
66 | 71 | ||
67 | var value = ""; | 72 | var value = ""; |
68 | var companyId = $stateParams.id; | 73 | var companyId = $stateParams.id; |
69 | $scope.companyData = {}; | 74 | $scope.companyData = {}; |
70 | $scope.multipleMsg = false; | 75 | $scope.multipleMsg = false; |
71 | $scope.companyData.masterMargin = ""; | 76 | $scope.companyData.masterMargin = ""; |
72 | $scope.isGlobal = false; | 77 | $scope.isGlobal = false; |
73 | getCompanyDetail(); | 78 | getCompanyDetail(); |
74 | function getCompanyDetail(){ | 79 | function getCompanyDetail(){ |
75 | $scope.showLoader = true; | 80 | $scope.showLoader = true; |
76 | ViewCompanyService.getCompany(companyId).then(function(result) { | 81 | ViewCompanyService.getCompany(companyId).then(function(result) { |
77 | $scope.companyData = result; | 82 | $scope.companyData = result; |
78 | $scope.isGlobal = result.global; | 83 | $scope.isGlobal = result.global; |
79 | if(result.global == true){ | 84 | if(result.global == true){ |
80 | $scope.companyData.global = true; | 85 | $scope.companyData.global = true; |
81 | } | 86 | } |
82 | if(result.margin != null){ | 87 | if(result.margin != null){ |
83 | $scope.companyData.masterMargin = result.margin.id; | 88 | $scope.companyData.masterMargin = result.margin.id; |
84 | } | 89 | } |
85 | if(result.marginAVGAS != null){ | 90 | if(result.marginAVGAS != null){ |
86 | $scope.companyData.avgasMargin = result.marginAVGAS.id; | 91 | $scope.companyData.avgasMargin = result.marginAVGAS.id; |
87 | } | 92 | } |
88 | 93 | ||
89 | 94 | ||
90 | 95 | ||
91 | if($scope.companyData.baseTenant){ | 96 | if($scope.companyData.baseTenant){ |
92 | 97 | ||
93 | $scope.selected.push({'first': 'Tenant/Base Customer'}) | 98 | $scope.selected.push({'first': 'Tenant/Base Customer'}) |
94 | console.log("$scope.selected",$scope.selected) | 99 | console.log("$scope.selected",$scope.selected) |
95 | 100 | ||
96 | } | 101 | } |
97 | 102 | ||
98 | if($scope.companyData.fuelerlinxCustomer){ | 103 | if($scope.companyData.fuelerlinxCustomer){ |
99 | $scope.selected.push({'first': 'FuelerLinx Customer'}) | 104 | $scope.selected.push({'first': 'FuelerLinx Customer'}) |
100 | console.log("$scope.selected",$scope.selected) | 105 | console.log("$scope.selected",$scope.selected) |
101 | } | 106 | } |
102 | 107 | ||
103 | if($scope.companyData.contractFuelVendor){ | 108 | if($scope.companyData.contractFuelVendor){ |
104 | $scope.selected.push({'first': 'CAA Member'}) | 109 | $scope.selected.push({'first': 'CAA Member'}) |
105 | console.log("$scope.selected",$scope.selected) | 110 | console.log("$scope.selected",$scope.selected) |
106 | } | 111 | } |
107 | 112 | ||
108 | console.log("$scope.companyData",$scope.companyData) | 113 | console.log("$scope.companyData",$scope.companyData) |
109 | getAircraftList(); | 114 | getAircraftList(); |
110 | $scope.showLoader = false; | 115 | $scope.showLoader = false; |
111 | }) | 116 | }) |
112 | } | 117 | } |
113 | 118 | ||
114 | 119 | ||
115 | $scope.changeCompanyStatus = function(){ | 120 | $scope.changeCompanyStatus = function(){ |
116 | $('#delete3').css('display', 'block'); | 121 | $('#delete3').css('display', 'block'); |
117 | if($scope.companyData.activate == true){ | 122 | if($scope.companyData.activate == true){ |
118 | $scope.statusMessage = 'Please confirm! Are you sure you want to ACTIVATE this company?' | 123 | $scope.statusMessage = 'Please confirm! Are you sure you want to ACTIVATE this company?' |
119 | }else{ | 124 | }else{ |
120 | $scope.statusMessage = 'Please confirm! Are you sure you want to DEACTIVATE this company?' | 125 | $scope.statusMessage = 'Please confirm! Are you sure you want to DEACTIVATE this company?' |
121 | } | 126 | } |
122 | } | 127 | } |
123 | 128 | ||
124 | $scope.companyStatus = function(){ | 129 | $scope.companyStatus = function(){ |
125 | $scope.showLoader = true; | 130 | $scope.showLoader = true; |
126 | var statusData = "status=" + $scope.companyData.activate; | 131 | var statusData = "status=" + $scope.companyData.activate; |
127 | ViewCompanyService.changeStatus(companyId, statusData).then(function(result) { | 132 | ViewCompanyService.changeStatus(companyId, statusData).then(function(result) { |
128 | if(result.success){ | 133 | if(result.success){ |
129 | $('#delete3').css('display', 'none'); | 134 | $('#delete3').css('display', 'none'); |
130 | toastr.success(''+result.success+'', { | 135 | toastr.success(''+result.success+'', { |
131 | closeButton: true | 136 | closeButton: true |
132 | }) | 137 | }) |
133 | getContactList(); | 138 | getContactList(); |
134 | } | 139 | } |
135 | }) | 140 | }) |
136 | $scope.showLoader = false; | 141 | $scope.showLoader = false; |
137 | } | 142 | } |
138 | 143 | ||
139 | 144 | ||
140 | $scope.cancelStatus = function(){ | 145 | $scope.cancelStatus = function(){ |
141 | $('#delete3').css('display', 'none'); | 146 | $('#delete3').css('display', 'none'); |
142 | $scope.companyData.activate = !$scope.companyData.activate; | 147 | $scope.companyData.activate = !$scope.companyData.activate; |
143 | } | 148 | } |
144 | 149 | ||
145 | getContactList(); | 150 | getContactList(); |
146 | function getContactList(){ | 151 | function getContactList(){ |
147 | ViewCompanyService.getContact(companyId).then(function(result) { | 152 | ViewCompanyService.getContact(companyId).then(function(result) { |
148 | $scope.companyContactList = result; | 153 | $scope.companyContactList = result; |
149 | }) | 154 | }) |
150 | } | 155 | } |
151 | $scope.aircraftmargins = []; | 156 | $scope.aircraftmargins = []; |
152 | 157 | ||
153 | function getAircraftList(){ | 158 | function getAircraftList(){ |
154 | ViewCompanyService.getAircraft(companyId).then(function(result) { | 159 | ViewCompanyService.getAircraft(companyId).then(function(result) { |
155 | $scope.contactAircraftList = result; | 160 | $scope.contactAircraftList = result; |
156 | for (var i = 0; i < $scope.contactAircraftList.length; i++) { | 161 | for (var i = 0; i < $scope.contactAircraftList.length; i++) { |
157 | if($scope.contactAircraftList[i].aircraftsMargin != null){ | 162 | if($scope.contactAircraftList[i].aircraftsMargin != null){ |
158 | $scope.aircraftmargins.push({ | 163 | $scope.aircraftmargins.push({ |
159 | 'id': $scope.contactAircraftList[i].aircraftsMargin.id | 164 | 'id': $scope.contactAircraftList[i].aircraftsMargin.id |
160 | }) | 165 | }) |
161 | } | 166 | } |
162 | } | 167 | } |
163 | if($scope.aircraftmargins.length > 0) { | 168 | if($scope.aircraftmargins.length > 0) { |
164 | for (var i = 0; i < $scope.aircraftmargins.length; i++) { | 169 | for (var i = 0; i < $scope.aircraftmargins.length; i++) { |
165 | if($scope.aircraftmargins[i].id != $scope.companyData.masterMargin){ | 170 | if($scope.aircraftmargins[i].id != $scope.companyData.masterMargin){ |
166 | $scope.multiple = true; | 171 | $scope.multiple = true; |
167 | $scope.multipleMsg = true; | 172 | $scope.multipleMsg = true; |
168 | if($scope.multiple) { | 173 | if($scope.multiple) { |
169 | $scope.companyData.masterMargin = "multiple"; | 174 | $scope.companyData.masterMargin = "multiple"; |
170 | } | 175 | } |
171 | } | 176 | } |
172 | } | 177 | } |
173 | } | 178 | } |
174 | }) | 179 | }) |
175 | } | 180 | } |
176 | 181 | ||
177 | $scope.contactData = {}; | 182 | $scope.contactData = {}; |
178 | $scope.contactData.contactList = []; | 183 | $scope.contactData.contactList = []; |
179 | $scope.addContact = function(){ | 184 | $scope.addContact = function(){ |
180 | $scope.showLoader = true; | 185 | $scope.showLoader = true; |
181 | $scope.data.companyId = companyId; | 186 | $scope.data.companyId = companyId; |
182 | $scope.contactData.contactList.push($scope.data); | 187 | $scope.contactData.contactList.push($scope.data); |
183 | ViewCompanyService.addContact($scope.contactData).then(function(result) { | 188 | ViewCompanyService.addContact($scope.contactData).then(function(result) { |
184 | console.log(result) | 189 | console.log(result) |
185 | if(result.status == 200){ | 190 | if(result.status == 200){ |
186 | // toastr.success(''+result.success+'', { | 191 | // toastr.success(''+result.success+'', { |
187 | // closeButton: true | 192 | // closeButton: true |
188 | // }) | 193 | // }) |
189 | $('#contact-modal-3').modal('hide'); | 194 | $('#contact-modal-3').modal('hide'); |
190 | $scope.primayData.id = result.data; | 195 | $scope.primayData.id = result.data; |
191 | $scope.data = {}; | 196 | $scope.data = {}; |
192 | $scope.sendPrimaryContact(); | 197 | $scope.sendPrimaryContact(); |
193 | getContactList(); | 198 | getContactList(); |
194 | }else{ | 199 | }else{ |
195 | toastr.error(''+result.statusText+'', { | 200 | toastr.error(''+result.statusText+'', { |
196 | closeButton: true | 201 | closeButton: true |
197 | }) | 202 | }) |
198 | } | 203 | } |
199 | }) | 204 | }) |
200 | $scope.showLoader = false; | 205 | $scope.showLoader = false; |
201 | } | 206 | } |
202 | 207 | ||
203 | getData(); | 208 | getData(); |
204 | function getData(){ | 209 | function getData(){ |
205 | $scope.showLoader = true; | 210 | $scope.showLoader = true; |
206 | CustomersService.getAircraftMake().then(function(result) { | 211 | CustomersService.getAircraftMake().then(function(result) { |
207 | $scope.aircraftMakeList = result; | 212 | $scope.aircraftMakeList = result; |
208 | }) | 213 | }) |
209 | $scope.showLoader = false; | 214 | $scope.showLoader = false; |
210 | } | 215 | } |
211 | 216 | ||
212 | $scope.clearAircrafts = function(){ | 217 | $scope.clearAircrafts = function(){ |
213 | $scope.aircraftDetails = []; | 218 | $scope.aircraftDetails = []; |
214 | $scope.aircraftDetails = [{ | 219 | $scope.aircraftDetails = [{ |
215 | 'tail':'', | 220 | 'tail':'', |
216 | 'make': '', | 221 | 'make': '', |
217 | 'model': '', | 222 | 'model': '', |
218 | 'sizeId' : '', | 223 | 'sizeId' : '', |
219 | 'marginId': '', | 224 | 'marginId': '', |
220 | 'avgasMarginId': '' | 225 | 'avgasMarginId': '' |
221 | }]; | 226 | }]; |
222 | } | 227 | } |
223 | 228 | ||
224 | $scope.addNew = function(){ | 229 | $scope.addNew = function(){ |
225 | $scope.aircraftDetails.push({ | 230 | $scope.aircraftDetails.push({ |
226 | 'tail':'', | 231 | 'tail':'', |
227 | 'make': '', | 232 | 'make': '', |
228 | 'model': '', | 233 | 'model': '', |
229 | 'sizeId' : '', | 234 | 'sizeId' : '', |
230 | 'marginId': '', | 235 | 'marginId': '', |
231 | 'avgasMarginId': '' | 236 | 'avgasMarginId': '' |
232 | }); | 237 | }); |
233 | console.log($scope.aircraftDetails) | 238 | console.log($scope.aircraftDetails) |
234 | }; | 239 | }; |
235 | 240 | ||
236 | $scope.getModal = function(makeId, index){ | 241 | $scope.getModal = function(makeId, index){ |
237 | $scope.showLoader = true; | 242 | $scope.showLoader = true; |
238 | $scope.aircraft.make = makeId; | 243 | $scope.aircraft.make = makeId; |
239 | //var makeId = makeId; | 244 | //var makeId = makeId; |
240 | CustomersService.getModal($scope.aircraft.make).then(function(result) { | 245 | CustomersService.getModal($scope.aircraft.make).then(function(result) { |
241 | $scope.showLoader = false; | 246 | $scope.showLoader = false; |
242 | $scope.aircraftDetails[index].aircraftModalList = result; | 247 | $scope.aircraftDetails[index].aircraftModalList = result; |
243 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | 248 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; |
244 | }) | 249 | }) |
245 | } | 250 | } |
246 | 251 | ||
247 | $scope.getSize = function(model, index){ | 252 | $scope.getSize = function(model, index){ |
248 | $scope.showLoader = true; | 253 | $scope.showLoader = true; |
249 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | 254 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
250 | $scope.showLoader = false; | 255 | $scope.showLoader = false; |
251 | $scope.aircraftDetails[index].aircraftSizeList = result; | 256 | $scope.aircraftDetails[index].aircraftSizeList = result; |
252 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | 257 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; |
253 | }) | 258 | }) |
254 | } | 259 | } |
255 | 260 | ||
256 | $scope.aircraftListData = {}; | 261 | $scope.aircraftListData = {}; |
257 | //$scope.addData = []; | 262 | //$scope.addData = []; |
258 | $scope.saveCompanyData = function(){ | 263 | $scope.saveCompanyData = function(){ |
259 | for(var i=0; i<$scope.aircraftDetails.length;i++){ | 264 | for(var i=0; i<$scope.aircraftDetails.length;i++){ |
260 | $scope.addData = []; | 265 | $scope.addData = []; |
261 | $scope.addData.push({ | 266 | $scope.addData.push({ |
262 | 'tail': $scope.aircraftDetails[i].tail, | 267 | 'tail': $scope.aircraftDetails[i].tail, |
263 | 'make': $scope.aircraftDetails[i].make, | 268 | 'make': $scope.aircraftDetails[i].make, |
264 | 'model': $scope.aircraftDetails[i].model, | 269 | 'model': $scope.aircraftDetails[i].model, |
265 | 'sizeId' : $scope.aircraftDetails[i].sizeId, | 270 | 'sizeId' : $scope.aircraftDetails[i].sizeId, |
266 | 'marginId': $scope.aircraftDetails[i].marginId, | 271 | 'marginId': $scope.aircraftDetails[i].marginId, |
267 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId | 272 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId |
268 | }); | 273 | }); |
269 | } | 274 | } |
270 | console.log($scope.addData) | 275 | console.log($scope.addData) |
271 | $scope.aircraftListData.aircraftList = $scope.addData; | 276 | $scope.aircraftListData.aircraftList = $scope.addData; |
272 | $scope.aircraftListData.accountId = companyId; | 277 | $scope.aircraftListData.accountId = companyId; |
273 | 278 | ||
274 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { | 279 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { |
275 | if(result != null && result.success){ | 280 | if(result != null && result.success){ |
276 | toastr.success(''+result.success+'', { | 281 | toastr.success(''+result.success+'', { |
277 | closeButton: true | 282 | closeButton: true |
278 | }) | 283 | }) |
279 | $('#aircraft-modal-3').modal('hide'); | 284 | $('#aircraft-modal-3').modal('hide'); |
280 | getAircraftList(); | 285 | getAircraftList(); |
281 | }else{ | 286 | }else{ |
282 | toastr.error(''+result.statusText+'', { | 287 | toastr.error(''+result.statusText+'', { |
283 | closeButton: true | 288 | closeButton: true |
284 | }) | 289 | }) |
285 | } | 290 | } |
286 | }); | 291 | }); |
287 | 292 | ||
288 | } | 293 | } |
289 | $scope.showNoteData = true; | 294 | $scope.showNoteData = true; |
290 | $scope.showCompanyName = true; | 295 | $scope.showCompanyName = true; |
291 | $scope.showAddress = true; | 296 | $scope.showAddress = true; |
292 | $scope.showNote = function(){ | 297 | $scope.showNote = function(){ |
293 | $scope.showNoteData = false; | 298 | $scope.showNoteData = false; |
294 | $scope.showUpdateBtn = true; | 299 | $scope.showUpdateBtn = true; |
295 | } | 300 | } |
296 | 301 | ||
297 | $scope.company = function(){ | 302 | $scope.company = function(){ |
298 | $scope.showCompanyName = false; | 303 | $scope.showCompanyName = false; |
299 | $scope.showUpdateBtn = true; | 304 | $scope.showUpdateBtn = true; |
300 | } | 305 | } |
301 | 306 | ||
302 | $scope.base = function(){ | 307 | $scope.base = function(){ |
303 | $scope.showUpdateBtn = true; | 308 | $scope.showUpdateBtn = true; |
304 | } | 309 | } |
305 | 310 | ||
306 | $scope.addressChange = function(){ | 311 | $scope.addressChange = function(){ |
307 | $scope.showAddress = false; | 312 | $scope.showAddress = false; |
308 | $scope.showUpdateBtn = true; | 313 | $scope.showUpdateBtn = true; |
309 | } | 314 | } |
310 | 315 | ||
311 | $scope.editData = function(inputName) { | 316 | $scope.editData = function(inputName) { |
312 | console.log($scope.companyData) | 317 | console.log($scope.companyData) |
313 | $scope.showLoader = true; | 318 | $scope.showLoader = true; |
314 | /*if(inputName == 'showNoteData'){ | 319 | /*if(inputName == 'showNoteData'){ |
315 | $scope.showNoteData = true; | 320 | $scope.showNoteData = true; |
316 | }else if(inputName == 'showCompanyName'){ | 321 | }else if(inputName == 'showCompanyName'){ |
317 | $scope.showCompanyName = true; | 322 | $scope.showCompanyName = true; |
318 | }else if(inputName == 'showAddress'){ | 323 | }else if(inputName == 'showAddress'){ |
319 | $scope.showAddress = true; | 324 | $scope.showAddress = true; |
320 | }*/ | 325 | }*/ |
321 | $scope.showNoteData = true; | 326 | $scope.showNoteData = true; |
322 | $scope.showCompanyName = true; | 327 | $scope.showCompanyName = true; |
323 | $scope.showAddress = true; | 328 | $scope.showAddress = true; |
324 | 329 | ||
325 | var companyData = "companyName=" + $scope.companyData.companyName + "&masterMargin=" + $scope.companyData.masterMargin + "&avgasMargin=" + $scope.companyData.avgasMargin | 330 | var companyData = "companyName=" + $scope.companyData.companyName + "&masterMargin=" + $scope.companyData.masterMargin + "&avgasMargin=" + $scope.companyData.avgasMargin |
326 | + "&addressOne=" + $scope.companyData.addressOne + "&addressTwo=" + $scope.companyData.addressTwo + "&city=" + $scope.companyData.city + "&state=" | 331 | + "&addressOne=" + $scope.companyData.addressOne + "&addressTwo=" + $scope.companyData.addressTwo + "&city=" + $scope.companyData.city + "&state=" |
327 | + $scope.companyData.state + "&country=" + $scope.companyData.country + "&zipcode=" + $scope.companyData.zipcode + "&internalNote=" | 332 | + $scope.companyData.state + "&country=" + $scope.companyData.country + "&zipcode=" + $scope.companyData.zipcode + "&internalNote=" |
328 | + $scope.companyData.internalNote + "&certificateType=" + $scope.companyData.certificateType + "&baseTenant=" + $scope.companyData.baseTenant | 333 | + $scope.companyData.internalNote + "&certificateType=" + $scope.companyData.certificateType + "&baseTenant=" + $scope.companyData.baseTenant |
329 | + "&fuelerlinxCustomer=" + $scope.companyData.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.companyData.contractFuelVendor | 334 | + "&fuelerlinxCustomer=" + $scope.companyData.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.companyData.contractFuelVendor |
330 | + "&activate=" + $scope.companyData.activate + "&baseIcao=" + $scope.companyData.baseIcao + "&companyId=" + companyId + "&global=" + $scope.companyData.global; | 335 | + "&activate=" + $scope.companyData.activate + "&baseIcao=" + $scope.companyData.baseIcao + "&companyId=" + companyId + "&global=" + $scope.companyData.global; |
331 | 336 | ||
332 | ViewCompanyService.updateCompany(companyData).then(function(result) { | 337 | ViewCompanyService.updateCompany(companyData).then(function(result) { |
333 | if(result != null && result.success){ | 338 | if(result != null && result.success){ |
334 | toastr.success(''+result.success+'', { | 339 | toastr.success(''+result.success+'', { |
335 | closeButton: true | 340 | closeButton: true |
336 | }) | 341 | }) |
337 | $scope.showUpdateBtn = false; | 342 | $scope.showUpdateBtn = false; |
338 | getCompanyDetail(); | 343 | getCompanyDetail(); |
339 | }else{ | 344 | }else{ |
340 | toastr.error(''+result.statusText+'', { | 345 | toastr.error(''+result.statusText+'', { |
341 | closeButton: true | 346 | closeButton: true |
342 | }) | 347 | }) |
343 | $scope.showUpdateBtn = true; | 348 | $scope.showUpdateBtn = true; |
344 | } | 349 | } |
345 | $scope.showLoader = false; | 350 | $scope.showLoader = false; |
346 | }) | 351 | }) |
347 | } | 352 | } |
348 | 353 | ||
349 | $scope.cancelData = function(){ | 354 | $scope.cancelData = function(){ |
350 | $scope.showNoteData = true; | 355 | $scope.showNoteData = true; |
351 | $scope.showCompanyName = true; | 356 | $scope.showCompanyName = true; |
352 | $scope.showAddress = true; | 357 | $scope.showAddress = true; |
353 | $scope.showUpdateBtn = false; | 358 | $scope.showUpdateBtn = false; |
354 | } | 359 | } |
355 | 360 | ||
356 | $scope.sendMail = function(){ | 361 | $scope.sendMail = function(){ |
357 | $('#confirm1').css('display', 'none'); | 362 | $('#confirm1').css('display', 'none'); |
358 | ViewCompanyService.sendMail(companyId).then(function(result) { | 363 | ViewCompanyService.sendMail(companyId).then(function(result) { |
359 | if(result != null && result.success){ | 364 | if(result != null && result.success){ |
360 | toastr.success(''+result.success+'', { | 365 | toastr.success(''+result.success+'', { |
361 | closeButton: true | 366 | closeButton: true |
362 | }) | 367 | }) |
363 | }else{ | 368 | }else{ |
364 | toastr.error(''+result.statusText+'', { | 369 | toastr.error(''+result.statusText+'', { |
365 | closeButton: true | 370 | closeButton: true |
366 | }) | 371 | }) |
367 | } | 372 | } |
368 | }) | 373 | }) |
369 | } | 374 | } |
370 | 375 | ||
371 | $scope.openConfirmMail = function(){ | 376 | $scope.openConfirmMail = function(){ |
372 | $('#confirm1').css('display', 'block'); | 377 | $('#confirm1').css('display', 'block'); |
373 | } | 378 | } |
374 | 379 | ||
375 | 380 | ||
376 | $scope.cancelAndCloseConfirm = function(){ | 381 | $scope.cancelAndCloseConfirm = function(){ |
377 | $('#confirm1').css('display', 'none'); | 382 | $('#confirm1').css('display', 'none'); |
378 | } | 383 | } |
379 | 384 | ||
380 | $scope.primaryContact = false; | 385 | $scope.primaryContact = false; |
381 | $scope.cancelPrimaryContact = function(){ | 386 | $scope.cancelPrimaryContact = function(){ |
382 | $('#primaryContact').css('display', 'none'); | 387 | $('#primaryContact').css('display', 'none'); |
383 | $scope.primaryContact = false; | 388 | $scope.primaryContact = false; |
384 | } | 389 | } |
385 | 390 | ||
386 | $scope.checkPrimaryContact = function(){ | 391 | $scope.checkPrimaryContact = function(){ |
387 | if($scope.primaryContact == true){ | 392 | if($scope.primaryContact == true){ |
388 | $scope.primaryContact = true; | 393 | $scope.primaryContact = true; |
389 | ViewCompanyService.checkPrimaryContact(companyId).then(function(result) { | 394 | ViewCompanyService.checkPrimaryContact(companyId).then(function(result) { |
390 | console.log(result) | 395 | console.log(result) |
391 | if(result.status == 422){ | 396 | if(result.status == 422){ |
392 | $('#primaryContact').css('display', 'block'); | 397 | $('#primaryContact').css('display', 'block'); |
393 | } | 398 | } |
394 | }) | 399 | }) |
395 | } | 400 | } |
396 | } | 401 | } |
397 | 402 | ||
398 | $scope.sendPrimaryContact = function(){ | 403 | $scope.sendPrimaryContact = function(){ |
399 | $('#primaryContact').css('display', 'none'); | 404 | $('#primaryContact').css('display', 'none'); |
400 | if($scope.primayData.id != null || $scope.primayData.id != undefined){ | 405 | if($scope.primayData.id != null || $scope.primayData.id != undefined){ |
401 | var priamryContactData = "companyContactId=" + $scope.primayData.id + "&primary=" + $scope.primaryContact; | 406 | var priamryContactData = "companyContactId=" + $scope.primayData.id + "&primary=" + $scope.primaryContact; |
402 | 407 | ||
403 | ViewCompanyService.addPrimaryContact(priamryContactData).then(function(result) { | 408 | ViewCompanyService.addPrimaryContact(priamryContactData).then(function(result) { |
404 | console.log(result) | 409 | console.log(result) |
405 | }) | 410 | }) |
406 | } | 411 | } |
407 | 412 | ||
408 | } | 413 | } |
409 | 414 | ||
410 | var newContactName = ""; | 415 | var newContactName = ""; |
411 | $scope.updateData = "" | 416 | $scope.updateData = "" |
412 | $scope.showContact = function(data, value){ | 417 | $scope.showContact = function(data, value){ |
413 | $('#updateContact').css('display', 'block'); | 418 | $('#updateContact').css('display', 'block'); |
414 | $scope.updateData = data; | 419 | $scope.updateData = data; |
415 | newContactName = value; | 420 | newContactName = value; |
416 | console.log($scope.updateData) | 421 | console.log($scope.updateData) |
417 | if($scope.updateData.email == null){ | 422 | if($scope.updateData.email == null){ |
418 | $scope.updateData.content = data.contactNumber; | 423 | $scope.updateData.content = data.contactNumber; |
419 | }else{ | 424 | }else{ |
420 | $scope.updateData.content = data.email; | 425 | $scope.updateData.content = data.email; |
421 | } | 426 | } |
422 | } | 427 | } |
423 | 428 | ||
424 | $scope.acceptUpdateField = function(){ | 429 | $scope.acceptUpdateField = function(){ |
425 | console.log($scope.updateData) | 430 | console.log($scope.updateData) |
426 | if($scope.updateData.content == undefined){ | 431 | if($scope.updateData.content == undefined){ |
427 | toastr.error('Please add some content', { | 432 | toastr.error('Please add some content', { |
428 | closeButton: true | 433 | closeButton: true |
429 | }) | 434 | }) |
430 | }else{ | 435 | }else{ |
431 | if(newContactName == 'phone'){ | 436 | if(newContactName == 'phone'){ |
432 | var updateCustomData = "companyId=" + companyId + "&contactNumber=" + $scope.updateData.content + "&contactId=" + $scope.updateData.id | 437 | var updateCustomData = "companyId=" + companyId + "&contactNumber=" + $scope.updateData.content + "&contactId=" + $scope.updateData.id |
433 | + "&title=" + $scope.updateData.title; | 438 | + "&title=" + $scope.updateData.title; |
434 | }else{ | 439 | }else{ |
435 | var updateCustomData = "companyId=" + companyId + "&email=" + $scope.updateData.content + "&contactId=" + $scope.updateData.id | 440 | var updateCustomData = "companyId=" + companyId + "&email=" + $scope.updateData.content + "&contactId=" + $scope.updateData.id |
436 | + "&title=" + $scope.updateData.title; | 441 | + "&title=" + $scope.updateData.title; |
437 | } | 442 | } |
438 | ViewCompanyService.updateCustomField(updateCustomData).then(function(result) { | 443 | ViewCompanyService.updateCustomField(updateCustomData).then(function(result) { |
439 | console.log(result) | 444 | console.log(result) |
440 | if(result != null && result.success){ | 445 | if(result != null && result.success){ |
441 | $('#updateContact').css('display', 'none'); | 446 | $('#updateContact').css('display', 'none'); |
442 | getCompanyDetail(); | 447 | getCompanyDetail(); |
443 | } | 448 | } |
444 | }) | 449 | }) |
445 | } | 450 | } |
446 | } | 451 | } |
447 | 452 | ||
448 | $scope.cancelUpdateField = function(){ | 453 | $scope.cancelUpdateField = function(){ |
449 | $('#updateContact').css('display', 'none'); | 454 | $('#updateContact').css('display', 'none'); |
450 | } | 455 | } |
451 | 456 | ||
452 | $scope.showEditTier2 = function(number){ | 457 | $scope.showEditTier2 = function(number){ |
453 | console.log(number) | 458 | console.log(number) |
454 | $scope.contactNumber = number; | 459 | $scope.contactNumber = number; |
455 | } | 460 | } |
456 | 461 | ||
457 | 462 | ||
458 | 463 | ||
459 | var contactName = ''; | 464 | var contactName = ''; |
460 | $scope.addCustom = function(value){ | 465 | $scope.addCustom = function(value){ |
461 | console.log(value) | 466 | console.log(value) |
462 | if(value != null){ | 467 | if(value != null){ |
463 | contactName = value; | 468 | contactName = value; |
464 | $('#customField').css('display', 'block'); | 469 | $('#customField').css('display', 'block'); |
465 | } | 470 | } |
466 | $scope.custom = {}; | 471 | $scope.custom = {}; |
467 | } | 472 | } |
468 | 473 | ||
469 | $scope.cancelCustomField = function(){ | 474 | $scope.cancelCustomField = function(){ |
470 | $('#customField').css('display', 'none'); | 475 | $('#customField').css('display', 'none'); |
471 | } | 476 | } |
472 | 477 | ||
473 | $scope.acceptCustomField = function(){ | 478 | $scope.acceptCustomField = function(){ |
474 | if($scope.custom.content == undefined){ | 479 | if($scope.custom.content == undefined){ |
475 | toastr.error('Please add some content', { | 480 | toastr.error('Please add some content', { |
476 | closeButton: true | 481 | closeButton: true |
477 | }) | 482 | }) |
478 | }else{ | 483 | }else{ |
479 | if(contactName == 'phone'){ | 484 | if(contactName == 'phone'){ |
480 | var customData = "companyId=" + companyId + "&contactNumber=" + $scope.custom.content | 485 | var customData = "companyId=" + companyId + "&contactNumber=" + $scope.custom.content |
481 | + "&title=" + $scope.custom.title; | 486 | + "&title=" + $scope.custom.title; |
482 | }else{ | 487 | }else{ |
483 | var customData = "companyId=" + companyId + "&email=" + $scope.custom.content | 488 | var customData = "companyId=" + companyId + "&email=" + $scope.custom.content |
484 | + "&title=" + $scope.custom.title; | 489 | + "&title=" + $scope.custom.title; |
485 | } | 490 | } |
486 | console.log(customData.email) | 491 | console.log(customData.email) |
487 | ViewCompanyService.addCustomField(customData).then(function(result) { | 492 | ViewCompanyService.addCustomField(customData).then(function(result) { |
488 | console.log(result) | 493 | console.log(result) |
489 | if(result != null && result.success){ | 494 | if(result != null && result.success){ |
490 | $('#customField').css('display', 'none'); | 495 | $('#customField').css('display', 'none'); |
491 | getCompanyDetail(); | 496 | getCompanyDetail(); |
492 | } | 497 | } |
493 | }) | 498 | }) |
494 | } | 499 | } |
495 | } | 500 | } |
496 | 501 | ||
497 | updateFuelManagerService.getFuelPricingNew().then(function(result) { | 502 | updateFuelManagerService.getFuelPricingNew().then(function(result) { |
498 | $scope.fuelPricing = result; | 503 | $scope.fuelPricing = result; |
499 | for (var i = 0; i<$scope.fuelPricing.length; i++) { | 504 | for (var i = 0; i<$scope.fuelPricing.length; i++) { |
500 | if ($scope.fuelPricing[i].fuelPricing.expirationDate != null) { | 505 | if ($scope.fuelPricing[i].fuelPricing.expirationDate != null) { |
501 | $scope.fuelPricing[i].fuelPricing.expirationDate = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); | 506 | $scope.fuelPricing[i].fuelPricing.expirationDate = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); |
502 | var newTime = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); | 507 | var newTime = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); |
503 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 508 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
504 | var dday = newTime.getUTCDate(); | 509 | var dday = newTime.getUTCDate(); |
505 | var dyear = newTime.getUTCFullYear(); | 510 | var dyear = newTime.getUTCFullYear(); |
506 | $scope.fuelPricing[i].fuelPricing.expirationDate = dmonth+'/'+dday+'/'+dyear; | 511 | $scope.fuelPricing[i].fuelPricing.expirationDate = dmonth+'/'+dday+'/'+dyear; |
507 | } | 512 | } |
508 | } | 513 | } |
509 | }) | 514 | }) |
510 | 515 | ||
511 | var deleteAircraftId = ""; | 516 | var deleteAircraftId = ""; |
512 | $scope.deleteAircraft = function(id){ | 517 | $scope.deleteAircraft = function(id){ |
513 | $('#delete1').css('display', 'block'); | 518 | $('#delete1').css('display', 'block'); |
514 | deleteAircraftId = id; | 519 | deleteAircraftId = id; |
515 | } | 520 | } |
516 | 521 | ||
517 | $scope.aircraftDelete = function(){ | 522 | $scope.aircraftDelete = function(){ |
518 | ViewCompanyService.deleteAircraft(deleteAircraftId).then(function(result) { | 523 | ViewCompanyService.deleteAircraft(deleteAircraftId).then(function(result) { |
519 | console.log(result) | 524 | console.log(result) |
520 | getAircraftList(); | 525 | getAircraftList(); |
521 | getCompanyDetail(); | 526 | getCompanyDetail(); |
522 | $('#delete1').css('display', 'none'); | 527 | $('#delete1').css('display', 'none'); |
523 | }) | 528 | }) |
524 | } | 529 | } |
525 | 530 | ||
526 | $scope.cancelDelete = function(){ | 531 | $scope.cancelDelete = function(){ |
527 | $('#delete1').css('display', 'none'); | 532 | $('#delete1').css('display', 'none'); |
528 | } | 533 | } |
529 | 534 | ||
530 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 535 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
531 | $scope.jetMarginList = result; | 536 | $scope.jetMarginList = result; |
532 | }) | 537 | }) |
533 | 538 | ||
534 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | 539 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { |
535 | $scope.avgsMarginList = result; | 540 | $scope.avgsMarginList = result; |
536 | }) | 541 | }) |
537 | 542 | ||
538 | $scope.changePriceEmail = function(id, index){ | 543 | $scope.changePriceEmail = function(id, index){ |
539 | event.stopPropagation(); | 544 | event.stopPropagation(); |
540 | var contactId = id; | 545 | var contactId = id; |
541 | var statusData = "status=" + $scope.companyContactList[index].priceEmail; | 546 | var statusData = "status=" + $scope.companyContactList[index].priceEmail; |
542 | ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { | 547 | ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { |
543 | if(result.success){ | 548 | if(result.success){ |
544 | $('#toogleMail').css('display', 'block'); | 549 | $('#toogleMail').css('display', 'block'); |
545 | if($scope.companyContactList[index].priceEmail == true){ | 550 | if($scope.companyContactList[index].priceEmail == true){ |
546 | $scope.messageText = 'You have enabled price distribution for this contact'; | 551 | $scope.messageText = 'You have enabled price distribution for this contact'; |
547 | }else{ | 552 | }else{ |
548 | $scope.messageText = 'You have disabled price distribution for this contact'; | 553 | $scope.messageText = 'You have disabled price distribution for this contact'; |
549 | } | 554 | } |
550 | } | 555 | } |
551 | }) | 556 | }) |
552 | } | 557 | } |
553 | 558 | ||
554 | $scope.cancelToogle = function(){ | 559 | $scope.cancelToogle = function(){ |
555 | $('#toogleMail').css('display', 'none'); | 560 | $('#toogleMail').css('display', 'none'); |
556 | } | 561 | } |
557 | 562 | ||
558 | $scope.checkboxStatus = function(value){ | 563 | $scope.checkboxStatus = function(value){ |
559 | console.log("checkbox",value) | 564 | console.log("checkbox",value) |
560 | $scope.showUpdateBtn = true; | 565 | $scope.showUpdateBtn = true; |
561 | } | 566 | } |
562 | 567 | ||
563 | $scope.fuelercheckboxStatus = function(value){ | 568 | $scope.fuelercheckboxStatus = function(value){ |
564 | $('#fuelerchange').css('display', 'block'); | 569 | $('#fuelerchange').css('display', 'block'); |
565 | if(value == true){ | 570 | if(value == true){ |
566 | $scope.statusMessage = 'Please confirm! Enabling FuelerLinx for this customer will enable price distribution web services and disable price emails for the contacts in this company' | 571 | $scope.statusMessage = 'Please confirm! Enabling FuelerLinx for this customer will enable price distribution web services and disable price emails for the contacts in this company' |
567 | }else{ | 572 | }else{ |
568 | $scope.statusMessage = 'Please confirm! Disabling FuelerLinx for this customer will disable price distribution web services into their FuelerLinx account. If you proceed then remember to enable price emails for the appropriate contacts in this company.' | 573 | $scope.statusMessage = 'Please confirm! Disabling FuelerLinx for this customer will disable price distribution web services into their FuelerLinx account. If you proceed then remember to enable price emails for the appropriate contacts in this company.' |
569 | } | 574 | } |
570 | 575 | ||
571 | 576 | ||
572 | } | 577 | } |
573 | 578 | ||
574 | $scope.fuelerCancelStatus = function(){ | 579 | $scope.fuelerCancelStatus = function(){ |
575 | $('#fuelerchange').css('display', 'none'); | 580 | $('#fuelerchange').css('display', 'none'); |
576 | $scope.companyData.fuelerlinxCustomer = !$scope.companyData.fuelerlinxCustomer; | 581 | $scope.companyData.fuelerlinxCustomer = !$scope.companyData.fuelerlinxCustomer; |
577 | } | 582 | } |
578 | 583 | ||
579 | $scope.fuelerAcceptStatus = function(){ | 584 | $scope.fuelerAcceptStatus = function(){ |
580 | $('#fuelerchange').css('display', 'none'); | 585 | $('#fuelerchange').css('display', 'none'); |
581 | $scope.showLoader = true; | 586 | $scope.showLoader = true; |
582 | var statusData; | 587 | var statusData; |
583 | if($scope.companyData.fuelerlinxCustomer == false){ | 588 | if($scope.companyData.fuelerlinxCustomer == false){ |
584 | statusData = "status=true"; | 589 | statusData = "status=true"; |
585 | } else { | 590 | } else { |
586 | statusData = "status=false"; | 591 | statusData = "status=false"; |
587 | } | 592 | } |
588 | ViewCompanyService.fuelerPricingChange(companyId, statusData).then(function(result) { | 593 | ViewCompanyService.fuelerPricingChange(companyId, statusData).then(function(result) { |
589 | if(result.success){ | 594 | if(result.success){ |
590 | $scope.showLoader = false; | 595 | $scope.showLoader = false; |
591 | 596 | ||
592 | $scope.editData(); | 597 | $scope.editData(); |
593 | getContactList(); | 598 | getContactList(); |
594 | 599 | ||
595 | } | 600 | } |
596 | }) | 601 | }) |
597 | } | 602 | } |
598 | 603 | ||
599 | $scope.updateOmit = function(fuel, omit) { | 604 | $scope.updateOmit = function(fuel, omit) { |
600 | $scope.fuelData = {}; | 605 | $scope.fuelData = {}; |
601 | $scope.fuelData.expirationDate = new Date(fuel.expirationDate); | 606 | $scope.fuelData.expirationDate = new Date(fuel.expirationDate); |
602 | $scope.fuelData.id = fuel.id; | 607 | $scope.fuelData.id = fuel.id; |
603 | $scope.fuelData.omit = fuel.omit; | 608 | $scope.fuelData.omit = fuel.omit; |
604 | $scope.fuelData.papMargin = fuel.papMargin; | 609 | $scope.fuelData.papMargin = fuel.papMargin; |
605 | $scope.fuelData.papTotal = fuel.papTotal; | 610 | $scope.fuelData.papTotal = fuel.papTotal; |
606 | $scope.fuelData.cost = fuel.cost; | 611 | $scope.fuelData.cost = fuel.cost; |
607 | ViewFuelVendorService.omitFuelPricing($scope.fuelData).then(function(result) { | 612 | ViewFuelVendorService.omitFuelPricing($scope.fuelData).then(function(result) { |
608 | if(result.success){ | 613 | if(result.success){ |
609 | toastr.success(''+result.success+'', { | 614 | toastr.success(''+result.success+'', { |
610 | closeButton: true | 615 | closeButton: true |
611 | }) | 616 | }) |
612 | }else{ | 617 | }else{ |
613 | toastr.error(''+result.statusText+'', { | 618 | toastr.error(''+result.statusText+'', { |
614 | closeButton: true | 619 | closeButton: true |
615 | }) | 620 | }) |
616 | } | 621 | } |
617 | }) | 622 | }) |
618 | } | 623 | } |
624 | |||
625 | // $scope.aircraftData = {} | ||
626 | $scope.checkJetWithTail = function(tail, index){ | ||
627 | |||
628 | console.log("tail==============",tail, index) | ||
629 | ViewCompanyService.checkJetType(tail).then(function(result) { | ||
630 | console.log("result",result) | ||
631 | if(result.jetA == "true"){ | ||
632 | $scope.jetShow[index] = false; | ||
633 | $scope.marginShow[index] = true; | ||
634 | }else{ | ||
635 | $scope.jetShow[index] = true; | ||
636 | $scope.marginShow[index] = false; | ||
637 | } | ||
638 | }) | ||
639 | } | ||
619 | 640 | ||
620 | }]); | 641 | }]); |
app/partials/viewCompany/viewCompany.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:nth-child(3) > a{ | 2 | .subnavbar .mainnav > li:nth-child(3) > a{ |
3 | color: #ff9900; | 3 | color: #ff9900; |
4 | } | 4 | } |
5 | .widget-content{ | 5 | .widget-content{ |
6 | padding: 10px !important; | 6 | padding: 10px !important; |
7 | } | 7 | } |
8 | .widget-content input[type="text"], .widget-content select{ | 8 | .widget-content input[type="text"], .widget-content select{ |
9 | height: 31px; | 9 | height: 31px; |
10 | padding: 0; | 10 | padding: 0; |
11 | } | 11 | } |
12 | .new-label span{ | 12 | .new-label span{ |
13 | float: left; | 13 | float: left; |
14 | line-height: 31px; | 14 | line-height: 31px; |
15 | } | 15 | } |
16 | .new-label span:first-child{ | 16 | .new-label span:first-child{ |
17 | margin-right: 5px; | 17 | margin-right: 5px; |
18 | font-weight: bold; | 18 | font-weight: bold; |
19 | } | 19 | } |
20 | .new-label span:last-child{ | 20 | .new-label span:last-child{ |
21 | margin-left: 5px; | 21 | margin-left: 5px; |
22 | } | 22 | } |
23 | .new-label select{ | 23 | .new-label select{ |
24 | display: -webkit-inline-box; | 24 | display: -webkit-inline-box; |
25 | display: inline-box; | 25 | display: inline-box; |
26 | float: left; | 26 | float: left; |
27 | } | 27 | } |
28 | .new-address p{ | 28 | .new-address p{ |
29 | margin-bottom: 0; | 29 | margin-bottom: 0; |
30 | } | 30 | } |
31 | .new-add-select{ | 31 | .new-add-select{ |
32 | padding-left: 15px; | 32 | padding-left: 15px; |
33 | margin: 10px 0; | 33 | margin: 10px 0; |
34 | } | 34 | } |
35 | .new-add-select select{ | 35 | .new-add-select select{ |
36 | width: 100px; | 36 | width: 100px; |
37 | } | 37 | } |
38 | .widget{ | 38 | .widget{ |
39 | -moz-box-shadow: 0px 3px 8px rgba(100,100,100, 0.7); | 39 | -moz-box-shadow: 0px 3px 8px rgba(100,100,100, 0.7); |
40 | -webkit-box-shadow: 0px 3px 8px rgba(100,100,100, 0.7); | 40 | -webkit-box-shadow: 0px 3px 8px rgba(100,100,100, 0.7); |
41 | box-shadow: 0px 3px 8px rgba(100,100,100, 0.7); | 41 | box-shadow: 0px 3px 8px rgba(100,100,100, 0.7); |
42 | } | 42 | } |
43 | .optionclass { | 43 | .optionclass { |
44 | background: #fff; | 44 | background: #fff; |
45 | } | 45 | } |
46 | .timess { | 46 | .timess { |
47 | float: right !important; | 47 | float: right !important; |
48 | margin-top: 10px !important; | 48 | margin-top: 10px !important; |
49 | margin-right: 10px !important; | 49 | margin-right: 10px !important; |
50 | color: #999 !important; | 50 | color: #999 !important; |
51 | cursor: pointer !important; | 51 | cursor: pointer !important; |
52 | } | 52 | } |
53 | 53 | ||
54 | .button1 { | 54 | .button1 { |
55 | display: inline-block; | 55 | display: inline-block; |
56 | height: 35px; | 56 | height: 35px; |
57 | line-height: 35px; | 57 | line-height: 35px; |
58 | padding-right: 15px; | 58 | padding-right: 15px; |
59 | padding-left: 50px; | 59 | padding-left: 50px; |
60 | position: relative; | 60 | position: relative; |
61 | background-color:rgb(41,127,184); | 61 | background-color:rgb(41,127,184); |
62 | color:rgb(255,255,255); | 62 | color:rgb(255,255,255); |
63 | text-decoration: none; | 63 | text-decoration: none; |
64 | text-transform: uppercase; | 64 | text-transform: uppercase; |
65 | letter-spacing: 1px; | 65 | letter-spacing: 1px; |
66 | margin-bottom: 15px; | 66 | margin-bottom: 15px; |
67 | border: 0; | 67 | border: 0; |
68 | 68 | ||
69 | 69 | ||
70 | border-radius: 5px; | 70 | border-radius: 5px; |
71 | -moz-border-radius: 5px; | 71 | -moz-border-radius: 5px; |
72 | -webkit-border-radius: 5px; | 72 | -webkit-border-radius: 5px; |
73 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); | 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; | 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); | 75 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); |
76 | 76 | ||
77 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 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); | 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); | 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)"; | 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); | 81 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); |
82 | } | 82 | } |
83 | 83 | ||
84 | .button1 span { | 84 | .button1 span { |
85 | position: absolute; | 85 | position: absolute; |
86 | left: 0; | 86 | left: 0; |
87 | top: 0; | 87 | top: 0; |
88 | width: 35px; | 88 | width: 35px; |
89 | background-color:rgba(0,0,0,0.5); | 89 | background-color:rgba(0,0,0,0.5); |
90 | 90 | ||
91 | -webkit-border-top-left-radius: 5px; | 91 | -webkit-border-top-left-radius: 5px; |
92 | -webkit-border-bottom-left-radius: 5px; | 92 | -webkit-border-bottom-left-radius: 5px; |
93 | -moz-border-radius-topleft: 5px; | 93 | -moz-border-radius-topleft: 5px; |
94 | -moz-border-radius-bottomleft: 5px; | 94 | -moz-border-radius-bottomleft: 5px; |
95 | border-top-left-radius: 5px; | 95 | border-top-left-radius: 5px; |
96 | border-bottom-left-radius: 5px; | 96 | border-bottom-left-radius: 5px; |
97 | border-right: 1px solid rgba(0,0,0,0.15); | 97 | border-right: 1px solid rgba(0,0,0,0.15); |
98 | } | 98 | } |
99 | 99 | ||
100 | .button1:hover span, .button1.active span { | 100 | .button1:hover span, .button1.active span { |
101 | background-color:rgb(0,102,26); | 101 | background-color:rgb(0,102,26); |
102 | border-right: 1px solid rgba(0,0,0,0.3); | 102 | border-right: 1px solid rgba(0,0,0,0.3); |
103 | } | 103 | } |
104 | 104 | ||
105 | .button1:active { | 105 | .button1:active { |
106 | margin-top: 2px; | 106 | margin-top: 2px; |
107 | margin-bottom: 13px; | 107 | margin-bottom: 13px; |
108 | 108 | ||
109 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 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); | 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); | 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)"; | 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); | 113 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); |
114 | } | 114 | } |
115 | 115 | ||
116 | .button1.turquoise { | 116 | .button1.turquoise { |
117 | background: #449d44; | 117 | background: #449d44; |
118 | } | 118 | } |
119 | 119 | ||
120 | </style> | 120 | </style> |
121 | 121 | ||
122 | <div class="myLoader" ng-show="showLoader"> | 122 | <div class="myLoader" ng-show="showLoader"> |
123 | <img src="../img/hourglass.gif" width="50px;"> | 123 | <img src="../img/hourglass.gif" width="50px;"> |
124 | </div> | 124 | </div> |
125 | 125 | ||
126 | <div class="col-xs-12 col-md-12"> | 126 | <div class="col-xs-12 col-md-12"> |
127 | <div class="row" style="margin-left:0px"> | 127 | <div class="row" style="margin-left:0px"> |
128 | <div class="col-md-12"> | 128 | <div class="col-md-12"> |
129 | <div class="widget"> | 129 | <div class="widget"> |
130 | <div class="widget-header"> | 130 | <div class="widget-header"> |
131 | <i class="fa fa-building-o" aria-hidden="true"></i> | 131 | <i class="fa fa-building-o" aria-hidden="true"></i> |
132 | <h3>{{companyData.companyName}} <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteCompany(companyData.id)" aria-hidden="true"></i></h3> | 132 | <h3>{{companyData.companyName}} <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteCompany(companyData.id)" aria-hidden="true"></i></h3> |
133 | <i class="fa fa-times timess" ui-sref="app.customers" aria-hidden="true"></i> | 133 | <i class="fa fa-times timess" ui-sref="app.customers" aria-hidden="true"></i> |
134 | </div> | 134 | </div> |
135 | <!-- /widget-header --> | 135 | <!-- /widget-header --> |
136 | <div class="widget-content"> | 136 | <div class="widget-content"> |
137 | <div class="row" style="margin-left:0px"> | 137 | <div class="row" style="margin-left:0px"> |
138 | <div class="col-md-6" ng-show="isGlobal"> | 138 | <div class="col-md-6" ng-show="isGlobal"> |
139 | <div class="widget"> | 139 | <div class="widget"> |
140 | <div class="widget-header"> | 140 | <div class="widget-header"> |
141 | <i class="fa fa-building-o" aria-hidden="true"></i> | 141 | <i class="fa fa-building-o" aria-hidden="true"></i> |
142 | <h3>Company Details</h3> | 142 | <h3>Company Details</h3> |
143 | <label>BASE ICAO</label> | 143 | <label>BASE ICAO</label> |
144 | <input type="tel" ng-model="companyData.baseIcao" ng-click="base()" style="line-height: 18px;width: 80px;padding: 0px 9px;" /> | 144 | <input type="tel" ng-model="companyData.baseIcao" ng-click="base()" style="line-height: 18px;width: 80px;padding: 0px 9px;" /> |
145 | 145 | ||
146 | <div class="pull-right" style="margin-top: 5px; margin-right: 10px;"> | 146 | <div class="pull-right" style="margin-top: 5px; margin-right: 10px;"> |
147 | <toggle ng-model="companyData.activate" ng-change="changeCompanyStatus()" size="customToogle" on="Active" off="Dactive"></toggle> | 147 | <toggle ng-model="companyData.activate" ng-change="changeCompanyStatus()" size="customToogle" on="Active" off="Dactive"></toggle> |
148 | </div> | 148 | </div> |
149 | 149 | ||
150 | </div> | 150 | </div> |
151 | <div class="widget-content" style="min-height: 350px;"> | 151 | <div class="widget-content" style="min-height: 350px;"> |
152 | <div class="row" style="margin-left:0px;"> | 152 | <div class="row" style="margin-left:0px;"> |
153 | <div class="col-md-7" style="padding-left: 0;"> | 153 | <div class="col-md-7" style="padding-left: 0;"> |
154 | <h4 ng-show="showCompanyName"> | 154 | <h4 ng-show="showCompanyName"> |
155 | <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> | 155 | <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> |
156 | </h4> | 156 | </h4> |
157 | <input type="tel" ng-hide="showCompanyName" ng-model="companyData.companyName" class="form-control"/> | 157 | <input type="tel" ng-hide="showCompanyName" ng-model="companyData.companyName" class="form-control"/> |
158 | </div> | 158 | </div> |
159 | <div class="col-md-5"> | 159 | <div class="col-md-5"> |
160 | <select class="form-control" style="padding: 4px 8px;background: #ebebeb;" ng-model="companyData.certificateType"> | 160 | <select class="form-control" style="padding: 4px 8px;background: #ebebeb;" ng-model="companyData.certificateType"> |
161 | <option class="optionclass" value="" disabled selected>Certificate Type</option> | 161 | <option class="optionclass" value="" disabled selected>Certificate Type</option> |
162 | <option class="optionclass" value="corporate">Part 91 (Corporate)</option> | 162 | <option class="optionclass" value="corporate">Part 91 (Corporate)</option> |
163 | <option class="optionclass" value="charter">Part 135 (Charter)</option> | 163 | <option class="optionclass" value="charter">Part 135 (Charter)</option> |
164 | <option class="optionclass" value="scheduled">Part 121 (Scheduled)</option> | 164 | <option class="optionclass" value="scheduled">Part 121 (Scheduled)</option> |
165 | <option class="optionclass" value="military">Military</option> | 165 | <option class="optionclass" value="military">Military</option> |
166 | <option class="optionclass" value="government">Government</option> | 166 | <option class="optionclass" value="government">Government</option> |
167 | </select> | 167 | </select> |
168 | </div> | 168 | </div> |
169 | </div> | 169 | </div> |
170 | <div> | 170 | <div> |
171 | <p class="new-label"> | 171 | <p class="new-label"> |
172 | <span>JET A Margin </span> | 172 | <span>JET A Margin </span> |
173 | <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-change="editData()" ng-model="companyData.masterMargin"> | 173 | <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-change="editData()" ng-model="companyData.masterMargin"> |
174 | <option ng-if="multiple" value="multiple">Multiple</option> | 174 | <option ng-if="multiple" value="multiple">Multiple</option> |
175 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | 175 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> |
176 | </select> | 176 | </select> |
177 | <span ng-show="multipleMsg"> See Aircrart List</span> | 177 | <span ng-show="multipleMsg"> See Aircrart List</span> |
178 | <div class="clearfix"></div> | 178 | <div class="clearfix"></div> |
179 | </p> | 179 | </p> |
180 | </div> | 180 | </div> |
181 | <div> | 181 | <div> |
182 | <p class="new-label"> | 182 | <p class="new-label"> |
183 | <span>AVGAS 100LL </span> | 183 | <span>AVGAS 100LL </span> |
184 | <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-change="editData()" ng-model="companyData.avgasMargin"> | 184 | <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-change="editData()" ng-model="companyData.avgasMargin"> |
185 | <option value="">N/A</option> | 185 | <option value="">N/A</option> |
186 | <option ng-repeat="margin in avgsMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | 186 | <option ng-repeat="margin in avgsMarginList" value="{{margin.id}}">{{margin.marginName}}</option> |
187 | </select> | 187 | </select> |
188 | <div class="clearfix"></div> | 188 | <div class="clearfix"></div> |
189 | </p> | 189 | </p> |
190 | </div> | 190 | </div> |
191 | <div> | 191 | <div> |
192 | <ui-select multiple class="form-control" ng-model="selected" name="name" ng-change="changeValue(selected)"> | 192 | <ui-select multiple class="form-control" ng-model="selected" name="name" ng-change="changeValue(selected)"> |
193 | <ui-select-match placeholder="Select or Search">{{$item.first}}</ui-select-match> | 193 | <ui-select-match placeholder="Select or Search">{{$item.first}}</ui-select-match> |
194 | <ui-select-choices repeat="val.first as val in values | filter: $select.search"> | 194 | <ui-select-choices repeat="val.first as val in values | filter: $select.search"> |
195 | {{val.first}} | 195 | {{val.first}} |
196 | <!-- <div ng-bind-html="val | highlight: $select"></div> --> | 196 | <!-- <div ng-bind-html="val | highlight: $select"></div> --> |
197 | </ui-select-choices> | 197 | </ui-select-choices> |
198 | </ui-select> | 198 | </ui-select> |
199 | </div> | 199 | </div> |
200 | </br> | 200 | </br> |
201 | <div class="new-address"> | 201 | <div class="new-address"> |
202 | </div> | 202 | </div> |
203 | <div> | 203 | <div> |
204 | <p style="margin-bottom: 0;"><b>Company Notes</b> <i class="fa fa-pencil-square-o" ng-click="showNote()" aria-hidden="true"></i></p> | 204 | <p style="margin-bottom: 0;"><b>Company Notes</b> <i class="fa fa-pencil-square-o" ng-click="showNote()" aria-hidden="true"></i></p> |
205 | <p ng-show="showNoteData">{{companyData.internalNote}}</p> | 205 | <p ng-show="showNoteData">{{companyData.internalNote}}</p> |
206 | <textarea name="message" ng-hide="showNoteData" style="margin-bottom: 6px;" class="form-control" ng-model="companyData.internalNote" rows="4" cols="34"></textarea> | 206 | <textarea name="message" ng-hide="showNoteData" style="margin-bottom: 6px;" class="form-control" ng-model="companyData.internalNote" rows="4" cols="34"></textarea> |
207 | </div> | 207 | </div> |
208 | <div class="pull-left"> | 208 | <div class="pull-left"> |
209 | <button ng-click="editData()" ng-show="showUpdateBtn" class="btn btn-success">Save</button> | 209 | <button ng-click="editData()" ng-show="showUpdateBtn" class="btn btn-success">Save</button> |
210 | <button ng-click="cancelData()" ng-show="showUpdateBtn" class="btn btn-default">Cancel</button> | 210 | <button ng-click="cancelData()" ng-show="showUpdateBtn" class="btn btn-default">Cancel</button> |
211 | </div> | 211 | </div> |
212 | <div class="pull-right"> | 212 | <div class="pull-right"> |
213 | <button type="button" ng-click="openConfirmMail()" class="btn btn-primary">Distribute Price to Company Contacts</button> | 213 | <button type="button" ng-click="openConfirmMail()" class="btn btn-primary">Distribute Price to Company Contacts</button> |
214 | <button type="button" class="btn btn-info" ui-sref="app.updateFuelManager">Setup Fuel</button> | 214 | <button type="button" class="btn btn-info" ui-sref="app.updateFuelManager">Setup Fuel</button> |
215 | </div> | 215 | </div> |
216 | <div class="clearfix"></div> | 216 | <div class="clearfix"></div> |
217 | </div> | 217 | </div> |
218 | </div> | 218 | </div> |
219 | </div> | 219 | </div> |
220 | <div class="col-md-6" ng-hide="isGlobal"> | 220 | <div class="col-md-6" ng-hide="isGlobal"> |
221 | <div class="widget"> | 221 | <div class="widget"> |
222 | <div class="widget-header"> | 222 | <div class="widget-header"> |
223 | <i class="fa fa-building-o" aria-hidden="true"></i> | 223 | <i class="fa fa-building-o" aria-hidden="true"></i> |
224 | <h3>Company Details</h3> | 224 | <h3>Company Details</h3> |
225 | <label>BASE ICAO</label> | 225 | <label>BASE ICAO</label> |
226 | <input type="tel" ng-model="companyData.baseIcao" ng-click="base()" style="line-height: 18px;width: 80px;padding: 0px 9px;" /> | 226 | <input type="tel" ng-model="companyData.baseIcao" ng-click="base()" style="line-height: 18px;width: 80px;padding: 0px 9px;" /> |
227 | 227 | ||
228 | <div class="pull-right" style="margin-top: 5px; margin-right: 10px;"> | 228 | <div class="pull-right" style="margin-top: 5px; margin-right: 10px;"> |
229 | <toggle ng-model="companyData.activate" ng-change="changeCompanyStatus()" size="customToogle" on="Active" off="Dactive"></toggle> | 229 | <toggle ng-model="companyData.activate" ng-change="changeCompanyStatus()" size="customToogle" on="Active" off="Dactive"></toggle> |
230 | </div> | 230 | </div> |
231 | 231 | ||
232 | </div> | 232 | </div> |
233 | <div class="widget-content"> | 233 | <div class="widget-content"> |
234 | <div class="row" style="margin-left:0px;"> | 234 | <div class="row" style="margin-left:0px;"> |
235 | <div class="col-md-7" style="padding-left: 0;"> | 235 | <div class="col-md-7" style="padding-left: 0;"> |
236 | <h4 ng-show="showCompanyName"> | 236 | <h4 ng-show="showCompanyName"> |
237 | <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> | 237 | <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> |
238 | </h4> | 238 | </h4> |
239 | <input type="tel" ng-hide="showCompanyName" ng-model="companyData.companyName" class="form-control"/> | 239 | <input type="tel" ng-hide="showCompanyName" ng-model="companyData.companyName" class="form-control"/> |
240 | </div> | 240 | </div> |
241 | <div class="col-md-5"> | 241 | <div class="col-md-5"> |
242 | <select class="form-control" style="padding: 4px 8px;background: #ebebeb;" ng-model="companyData.certificateType"> | 242 | <select class="form-control" style="padding: 4px 8px;background: #ebebeb;" ng-model="companyData.certificateType"> |
243 | <option class="optionclass" value="" disabled selected>Certificate Type</option> | 243 | <option class="optionclass" value="" disabled selected>Certificate Type</option> |
244 | <option class="optionclass" value="corporate">Part 91 (Corporate)</option> | 244 | <option class="optionclass" value="corporate">Part 91 (Corporate)</option> |
245 | <option class="optionclass" value="charter">Part 135 (Charter)</option> | 245 | <option class="optionclass" value="charter">Part 135 (Charter)</option> |
246 | <option class="optionclass" value="scheduled">Part 121 (Scheduled)</option> | 246 | <option class="optionclass" value="scheduled">Part 121 (Scheduled)</option> |
247 | <option class="optionclass" value="military">Military</option> | 247 | <option class="optionclass" value="military">Military</option> |
248 | <option class="optionclass" value="government">Government</option> | 248 | <option class="optionclass" value="government">Government</option> |
249 | </select> | 249 | </select> |
250 | </div> | 250 | </div> |
251 | </div> | 251 | </div> |
252 | <div> | 252 | <div> |
253 | <p class="new-label"> | 253 | <p class="new-label"> |
254 | <span>JET A Margin </span> | 254 | <span>JET A Margin </span> |
255 | <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-change="editData()" ng-model="companyData.masterMargin"> | 255 | <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-change="editData()" ng-model="companyData.masterMargin"> |
256 | <option ng-if="multiple" value="multiple">Multiple</option> | 256 | <option ng-if="multiple" value="multiple">Multiple</option> |
257 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | 257 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> |
258 | </select> | 258 | </select> |
259 | <span ng-show="multipleMsg"> See Aircrart List</span> | 259 | <span ng-show="multipleMsg"> See Aircrart List</span> |
260 | <div class="clearfix"></div> | 260 | <div class="clearfix"></div> |
261 | </p> | 261 | </p> |
262 | </div> | 262 | </div> |
263 | <div> | 263 | <div> |
264 | <p class="new-label"> | 264 | <p class="new-label"> |
265 | <span>AVGAS 100LL </span> | 265 | <span>AVGAS 100LL </span> |
266 | <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-change="editData()" ng-model="companyData.avgasMargin"> | 266 | <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-change="editData()" ng-model="companyData.avgasMargin"> |
267 | <option value="">N/A</option> | 267 | <option value="">N/A</option> |
268 | <option ng-repeat="margin in avgsMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | 268 | <option ng-repeat="margin in avgsMarginList" value="{{margin.id}}">{{margin.marginName}}</option> |
269 | </select> | 269 | </select> |
270 | <div class="clearfix"></div> | 270 | <div class="clearfix"></div> |
271 | </p> | 271 | </p> |
272 | </div> | 272 | </div> |
273 | <div class="row" style="margin-left:0px;"> | 273 | <div class="row" style="margin-left:0px;"> |
274 | <div class="col-md-5" style="padding-left: 0;"> | 274 | <div class="col-md-5" style="padding-left: 0;"> |
275 | <input type="checkbox" name="" ng-model="companyData.baseTenant" ng-change="checkboxStatus(companyData.baseTenant)"> Tenant/Base Customer | 275 | <input type="checkbox" name="" ng-model="companyData.baseTenant" ng-change="checkboxStatus(companyData.baseTenant)"> Tenant/Base Customer |
276 | </div> | 276 | </div> |
277 | <div class="col-md-5" style="padding-left: 0;"> | 277 | <div class="col-md-5" style="padding-left: 0;"> |
278 | <input type="checkbox" name="" ng-model="companyData.fuelerlinxCustomer" ng-change="fuelercheckboxStatus(companyData.fuelerlinxCustomer)"> FuelerLinx Customer | 278 | <input type="checkbox" name="" ng-model="companyData.fuelerlinxCustomer" ng-change="fuelercheckboxStatus(companyData.fuelerlinxCustomer)"> FuelerLinx Customer |
279 | </div> | 279 | </div> |
280 | </div> | 280 | </div> |
281 | <div> | 281 | <div> |
282 | <input type="checkbox" name="" ng-model="companyData.contractFuelVendor" ng-change="checkboxStatus(companyData.contractFuelVendor)"> CAA Member | 282 | <input type="checkbox" name="" ng-model="companyData.contractFuelVendor" ng-change="checkboxStatus(companyData.contractFuelVendor)"> CAA Member |
283 | </div> | 283 | </div> |
284 | </br> | 284 | </br> |
285 | <div class="new-address"> | 285 | <div class="new-address"> |
286 | <p ng-show="showAddress"><i class="fa fa-map-marker"></i> {{companyData.addressOne}} {{companyData.addressTwo}} <i class="fa fa-pencil-square-o" ng-click="addressChange()" aria-hidden="true"></i> </p> | 286 | <p ng-show="showAddress"><i class="fa fa-map-marker"></i> {{companyData.addressOne}} {{companyData.addressTwo}} <i class="fa fa-pencil-square-o" ng-click="addressChange()" aria-hidden="true"></i> </p> |
287 | 287 | ||
288 | <div ng-hide="showAddress"> | 288 | <div ng-hide="showAddress"> |
289 | <label>Address1</label> | 289 | <label>Address1</label> |
290 | <input type="tel" style="width: 50%;" ng-hide="showAddress" ng-model="companyData.addressOne" class="form-control" /> | 290 | <input type="tel" style="width: 50%;" ng-hide="showAddress" ng-model="companyData.addressOne" class="form-control" /> |
291 | <label>Address2</label> | 291 | <label>Address2</label> |
292 | <input type="tel" style="width: 50%;" ng-hide="showAddress" ng-model="companyData.addressTwo" class="form-control" /> | 292 | <input type="tel" style="width: 50%;" ng-hide="showAddress" ng-model="companyData.addressTwo" class="form-control" /> |
293 | </div> | 293 | </div> |
294 | 294 | ||
295 | <p ng-repeat="data in companyData.companyCustomContacts" ng-if="data.contactNumber != null"> | 295 | <p ng-repeat="data in companyData.companyCustomContacts" ng-if="data.contactNumber != null"> |
296 | <i class="fa fa-phone" ng-hide="showEditContact"></i> | 296 | <i class="fa fa-phone" ng-hide="showEditContact"></i> |
297 | <span ng-hide="showEditContact">{{data.contactNumber}} </span> | 297 | <span ng-hide="showEditContact">{{data.contactNumber}} </span> |
298 | <i ng-click="showContact(data, 'phone')" ng-hide="showEditContact" class="fa fa-pencil-square-o" aria-hidden="true"></i> | 298 | <i ng-click="showContact(data, 'phone')" ng-hide="showEditContact" class="fa fa-pencil-square-o" aria-hidden="true"></i> |
299 | 299 | ||
300 | </p> | 300 | </p> |
301 | <p ng-repeat="data in companyData.companyCustomContacts" ng-if="data.email != null"> | 301 | <p ng-repeat="data in companyData.companyCustomContacts" ng-if="data.email != null"> |
302 | <i class="fa fa-envelope" ng-hide="showEditEmail"></i> | 302 | <i class="fa fa-envelope" ng-hide="showEditEmail"></i> |
303 | <span ng-hide="showEditEmail">{{data.email}} </span> | 303 | <span ng-hide="showEditEmail">{{data.email}} </span> |
304 | <i ng-click="showContact(data, 'email')" ng-hide="showEditEmail" class="fa fa-pencil-square-o" aria-hidden="true"></i> | 304 | <i ng-click="showContact(data, 'email')" ng-hide="showEditEmail" class="fa fa-pencil-square-o" aria-hidden="true"></i> |
305 | 305 | ||
306 | </p> | 306 | </p> |
307 | </div> | 307 | </div> |
308 | <div class="new-add-select"> | 308 | <div class="new-add-select"> |
309 | <select class="form-control" ng-model="value" ng-click="addCustom(value)" style="background: #ebebeb;padding: 4px 8px;width: 115px;"> | 309 | <select class="form-control" ng-model="value" ng-click="addCustom(value)" style="background: #ebebeb;padding: 4px 8px;width: 115px;"> |
310 | <option value="" disabled selected>Add Field</option> | 310 | <option value="" disabled selected>Add Field</option> |
311 | <option value="phone" class="optionclass">Add Phone</option> | 311 | <option value="phone" class="optionclass">Add Phone</option> |
312 | <option value="email" class="optionclass">Add Email</option> | 312 | <option value="email" class="optionclass">Add Email</option> |
313 | </select> | 313 | </select> |
314 | </div> | 314 | </div> |
315 | <div> | 315 | <div> |
316 | <p style="margin-bottom: 0;"><b>Company Notes</b> <i class="fa fa-pencil-square-o" ng-click="showNote()" aria-hidden="true"></i></p> | 316 | <p style="margin-bottom: 0;"><b>Company Notes</b> <i class="fa fa-pencil-square-o" ng-click="showNote()" aria-hidden="true"></i></p> |
317 | <p ng-show="showNoteData">{{companyData.internalNote}}</p> | 317 | <p ng-show="showNoteData">{{companyData.internalNote}}</p> |
318 | <textarea name="message" ng-hide="showNoteData" style="margin-bottom: 6px;" class="form-control" ng-model="companyData.internalNote" rows="4" cols="34"></textarea> | 318 | <textarea name="message" ng-hide="showNoteData" style="margin-bottom: 6px;" class="form-control" ng-model="companyData.internalNote" rows="4" cols="34"></textarea> |
319 | </div> | 319 | </div> |
320 | <div class="pull-left"> | 320 | <div class="pull-left"> |
321 | <button ng-click="editData()" ng-show="showUpdateBtn" class="btn btn-success">Save</button> | 321 | <button ng-click="editData()" ng-show="showUpdateBtn" class="btn btn-success">Save</button> |
322 | <button ng-click="cancelData()" ng-show="showUpdateBtn" class="btn btn-default">Cancel</button> | 322 | <button ng-click="cancelData()" ng-show="showUpdateBtn" class="btn btn-default">Cancel</button> |
323 | </div> | 323 | </div> |
324 | <div class="pull-right"> | 324 | <div class="pull-right"> |
325 | <button type="button" ng-click="openConfirmMail()" class="btn btn-primary">Distribute Price to Company Contacts</button> | 325 | <button type="button" ng-click="openConfirmMail()" class="btn btn-primary">Distribute Price to Company Contacts</button> |
326 | <button type="button" class="btn btn-info" ui-sref="app.updateFuelManager">Setup Fuel</button> | 326 | <button type="button" class="btn btn-info" ui-sref="app.updateFuelManager">Setup Fuel</button> |
327 | </div> | 327 | </div> |
328 | <div class="clearfix"></div> | 328 | <div class="clearfix"></div> |
329 | </div> | 329 | </div> |
330 | </div> | 330 | </div> |
331 | </div> | 331 | </div> |
332 | <div class="col-md-6"> | 332 | <div class="col-md-6"> |
333 | <div class="widget" style="min-height: 350px;"> | 333 | <div class="widget" style="min-height: 350px;"> |
334 | <div class="widget-header"> | 334 | <div class="widget-header"> |
335 | <i class="fa fa-plane"></i> | 335 | <i class="fa fa-plane"></i> |
336 | <h3>Aircraft List</h3> | 336 | <h3>Aircraft List</h3> |
337 | <div class="pull-right"> | 337 | <div class="pull-right"> |
338 | <button type="submit" class="btn btn-success btn-sm" data-toggle="modal" ng-click="clearAircrafts()" data-target="#aircraft-modal-3" style="margin-top: 4px; margin-right: 9px;"><i class="fa fa-plus" aria-hidden="true"></i> Add Aircraft</button> | 338 | <button type="submit" class="btn btn-success btn-sm" data-toggle="modal" ng-click="clearAircrafts()" data-target="#aircraft-modal-3" style="margin-top: 4px; margin-right: 9px;"><i class="fa fa-plus" aria-hidden="true"></i> Add Aircraft</button> |
339 | </div> | 339 | </div> |
340 | </div> | 340 | </div> |
341 | <div class="widget-content" style="padding:0px;min-height: 350px;"> | 341 | <div class="widget-content" style="padding:0px;min-height: 350px;"> |
342 | <div class="table-responsive"> | 342 | <div class="table-responsive"> |
343 | <table class="table table-bordered table-hover table-striped"> | 343 | <table class="table table-bordered table-hover table-striped"> |
344 | <thead> | 344 | <thead> |
345 | <tr> | 345 | <tr> |
346 | <th>Tail #</th> | 346 | <th>Tail #</th> |
347 | <th>Make</th> | 347 | <th>Make</th> |
348 | <th>Model</th> | 348 | <th>Model</th> |
349 | <th>JET-A</th> | 349 | <th>JET-A</th> |
350 | <th>All In</th> | 350 | <th>All In</th> |
351 | <th>AVGAS</th> | 351 | <th>AVGAS</th> |
352 | <th>All In</th> | 352 | <th>All In</th> |
353 | <th></th> | 353 | <th></th> |
354 | </tr> | 354 | </tr> |
355 | </thead> | 355 | </thead> |
356 | <tbody> | 356 | <tbody> |
357 | <tr ng-repeat="aircraft in contactAircraftList"> | 357 | <tr ng-repeat="aircraft in contactAircraftList"> |
358 | <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.tail}}</td> | 358 | <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.tail}}</td> |
359 | <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.make}}</td> | 359 | <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.make}}</td> |
360 | <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.model}}</td> | 360 | <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.model}}</td> |
361 | <td> | 361 | <td> |
362 | <select class="form-control" style="height:31px;" ng-model="aircraft.aircraftsMargin.id" ng-options="margin.id as margin.marginName for margin in jetMarginList" required></select> | 362 | <select class="form-control" style="height:31px;" ng-model="aircraft.aircraftsMargin.id" ng-options="margin.id as margin.marginName for margin in jetMarginList" required></select> |
363 | </td> | 363 | </td> |
364 | <td style="color:#55AF8B;">${{aircraft.marginAllIn}}</td> | 364 | <td style="color:#55AF8B;">${{aircraft.marginAllIn}}</td> |
365 | <td> | 365 | <td> |
366 | <select class="form-control" style="height:31px;" ng-model="aircraft.aircraftsAVGASMargin.id"> | 366 | <select class="form-control" style="height:31px;" ng-model="aircraft.aircraftsAVGASMargin.id"> |
367 | <option value="">N/A</option> | 367 | <option value="">N/A</option> |
368 | <option ng-repeat="margin in avgsMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | 368 | <option ng-repeat="margin in avgsMarginList" value="{{margin.id}}">{{margin.marginName}}</option> |
369 | </select> | 369 | </select> |
370 | </td> | 370 | </td> |
371 | <td style="color:#55AF8B;">${{aircraft.marginAvgasAllIn}}</td> | 371 | <td style="color:#55AF8B;">${{aircraft.marginAvgasAllIn}}</td> |
372 | <td> | 372 | <td> |
373 | <i class="fa fa-trash-o deleteTierIcon" ng-if="!aircraft.global" ng-click="deleteAircraft(aircraft.id)" aria-hidden="true"></i> | 373 | <i class="fa fa-trash-o deleteTierIcon" ng-if="!aircraft.global" ng-click="deleteAircraft(aircraft.id)" aria-hidden="true"></i> |
374 | </td> | 374 | </td> |
375 | </tr> | 375 | </tr> |
376 | </tbody> | 376 | </tbody> |
377 | </table> | 377 | </table> |
378 | </div> | 378 | </div> |
379 | </div> | 379 | </div> |
380 | </div> | 380 | </div> |
381 | </div> | 381 | </div> |
382 | </div> | 382 | </div> |
383 | <div class="row" style="margin-left:0px"> | 383 | <div class="row" style="margin-left:0px"> |
384 | <div class="col-md-6"> | 384 | <div class="col-md-6"> |
385 | <div class="widget"> | 385 | <div class="widget"> |
386 | <div class="widget-header"> | 386 | <div class="widget-header"> |
387 | <i class="fa fa-user"></i> | 387 | <i class="fa fa-user"></i> |
388 | <h3>Contact List</h3> | 388 | <h3>Contact List</h3> |
389 | <div class="pull-right"> | 389 | <div class="pull-right"> |
390 | <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> | 390 | <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> |
391 | </div> | 391 | </div> |
392 | </div> | 392 | </div> |
393 | <div class="widget-content" style="padding:0px"> | 393 | <div class="widget-content" style="padding:0px"> |
394 | <div class="table-responsive"> | 394 | <div class="table-responsive"> |
395 | <table class="table table-bordered table-hover table-striped"> | 395 | <table class="table table-bordered table-hover table-striped"> |
396 | <thead> | 396 | <thead> |
397 | <tr> | 397 | <tr> |
398 | <th>Price Email</th> | 398 | <th>Price Email</th> |
399 | <th>First Name</th> | 399 | <th>First Name</th> |
400 | <th>Last Name</th> | 400 | <th>Last Name</th> |
401 | <th>Title</th> | 401 | <th>Title</th> |
402 | </tr> | 402 | </tr> |
403 | </thead> | 403 | </thead> |
404 | <tbody> | 404 | <tbody> |
405 | <tr ng-repeat="contact in companyContactList" style="cursor: pointer;" ui-sref="app.viewContact({id : contact.id})"> | 405 | <tr ng-repeat="contact in companyContactList" style="cursor: pointer;" ui-sref="app.viewContact({id : contact.id})"> |
406 | <td><toggle ng-model="contact.priceEmail" ng-change="changePriceEmail(contact.id, $index)" size="customToogle"></toggle></td> | 406 | <td><toggle ng-model="contact.priceEmail" ng-change="changePriceEmail(contact.id, $index)" size="customToogle"></toggle></td> |
407 | <td> | 407 | <td> |
408 | {{contact.firstName}} | 408 | {{contact.firstName}} |
409 | </td> | 409 | </td> |
410 | <td>{{contact.lastName}}</td> | 410 | <td>{{contact.lastName}}</td> |
411 | <td>{{contact.title}}</td> | 411 | <td>{{contact.title}}</td> |
412 | </tr> | 412 | </tr> |
413 | </tbody> | 413 | </tbody> |
414 | </table> | 414 | </table> |
415 | </div> | 415 | </div> |
416 | </div> | 416 | </div> |
417 | </div> | 417 | </div> |
418 | </div> | 418 | </div> |
419 | <div class="col-md-6"> | 419 | <div class="col-md-6"> |
420 | <div class="widget"> | 420 | <div class="widget"> |
421 | <div class="widget-header"> | 421 | <div class="widget-header"> |
422 | <i class="fa fa-pencil"></i> | 422 | <i class="fa fa-pencil"></i> |
423 | <h3>Price Manager Reference</h3> | 423 | <h3>Price Manager Reference</h3> |
424 | </div> | 424 | </div> |
425 | <div class="widget-content"> | 425 | <div class="widget-content"> |
426 | <div class="table-responsive"> | 426 | <div class="table-responsive"> |
427 | <table class="table table-striped" style="position: relative; top: -33px; margin-bottom: 0;"> | 427 | <table class="table table-striped" style="position: relative; top: -33px; margin-bottom: 0;"> |
428 | <thead> | 428 | <thead> |
429 | <tr> | 429 | <tr> |
430 | <th>Omit</th> | 430 | <th>Omit</th> |
431 | <th>Product</th> | 431 | <th>Product</th> |
432 | <th>Cost</th> | 432 | <th>Cost</th> |
433 | <th>PAP (Margin)</th> | 433 | <th>PAP (Margin)</th> |
434 | <th>PAP (Total)</th> | 434 | <th>PAP (Total)</th> |
435 | <th style="color:#F90">Expires</th> | 435 | <th style="color:#F90">Expires</th> |
436 | </tr> | 436 | </tr> |
437 | </thead> | 437 | </thead> |
438 | <tbody> | 438 | <tbody> |
439 | <tr ng-repeat="fuel in fuelPricing | filter:{ status: true }"> | 439 | <tr ng-repeat="fuel in fuelPricing | filter:{ status: true }"> |
440 | <td><input type="checkbox" ng-model="fuel.fuelPricing.omit" ng-change="updateOmit(fuel.fuelPricing, fuel.status)"></td> | 440 | <td><input type="checkbox" ng-model="fuel.fuelPricing.omit" ng-change="updateOmit(fuel.fuelPricing, fuel.status)"></td> |
441 | <td>{{fuel.name}}</td> | 441 | <td>{{fuel.name}}</td> |
442 | <td>${{fuel.fuelPricing.cost}}</td> | 442 | <td>${{fuel.fuelPricing.cost}}</td> |
443 | <td>${{fuel.fuelPricing.papMargin}}</td> | 443 | <td>${{fuel.fuelPricing.papMargin}}</td> |
444 | <td style="color:#55AF8B;">${{fuel.fuelPricing.papTotal}}</td> | 444 | <td style="color:#55AF8B;">${{fuel.fuelPricing.papTotal}}</td> |
445 | <td style="color:#F90">{{fuel.fuelPricing.expirationDate}}</td> | 445 | <td style="color:#F90">{{fuel.fuelPricing.expirationDate}}</td> |
446 | </tr> | 446 | </tr> |
447 | </tbody> | 447 | </tbody> |
448 | </table> | 448 | </table> |
449 | </div> | 449 | </div> |
450 | </div> | 450 | </div> |
451 | </div> | 451 | </div> |
452 | </div> | 452 | </div> |
453 | </div> | 453 | </div> |
454 | </div> | 454 | </div> |
455 | <!-- /widget-content --> | 455 | <!-- /widget-content --> |
456 | </div> | 456 | </div> |
457 | <!-- /widget --> | 457 | <!-- /widget --> |
458 | </div> | 458 | </div> |
459 | <!-- /span6 --> | 459 | <!-- /span6 --> |
460 | </div> | 460 | </div> |
461 | <!-- /widget --> | 461 | <!-- /widget --> |
462 | </div> | 462 | </div> |
463 | <!-- /container --> | 463 | <!-- /container --> |
464 | <form class="modal multi-step" id="contact-modal-3" name="companyForm"> | 464 | <form class="modal multi-step" id="contact-modal-3" name="companyForm"> |
465 | <div class="modal-dialog modal-lg"> | 465 | <div class="modal-dialog modal-lg"> |
466 | <div class="modal-content"> | 466 | <div class="modal-content"> |
467 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 467 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
468 | <div> | 468 | <div> |
469 | <div class="row" style="margin: 0;"> | 469 | <div class="row" style="margin: 0;"> |
470 | <div> | 470 | <div> |
471 | <div class="widget" style="margin-bottom: 0; box-shadow: none;"> | 471 | <div class="widget" style="margin-bottom: 0; box-shadow: none;"> |
472 | <div class="widget-header"> | 472 | <div class="widget-header"> |
473 | <i class="icon-pencil"></i> | 473 | <i class="icon-pencil"></i> |
474 | <i class="fa fa-tasks" aria-hidden="true"></i> | 474 | <i class="fa fa-tasks" aria-hidden="true"></i> |
475 | <h3>Add a New Contact</h3> | 475 | <h3>Add a New Contact</h3> |
476 | <div class="clearfix"></div> | 476 | <div class="clearfix"></div> |
477 | </div> | 477 | </div> |
478 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 478 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
479 | <div class="col-xs-12"> | 479 | <div class="col-xs-12"> |
480 | <div class="col-md-6"> | 480 | <div class="col-md-6"> |
481 | <div class="pull-left" style="width: 110px;"> | 481 | <div class="pull-left" style="width: 110px;"> |
482 | <label class="new-input-label"><b>First Name</b></label> | 482 | <label class="new-input-label"><b>First Name</b></label> |
483 | </div> | 483 | </div> |
484 | <div class="pull-left" style="margin-left: 15px;"> | 484 | <div class="pull-left" style="margin-left: 15px;"> |
485 | <input type="tel" ng-model="data.firstName" class="form-control" placeholder=""> | 485 | <input type="tel" ng-model="data.firstName" class="form-control" placeholder=""> |
486 | </div> | 486 | </div> |
487 | <div class="clearfix"></div> | 487 | <div class="clearfix"></div> |
488 | </div> | 488 | </div> |
489 | <div class="col-md-6"> | 489 | <div class="col-md-6"> |
490 | 490 | ||
491 | <div class="pull-left" style="width: 110px;"> | 491 | <div class="pull-left" style="width: 110px;"> |
492 | <label class="new-input-label"><b>Last Name</b></label> | 492 | <label class="new-input-label"><b>Last Name</b></label> |
493 | </div> | 493 | </div> |
494 | <div class="pull-left" style="margin-left: 15px;"> | 494 | <div class="pull-left" style="margin-left: 15px;"> |
495 | <input type="tel" ng-model="data.lastName" class="form-control" id="Address" placeholder=""> | 495 | <input type="tel" ng-model="data.lastName" class="form-control" id="Address" placeholder=""> |
496 | </div> | 496 | </div> |
497 | <div class="clearfix"></div> | 497 | <div class="clearfix"></div> |
498 | </div> | 498 | </div> |
499 | </div> | 499 | </div> |
500 | <div class="clearfix"></div><br> | 500 | <div class="clearfix"></div><br> |
501 | <div class="col-xs-12"> | 501 | <div class="col-xs-12"> |
502 | <div class="col-md-6"> | 502 | <div class="col-md-6"> |
503 | <div class="pull-left" style="width: 110px;"> | 503 | <div class="pull-left" style="width: 110px;"> |
504 | <label class="new-input-label"><b>Title</b></label> | 504 | <label class="new-input-label"><b>Title</b></label> |
505 | </div> | 505 | </div> |
506 | <div class="pull-left" style="margin-left: 15px;"> | 506 | <div class="pull-left" style="margin-left: 15px;"> |
507 | <input type="tel" ng-model="data.title" class="form-control" id="Address" placeholder=""> | 507 | <input type="tel" ng-model="data.title" class="form-control" id="Address" placeholder=""> |
508 | </div> | 508 | </div> |
509 | <div class="clearfix"></div> | 509 | <div class="clearfix"></div> |
510 | </div> | 510 | </div> |
511 | <div class="col-md-6"> | 511 | <div class="col-md-6"> |
512 | 512 | ||
513 | <div class="pull-left" style="width: 110px;"> | 513 | <div class="pull-left" style="width: 110px;"> |
514 | <label class="new-input-label"><b>Email</b></label> | 514 | <label class="new-input-label"><b>Email</b></label> |
515 | </div> | 515 | </div> |
516 | <div class="pull-left" style="margin-left: 15px;"> | 516 | <div class="pull-left" style="margin-left: 15px;"> |
517 | <input type="email" ng-model="data.email" class="form-control" id="Address" placeholder=""> | 517 | <input type="email" ng-model="data.email" class="form-control" id="Address" placeholder=""> |
518 | </div> | 518 | </div> |
519 | <div class="clearfix"></div> | 519 | <div class="clearfix"></div> |
520 | </div> | 520 | </div> |
521 | </div> | 521 | </div> |
522 | <div class="clearfix"></div><br> | 522 | <div class="clearfix"></div><br> |
523 | <div class="col-xs-12"> | 523 | <div class="col-xs-12"> |
524 | <div class="col-md-6"> | 524 | <div class="col-md-6"> |
525 | <div class="pull-left" style="width: 110px;"> | 525 | <div class="pull-left" style="width: 110px;"> |
526 | <label class="new-input-label"><b>Username</b></label> | 526 | <label class="new-input-label"><b>Username</b></label> |
527 | </div> | 527 | </div> |
528 | <div class="pull-left" style="margin-left: 15px;"> | 528 | <div class="pull-left" style="margin-left: 15px;"> |
529 | <input type="tel" ng-model="data.userName" class="form-control" id="Address" placeholder=""> | 529 | <input type="tel" ng-model="data.userName" class="form-control" id="Address" placeholder=""> |
530 | </div> | 530 | </div> |
531 | <div class="clearfix"></div> | 531 | <div class="clearfix"></div> |
532 | </div> | 532 | </div> |
533 | <div class="col-md-6"> | 533 | <div class="col-md-6"> |
534 | 534 | ||
535 | <div class="pull-left" style="width: 110px;"> | 535 | <div class="pull-left" style="width: 110px;"> |
536 | <label class="new-input-label"><b>Password</b></label> | 536 | <label class="new-input-label"><b>Password</b></label> |
537 | </div> | 537 | </div> |
538 | <div class="pull-left" style="margin-left: 15px;"> | 538 | <div class="pull-left" style="margin-left: 15px;"> |
539 | <input type="password" ng-model="data.password" class="form-control" id="Address" placeholder=""> | 539 | <input type="password" ng-model="data.password" class="form-control" id="Address" placeholder=""> |
540 | </div> | 540 | </div> |
541 | <div class="clearfix"></div> | 541 | <div class="clearfix"></div> |
542 | </div> | 542 | </div> |
543 | </div> | 543 | </div> |
544 | <div class="clearfix"></div><br> | 544 | <div class="clearfix"></div><br> |
545 | <div class="col-xs-12"> | 545 | <div class="col-xs-12"> |
546 | <div class="col-md-6"> | 546 | <div class="col-md-6"> |
547 | <div class="pull-left" style="width: 110px;"> | 547 | <div class="pull-left" style="width: 110px;"> |
548 | <label class="new-input-label"><b>Work Phone</b></label> | 548 | <label class="new-input-label"><b>Work Phone</b></label> |
549 | </div> | 549 | </div> |
550 | <div class="pull-left" style="margin-left: 15px;"> | 550 | <div class="pull-left" style="margin-left: 15px;"> |
551 | <input type="tel" ng-model="data.workPhone" class="form-control" id="Address" placeholder=""> | 551 | <input type="tel" ng-model="data.workPhone" class="form-control" id="Address" placeholder=""> |
552 | </div> | 552 | </div> |
553 | <div class="clearfix"></div> | 553 | <div class="clearfix"></div> |
554 | </div> | 554 | </div> |
555 | <div class="col-md-6"> | 555 | <div class="col-md-6"> |
556 | 556 | ||
557 | <div class="pull-left" style="width: 110px;"> | 557 | <div class="pull-left" style="width: 110px;"> |
558 | <label class="new-input-label"><b>Mobile Phone</b></label> | 558 | <label class="new-input-label"><b>Mobile Phone</b></label> |
559 | </div> | 559 | </div> |
560 | <div class="pull-left" style="margin-left: 15px;"> | 560 | <div class="pull-left" style="margin-left: 15px;"> |
561 | <input type="tel" ng-model="data.mobilePhone" class="form-control" id="Address" placeholder=""> | 561 | <input type="tel" ng-model="data.mobilePhone" class="form-control" id="Address" placeholder=""> |
562 | </div> | 562 | </div> |
563 | <div class="clearfix"></div> | 563 | <div class="clearfix"></div> |
564 | </div> | 564 | </div> |
565 | </div> | 565 | </div> |
566 | <div class="clearfix"></div><br> | 566 | <div class="clearfix"></div><br> |
567 | <div class="col-xs-12"> | 567 | <div class="col-xs-12"> |
568 | <div class="col-md-12"> | 568 | <div class="col-md-12"> |
569 | <div class="pull-left" style="width: 110px;"> | 569 | <div class="pull-left" style="width: 110px;"> |
570 | <label class="new-input-label"><b>Address</b></label> | 570 | <label class="new-input-label"><b>Address</b></label> |
571 | </div> | 571 | </div> |
572 | <div class="pull-right" style="width: calc(100% - 123px);"> | 572 | <div class="pull-right" style="width: calc(100% - 123px);"> |
573 | <input type="tel" class="form-control" ng-model="data.address" id="Address" placeholder=""> | 573 | <input type="tel" class="form-control" ng-model="data.address" id="Address" placeholder=""> |
574 | </div> | 574 | </div> |
575 | <div class="clearfix"></div> | 575 | <div class="clearfix"></div> |
576 | </div> | 576 | </div> |
577 | </div> | 577 | </div> |
578 | <div class="clearfix"></div> | 578 | <div class="clearfix"></div> |
579 | <br/> | 579 | <br/> |
580 | <div class="col-xs-12"> | 580 | <div class="col-xs-12"> |
581 | <div class="col-md-3"> | 581 | <div class="col-md-3"> |
582 | <div class="pull-left my-toggle-switch"> | 582 | <div class="pull-left my-toggle-switch"> |
583 | <div style="color: #ff9a01;">Price Email     | 583 | <div style="color: #ff9a01;">Price Email     |
584 | <toggle ng-model="data.priceEmail" size="customToogle"></toggle> | 584 | <toggle ng-model="data.priceEmail" size="customToogle"></toggle> |
585 | </div> | 585 | </div> |
586 | </div> | 586 | </div> |
587 | <div class="clearfix"></div> | 587 | <div class="clearfix"></div> |
588 | </div> | 588 | </div> |
589 | <div class="col-md-3"> | 589 | <div class="col-md-3"> |
590 | <div class="pull-left my-toggle-switch"> | 590 | <div class="pull-left my-toggle-switch"> |
591 | <div style="color: #ff9a01;">Primary Contact     | 591 | <div style="color: #ff9a01;">Primary Contact     |
592 | <input type="checkbox" ng-click="checkPrimaryContact()" ng-model="primaryContact"> | 592 | <input type="checkbox" ng-click="checkPrimaryContact()" ng-model="primaryContact"> |
593 | </div> | 593 | </div> |
594 | </div> | 594 | </div> |
595 | <div class="clearfix"></div> | 595 | <div class="clearfix"></div> |
596 | </div> | 596 | </div> |
597 | <div class="col-md-6"> | 597 | <div class="col-md-6"> |
598 | <div class="pull-left" style="width: 110px;"> | 598 | <div class="pull-left" style="width: 110px;"> |
599 | <label class="new-input-label"><b>Internal Note</b></label> | 599 | <label class="new-input-label"><b>Internal Note</b></label> |
600 | </div> | 600 | </div> |
601 | <div class="pull-left" style="width: calc(100% - 110px);"> | 601 | <div class="pull-left" style="width: calc(100% - 110px);"> |
602 | <textarea name="message" ng-model="data.note" rows="4" cols="34"></textarea> | 602 | <textarea name="message" ng-model="data.note" rows="4" cols="34"></textarea> |
603 | </div> | 603 | </div> |
604 | </div> | 604 | </div> |
605 | <div class="clearfix"></div> | 605 | <div class="clearfix"></div> |
606 | </div> | 606 | </div> |
607 | <div class="clearfix"></div><br> | 607 | <div class="clearfix"></div><br> |
608 | </div> | 608 | </div> |
609 | </div> | 609 | </div> |
610 | <div class="clearfix"></div> | 610 | <div class="clearfix"></div> |
611 | </div> | 611 | </div> |
612 | </div> | 612 | </div> |
613 | </div> | 613 | </div> |
614 | </div> | 614 | </div> |
615 | <div class="modal-footer" style="border-top: 0;"> | 615 | <div class="modal-footer" style="border-top: 0;"> |
616 | <button type="button" class="btn btn-default" id="reset" data-dismiss="modal">Cancel</button> | 616 | <button type="button" class="btn btn-default" id="reset" data-dismiss="modal">Cancel</button> |
617 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addContact()">Save</button> | 617 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addContact()">Save</button> |
618 | </div> | 618 | </div> |
619 | </div> | 619 | </div> |
620 | </div> | 620 | </div> |
621 | </form> | 621 | </form> |
622 | <div class="clearfix"></div> | 622 | <div class="clearfix"></div> |
623 | 623 | ||
624 | <form class="modal multi-step" id="aircraft-modal-3" name="aircraftForm"> | 624 | <form class="modal multi-step" id="aircraft-modal-3" name="aircraftForm"> |
625 | <div class="modal-dialog modal-lg"> | 625 | <div class="modal-dialog modal-lg"> |
626 | <div class="modal-content"> | 626 | <div class="modal-content"> |
627 | <div class="modal-body step-2" data-step="2" style="padding: 0;"> | 627 | <div class="modal-body step-2" data-step="2" style="padding: 0;"> |
628 | <div> | 628 | <div> |
629 | <div class="row" style="margin: 0;"> | 629 | <div class="row" style="margin: 0;"> |
630 | <div> | 630 | <div> |
631 | <div class="widget" style="margin-bottom: 0;box-shadow: none;"> | 631 | <div class="widget" style="margin-bottom: 0;box-shadow: none;"> |
632 | <div class="widget-header"> | 632 | <div class="widget-header"> |
633 | <i class="icon-pencil"></i> | 633 | <i class="icon-pencil"></i> |
634 | <i class="fa fa-tasks" aria-hidden="true"></i> | 634 | <i class="fa fa-tasks" aria-hidden="true"></i> |
635 | <h3>Add a New Aircraft</h3> | 635 | <h3>Add a New Aircraft</h3> |
636 | <div class="clearfix"></div> | 636 | <div class="clearfix"></div> |
637 | </div> | 637 | </div> |
638 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 638 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
639 | <div class="col-xs-12"> | 639 | <div class="col-xs-12"> |
640 | <div class="widget-header"> | 640 | <div class="widget-header"> |
641 | <i class="fa fa-list"></i> | 641 | <i class="fa fa-list"></i> |
642 | <h3>Aircraft List</h3> | 642 | <h3>Aircraft List</h3> |
643 | </div> | 643 | </div> |
644 | <div class="widget-content" style="padding:0px;border: 0px; padding: 0px !important;"> | 644 | <div class="widget-content" style="padding:0px;border: 0px; padding: 0px !important;"> |
645 | <div class="table-responsive"> | 645 | <div class="table-responsive"> |
646 | <table class="table table-striped table-bordered"> | 646 | <table class="table table-striped table-bordered"> |
647 | <thead> | 647 | <thead> |
648 | <tr> | 648 | <tr> |
649 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | 649 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> |
650 | <th>Tail</th> | 650 | <th>Tail</th> |
651 | <th>Make</th> | 651 | <th>Make</th> |
652 | <th>Model</th> | 652 | <th>Model</th> |
653 | <th>Size</th> | 653 | <th>Size</th> |
654 | <th>JET A Margin</th> | 654 | <th>JET A Margin</th> |
655 | <th>AVGS 100LL Margin</th> | 655 | <th>AVGS 100LL Margin</th> |
656 | </tr> | 656 | </tr> |
657 | </thead> | 657 | </thead> |
658 | <tbody> | 658 | <tbody> |
659 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | 659 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> |
660 | <!-- <td> | 660 | <!-- <td> |
661 | <input type="checkbox" ng-model="aircraftData.selected"/> | 661 | <input type="checkbox" ng-model="aircraftData.selected"/> |
662 | </td> --> | 662 | </td> --> |
663 | <td style="width: 15%"> | 663 | <td style="width: 15%"> |
664 | <input type="tel" class="form-control" ng-model="aircraftData.tail" required/> | 664 | <input type="tel" class="form-control" ng-model="aircraftData.tail" ng-blur="checkJetWithTail(aircraftData.tail, $index)" required/> |
665 | </td> | 665 | </td> |
666 | <td style="width: 17%"> | 666 | <td style="width: 17%"> |
667 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | 667 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> |
668 | <option value="" disabled>Select</option> | ||
668 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 669 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
669 | </select> | 670 | </select> |
670 | </td> | 671 | </td> |
671 | <td style="width: 17%"> | 672 | <td style="width: 17%"> |
672 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | 673 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> |
674 | <option value="" disabled>Select</option> | ||
673 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> | 675 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> |
674 | </select> | 676 | </select> |
675 | </td> | 677 | </td> |
676 | <td style="width: 17%"> | 678 | <td style="width: 17%"> |
677 | <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> | 679 | <select class="form-control" ng-model="aircraftData.sizeId"> |
678 | <!-- <select class="form-control" ng-model="aircraftData.size"> | 680 | <option value="" disabled>Select</option> |
679 | <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | 681 | <option ng-repeat="size in aircraftData.aircraftSizeList" value="{{size.aircraftSize.id}}">{{size.aircraftSize.size}}</option> |
680 | </select> --> | 682 | </select> |
683 | |||
684 | <!-- <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> --> | ||
685 | |||
681 | </td> | 686 | </td> |
682 | <td style="width: 17%"> | 687 | <td style="width: 17%"> |
683 | <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in jetMarginList"> | 688 | |
684 | <option value="" disabled>Select...</option> | 689 | <select class="form-control" ng-model="aircraftData.marginId" ng-disabled="jetShow[$index]"> |
690 | <option value="" disabled>Select</option> | ||
691 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | ||
685 | </select> | 692 | </select> |
693 | |||
694 | <!-- <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in jetMarginList" ng-disabled="jetShow[$index]"> | ||
695 | |||
696 | <option value="" disabled>Select...</option> | ||
697 | </select> --> | ||
698 | |||
686 | </td> | 699 | </td> |
687 | <td style="width: 17%"> | 700 | <td style="width: 17%"> |
688 | <select class="form-control marginSelectBox" ng-model="aircraftData.avgasMarginId" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> | 701 | <select class="form-control" ng-model="aircraftData.avgasMarginId" ng-disabled="marginShow[$index]"> |
689 | <option value="" disabled>Select...</option> | 702 | <option value="" disabled>Select</option> |
703 | <option ng-repeat="avgs in avgsMarginList" value="{{avgs.id}}">{{avgs.marginName}}</option> | ||
690 | </select> | 704 | </select> |
705 | |||
706 | <!-- <select class="form-control marginSelectBox" ng-model="aircraftData.avgasMarginId" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList" ng-disabled="marginShow[$index]"> | ||
707 | <option value="" disabled>Select...</option> | ||
708 | </select> --> | ||
691 | </td> | 709 | </td> |
692 | </tr> | 710 | </tr> |
693 | </tbody> | 711 | </tbody> |
694 | </table> | 712 | </table> |
695 | </div> | 713 | </div> |
696 | <div class="clearfix"></div> | 714 | <div class="clearfix"></div> |
697 | </div> | 715 | </div> |
698 | </div> | 716 | </div> |
699 | <div class="clearfix"></div> | 717 | <div class="clearfix"></div> |
700 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | 718 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> |
701 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | 719 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> |
702 | </div> | 720 | </div> |
703 | </div> | 721 | </div> |
704 | </div> | 722 | </div> |
705 | <div class="clearfix"></div> | 723 | <div class="clearfix"></div> |
706 | </div> | 724 | </div> |
707 | </div> | 725 | </div> |
708 | </div> | 726 | </div> |
709 | </div> | 727 | </div> |
710 | <div class="modal-footer" style="border-top: 0;"> | 728 | <div class="modal-footer" style="border-top: 0;"> |
711 | <button type="button" class="btn btn-default" id="reset" data-dismiss="modal">Cancel</button> | 729 | <button type="button" class="btn btn-default" id="reset" data-dismiss="modal">Cancel</button> |
712 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="saveCompanyData()">Save</button> | 730 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="saveCompanyData()">Save</button> |
713 | </div> | 731 | </div> |
714 | </div> | 732 | </div> |
715 | </div> | 733 | </div> |
716 | </form> | 734 | </form> |
717 | <div class="customConfirmPopBackdrop" id="fuelerchange" > | 735 | <div class="customConfirmPopBackdrop" id="fuelerchange" > |
718 | <div class="customModalInner" style="max-width: 550px;"> | 736 | <div class="customModalInner" style="max-width: 550px;"> |
719 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 737 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
720 | <table> | 738 | <table> |
721 | <tr> | 739 | <tr> |
722 | <td> | 740 | <td> |
723 | <img src="img/info.png" style="width: 50px;"> | 741 | <img src="img/info.png" style="width: 50px;"> |
724 | </td> | 742 | </td> |
725 | <td> | 743 | <td> |
726 | <p style="padding: 5px 10px; margin-bottom: 0;">{{statusMessage}}</p> | 744 | <p style="padding: 5px 10px; margin-bottom: 0;">{{statusMessage}}</p> |
727 | </td> | 745 | </td> |
728 | </tr> | 746 | </tr> |
729 | </table> | 747 | </table> |
730 | </div> | 748 | </div> |
731 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 749 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
732 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="fuelerAcceptStatus()">Accept</button> | 750 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="fuelerAcceptStatus()">Accept</button> |
733 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="fuelerCancelStatus()">Cancel</button> | 751 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="fuelerCancelStatus()">Cancel</button> |
734 | </div> | 752 | </div> |
735 | </div> | 753 | </div> |
736 | </div> | 754 | </div> |
737 | <div class="customConfirmPopBackdrop" id="confirm1"> | 755 | <div class="customConfirmPopBackdrop" id="confirm1"> |
738 | <div class="customModalInner" style="max-width: 400px;"> | 756 | <div class="customModalInner" style="max-width: 400px;"> |
739 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 757 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
740 | <table> | 758 | <table> |
741 | <tr> | 759 | <tr> |
742 | <td> | 760 | <td> |
743 | <img src="img/info.png" style="width: 50px;"> | 761 | <img src="img/info.png" style="width: 50px;"> |
744 | </td> | 762 | </td> |
745 | <td> | 763 | <td> |
746 | <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure that you want to email pricing to everyone in your contact list?</p> | 764 | <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure that you want to email pricing to everyone in your contact list?</p> |
747 | </td> | 765 | </td> |
748 | </tr> | 766 | </tr> |
749 | </table> | 767 | </table> |
750 | </div> | 768 | </div> |
751 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 769 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
752 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendMail()">Yes</button> | 770 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendMail()">Yes</button> |
753 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAndCloseConfirm()">Cancel</button> | 771 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAndCloseConfirm()">Cancel</button> |
754 | </div> | 772 | </div> |
755 | </div> | 773 | </div> |
756 | </div> | 774 | </div> |
757 | <div class="customConfirmPopBackdrop" id="primaryContact"> | 775 | <div class="customConfirmPopBackdrop" id="primaryContact"> |
758 | <div class="customModalInner" style="max-width: 400px;"> | 776 | <div class="customModalInner" style="max-width: 400px;"> |
759 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 777 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
760 | <table> | 778 | <table> |
761 | <tr> | 779 | <tr> |
762 | <td> | 780 | <td> |
763 | <img src="img/info.png" style="width: 50px;"> | 781 | <img src="img/info.png" style="width: 50px;"> |
764 | </td> | 782 | </td> |
765 | <td> | 783 | <td> |
766 | <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure you want to set this person as your primary contact?</p> | 784 | <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure you want to set this person as your primary contact?</p> |
767 | </td> | 785 | </td> |
768 | </tr> | 786 | </tr> |
769 | </table> | 787 | </table> |
770 | </div> | 788 | </div> |
771 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 789 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
772 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendPrimaryContact()">Yes</button> | 790 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendPrimaryContact()">Yes</button> |
773 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelPrimaryContact()">Cancel</button> | 791 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelPrimaryContact()">Cancel</button> |
774 | </div> | 792 | </div> |
775 | </div> | 793 | </div> |
776 | </div> | 794 | </div> |
777 | <div class="customConfirmPopBackdrop" id="customField"> | 795 | <div class="customConfirmPopBackdrop" id="customField"> |
778 | <div class="customModalInner" style="max-width: 400px;"> | 796 | <div class="customModalInner" style="max-width: 400px;"> |
779 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 797 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
780 | <div class="col-md-2"><img class="src-image" src="img/images.jpg"></div> | 798 | <div class="col-md-2"><img class="src-image" src="img/images.jpg"></div> |
781 | <div class="col-md-10"> | 799 | <div class="col-md-10"> |
782 | <form> | 800 | <form> |
783 | Title:<br> | 801 | Title:<br> |
784 | <input type="text" name="firstname" ng-model="custom.title"><br> | 802 | <input type="text" name="firstname" ng-model="custom.title"><br> |
785 | Content:<br> | 803 | Content:<br> |
786 | <input type="text" name="lastname" ng-model="custom.content"> | 804 | <input type="text" name="lastname" ng-model="custom.content"> |
787 | </form> | 805 | </form> |
788 | </div> | 806 | </div> |
789 | <div class="clearfix"></div> | 807 | <div class="clearfix"></div> |
790 | </div> | 808 | </div> |
791 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 809 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
792 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="acceptCustomField()">Accept</button> | 810 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="acceptCustomField()">Accept</button> |
793 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelCustomField()">Cancel</button> | 811 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelCustomField()">Cancel</button> |
794 | </div> | 812 | </div> |
795 | </div> | 813 | </div> |
796 | </div> | 814 | </div> |
797 | <div class="customConfirmPopBackdrop" id="updateContact"> | 815 | <div class="customConfirmPopBackdrop" id="updateContact"> |
798 | <div class="customModalInner" style="max-width: 400px;"> | 816 | <div class="customModalInner" style="max-width: 400px;"> |
799 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 817 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
800 | <div class="col-md-2"><img class="src-image" src="img/images.jpg"></div> | 818 | <div class="col-md-2"><img class="src-image" src="img/images.jpg"></div> |
801 | <div class="col-md-10"> | 819 | <div class="col-md-10"> |
802 | <form> | 820 | <form> |
803 | Title:<br> | 821 | Title:<br> |
804 | <input type="text" name="firstname" ng-model="updateData.title"><br> | 822 | <input type="text" name="firstname" ng-model="updateData.title"><br> |
805 | Content:<br> | 823 | Content:<br> |
806 | <input type="text" name="lastname" ng-model="updateData.content"> | 824 | <input type="text" name="lastname" ng-model="updateData.content"> |
807 | </form> | 825 | </form> |
808 | </div> | 826 | </div> |
809 | <div class="clearfix"></div> | 827 | <div class="clearfix"></div> |
810 | </div> | 828 | </div> |
811 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 829 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
812 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="acceptUpdateField()">Accept</button> | 830 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="acceptUpdateField()">Accept</button> |
813 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelUpdateField()">Cancel</button> | 831 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelUpdateField()">Cancel</button> |
814 | </div> | 832 | </div> |
815 | </div> | 833 | </div> |
816 | </div> | 834 | </div> |
817 | <div class="customConfirmPopBackdrop" id="delete1"> | 835 | <div class="customConfirmPopBackdrop" id="delete1"> |
818 | <div class="customModalInner" style="max-width: 400px;"> | 836 | <div class="customModalInner" style="max-width: 400px;"> |
819 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 837 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
820 | <table> | 838 | <table> |
821 | <tr> | 839 | <tr> |
822 | <td> | 840 | <td> |
823 | <img src="img/info.png" style="width: 50px;"> | 841 | <img src="img/info.png" style="width: 50px;"> |
824 | </td> | 842 | </td> |
825 | <td> | 843 | <td> |
826 | <p style="padding: 5px 10px; margin-bottom: 0;">Please confirm! Are you sure you want to DELETE this Aircraft?</p> | 844 | <p style="padding: 5px 10px; margin-bottom: 0;">Please confirm! Are you sure you want to DELETE this Aircraft?</p> |
827 | </td> | 845 | </td> |
828 | </tr> | 846 | </tr> |
829 | </table> | 847 | </table> |
830 | </div> | 848 | </div> |
831 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 849 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
832 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="aircraftDelete()">Accept</button> | 850 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="aircraftDelete()">Accept</button> |
833 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDelete()">Cancel</button> | 851 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDelete()">Cancel</button> |
834 | </div> | 852 | </div> |
835 | </div> | 853 | </div> |
836 | </div> | 854 | </div> |
837 | <div class="customConfirmPopBackdrop" id="delete3"> | 855 | <div class="customConfirmPopBackdrop" id="delete3"> |
838 | <div class="customModalInner" style="max-width: 400px;"> | 856 | <div class="customModalInner" style="max-width: 400px;"> |
839 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 857 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
840 | <table> | 858 | <table> |
841 | <tr> | 859 | <tr> |
842 | <td> | 860 | <td> |
843 | <img src="img/info.png" style="width: 50px;"> | 861 | <img src="img/info.png" style="width: 50px;"> |
844 | </td> | 862 | </td> |
845 | <td> | 863 | <td> |
846 | <p style="padding: 5px 10px; margin-bottom: 0;">{{statusMessage}}</p> | 864 | <p style="padding: 5px 10px; margin-bottom: 0;">{{statusMessage}}</p> |
847 | </td> | 865 | </td> |
848 | </tr> | 866 | </tr> |
849 | </table> | 867 | </table> |
850 | </div> | 868 | </div> |
851 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 869 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
852 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="companyStatus()">Accept</button> | 870 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="companyStatus()">Accept</button> |
853 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelStatus()">Cancel</button> | 871 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelStatus()">Cancel</button> |
854 | </div> | 872 | </div> |
855 | </div> | 873 | </div> |
856 | </div> | 874 | </div> |
857 | <div class="customConfirmPopBackdrop" id="toogleMail"> | 875 | <div class="customConfirmPopBackdrop" id="toogleMail"> |
858 | <div class="customModalInner" style="max-width: 400px;"> | 876 | <div class="customModalInner" style="max-width: 400px;"> |
859 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 877 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
860 | <table> | 878 | <table> |
861 | <tr> | 879 | <tr> |
862 | <!-- <td> | 880 | <!-- <td> |
863 | <img src="" style="width: 50px;"> | 881 | <img src="" style="width: 50px;"> |
864 | </td> --> | 882 | </td> --> |
865 | <td> | 883 | <td> |
866 | <p style="padding: 5px 10px; margin-bottom: 0;text-align: center;">{{messageText}}</p> | 884 | <p style="padding: 5px 10px; margin-bottom: 0;text-align: center;">{{messageText}}</p> |
867 | </td> | 885 | </td> |
868 | </tr> | 886 | </tr> |
869 | </table> | 887 | </table> |
870 | </div> | 888 | </div> |
871 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 889 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
872 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelToogle()">Cancel</button> | 890 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelToogle()">Cancel</button> |
873 | </div> | 891 | </div> |
874 | </div> | 892 | </div> |
875 | </div> | 893 | </div> |
876 | <div class="myLoader" ng-show="showLoader"> | 894 | <div class="myLoader" ng-show="showLoader"> |
877 | <img src="../img/hourglass.gif" width="50px;"> | 895 | <img src="../img/hourglass.gif" width="50px;"> |
878 | </div> | 896 | </div> |
879 | 897 | ||
880 | <!-- Le javascript | 898 | <!-- Le javascript |
881 | ================================================== --> | 899 | ================================================== --> |
882 | <!-- Placed at the end of the document so the pages load faster --> | 900 | <!-- Placed at the end of the document so the pages load faster --> |
883 | <!-- <script | 901 | <!-- <script |
884 | CKEDITOR.replace( 'editor2', { | 902 | CKEDITOR.replace( 'editor2', { |
885 | height: 250, | 903 | height: 250, |
886 | extraPlugins: 'divarea' | 904 | extraPlugins: 'divarea' |
887 | } ); | 905 | } ); |
888 | </script> --> | 906 | </script> --> |
889 | 907 |
app/partials/viewCompany/viewCompany.service.js
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | .service('ViewCompanyService', ['$q', '$http', 'BASE_URL', ViewCompanyService]); | 4 | .service('ViewCompanyService', ['$q', '$http', 'BASE_URL', ViewCompanyService]); |
5 | 5 | ||
6 | function ViewCompanyService($q, $http, BASE_URL) { | 6 | function ViewCompanyService($q, $http, BASE_URL) { |
7 | 7 | ||
8 | this.getCompany = function(id) { | 8 | this.getCompany = function(id) { |
9 | 9 | ||
10 | var deferred = $q.defer(); | 10 | var deferred = $q.defer(); |
11 | $http({ | 11 | $http({ |
12 | method : 'GET', | 12 | method : 'GET', |
13 | url : BASE_URL.url +'/company/'+id, | 13 | url : BASE_URL.url +'/company/'+id, |
14 | headers : {'Content-Type': 'application/json'}, | 14 | headers : {'Content-Type': 'application/json'}, |
15 | }) | 15 | }) |
16 | .then(function (result){ | 16 | .then(function (result){ |
17 | deferred.resolve(result.data); | 17 | deferred.resolve(result.data); |
18 | },function (result){ | 18 | },function (result){ |
19 | deferred.resolve(result.data); | 19 | deferred.resolve(result.data); |
20 | }) | 20 | }) |
21 | return deferred.promise; | 21 | return deferred.promise; |
22 | } | 22 | } |
23 | 23 | ||
24 | this.getContact = function(id) { | 24 | this.getContact = function(id) { |
25 | 25 | ||
26 | var deferred = $q.defer(); | 26 | var deferred = $q.defer(); |
27 | $http({ | 27 | $http({ |
28 | method : 'GET', | 28 | method : 'GET', |
29 | url : BASE_URL.url +'/company/contacts/'+id, | 29 | url : BASE_URL.url +'/company/contacts/'+id, |
30 | headers : {'Content-Type': 'application/json'}, | 30 | headers : {'Content-Type': 'application/json'}, |
31 | }) | 31 | }) |
32 | .then(function (result){ | 32 | .then(function (result){ |
33 | deferred.resolve(result.data); | 33 | deferred.resolve(result.data); |
34 | },function (result){ | 34 | },function (result){ |
35 | deferred.resolve(result.data); | 35 | deferred.resolve(result.data); |
36 | }) | 36 | }) |
37 | return deferred.promise; | 37 | return deferred.promise; |
38 | } | 38 | } |
39 | 39 | ||
40 | this.addContact = function(data) { | 40 | this.addContact = function(data) { |
41 | 41 | ||
42 | var deferred = $q.defer(); | 42 | var deferred = $q.defer(); |
43 | $http({ | 43 | $http({ |
44 | method : 'POST', | 44 | method : 'POST', |
45 | url : BASE_URL.url +'/company/contact', | 45 | url : BASE_URL.url +'/company/contact', |
46 | data : data, | 46 | data : data, |
47 | headers : {'Content-Type': 'application/json'}, | 47 | headers : {'Content-Type': 'application/json'}, |
48 | }) | 48 | }) |
49 | .then(function (result){ | 49 | .then(function (result){ |
50 | deferred.resolve(result); | 50 | deferred.resolve(result); |
51 | },function (result){ | 51 | },function (result){ |
52 | deferred.resolve(result); | 52 | deferred.resolve(result); |
53 | }) | 53 | }) |
54 | return deferred.promise; | 54 | return deferred.promise; |
55 | } | 55 | } |
56 | 56 | ||
57 | this.addCustomField = function(data){ | 57 | this.addCustomField = function(data){ |
58 | var deferred = $q.defer(); | 58 | var deferred = $q.defer(); |
59 | $http({ | 59 | $http({ |
60 | method : 'POST', | 60 | method : 'POST', |
61 | url : BASE_URL.url +'/company/custom/contacts', | 61 | url : BASE_URL.url +'/company/custom/contacts', |
62 | data : data, | 62 | data : data, |
63 | headers : {'Content-Type': 'application/json'}, | 63 | headers : {'Content-Type': 'application/json'}, |
64 | }) | 64 | }) |
65 | .then(function (result){ | 65 | .then(function (result){ |
66 | deferred.resolve(result.data); | 66 | deferred.resolve(result.data); |
67 | },function (result){ | 67 | },function (result){ |
68 | deferred.resolve(result.data); | 68 | deferred.resolve(result.data); |
69 | }) | 69 | }) |
70 | return deferred.promise; | 70 | return deferred.promise; |
71 | } | 71 | } |
72 | 72 | ||
73 | this.updateCustomField = function(data){ | 73 | this.updateCustomField = function(data){ |
74 | var deferred = $q.defer(); | 74 | var deferred = $q.defer(); |
75 | $http({ | 75 | $http({ |
76 | method : 'PUT', | 76 | method : 'PUT', |
77 | url : BASE_URL.url +'/company/custom/contacts', | 77 | url : BASE_URL.url +'/company/custom/contacts', |
78 | data : data, | 78 | data : data, |
79 | headers : {'Content-Type': 'application/json'}, | 79 | headers : {'Content-Type': 'application/json'}, |
80 | }) | 80 | }) |
81 | .then(function (result){ | 81 | .then(function (result){ |
82 | deferred.resolve(result.data); | 82 | deferred.resolve(result.data); |
83 | },function (result){ | 83 | },function (result){ |
84 | deferred.resolve(result.data); | 84 | deferred.resolve(result.data); |
85 | }) | 85 | }) |
86 | return deferred.promise; | 86 | return deferred.promise; |
87 | } | 87 | } |
88 | 88 | ||
89 | this.addPrimaryContact = function(data){ | 89 | this.addPrimaryContact = function(data){ |
90 | var deferred = $q.defer(); | 90 | var deferred = $q.defer(); |
91 | $http({ | 91 | $http({ |
92 | method : 'POST', | 92 | method : 'POST', |
93 | url : BASE_URL.url +'/company/contact/createPrimaryContact', | 93 | url : BASE_URL.url +'/company/contact/createPrimaryContact', |
94 | data : data, | 94 | data : data, |
95 | headers : {'Content-Type': 'application/json'}, | 95 | headers : {'Content-Type': 'application/json'}, |
96 | }) | 96 | }) |
97 | .then(function (result){ | 97 | .then(function (result){ |
98 | deferred.resolve(result.data); | 98 | deferred.resolve(result.data); |
99 | },function (result){ | 99 | },function (result){ |
100 | deferred.resolve(result.data); | 100 | deferred.resolve(result.data); |
101 | }) | 101 | }) |
102 | return deferred.promise; | 102 | return deferred.promise; |
103 | } | 103 | } |
104 | 104 | ||
105 | this.sendMail = function(id) { | 105 | this.sendMail = function(id) { |
106 | 106 | ||
107 | var deferred = $q.defer(); | 107 | var deferred = $q.defer(); |
108 | $http({ | 108 | $http({ |
109 | method : 'POST', | 109 | method : 'POST', |
110 | url : BASE_URL.url +'/company/mailPriceToContacts/'+id, | 110 | url : BASE_URL.url +'/company/mailPriceToContacts/'+id, |
111 | headers : {'Content-Type': 'application/json'}, | 111 | headers : {'Content-Type': 'application/json'}, |
112 | }) | 112 | }) |
113 | .then(function (result){ | 113 | .then(function (result){ |
114 | deferred.resolve(result.data); | 114 | deferred.resolve(result.data); |
115 | },function (result){ | 115 | },function (result){ |
116 | deferred.resolve(result.data); | 116 | deferred.resolve(result.data); |
117 | }) | 117 | }) |
118 | return deferred.promise; | 118 | return deferred.promise; |
119 | } | 119 | } |
120 | 120 | ||
121 | this.changeStatus = function(companyId, data){ | 121 | this.changeStatus = function(companyId, data){ |
122 | var deferred = $q.defer(); | 122 | var deferred = $q.defer(); |
123 | $http({ | 123 | $http({ |
124 | method : 'PUT', | 124 | method : 'PUT', |
125 | url : BASE_URL.url +'/company/status/'+companyId, | 125 | url : BASE_URL.url +'/company/status/'+companyId, |
126 | data : data, | 126 | data : data, |
127 | headers : {'Content-Type': 'application/json'}, | 127 | headers : {'Content-Type': 'application/json'}, |
128 | }) | 128 | }) |
129 | .then(function (result){ | 129 | .then(function (result){ |
130 | deferred.resolve(result.data); | 130 | deferred.resolve(result.data); |
131 | },function (result){ | 131 | },function (result){ |
132 | deferred.resolve(result.data); | 132 | deferred.resolve(result.data); |
133 | }) | 133 | }) |
134 | return deferred.promise; | 134 | return deferred.promise; |
135 | } | 135 | } |
136 | 136 | ||
137 | this.fuelerPricingChange = function(companyId, data){ | 137 | this.fuelerPricingChange = function(companyId, data){ |
138 | var deferred = $q.defer(); | 138 | var deferred = $q.defer(); |
139 | $http({ | 139 | $http({ |
140 | method : 'PUT', | 140 | method : 'PUT', |
141 | url : BASE_URL.url +'/company/contact/disablePriceEmail/'+companyId, | 141 | url : BASE_URL.url +'/company/contact/disablePriceEmail/'+companyId, |
142 | data : data, | 142 | data : data, |
143 | headers : {'Content-Type': 'application/json'}, | 143 | headers : {'Content-Type': 'application/json'}, |
144 | }) | 144 | }) |
145 | .then(function (result){ | 145 | .then(function (result){ |
146 | deferred.resolve(result.data); | 146 | deferred.resolve(result.data); |
147 | },function (result){ | 147 | },function (result){ |
148 | deferred.resolve(result.data); | 148 | deferred.resolve(result.data); |
149 | }) | 149 | }) |
150 | return deferred.promise; | 150 | return deferred.promise; |
151 | } | 151 | } |
152 | 152 | ||
153 | this.updateCompany = function(data) { | 153 | this.updateCompany = function(data) { |
154 | 154 | ||
155 | var deferred = $q.defer(); | 155 | var deferred = $q.defer(); |
156 | $http({ | 156 | $http({ |
157 | method : 'PUT', | 157 | method : 'PUT', |
158 | url : BASE_URL.url +'/company', | 158 | url : BASE_URL.url +'/company', |
159 | data : data, | 159 | data : data, |
160 | headers : {'Content-Type': 'application/json'}, | 160 | headers : {'Content-Type': 'application/json'}, |
161 | }) | 161 | }) |
162 | .then(function (result){ | 162 | .then(function (result){ |
163 | deferred.resolve(result.data); | 163 | deferred.resolve(result.data); |
164 | },function (result){ | 164 | },function (result){ |
165 | deferred.resolve(result.data); | 165 | deferred.resolve(result.data); |
166 | }) | 166 | }) |
167 | return deferred.promise; | 167 | return deferred.promise; |
168 | } | 168 | } |
169 | 169 | ||
170 | this.getAircraft = function(id) { | 170 | this.getAircraft = function(id) { |
171 | 171 | ||
172 | var deferred = $q.defer(); | 172 | var deferred = $q.defer(); |
173 | $http({ | 173 | $http({ |
174 | method : 'GET', | 174 | method : 'GET', |
175 | url : BASE_URL.url +'/company/aircrafts/'+id, | 175 | url : BASE_URL.url +'/company/aircrafts/'+id, |
176 | headers : {'Content-Type': 'application/json'}, | 176 | headers : {'Content-Type': 'application/json'}, |
177 | }) | 177 | }) |
178 | .then(function (result){ | 178 | .then(function (result){ |
179 | deferred.resolve(result.data); | 179 | deferred.resolve(result.data); |
180 | },function (result){ | 180 | },function (result){ |
181 | deferred.resolve(result.data); | 181 | deferred.resolve(result.data); |
182 | }) | 182 | }) |
183 | return deferred.promise; | 183 | return deferred.promise; |
184 | } | 184 | } |
185 | 185 | ||
186 | this.checkPrimaryContact = function(id){ | 186 | this.checkPrimaryContact = function(id){ |
187 | var deferred = $q.defer(); | 187 | var deferred = $q.defer(); |
188 | $http({ | 188 | $http({ |
189 | method : 'GET', | 189 | method : 'GET', |
190 | url : BASE_URL.url +'/company/contact/check/primaryContact/'+id, | 190 | url : BASE_URL.url +'/company/contact/check/primaryContact/'+id, |
191 | headers : {'Content-Type': 'application/json'}, | 191 | headers : {'Content-Type': 'application/json'}, |
192 | }) | 192 | }) |
193 | .then(function (result){ | 193 | .then(function (result){ |
194 | deferred.resolve(result); | 194 | deferred.resolve(result); |
195 | },function (result){ | 195 | },function (result){ |
196 | deferred.resolve(result); | 196 | deferred.resolve(result); |
197 | }) | 197 | }) |
198 | return deferred.promise; | 198 | return deferred.promise; |
199 | } | 199 | } |
200 | 200 | ||
201 | this.deleteAircraft = function(id){ | 201 | this.deleteAircraft = function(id){ |
202 | var deferred = $q.defer(); | 202 | var deferred = $q.defer(); |
203 | $http({ | 203 | $http({ |
204 | method : 'DELETE', | 204 | method : 'DELETE', |
205 | url : BASE_URL.url +'/company/aircraft/'+id, | 205 | url : BASE_URL.url +'/company/aircraft/'+id, |
206 | headers : {'Content-Type': 'application/json'}, | 206 | headers : {'Content-Type': 'application/json'}, |
207 | }) | 207 | }) |
208 | .then(function (result){ | 208 | .then(function (result){ |
209 | deferred.resolve(result); | 209 | deferred.resolve(result); |
210 | },function (result){ | 210 | },function (result){ |
211 | deferred.resolve(result); | 211 | deferred.resolve(result); |
212 | }) | 212 | }) |
213 | return deferred.promise; | 213 | return deferred.promise; |
214 | } | 214 | } |
215 | |||
216 | this.checkJetType = function(tail) { | ||
217 | |||
218 | var deferred = $q.defer(); | ||
219 | $http({ | ||
220 | method : 'GET', | ||
221 | url : BASE_URL.url +'/flightDept/getFboData/'+tail+'/aircraft', | ||
222 | headers : {'Content-Type': 'application/json'}, | ||
223 | }) | ||
224 | .then(function (result){ | ||
225 | deferred.resolve(result.data); | ||
226 | },function (result){ | ||
227 | deferred.resolve(result.data); | ||
228 | }) | ||
229 | return deferred.promise; | ||
230 | } | ||
215 | 231 | ||
216 | } | 232 | } |
233 | |||
234 | |||
217 | 235 | ||
218 | })(); | 236 | })(); |