diff --git a/app/views/fbo-admin/dashboard.controller.js b/app/views/fbo-admin/dashboard.controller.js
index 0b204d7..b275f38 100644
--- a/app/views/fbo-admin/dashboard.controller.js
+++ b/app/views/fbo-admin/dashboard.controller.js
@@ -59,7 +59,7 @@
})
$state.go('index.fboAdmin');
}, function (err) {
- toastr.error('Error in registering', {
+ toastr.error('Error in registeration', {
closeButton: true
})
});
diff --git a/app/views/fbo-flight/flight.html b/app/views/fbo-flight/flight.html
index da4d444..c4b2905 100644
--- a/app/views/fbo-flight/flight.html
+++ b/app/views/fbo-flight/flight.html
@@ -1,13 +1,79 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -80,7 +146,7 @@
Aircraft List
-
+
Add Aircraft
-
@@ -133,11 +197,11 @@
-
+ -->
-
+
+
+
+
+
diff --git a/app/views/fbo-flight/flightDept.controller.js b/app/views/fbo-flight/flightDept.controller.js
index 64d97ce..85fba15 100644
--- a/app/views/fbo-flight/flightDept.controller.js
+++ b/app/views/fbo-flight/flightDept.controller.js
@@ -3,7 +3,7 @@
//Load controller
angular.module('acuefuel')
- .controller('FlightDeptController', function ($scope, $uibModal, FBOFlight) {
+ .controller('FlightDeptController', function ($scope, $uibModal, $state, FBOFlight) {
$(document).ready(function(){
$('.fboflight').addClass('active');
});
@@ -11,6 +11,7 @@
$scope.user = {};
$scope.aircraft = {};
$scope.userData = function(){
+
if($scope.user.email == undefined || $scope.user.email == null){
toastr.error('Please enter your email first', {
closeButton: true
@@ -33,12 +34,15 @@
$scope.registerId = result;
$scope.data.accountId = $scope.registerId;
$scope.aircraft.accountId = $scope.registerId;
+ if($scope.aircraft.accountId == $scope.registerId){
+ $scope.saveCompanyData();
+ }
toastr.success('Created Successfully', {
closeButton: true
})
$state.go('index.flightDept');
}, function (err) {
- toastr.error('Error in registering', {
+ toastr.error('Error in registeration', {
closeButton: true
})
});
@@ -68,81 +72,152 @@
getData();
function getData(){
- FBOFlight.getAircraftMake().then(function(result) {
+ FBOFlight.getAircraftMake().then(function(result) {
$scope.aircraftMakeList = result;
- $scope.aircraft.make = $scope.aircraftMakeList[0];
- FBOFlight.getModal($scope.aircraft.make).then(function(result) {
- $scope.aircraftModalList = result;
- $scope.aircraft.model = $scope.aircraftModalList[0];
- FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
- $scope.aircraftSizeList = result;
- $scope.aircraft.size = $scope.aircraftSizeList[0];
- })
- })
-
})
}
-
- $scope.getModal = function(){
- var makeId = $scope.aircraft.make;
- FBOFlight.getModal(makeId).then(function(result) {
- $scope.aircraftModalList = result;
- $scope.aircraft.model = $scope.aircraftModalList[0];
- FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) {
- $scope.aircraftSizeList = result;
- $scope.aircraft.size = $scope.aircraftSizeList[0];
- })
+ $scope.aircraftDetails = [{
+ 'tail':'',
+ 'make': '',
+ 'model': '',
+ 'sizeId' : ''
+ }];
+
+ $scope.addNew = function(){
+ $scope.aircraftDetails.push({
+ 'tail':'',
+ 'make': '',
+ 'model': '',
+ 'sizeId' : ''
+ });
+ console.log($scope.aircraftDetails)
+ };
+
+ $scope.getModal = function(makeId, index){
+ $scope.aircraft.make = makeId;
+ //var makeId = makeId;
+ FBOFlight.getModal($scope.aircraft.make).then(function(result) {
+ $scope.aircraftDetails[index].aircraftModalList = result;
+ //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0];
})
}
- $scope.getSize = function(){
- FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
- $scope.aircraftSizeList = result;
- $scope.aircraft.size = $scope.aircraftSizeList[0];
+ $scope.getSize = function(model, index){
+ FBOFlight.getAircraftSize($scope.aircraft.make, model).then(function(result) {
+ $scope.aircraftDetails[index].aircraftSizeList = result;
+ //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0];
+ console.log($scope.aircraftDetails[index])
})
}
- $scope.openModal = function(){
- if($scope.aircraft.accountId == undefined){
- toastr.error('Please Add Contact Information', {
- closeButton: true
- })
- $('#myModal4').modal('hide');
- }else{
- $('#myModal4').modal('show');
- }
-
- }
- $scope.aircraftData = {};
- $scope.aircraftData.aircraftList = [];
- $scope.getCraftList = [];
- $scope.addAircraft = function(){
- $scope.aircraftData.aircraftList.push($scope.aircraft);
- if ($scope.getCraftList.indexOf($scope.aircraft) == -1) {
- $scope.getCraftList.push($scope.aircraft);
+ $scope.aircraftListData = {};
+ $scope.addData = [];
+
+ $scope.saveCompanyData = function(){
+ for(var i=0; i<$scope.aircraftDetails.length;i++){
+ $scope.addData.push({
+ 'tail': $scope.aircraftDetails[i].tail,
+ 'make': $scope.aircraftDetails[i].make,
+ 'model': $scope.aircraftDetails[i].model,
+ 'sizeId' : $scope.aircraftDetails[i].sizeId
+ });
}
+ $scope.aircraftListData.aircraftList = $scope.addData;
+ $scope.aircraftListData.accountId = $scope.aircraft.accountId;
- FBOFlight.addAircraft($scope.aircraftData).then(function(result) {
- $('#myModal4').modal('hide');
- $scope.reset();
- toastr.success('Created Successfully', {
- closeButton: true
- })
- }, function (err) {
- toastr.error('Error in Adding Aircraft', {
- closeButton: true
- })
- $('#myModal4').modal('hide');
- $scope.getCraftList.splice($scope.aircraft);
+ FBOFlight.addAircraft($scope.aircraftListData).then(function(result) {
+ console.log(result)
+ if(result != null && result.success){
+ toastr.success(''+result.success+'', {
+ closeButton: true
+ })
+ }else{
+ toastr.error(''+result.statusText+'', {
+ closeButton: true
+ })
+ }
});
}
- $scope.reset = function() {
- $scope.aircraft = {};
- $scope.aircraft.accountId = $scope.data.accountId;
- $scope.aircraftData.aircraftList = [];
- getData();
- }
+ // getData();
+ // function getData(){
+ // FBOFlight.getAircraftMake().then(function(result) {
+ // $scope.aircraftMakeList = result;
+ // $scope.aircraft.make = $scope.aircraftMakeList[0];
+ // FBOFlight.getModal($scope.aircraft.make).then(function(result) {
+ // $scope.aircraftModalList = result;
+ // $scope.aircraft.model = $scope.aircraftModalList[0];
+ // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
+ // $scope.aircraftSizeList = result;
+ // $scope.aircraft.size = $scope.aircraftSizeList[0];
+ // })
+ // })
+
+ // })
+ // }
+
+
+ // $scope.getModal = function(){
+ // var makeId = $scope.aircraft.make;
+ // FBOFlight.getModal(makeId).then(function(result) {
+ // $scope.aircraftModalList = result;
+ // $scope.aircraft.model = $scope.aircraftModalList[0];
+ // FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) {
+ // $scope.aircraftSizeList = result;
+ // $scope.aircraft.size = $scope.aircraftSizeList[0];
+ // })
+ // })
+ // }
+
+ // $scope.getSize = function(){
+ // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
+ // $scope.aircraftSizeList = result;
+ // $scope.aircraft.size = $scope.aircraftSizeList[0];
+ // })
+ // }
+
+ // $scope.openModal = function(){
+ // if($scope.aircraft.accountId == undefined){
+ // toastr.error('Please Add Contact Information', {
+ // closeButton: true
+ // })
+ // $('#myModal4').modal('hide');
+ // }else{
+ // $('#myModal4').modal('show');
+ // }
+
+ // }
+ // $scope.aircraftData = {};
+ // $scope.aircraftData.aircraftList = [];
+ // $scope.getCraftList = [];
+ // $scope.addAircraft = function(){
+ // $scope.aircraftData.aircraftList.push($scope.aircraft);
+ // if ($scope.getCraftList.indexOf($scope.aircraft) == -1) {
+ // $scope.getCraftList.push($scope.aircraft);
+ // }
+
+ // FBOFlight.addAircraft($scope.aircraftData).then(function(result) {
+ // $('#myModal4').modal('hide');
+ // $scope.reset();
+ // toastr.success('Created Successfully', {
+ // closeButton: true
+ // })
+ // }, function (err) {
+ // toastr.error('Error in Adding Aircraft', {
+ // closeButton: true
+ // })
+ // $('#myModal4').modal('hide');
+ // $scope.getCraftList.splice($scope.aircraft);
+ // });
+
+ // }
+
+ // $scope.reset = function() {
+ // $scope.aircraft = {};
+ // $scope.aircraft.accountId = $scope.data.accountId;
+ // $scope.aircraftData.aircraftList = [];
+ // getData();
+ // }
});
\ No newline at end of file
diff --git a/app/views/updateAllFBO/updateAllFBO.html b/app/views/updateAllFBO/updateAllFBO.html
index dbf9ee3..1f99e42 100644
--- a/app/views/updateAllFBO/updateAllFBO.html
+++ b/app/views/updateAllFBO/updateAllFBO.html
@@ -39,7 +39,7 @@