Commit 2d83813352fc0decb16a30e5237594a82305f431
1 parent
1c749689b1
Exists in
master
menu highlighted focus
Showing
5 changed files
with
10 additions
and
3 deletions
Show diff stats
app/views/common/navigation.html
1 | <nav class="navbar-default navbar-static-side" role="navigation" ng-controller="MainCtrl"> | 1 | <nav class="navbar-default navbar-static-side" role="navigation" ng-controller="MainCtrl"> |
2 | <div class="sidebar-collapse"> | 2 | <div class="sidebar-collapse"> |
3 | <ul side-navigation class="nav metismenu" id="side-menu"> | 3 | <ul side-navigation class="nav metismenu" id="side-menu"> |
4 | <li class="nav-header"> | 4 | <li class="nav-header"> |
5 | 5 | ||
6 | <div class="profile-element" uib-dropdown> | 6 | <div class="profile-element" uib-dropdown> |
7 | <a uib-dropdown-toggle href> | 7 | <a uib-dropdown-toggle href> |
8 | <span class="clear"> | 8 | <span class="clear"> |
9 | <span class="block m-t-xs"> | 9 | <span class="block m-t-xs"> |
10 | <strong class="font-bold">{{userName}}</strong> | 10 | <strong class="font-bold">{{userName}}</strong> |
11 | <!-- </span> | 11 | <!-- </span> |
12 | <span class="text-muted text-xs block">Example menu<b class="caret"></b></span> | 12 | <span class="text-muted text-xs block">Example menu<b class="caret"></b></span> |
13 | </span> --> | 13 | </span> --> |
14 | </a> | 14 | </a> |
15 | <ul uib-dropdown-menu class="animated flipInX m-t-xs"> | 15 | <ul uib-dropdown-menu class="animated flipInX m-t-xs"> |
16 | <li><a href="">Logout</a></li> | 16 | <li><a href="">Logout</a></li> |
17 | </ul> | 17 | </ul> |
18 | </div> | 18 | </div> |
19 | <div class="logo-element"> | 19 | <div class="logo-element"> |
20 | IN+ | 20 | IN+ |
21 | </div> | 21 | </div> |
22 | 22 | ||
23 | </li> | 23 | </li> |
24 | 24 | ||
25 | <li ui-sref-active="active"> | 25 | <li ui-sref-active="active" class="fboadmin"> |
26 | <a ui-sref="index.fboAdmin"><i class="fa fa-tint"></i> <span class="nav-label">FBO Admin</span> </a> | 26 | <a ui-sref="index.fboAdmin"><i class="fa fa-tint"></i> <span class="nav-label">FBO Admin</span> </a> |
27 | </li> | 27 | </li> |
28 | <li ui-sref-active="active"> | 28 | <li ui-sref-active="active" class="fboflight"> |
29 | <a ui-sref="index.flightDept"><i class="fa fa-plane"></i> <span class="nav-label">Flight Dept Admin</span></a> | 29 | <a ui-sref="index.flightDept"><i class="fa fa-plane"></i> <span class="nav-label">Flight Dept Admin</span></a> |
30 | </li> | 30 | </li> |
31 | <li ui-sref-active="active"> | 31 | <li ui-sref-active="active"> |
32 | <a ui-sref="index.updateAirports"><i class="fa fa-map-marker"></i> <span class="nav-label">Update Airports</span></a> | 32 | <a ui-sref="index.updateAirports"><i class="fa fa-map-marker"></i> <span class="nav-label">Update Airports</span></a> |
33 | </li> | 33 | </li> |
34 | <!-- <li ui-sref-active="active"> | 34 | <!-- <li ui-sref-active="active"> |
35 | <a ui-sref="index.fboClients"><i class="fa fa-user"></i> <span class="nav-label">FBO Clients</span></a> | 35 | <a ui-sref="index.fboClients"><i class="fa fa-user"></i> <span class="nav-label">FBO Clients</span></a> |
36 | </li> --> | 36 | </li> --> |
37 | </ul> | 37 | </ul> |
38 | 38 | ||
39 | </div> | 39 | </div> |
40 | </nav> | 40 | </nav> |
app/views/fbo-admin/dashboard.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('DashboardController', function($scope, $state, FBOAdmin) { | 6 | .controller('DashboardController', function($scope, $state, FBOAdmin) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.i-checks').iCheck({ | 8 | $('.i-checks').iCheck({ |
9 | checkboxClass: 'icheckbox_square-green', | 9 | checkboxClass: 'icheckbox_square-green', |
10 | radioClass: 'iradio_square-green', | 10 | radioClass: 'iradio_square-green', |
11 | }); | 11 | }); |
12 | $('.fboadmin').addClass('active'); | ||
12 | }); | 13 | }); |
13 | $scope.userName = 'Dylan Goodwin'; | 14 | $scope.userName = 'Dylan Goodwin'; |
14 | $scope.essAccountId = true; | 15 | $scope.essAccountId = true; |
15 | $("#esAccId").css({ opacity: 0.5 }); | 16 | $("#esAccId").css({ opacity: 0.5 }); |
16 | $scope.user = {}; | 17 | $scope.user = {}; |
17 | $scope.feature = {}; | 18 | $scope.feature = {}; |
18 | $scope.feature.level = 'silver'; | 19 | $scope.feature.level = 'silver'; |
19 | $scope.feature.essintaPosSystem = false; | 20 | $scope.feature.essintaPosSystem = false; |
20 | $scope.feature.acuQuote = false; | 21 | $scope.feature.acuQuote = false; |
21 | $scope.feature.acuTrack = false; | 22 | $scope.feature.acuTrack = false; |
22 | $scope.feature.fuelProgram = false; | 23 | $scope.feature.fuelProgram = false; |
23 | $scope.feature.amstatIntegration = false; | 24 | $scope.feature.amstatIntegration = false; |
24 | $scope.feature.posAccountingIntegration = false; | 25 | $scope.feature.posAccountingIntegration = false; |
25 | $scope.feature.posVeederRootIntegration = false; | 26 | $scope.feature.posVeederRootIntegration = false; |
26 | $scope.userData = function(){ | 27 | $scope.userData = function(){ |
27 | if($scope.user.email == undefined || $scope.user.email == null){ | 28 | if($scope.user.email == undefined || $scope.user.email == null){ |
28 | toastr.error('Please enter your email first', { | 29 | toastr.error('Please enter your email first', { |
29 | closeButton: true | 30 | closeButton: true |
30 | }) | 31 | }) |
31 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 32 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
32 | toastr.error('Please enter your First Name', { | 33 | toastr.error('Please enter your First Name', { |
33 | closeButton: true | 34 | closeButton: true |
34 | }) | 35 | }) |
35 | }else{ | 36 | }else{ |
36 | if($scope.status == true){ | 37 | if($scope.status == true){ |
37 | $scope.user.status = 'active'; | 38 | $scope.user.status = 'active'; |
38 | }else{ | 39 | }else{ |
39 | $scope.user.status = 'inactive'; | 40 | $scope.user.status = 'inactive'; |
40 | } | 41 | } |
41 | $scope.user.username = $scope.user.email; | 42 | $scope.user.username = $scope.user.email; |
42 | $scope.user.userType = 'fbo'; | 43 | $scope.user.userType = 'fbo'; |
43 | console.log($scope.user) | 44 | console.log($scope.user) |
44 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; | 45 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; |
45 | FBOAdmin.registerUser(formdata).then(function(result) { | 46 | FBOAdmin.registerUser(formdata).then(function(result) { |
46 | toastr.success('Created Successfully', { | 47 | toastr.success('Created Successfully', { |
47 | closeButton: true | 48 | closeButton: true |
48 | }) | 49 | }) |
49 | $scope.feature.accountId = result; | 50 | $scope.feature.accountId = result; |
50 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem | 51 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem |
51 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" | 52 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" |
52 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration | 53 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration |
53 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; | 54 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; |
54 | 55 | ||
55 | FBOAdmin.featureControl(featureControlData).then(function(response) { | 56 | FBOAdmin.featureControl(featureControlData).then(function(response) { |
56 | console.log(response) | 57 | console.log(response) |
57 | 58 | ||
58 | }) | 59 | }) |
59 | $state.go('index.fboAdmin'); | 60 | $state.go('index.fboAdmin'); |
60 | }, function (err) { | 61 | }, function (err) { |
61 | toastr.error('Error in registering', { | 62 | toastr.error('Error in registering', { |
62 | closeButton: true | 63 | closeButton: true |
63 | }) | 64 | }) |
64 | }); | 65 | }); |
65 | } | 66 | } |
66 | 67 | ||
67 | } | 68 | } |
68 | 69 | ||
69 | $scope.enableEssId = function(){ | 70 | $scope.enableEssId = function(){ |
70 | if($scope.feature.essintaPosSystem == true){ | 71 | if($scope.feature.essintaPosSystem == true){ |
71 | $scope.essAccountId = false; | 72 | $scope.essAccountId = false; |
72 | $("#esAccId").css({ opacity: 1 }); | 73 | $("#esAccId").css({ opacity: 1 }); |
73 | }else{ | 74 | }else{ |
74 | $scope.essAccountId = true; | 75 | $scope.essAccountId = true; |
75 | delete $scope.feature.essintaAccountUid; | 76 | delete $scope.feature.essintaAccountUid; |
76 | $("#esAccId").css({ opacity: 0.5 }); | 77 | $("#esAccId").css({ opacity: 0.5 }); |
77 | } | 78 | } |
78 | } | 79 | } |
79 | 80 | ||
80 | }); | 81 | }); |
app/views/fbo-flight/flightDept.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('FlightDeptController', function ($scope, $uibModal, FBOFlight) { | 6 | .controller('FlightDeptController', function ($scope, $uibModal, FBOFlight) { |
7 | $(document).ready(function(){ | ||
8 | $('.fboflight').addClass('active'); | ||
9 | }); | ||
7 | $scope.data = {}; | 10 | $scope.data = {}; |
8 | $scope.user = {}; | 11 | $scope.user = {}; |
9 | $scope.aircraft = {}; | 12 | $scope.aircraft = {}; |
10 | $scope.userData = function(){ | 13 | $scope.userData = function(){ |
11 | if($scope.user.email == undefined || $scope.user.email == null){ | 14 | if($scope.user.email == undefined || $scope.user.email == null){ |
12 | toastr.error('Please enter your email first', { | 15 | toastr.error('Please enter your email first', { |
13 | closeButton: true | 16 | closeButton: true |
14 | }) | 17 | }) |
15 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 18 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
16 | toastr.error('Please enter your First Name', { | 19 | toastr.error('Please enter your First Name', { |
17 | closeButton: true | 20 | closeButton: true |
18 | }) | 21 | }) |
19 | }else{ | 22 | }else{ |
20 | if($scope.status == true){ | 23 | if($scope.status == true){ |
21 | $scope.user.status = 'active'; | 24 | $scope.user.status = 'active'; |
22 | }else{ | 25 | }else{ |
23 | $scope.user.status = 'inactive'; | 26 | $scope.user.status = 'inactive'; |
24 | } | 27 | } |
25 | $scope.user.username = $scope.user.email; | 28 | $scope.user.username = $scope.user.email; |
26 | $scope.user.userType = 'flightDetp'; | 29 | $scope.user.userType = 'flightDetp'; |
27 | console.log($scope.user) | 30 | console.log($scope.user) |
28 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; | 31 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; |
29 | FBOFlight.registerUser(formdata).then(function(result) { | 32 | FBOFlight.registerUser(formdata).then(function(result) { |
30 | $scope.registerId = result; | 33 | $scope.registerId = result; |
31 | $scope.data.accountId = $scope.registerId; | 34 | $scope.data.accountId = $scope.registerId; |
32 | $scope.aircraft.accountId = $scope.registerId; | 35 | $scope.aircraft.accountId = $scope.registerId; |
33 | toastr.success('Created Successfully', { | 36 | toastr.success('Created Successfully', { |
34 | closeButton: true | 37 | closeButton: true |
35 | }) | 38 | }) |
36 | $state.go('index.flightDept'); | 39 | $state.go('index.flightDept'); |
37 | }, function (err) { | 40 | }, function (err) { |
38 | toastr.error('Error in registering', { | 41 | toastr.error('Error in registering', { |
39 | closeButton: true | 42 | closeButton: true |
40 | }) | 43 | }) |
41 | }); | 44 | }); |
42 | } | 45 | } |
43 | } | 46 | } |
44 | 47 | ||
45 | $scope.data.cardType = 'creditCard'; | 48 | $scope.data.cardType = 'creditCard'; |
46 | var cardData = {} | 49 | var cardData = {} |
47 | cardData.paymentMethodList = []; | 50 | cardData.paymentMethodList = []; |
48 | $scope.addCard = function(){ | 51 | $scope.addCard = function(){ |
49 | if($scope.aircraft.accountId == undefined){ | 52 | if($scope.aircraft.accountId == undefined){ |
50 | toastr.error('Please Add Contact Information', { | 53 | toastr.error('Please Add Contact Information', { |
51 | closeButton: true | 54 | closeButton: true |
52 | }) | 55 | }) |
53 | }else{ | 56 | }else{ |
54 | cardData.paymentMethodList.push($scope.data); | 57 | cardData.paymentMethodList.push($scope.data); |
55 | console.log("cardData", cardData); | 58 | console.log("cardData", cardData); |
56 | FBOFlight.addCardInformation(cardData).then(function(result) { | 59 | FBOFlight.addCardInformation(cardData).then(function(result) { |
57 | console.log(result) | 60 | console.log(result) |
58 | toastr.success('Created Successfully', { | 61 | toastr.success('Created Successfully', { |
59 | closeButton: true | 62 | closeButton: true |
60 | }) | 63 | }) |
61 | }) | 64 | }) |
62 | } | 65 | } |
63 | 66 | ||
64 | } | 67 | } |
65 | 68 | ||
66 | getData(); | 69 | getData(); |
67 | function getData(){ | 70 | function getData(){ |
68 | FBOFlight.getAircraftMake().then(function(result) { | 71 | FBOFlight.getAircraftMake().then(function(result) { |
69 | $scope.aircraftMakeList = result; | 72 | $scope.aircraftMakeList = result; |
70 | $scope.aircraft.make = $scope.aircraftMakeList[0]; | 73 | $scope.aircraft.make = $scope.aircraftMakeList[0]; |
71 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 74 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
72 | $scope.aircraftModalList = result; | 75 | $scope.aircraftModalList = result; |
73 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 76 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
74 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 77 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
75 | $scope.aircraftSizeList = result; | 78 | $scope.aircraftSizeList = result; |
76 | $scope.aircraft.size = $scope.aircraftSizeList[0]; | 79 | $scope.aircraft.size = $scope.aircraftSizeList[0]; |
77 | }) | 80 | }) |
78 | }) | 81 | }) |
79 | 82 | ||
80 | }) | 83 | }) |
81 | } | 84 | } |
82 | 85 | ||
83 | 86 | ||
84 | $scope.getModal = function(){ | 87 | $scope.getModal = function(){ |
85 | var makeId = $scope.aircraft.make; | 88 | var makeId = $scope.aircraft.make; |
86 | FBOFlight.getModal(makeId).then(function(result) { | 89 | FBOFlight.getModal(makeId).then(function(result) { |
87 | $scope.aircraftModalList = result; | 90 | $scope.aircraftModalList = result; |
88 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 91 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
89 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | 92 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { |
90 | $scope.aircraftSizeList = result; | 93 | $scope.aircraftSizeList = result; |
91 | $scope.aircraft.size = $scope.aircraftSizeList[0]; | 94 | $scope.aircraft.size = $scope.aircraftSizeList[0]; |
92 | }) | 95 | }) |
93 | }) | 96 | }) |
94 | } | 97 | } |
95 | 98 | ||
96 | $scope.getSize = function(){ | 99 | $scope.getSize = function(){ |
97 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 100 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
98 | $scope.aircraftSizeList = result; | 101 | $scope.aircraftSizeList = result; |
99 | $scope.aircraft.size = $scope.aircraftSizeList[0]; | 102 | $scope.aircraft.size = $scope.aircraftSizeList[0]; |
100 | }) | 103 | }) |
101 | } | 104 | } |
102 | 105 | ||
103 | $scope.openModal = function(){ | 106 | $scope.openModal = function(){ |
104 | if($scope.aircraft.accountId == undefined){ | 107 | if($scope.aircraft.accountId == undefined){ |
105 | toastr.error('Please Add Contact Information', { | 108 | toastr.error('Please Add Contact Information', { |
106 | closeButton: true | 109 | closeButton: true |
107 | }) | 110 | }) |
108 | $('#myModal4').modal('hide'); | 111 | $('#myModal4').modal('hide'); |
109 | }else{ | 112 | }else{ |
110 | $('#myModal4').modal('show'); | 113 | $('#myModal4').modal('show'); |
111 | } | 114 | } |
112 | 115 | ||
113 | } | 116 | } |
114 | $scope.aircraftData = {}; | 117 | $scope.aircraftData = {}; |
115 | $scope.aircraftData.aircraftList = []; | 118 | $scope.aircraftData.aircraftList = []; |
116 | $scope.getCraftList = []; | 119 | $scope.getCraftList = []; |
117 | $scope.addAircraft = function(){ | 120 | $scope.addAircraft = function(){ |
118 | $scope.aircraftData.aircraftList.push($scope.aircraft); | 121 | $scope.aircraftData.aircraftList.push($scope.aircraft); |
119 | if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { | 122 | if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { |
120 | $scope.getCraftList.push($scope.aircraft); | 123 | $scope.getCraftList.push($scope.aircraft); |
121 | } | 124 | } |
122 | 125 | ||
123 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | 126 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { |
124 | $('#myModal4').modal('hide'); | 127 | $('#myModal4').modal('hide'); |
125 | $scope.reset(); | 128 | $scope.reset(); |
126 | toastr.success('Created Successfully', { | 129 | toastr.success('Created Successfully', { |
127 | closeButton: true | 130 | closeButton: true |
128 | }) | 131 | }) |
129 | }, function (err) { | 132 | }, function (err) { |
130 | toastr.error('Error in Adding Aircraft', { | 133 | toastr.error('Error in Adding Aircraft', { |
131 | closeButton: true | 134 | closeButton: true |
132 | }) | 135 | }) |
133 | $('#myModal4').modal('hide'); | 136 | $('#myModal4').modal('hide'); |
134 | $scope.getCraftList.splice($scope.aircraft); | 137 | $scope.getCraftList.splice($scope.aircraft); |
135 | }); | 138 | }); |
136 | 139 | ||
137 | } | 140 | } |
138 | 141 | ||
139 | $scope.reset = function() { | 142 | $scope.reset = function() { |
140 | $scope.aircraft = {}; | 143 | $scope.aircraft = {}; |
141 | $scope.aircraft.accountId = $scope.data.accountId; | 144 | $scope.aircraft.accountId = $scope.data.accountId; |
142 | $scope.aircraftData.aircraftList = []; | 145 | $scope.aircraftData.aircraftList = []; |
143 | getData(); | 146 | getData(); |
144 | } | 147 | } |
145 | }); | 148 | }); |
app/views/updateAllFBO/updateAllFBO.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('updateAllFBOController', function($scope, $stateParams, $state, UpdateAllFBO) { | 6 | .controller('updateAllFBOController', function($scope, $stateParams, $state, UpdateAllFBO) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.i-checks').iCheck({ | 8 | $('.i-checks').iCheck({ |
9 | checkboxClass: 'icheckbox_square-green', | 9 | checkboxClass: 'icheckbox_square-green', |
10 | radioClass: 'iradio_square-green', | 10 | radioClass: 'iradio_square-green', |
11 | }); | 11 | }); |
12 | $('.fboadmin').addClass('active'); | ||
12 | 13 | ||
13 | }); | 14 | }); |
14 | 15 | ||
15 | $scope.feature = {}; | 16 | $scope.feature = {}; |
16 | var userProfileID = $stateParams.id; | 17 | var userProfileID = $stateParams.id; |
17 | UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { | 18 | UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { |
18 | console.log(result) | 19 | console.log(result) |
19 | $scope.user = result; | 20 | $scope.user = result; |
20 | $scope.user.userTypeId = result.userType.id; | 21 | $scope.user.userTypeId = result.userType.id; |
21 | 22 | ||
22 | if(result.accountFeatureControl != null){ | 23 | if(result.accountFeatureControl != null){ |
23 | $scope.feature = result.accountFeatureControl; | 24 | $scope.feature = result.accountFeatureControl; |
24 | $scope.feature.accountId = result.account.id; | 25 | $scope.feature.accountId = result.account.id; |
25 | console.log($scope.feature) | 26 | console.log($scope.feature) |
26 | if($scope.feature.essintaPosSystem == true){ | 27 | if($scope.feature.essintaPosSystem == true){ |
27 | $scope.essAccountId = false; | 28 | $scope.essAccountId = false; |
28 | $("#esAccId").css({ opacity: 1 }); | 29 | $("#esAccId").css({ opacity: 1 }); |
29 | }else{ | 30 | }else{ |
30 | $scope.essAccountId = true; | 31 | $scope.essAccountId = true; |
31 | delete $scope.feature.essintaAccountUid; | 32 | delete $scope.feature.essintaAccountUid; |
32 | $("#esAccId").css({ opacity: 0.5 }); | 33 | $("#esAccId").css({ opacity: 0.5 }); |
33 | } | 34 | } |
34 | }else{ | 35 | }else{ |
35 | $scope.feature.accountId = result.account.id; | 36 | $scope.feature.accountId = result.account.id; |
36 | } | 37 | } |
37 | 38 | ||
38 | UpdateAllFBO.getNotes(userProfileID).then(function(response) { | 39 | UpdateAllFBO.getNotes(userProfileID).then(function(response) { |
39 | $scope.user.clientNote = response[0].notes | 40 | $scope.user.clientNote = response[0].notes |
40 | $scope.user.userNoteId = response[0].id; | 41 | $scope.user.userNoteId = response[0].id; |
41 | }) | 42 | }) |
42 | console.log($scope.feature,"dsdsdsds") | 43 | console.log($scope.feature,"dsdsdsds") |
43 | if($scope.user.account.user.status == 'ACTIVE'){ | 44 | if($scope.user.account.user.status == 'ACTIVE'){ |
44 | $scope.status = true; | 45 | $scope.status = true; |
45 | }else { | 46 | }else { |
46 | $scope.status = false; | 47 | $scope.status = false; |
47 | } | 48 | } |
48 | }) | 49 | }) |
49 | 50 | ||
50 | $scope.enableEssId = function(){ | 51 | $scope.enableEssId = function(){ |
51 | if($scope.feature.essintaPosSystem == true){ | 52 | if($scope.feature.essintaPosSystem == true){ |
52 | $scope.essAccountId = false; | 53 | $scope.essAccountId = false; |
53 | $("#esAccId").css({ opacity: 1 }); | 54 | $("#esAccId").css({ opacity: 1 }); |
54 | }else{ | 55 | }else{ |
55 | $scope.essAccountId = true; | 56 | $scope.essAccountId = true; |
56 | delete $scope.feature.essintaAccountUid; | 57 | delete $scope.feature.essintaAccountUid; |
57 | $("#esAccId").css({ opacity: 0.5 }); | 58 | $("#esAccId").css({ opacity: 0.5 }); |
58 | } | 59 | } |
59 | } | 60 | } |
60 | 61 | ||
61 | $scope.userData = function(){ | 62 | $scope.userData = function(){ |
62 | console.log($scope.user.userTypeId) | 63 | console.log($scope.user.userTypeId) |
63 | if($scope.user.email == undefined || $scope.user.email == null){ | 64 | if($scope.user.email == undefined || $scope.user.email == null){ |
64 | toastr.error('Please enter your email first', { | 65 | toastr.error('Please enter your email first', { |
65 | closeButton: true | 66 | closeButton: true |
66 | }) | 67 | }) |
67 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 68 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
68 | toastr.error('Please enter your First Name', { | 69 | toastr.error('Please enter your First Name', { |
69 | closeButton: true | 70 | closeButton: true |
70 | }) | 71 | }) |
71 | }else{ | 72 | }else{ |
72 | if($scope.status == true){ | 73 | if($scope.status == true){ |
73 | $scope.user.status = 'active'; | 74 | $scope.user.status = 'active'; |
74 | }else{ | 75 | }else{ |
75 | $scope.user.status = 'inactive'; | 76 | $scope.user.status = 'inactive'; |
76 | } | 77 | } |
77 | $scope.user.username = $scope.user.email; | 78 | $scope.user.username = $scope.user.email; |
78 | $scope.user.userType = 'fbo'; | 79 | $scope.user.userType = 'fbo'; |
79 | console.log($scope.user) | 80 | console.log($scope.user) |
80 | // if($scope.user.userNoteId == undefined){ | 81 | // if($scope.user.userNoteId == undefined){ |
81 | // $scope.user.userNoteId = null; | 82 | // $scope.user.userNoteId = null; |
82 | // } | 83 | // } |
83 | var updateData = "companyName=" + $scope.user.companyName + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&userNote=" + $scope.user.clientNote + "&userNoteId=" + $scope.user.userNoteId + "&userTypeId=" + $scope.user.userTypeId + "&userProfileId=" + userProfileID; | 84 | var updateData = "companyName=" + $scope.user.companyName + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&userNote=" + $scope.user.clientNote + "&userNoteId=" + $scope.user.userNoteId + "&userTypeId=" + $scope.user.userTypeId + "&userProfileId=" + userProfileID; |
84 | UpdateAllFBO.updateUser(updateData).then(function(result) { | 85 | UpdateAllFBO.updateUser(updateData).then(function(result) { |
85 | toastr.success(''+result.success+'', { | 86 | toastr.success(''+result.success+'', { |
86 | closeButton: true | 87 | closeButton: true |
87 | }) | 88 | }) |
88 | var updatefeatureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem | 89 | var updatefeatureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem |
89 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" | 90 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" |
90 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration | 91 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration |
91 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id; | 92 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id; |
92 | 93 | ||
93 | UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) { | 94 | UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) { |
94 | console.log(response) | 95 | console.log(response) |
95 | }) | 96 | }) |
96 | $state.go('index.fboAdmin'); | 97 | $state.go('index.fboAdmin'); |
97 | }) | 98 | }) |
98 | } | 99 | } |
99 | } | 100 | } |
100 | 101 | ||
101 | }); | 102 | }); |
app/views/updateFBODept/updateFBODept.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('updateFBODeptController', function($scope, $stateParams, $state, UpdateAllFBODept, UpdateAllFBO, FBOFlight) { | 6 | .controller('updateFBODeptController', function($scope, $stateParams, $state, UpdateAllFBODept, UpdateAllFBO, FBOFlight) { |
7 | 7 | $(document).ready(function(){ | |
8 | $('.fboflight').addClass('active'); | ||
9 | }); | ||
8 | $scope.showPayments = true; | 10 | $scope.showPayments = true; |
9 | $scope.aircraft = {}; | 11 | $scope.aircraft = {}; |
10 | $scope.updateData = {}; | 12 | $scope.updateData = {}; |
11 | var userProfileID = $stateParams.id; | 13 | var userProfileID = $stateParams.id; |
12 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { | 14 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { |
13 | console.log(result) | 15 | console.log(result) |
14 | $scope.user = result; | 16 | $scope.user = result; |
15 | $scope.aircraft.accountId = result.account.id; | 17 | $scope.aircraft.accountId = result.account.id; |
16 | $scope.user.userTypeId = result.userType.id; | 18 | $scope.user.userTypeId = result.userType.id; |
17 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { | 19 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { |
18 | $scope.user.clientNote = response[0].notes | 20 | $scope.user.clientNote = response[0].notes |
19 | $scope.user.userNoteId = response[0].id; | 21 | $scope.user.userNoteId = response[0].id; |
20 | }) | 22 | }) |
21 | // $scope.feature = result.accountFeatureControl; | 23 | // $scope.feature = result.accountFeatureControl; |
22 | // console.log($scope.feature,"dsdsdsds") | 24 | // console.log($scope.feature,"dsdsdsds") |
23 | if($scope.user.account.user.status == 'ACTIVE'){ | 25 | if($scope.user.account.user.status == 'ACTIVE'){ |
24 | $scope.status = true; | 26 | $scope.status = true; |
25 | }else { | 27 | }else { |
26 | $scope.status = false; | 28 | $scope.status = false; |
27 | } | 29 | } |
28 | }) | 30 | }) |
29 | 31 | ||
30 | getCrafts(); | 32 | getCrafts(); |
31 | function getCrafts(){ | 33 | function getCrafts(){ |
32 | UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { | 34 | UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { |
33 | $scope.getCraftList = response; | 35 | $scope.getCraftList = response; |
34 | }) | 36 | }) |
35 | } | 37 | } |
36 | 38 | ||
37 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { | 39 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { |
38 | $scope.paymentList = response; | 40 | $scope.paymentList = response; |
39 | 41 | ||
40 | }) | 42 | }) |
41 | 43 | ||
42 | $scope.openCard = function(payment){ | 44 | $scope.openCard = function(payment){ |
43 | console.log(payment) | 45 | console.log(payment) |
44 | $scope.showPayments = false; | 46 | $scope.showPayments = false; |
45 | $scope.data = {}; | 47 | $scope.data = {}; |
46 | $scope.data.cardNumber = payment.cardNumber; | 48 | $scope.data.cardNumber = payment.cardNumber; |
47 | $scope.data.cardType = payment.cardType; | 49 | $scope.data.cardType = payment.cardType; |
48 | $scope.data.expiryDate = payment.expiryDate; | 50 | $scope.data.expiryDate = payment.expiryDate; |
49 | $scope.data.id = payment.id; | 51 | $scope.data.id = payment.id; |
50 | $scope.data.accountId = payment.user.account.id; | 52 | $scope.data.accountId = payment.user.account.id; |
51 | } | 53 | } |
52 | 54 | ||
53 | var cardData = {} | 55 | var cardData = {} |
54 | cardData.paymentMethodList = []; | 56 | cardData.paymentMethodList = []; |
55 | $scope.updateCard = function(){ | 57 | $scope.updateCard = function(){ |
56 | console.log($scope.data) | 58 | console.log($scope.data) |
57 | cardData.paymentMethodList.push($scope.data); | 59 | cardData.paymentMethodList.push($scope.data); |
58 | console.log("cardData", cardData); | 60 | console.log("cardData", cardData); |
59 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { | 61 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { |
60 | console.log(result) | 62 | console.log(result) |
61 | toastr.success('Updated Successfully', { | 63 | toastr.success('Updated Successfully', { |
62 | closeButton: true | 64 | closeButton: true |
63 | }) | 65 | }) |
64 | $scope.reset(); | 66 | $scope.reset(); |
65 | }) | 67 | }) |
66 | } | 68 | } |
67 | 69 | ||
68 | 70 | ||
69 | $scope.reset = function(){ | 71 | $scope.reset = function(){ |
70 | cardData.paymentMethodList = []; | 72 | cardData.paymentMethodList = []; |
71 | } | 73 | } |
72 | 74 | ||
73 | $scope.userData = function(){ | 75 | $scope.userData = function(){ |
74 | console.log($scope.user.userTypeId) | 76 | console.log($scope.user.userTypeId) |
75 | if($scope.user.email == undefined || $scope.user.email == null){ | 77 | if($scope.user.email == undefined || $scope.user.email == null){ |
76 | toastr.error('Please enter your email first', { | 78 | toastr.error('Please enter your email first', { |
77 | closeButton: true | 79 | closeButton: true |
78 | }) | 80 | }) |
79 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 81 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
80 | toastr.error('Please enter your First Name', { | 82 | toastr.error('Please enter your First Name', { |
81 | closeButton: true | 83 | closeButton: true |
82 | }) | 84 | }) |
83 | }else{ | 85 | }else{ |
84 | if($scope.status == true){ | 86 | if($scope.status == true){ |
85 | $scope.user.status = 'active'; | 87 | $scope.user.status = 'active'; |
86 | }else{ | 88 | }else{ |
87 | $scope.user.status = 'inactive'; | 89 | $scope.user.status = 'inactive'; |
88 | } | 90 | } |
89 | $scope.user.username = $scope.user.email; | 91 | $scope.user.username = $scope.user.email; |
90 | $scope.user.userType = 'flightDetp'; | 92 | $scope.user.userType = 'flightDetp'; |
91 | console.log($scope.user) | 93 | console.log($scope.user) |
92 | // if($scope.user.userNoteId == undefined){ | 94 | // if($scope.user.userNoteId == undefined){ |
93 | // $scope.user.userNoteId = null; | 95 | // $scope.user.userNoteId = null; |
94 | // } | 96 | // } |
95 | var updateData = "companyName=" + $scope.user.companyName + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&userNote=" + $scope.user.clientNote + "&userNoteId=" + $scope.user.userNoteId + "&userTypeId=" + $scope.user.userTypeId + "&userProfileId=" + userProfileID; | 97 | var updateData = "companyName=" + $scope.user.companyName + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&userNote=" + $scope.user.clientNote + "&userNoteId=" + $scope.user.userNoteId + "&userTypeId=" + $scope.user.userTypeId + "&userProfileId=" + userProfileID; |
96 | UpdateAllFBO.updateUser(updateData).then(function(result) { | 98 | UpdateAllFBO.updateUser(updateData).then(function(result) { |
97 | toastr.success(''+result.success+'', { | 99 | toastr.success(''+result.success+'', { |
98 | closeButton: true | 100 | closeButton: true |
99 | }) | 101 | }) |
100 | }) | 102 | }) |
101 | $state.go('index.flightDept'); | 103 | $state.go('index.flightDept'); |
102 | } | 104 | } |
103 | } | 105 | } |
104 | 106 | ||
105 | getData(); | 107 | getData(); |
106 | function getData(){ | 108 | function getData(){ |
107 | FBOFlight.getAircraftMake().then(function(result) { | 109 | FBOFlight.getAircraftMake().then(function(result) { |
108 | $scope.aircraftMakeList = result; | 110 | $scope.aircraftMakeList = result; |
109 | $scope.aircraft.make = $scope.aircraftMakeList[0]; | 111 | $scope.aircraft.make = $scope.aircraftMakeList[0]; |
110 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 112 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
111 | $scope.aircraftModalList = result; | 113 | $scope.aircraftModalList = result; |
112 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 114 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
113 | 115 | ||
114 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 116 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
115 | $scope.aircraftSizeList = result; | 117 | $scope.aircraftSizeList = result; |
116 | $scope.aircraft.size = $scope.aircraftSizeList[0]; | 118 | $scope.aircraft.size = $scope.aircraftSizeList[0]; |
117 | 119 | ||
118 | }) | 120 | }) |
119 | }) | 121 | }) |
120 | 122 | ||
121 | }) | 123 | }) |
122 | } | 124 | } |
123 | 125 | ||
124 | $scope.getModal = function(){ | 126 | $scope.getModal = function(){ |
125 | var makeId = $scope.aircraft.make | 127 | var makeId = $scope.aircraft.make |
126 | FBOFlight.getModal(makeId).then(function(result) { | 128 | FBOFlight.getModal(makeId).then(function(result) { |
127 | $scope.aircraftModalList = result; | 129 | $scope.aircraftModalList = result; |
128 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 130 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
129 | 131 | ||
130 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | 132 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { |
131 | $scope.aircraftSizeList = result; | 133 | $scope.aircraftSizeList = result; |
132 | $scope.aircraft.size = $scope.aircraftSizeList[0]; | 134 | $scope.aircraft.size = $scope.aircraftSizeList[0]; |
133 | }) | 135 | }) |
134 | }) | 136 | }) |
135 | } | 137 | } |
136 | 138 | ||
137 | $scope.getSize = function(){ | 139 | $scope.getSize = function(){ |
138 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 140 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
139 | $scope.aircraftSizeList = result; | 141 | $scope.aircraftSizeList = result; |
140 | $scope.aircraft.size = $scope.aircraftSizeList[0]; | 142 | $scope.aircraft.size = $scope.aircraftSizeList[0]; |
141 | }) | 143 | }) |
142 | } | 144 | } |
143 | 145 | ||
144 | $scope.aircraftData = {}; | 146 | $scope.aircraftData = {}; |
145 | $scope.aircraftData.aircraftList = []; | 147 | $scope.aircraftData.aircraftList = []; |
146 | $scope.addAircraft = function(){ | 148 | $scope.addAircraft = function(){ |
147 | $scope.aircraftData.aircraftList.push($scope.aircraft); | 149 | $scope.aircraftData.aircraftList.push($scope.aircraft); |
148 | 150 | ||
149 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | 151 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { |
150 | $('#myModal4').modal('hide'); | 152 | $('#myModal4').modal('hide'); |
151 | getCrafts(); | 153 | getCrafts(); |
152 | $scope.resetData(); | 154 | $scope.resetData(); |
153 | toastr.success('Created Successfully', { | 155 | toastr.success('Created Successfully', { |
154 | closeButton: true | 156 | closeButton: true |
155 | }) | 157 | }) |
156 | }, function (err) { | 158 | }, function (err) { |
157 | toastr.error('Error in Adding Aircraft', { | 159 | toastr.error('Error in Adding Aircraft', { |
158 | closeButton: true | 160 | closeButton: true |
159 | }) | 161 | }) |
160 | $('#myModal4').modal('hide'); | 162 | $('#myModal4').modal('hide'); |
161 | $scope.getCraftList.splice($scope.aircraft); | 163 | $scope.getCraftList.splice($scope.aircraft); |
162 | }); | 164 | }); |
163 | } | 165 | } |
164 | 166 | ||
165 | $scope.closeModal = function(){ | 167 | $scope.closeModal = function(){ |
166 | $("#myModal5").modal('hide'); | 168 | $("#myModal5").modal('hide'); |
167 | $scope.resetData(); | 169 | $scope.resetData(); |
168 | } | 170 | } |
169 | 171 | ||
170 | $scope.update = function(airdata){ | 172 | $scope.update = function(airdata){ |
171 | $("#myModal5").modal('show'); | 173 | $("#myModal5").modal('show'); |
172 | $scope.aircraft = airdata; | 174 | $scope.aircraft = airdata; |
173 | console.log($scope.aircraft) | 175 | console.log($scope.aircraft) |
174 | $scope.aircraft.accountId = $scope.user.account.id; | 176 | $scope.aircraft.accountId = $scope.user.account.id; |
175 | 177 | ||
176 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 178 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
177 | $scope.aircraftModalList = result; | 179 | $scope.aircraftModalList = result; |
178 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 180 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
179 | $scope.aircraftSizeList = result; | 181 | $scope.aircraftSizeList = result; |
180 | 182 | ||
181 | }) | 183 | }) |
182 | }) | 184 | }) |
183 | } | 185 | } |
184 | 186 | ||
185 | $scope.updatecraftData = {}; | 187 | $scope.updatecraftData = {}; |
186 | $scope.updatecraftData.aircraftList = []; | 188 | $scope.updatecraftData.aircraftList = []; |
187 | $scope.updateAircraftData = {}; | 189 | $scope.updateAircraftData = {}; |
188 | 190 | ||
189 | $scope.updateAircraft = function(updateAircraft){ | 191 | $scope.updateAircraft = function(updateAircraft){ |
190 | $scope.updateAircraftData.id = updateAircraft.id; | 192 | $scope.updateAircraftData.id = updateAircraft.id; |
191 | $scope.updateAircraftData.make = updateAircraft.make; | 193 | $scope.updateAircraftData.make = updateAircraft.make; |
192 | $scope.updateAircraftData.model = updateAircraft.model; | 194 | $scope.updateAircraftData.model = updateAircraft.model; |
193 | $scope.updateAircraftData.size = updateAircraft.size; | 195 | $scope.updateAircraftData.size = updateAircraft.size; |
194 | $scope.updateAircraftData.tail = updateAircraft.tail; | 196 | $scope.updateAircraftData.tail = updateAircraft.tail; |
195 | $scope.updateAircraftData.accountId = updateAircraft.accountId; | 197 | $scope.updateAircraftData.accountId = updateAircraft.accountId; |
196 | console.log($scope.updateAircraftData) | 198 | console.log($scope.updateAircraftData) |
197 | 199 | ||
198 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); | 200 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); |
199 | console.log($scope.updatecraftData.aircraftList) | 201 | console.log($scope.updatecraftData.aircraftList) |
200 | 202 | ||
201 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { | 203 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { |
202 | $('#myModal5').modal('hide'); | 204 | $('#myModal5').modal('hide'); |
203 | $scope.resetData(); | 205 | $scope.resetData(); |
204 | toastr.success('Updated Successfully', { | 206 | toastr.success('Updated Successfully', { |
205 | closeButton: true | 207 | closeButton: true |
206 | }) | 208 | }) |
207 | }, function (err) { | 209 | }, function (err) { |
208 | toastr.error('Error in Updating Aircraft', { | 210 | toastr.error('Error in Updating Aircraft', { |
209 | closeButton: true | 211 | closeButton: true |
210 | }) | 212 | }) |
211 | $('#myModal5').modal('hide'); | 213 | $('#myModal5').modal('hide'); |
212 | $scope.getCraftList.splice($scope.aircraft); | 214 | $scope.getCraftList.splice($scope.aircraft); |
213 | }); | 215 | }); |
214 | } | 216 | } |
215 | 217 | ||
216 | $scope.remove = function(data){ | 218 | $scope.remove = function(data){ |
217 | console.log(data) | 219 | console.log(data) |
218 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { | 220 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { |
219 | toastr.success(''+result.success+'', { | 221 | toastr.success(''+result.success+'', { |
220 | closeButton: true | 222 | closeButton: true |
221 | }) | 223 | }) |
222 | getCrafts(); | 224 | getCrafts(); |
223 | }) | 225 | }) |
224 | } | 226 | } |
225 | 227 | ||
226 | $scope.resetData = function() { | 228 | $scope.resetData = function() { |
227 | $scope.aircraft = {}; | 229 | $scope.aircraft = {}; |
228 | $scope.aircraft.accountId = $scope.user.account.id; | 230 | $scope.aircraft.accountId = $scope.user.account.id; |
229 | $scope.aircraftData.aircraftList = []; | 231 | $scope.aircraftData.aircraftList = []; |
230 | getData(); | 232 | getData(); |
231 | } | 233 | } |
232 | 234 | ||
233 | }); | 235 | }); |