Commit db8e1f992cf3bc0f84f64c859751aa2dfc283f99

Authored by Rishav
1 parent 1956e38441
Exists in master

pending user api, update company name with editable field, size according to mak…

…e modal, and some other ui changes
app/scripts/controllers.js
1 /** 1 /**
2 * acuefuel - Responsive Admin Theme 2 * acuefuel - Responsive Admin Theme
3 * 3 *
4 */ 4 */
5 5
6 /** 6 /**
7 * MainCtrl - controller 7 * MainCtrl - controller
8 */ 8 */
9 function MainCtrl($scope, $location, $state, $rootScope, LoginService) { 9 function MainCtrl($scope, $location, $state, $rootScope, LoginService) {
10 10
11 $scope.userName = 'Dylan Goodwin'; 11 $scope.userName = 'Dylan Goodwin';
12 $scope.helloText = 'Welcome in SeedProject'; 12 $scope.helloText = 'Welcome in SeedProject';
13 $scope.descriptionText = 'It is an application skeleton for a typical AngularJS web app. You can use it to quickly bootstrap your angular webapp projects and dev environment for these projects.'; 13 $scope.descriptionText = 'It is an application skeleton for a typical AngularJS web app. You can use it to quickly bootstrap your angular webapp projects and dev environment for these projects.';
14 14
15 LoginService.getActiveUser().then(function(result) {
16 $scope.pendingUser = result;
17 })
15 $scope.logout = function(){ 18 $scope.logout = function(){
16 console.log("Called") 19 console.log("Called")
17 LoginService.logout(); 20 LoginService.logout();
18 $state.go('login') 21 $state.go('login')
19 } 22 }
20 console.log($location) 23 console.log($location)
21 $rootScope.$on('$stateChangeStart', function(event, next, nextParams, fromState) { 24 $rootScope.$on('$stateChangeStart', function(event, next, nextParams, fromState) {
22 console.log(next) 25 console.log(next)
23 if(next.name == "index.fboAdmin" || next.name == "index.dashboard" || next.name == "index.updateFBO"){ 26 if(next.name == "index.fboAdmin" || next.name == "index.dashboard" || next.name == "index.updateFBO"){
24 $scope.headingName = 'FBO Admin Conductor'; 27 $scope.headingName = 'FBO Admin Conductor';
25 }else if(next.name == "index.flightDept" || next.name == "index.flight" || next.name == "index.updateFBODept"){ 28 }else if(next.name == "index.flightDept" || next.name == "index.flight" || next.name == "index.updateFBODept"){
26 $scope.headingName = 'Flight Department Admin Conductor'; 29 $scope.headingName = 'Flight Department Admin Conductor';
27 }else{ 30 }else{
28 $scope.headingName = ''; 31 $scope.headingName = '';
29 } 32 }
30 }) 33 })
31 }; 34 };
32 35
33 36
34 angular 37 angular
35 .module('acuefuel') 38 .module('acuefuel')
36 .controller('MainCtrl', MainCtrl) 39 .controller('MainCtrl', MainCtrl)
app/scripts/directives.js
1 /** 1 /**
2 * acuefuel - Responsive Admin Theme 2 * acuefuel - Responsive Admin Theme
3 * 3 *
4 */ 4 */
5 5
6 6
7 /** 7 /**
8 * pageTitle - Directive for set Page title - mata title 8 * pageTitle - Directive for set Page title - mata title
9 */ 9 */
10 function pageTitle($rootScope, $timeout) { 10 function pageTitle($rootScope, $timeout) {
11 return { 11 return {
12 link: function(scope, element) { 12 link: function(scope, element) {
13 var listener = function(event, toState, toParams, fromState, fromParams) { 13 var listener = function(event, toState, toParams, fromState, fromParams) {
14 // Default title - load on Dashboard 1 14 // Default title - load on Dashboard 1
15 var title = 'Acuefuel'; 15 var title = 'Acufuel';
16 // Create your own title pattern 16 // Create your own title pattern
17 if (toState.data && toState.data.pageTitle) title = 'INSPINIA | ' + toState.data.pageTitle; 17 if (toState.data && toState.data.pageTitle) title = 'ACUFUEL | ' + toState.data.pageTitle;
18 $timeout(function() { 18 $timeout(function() {
19 element.text(title); 19 element.text(title);
20 }); 20 });
21 }; 21 };
22 $rootScope.$on('$stateChangeStart', listener); 22 $rootScope.$on('$stateChangeStart', listener);
23 } 23 }
24 } 24 }
25 }; 25 };
26 26
27 /** 27 /**
28 * sideNavigation - Directive for run metsiMenu on sidebar navigation 28 * sideNavigation - Directive for run metsiMenu on sidebar navigation
29 */ 29 */
30 function sideNavigation($timeout) { 30 function sideNavigation($timeout) {
31 return { 31 return {
32 restrict: 'A', 32 restrict: 'A',
33 link: function(scope, element) { 33 link: function(scope, element) {
34 // Call the metsiMenu plugin and plug it to sidebar navigation 34 // Call the metsiMenu plugin and plug it to sidebar navigation
35 $timeout(function(){ 35 $timeout(function(){
36 element.metisMenu(); 36 element.metisMenu();
37 37
38 }); 38 });
39 39
40 // Colapse menu in mobile mode after click on element 40 // Colapse menu in mobile mode after click on element
41 var menuElement = $('#side-menu a:not([href$="\\#"])'); 41 var menuElement = $('#side-menu a:not([href$="\\#"])');
42 menuElement.click(function(){ 42 menuElement.click(function(){
43 if ($(window).width() < 769) { 43 if ($(window).width() < 769) {
44 $("body").toggleClass("mini-navbar"); 44 $("body").toggleClass("mini-navbar");
45 } 45 }
46 }); 46 });
47 47
48 // Enable initial fixed sidebar 48 // Enable initial fixed sidebar
49 if ($("body").hasClass('fixed-sidebar')) { 49 if ($("body").hasClass('fixed-sidebar')) {
50 var sidebar = element.parent(); 50 var sidebar = element.parent();
51 sidebar.slimScroll({ 51 sidebar.slimScroll({
52 height: '100%', 52 height: '100%',
53 railOpacity: 0.9 53 railOpacity: 0.9
54 }); 54 });
55 } 55 }
56 } 56 }
57 }; 57 };
58 }; 58 };
59 59
60 /** 60 /**
61 * iboxTools - Directive for iBox tools elements in right corner of ibox 61 * iboxTools - Directive for iBox tools elements in right corner of ibox
62 */ 62 */
63 function iboxTools($timeout) { 63 function iboxTools($timeout) {
64 return { 64 return {
65 restrict: 'A', 65 restrict: 'A',
66 scope: true, 66 scope: true,
67 templateUrl: 'views/common/ibox_tools.html', 67 templateUrl: 'views/common/ibox_tools.html',
68 controller: function ($scope, $element) { 68 controller: function ($scope, $element) {
69 // Function for collapse ibox 69 // Function for collapse ibox
70 $scope.showhide = function () { 70 $scope.showhide = function () {
71 var ibox = $element.closest('div.ibox'); 71 var ibox = $element.closest('div.ibox');
72 var icon = $element.find('i:first'); 72 var icon = $element.find('i:first');
73 var content = ibox.children('.ibox-content'); 73 var content = ibox.children('.ibox-content');
74 content.slideToggle(200); 74 content.slideToggle(200);
75 // Toggle icon from up to down 75 // Toggle icon from up to down
76 icon.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down'); 76 icon.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
77 ibox.toggleClass('').toggleClass('border-bottom'); 77 ibox.toggleClass('').toggleClass('border-bottom');
78 $timeout(function () { 78 $timeout(function () {
79 ibox.resize(); 79 ibox.resize();
80 ibox.find('[id^=map-]').resize(); 80 ibox.find('[id^=map-]').resize();
81 }, 50); 81 }, 50);
82 }, 82 },
83 // Function for close ibox 83 // Function for close ibox
84 $scope.closebox = function () { 84 $scope.closebox = function () {
85 var ibox = $element.closest('div.ibox'); 85 var ibox = $element.closest('div.ibox');
86 ibox.remove(); 86 ibox.remove();
87 } 87 }
88 } 88 }
89 }; 89 };
90 }; 90 };
91 91
92 /** 92 /**
93 * minimalizaSidebar - Directive for minimalize sidebar 93 * minimalizaSidebar - Directive for minimalize sidebar
94 */ 94 */
95 function minimalizaSidebar($timeout) { 95 function minimalizaSidebar($timeout) {
96 return { 96 return {
97 restrict: 'A', 97 restrict: 'A',
98 template: '<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="" ng-click="minimalize()"><i class="fa fa-bars"></i></a>', 98 template: '<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="" ng-click="minimalize()"><i class="fa fa-bars"></i></a>',
99 controller: function ($scope, $element) { 99 controller: function ($scope, $element) {
100 $scope.minimalize = function () { 100 $scope.minimalize = function () {
101 $("body").toggleClass("mini-navbar"); 101 $("body").toggleClass("mini-navbar");
102 if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) { 102 if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) {
103 // Hide menu in order to smoothly turn on when maximize menu 103 // Hide menu in order to smoothly turn on when maximize menu
104 $('#side-menu').hide(); 104 $('#side-menu').hide();
105 // For smoothly turn on menu 105 // For smoothly turn on menu
106 setTimeout( 106 setTimeout(
107 function () { 107 function () {
108 $('#side-menu').fadeIn(400); 108 $('#side-menu').fadeIn(400);
109 }, 200); 109 }, 200);
110 } else if ($('body').hasClass('fixed-sidebar')){ 110 } else if ($('body').hasClass('fixed-sidebar')){
111 $('#side-menu').hide(); 111 $('#side-menu').hide();
112 setTimeout( 112 setTimeout(
113 function () { 113 function () {
114 $('#side-menu').fadeIn(400); 114 $('#side-menu').fadeIn(400);
115 }, 100); 115 }, 100);
116 } else { 116 } else {
117 // Remove all inline style from jquery fadeIn function to reset menu state 117 // Remove all inline style from jquery fadeIn function to reset menu state
118 $('#side-menu').removeAttr('style'); 118 $('#side-menu').removeAttr('style');
119 } 119 }
120 } 120 }
121 } 121 }
122 }; 122 };
123 }; 123 };
124 124
125 /** 125 /**
126 * iboxTools with full screen - Directive for iBox tools elements in right corner of ibox with full screen option 126 * iboxTools with full screen - Directive for iBox tools elements in right corner of ibox with full screen option
127 */ 127 */
128 function iboxToolsFullScreen($timeout) { 128 function iboxToolsFullScreen($timeout) {
129 return { 129 return {
130 restrict: 'A', 130 restrict: 'A',
131 scope: true, 131 scope: true,
132 templateUrl: 'views/common/ibox_tools_full_screen.html', 132 templateUrl: 'views/common/ibox_tools_full_screen.html',
133 controller: function ($scope, $element) { 133 controller: function ($scope, $element) {
134 // Function for collapse ibox 134 // Function for collapse ibox
135 $scope.showhide = function () { 135 $scope.showhide = function () {
136 var ibox = $element.closest('div.ibox'); 136 var ibox = $element.closest('div.ibox');
137 var icon = $element.find('i:first'); 137 var icon = $element.find('i:first');
138 var content = ibox.children('.ibox-content'); 138 var content = ibox.children('.ibox-content');
139 content.slideToggle(200); 139 content.slideToggle(200);
140 // Toggle icon from up to down 140 // Toggle icon from up to down
141 icon.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down'); 141 icon.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
142 ibox.toggleClass('').toggleClass('border-bottom'); 142 ibox.toggleClass('').toggleClass('border-bottom');
143 $timeout(function () { 143 $timeout(function () {
144 ibox.resize(); 144 ibox.resize();
145 ibox.find('[id^=map-]').resize(); 145 ibox.find('[id^=map-]').resize();
146 }, 50); 146 }, 50);
147 }; 147 };
148 // Function for close ibox 148 // Function for close ibox
149 $scope.closebox = function () { 149 $scope.closebox = function () {
150 var ibox = $element.closest('div.ibox'); 150 var ibox = $element.closest('div.ibox');
151 ibox.remove(); 151 ibox.remove();
152 }; 152 };
153 // Function for full screen 153 // Function for full screen
154 $scope.fullscreen = function () { 154 $scope.fullscreen = function () {
155 var ibox = $element.closest('div.ibox'); 155 var ibox = $element.closest('div.ibox');
156 var button = $element.find('i.fa-expand'); 156 var button = $element.find('i.fa-expand');
157 $('body').toggleClass('fullscreen-ibox-mode'); 157 $('body').toggleClass('fullscreen-ibox-mode');
158 button.toggleClass('fa-expand').toggleClass('fa-compress'); 158 button.toggleClass('fa-expand').toggleClass('fa-compress');
159 ibox.toggleClass('fullscreen'); 159 ibox.toggleClass('fullscreen');
160 setTimeout(function() { 160 setTimeout(function() {
161 $(window).trigger('resize'); 161 $(window).trigger('resize');
162 }, 100); 162 }, 100);
163 } 163 }
164 } 164 }
165 }; 165 };
166 } 166 }
167 167
168 168
169 169
170 /** 170 /**
171 * 171 *
172 * Pass all functions into module 172 * Pass all functions into module
173 */ 173 */
174 angular 174 angular
175 .module('acuefuel') 175 .module('acuefuel')
176 .directive('pageTitle', pageTitle) 176 .directive('pageTitle', pageTitle)
177 .directive('sideNavigation', sideNavigation) 177 .directive('sideNavigation', sideNavigation)
178 .directive('iboxTools', iboxTools) 178 .directive('iboxTools', iboxTools)
179 .directive('minimalizaSidebar', minimalizaSidebar) 179 .directive('minimalizaSidebar', minimalizaSidebar)
180 .directive('iboxToolsFullScreen', iboxToolsFullScreen); 180 .directive('iboxToolsFullScreen', iboxToolsFullScreen);
181 181
app/views/common/topnavbar.html
1 <div class="row border-bottom"> 1 <div class="row border-bottom">
2 <!-- <nav class="navbar navbar-static-top white-bg" role="navigation" style="margin-bottom: 0"> 2 <!-- <nav class="navbar navbar-static-top white-bg" role="navigation" style="margin-bottom: 0">
3 <div class="navbar-header"> 3 <div class="navbar-header">
4 <span minimaliza-sidebar></span> 4 <span minimaliza-sidebar></span>
5 <h1 style="font-weight: 500;margin-left: 10px;margin-top: 12px;float: left;">FBO Admin Conductor</h1> 5 <h1 style="font-weight: 500;margin-left: 10px;margin-top: 12px;float: left;">FBO Admin Conductor</h1>
6 <form role="search" class="navbar-form-custom" method="post" action=""> 6 <form role="search" class="navbar-form-custom" method="post" action="">
7 <div class="form-group"> 7 <div class="form-group">
8 <input type="text" placeholder="Search for something..." class="form-control" name="top-search" id="top-search"> 8 <input type="text" placeholder="Search for something..." class="form-control" name="top-search" id="top-search">
9 </div> 9 </div>
10 </form> 10 </form>
11 </div> 11 </div>
12 <ul class="nav navbar-top-links navbar-right"> 12 <ul class="nav navbar-top-links navbar-right">
13 <li> 13 <li>
14 <a href=""> 14 <a href="">
15 <i class="fa fa-sign-out"></i> Log out 15 <i class="fa fa-sign-out"></i> Log out
16 </a> 16 </a>
17 </li> 17 </li>
18 </ul> 18 </ul>
19 </nav> --> 19 </nav> -->
20 <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0" ng-controller="MainCtrl"> 20 <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0" ng-controller="MainCtrl">
21 <div class="navbar-header"> 21 <div class="navbar-header">
22 <span minimaliza-sidebar></span> 22 <span minimaliza-sidebar></span>
23 <h1 style="font-weight: 500;margin-left: 10px;margin-top: 12px;float: left;">{{headingName}}</h1> 23 <h1 style="font-weight: 500;margin-left: 10px;margin-top: 12px;float: left;">{{headingName}}</h1>
24 </div> 24 </div>
25 <ul class="nav navbar-top-links navbar-right"> 25 <ul class="nav navbar-top-links navbar-right">
26 <li> 26 <li>
27 <span class="m-r-sm text-muted welcome-message">Welcome to Acufuel Elite Admin</span> 27 <span class="m-r-sm text-muted welcome-message">Welcome to Acufuel Elite Admin</span>
28 </li> 28 </li>
29 <li class="dropdown"> 29 <li class="dropdown">
30 <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#"> 30 <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
31 <i class="fa fa-cog"></i> <span class="label label-warning"></span> 31 <i class="fa fa-cog"></i> <span class="label label-warning"></span>
32 </a> 32 </a>
33 <!-- <ul class="dropdown-menu dropdown-messages"> 33 <!-- <ul class="dropdown-menu dropdown-messages">
34 <li> 34 <li>
35 <div class="dropdown-messages-box"> 35 <div class="dropdown-messages-box">
36 <a href="profile.html" class="pull-left"> 36 <a href="profile.html" class="pull-left">
37 <img alt="image" class="img-circle" src="img/a7.jpg"> 37 <img alt="image" class="img-circle" src="img/a7.jpg">
38 </a> 38 </a>
39 <div class="media-body"> 39 <div class="media-body">
40 <small class="pull-right">46h ago</small> 40 <small class="pull-right">46h ago</small>
41 <strong>Mike Loreipsum</strong> started following <strong>Monica Smith</strong>. <br> 41 <strong>Mike Loreipsum</strong> started following <strong>Monica Smith</strong>. <br>
42 <small class="text-muted">3 days ago at 7:58 pm - 10.06.2014</small> 42 <small class="text-muted">3 days ago at 7:58 pm - 10.06.2014</small>
43 </div> 43 </div>
44 </div> 44 </div>
45 </li> 45 </li>
46 <li class="divider"></li> 46 <li class="divider"></li>
47 <li> 47 <li>
48 <div class="dropdown-messages-box"> 48 <div class="dropdown-messages-box">
49 <a href="profile.html" class="pull-left"> 49 <a href="profile.html" class="pull-left">
50 <img alt="image" class="img-circle" src="img/a4.jpg"> 50 <img alt="image" class="img-circle" src="img/a4.jpg">
51 </a> 51 </a>
52 <div class="media-body "> 52 <div class="media-body ">
53 <small class="pull-right text-navy">5h ago</small> 53 <small class="pull-right text-navy">5h ago</small>
54 <strong>Chris Johnatan Overtunk</strong> started following <strong>Monica Smith</strong>. <br> 54 <strong>Chris Johnatan Overtunk</strong> started following <strong>Monica Smith</strong>. <br>
55 <small class="text-muted">Yesterday 1:21 pm - 11.06.2014</small> 55 <small class="text-muted">Yesterday 1:21 pm - 11.06.2014</small>
56 </div> 56 </div>
57 </div> 57 </div>
58 </li> 58 </li>
59 <li class="divider"></li> 59 <li class="divider"></li>
60 <li> 60 <li>
61 <div class="dropdown-messages-box"> 61 <div class="dropdown-messages-box">
62 <a href="profile.html" class="pull-left"> 62 <a href="profile.html" class="pull-left">
63 <img alt="image" class="img-circle" src="img/profile.jpg"> 63 <img alt="image" class="img-circle" src="img/profile.jpg">
64 </a> 64 </a>
65 <div class="media-body "> 65 <div class="media-body ">
66 <small class="pull-right">23h ago</small> 66 <small class="pull-right">23h ago</small>
67 <strong>Monica Smith</strong> love <strong>Kim Smith</strong>. <br> 67 <strong>Monica Smith</strong> love <strong>Kim Smith</strong>. <br>
68 <small class="text-muted">2 days ago at 2:30 am - 11.06.2014</small> 68 <small class="text-muted">2 days ago at 2:30 am - 11.06.2014</small>
69 </div> 69 </div>
70 </div> 70 </div>
71 </li> 71 </li>
72 <li class="divider"></li> 72 <li class="divider"></li>
73 <li> 73 <li>
74 <div class="text-center link-block"> 74 <div class="text-center link-block">
75 <a href="mailbox.html"> 75 <a href="mailbox.html">
76 <i class="fa fa-envelope"></i> <strong>Read All Messages</strong> 76 <i class="fa fa-envelope"></i> <strong>Read All Messages</strong>
77 </a> 77 </a>
78 </div> 78 </div>
79 </li> 79 </li>
80 </ul> --> 80 </ul> -->
81 </li> 81 </li>
82 <li class="dropdown"> 82 <li class="dropdown">
83 <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#"> 83 <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
84 <i class="fa fa-bell"></i> <span class="label label-primary">8</span> 84 <i class="fa fa-bell"></i> <span class="label label-primary">{{pendingUser}}</span>
85 </a> 85 </a>
86 <ul class="dropdown-menu dropdown-alerts"> 86 <ul class="dropdown-menu dropdown-alerts">
87 <li> 87 <li>
88 <a href="mailbox.html"> 88 <a href="mailbox.html">
89 <div> 89 <div>
90 <i class="fa fa-envelope fa-fw"></i> You have 16 messages 90 <i class="fa fa-envelope fa-fw"></i> You have 16 messages
91 <span class="pull-right text-muted small">4 minutes ago</span> 91 <span class="pull-right text-muted small">4 minutes ago</span>
92 </div> 92 </div>
93 </a> 93 </a>
94 </li> 94 </li>
95 <li class="divider"></li> 95 <li class="divider"></li>
96 <li> 96 <li>
97 <a href="profile.html"> 97 <a href="profile.html">
98 <div> 98 <div>
99 <i class="fa fa-twitter fa-fw"></i> 3 New Followers 99 <i class="fa fa-twitter fa-fw"></i> 3 New Followers
100 <span class="pull-right text-muted small">12 minutes ago</span> 100 <span class="pull-right text-muted small">12 minutes ago</span>
101 </div> 101 </div>
102 </a> 102 </a>
103 </li> 103 </li>
104 <li class="divider"></li> 104 <li class="divider"></li>
105 <li> 105 <li>
106 <a href="grid_options.html"> 106 <a href="grid_options.html">
107 <div> 107 <div>
108 <i class="fa fa-upload fa-fw"></i> Server Rebooted 108 <i class="fa fa-upload fa-fw"></i> Server Rebooted
109 <span class="pull-right text-muted small">4 minutes ago</span> 109 <span class="pull-right text-muted small">4 minutes ago</span>
110 </div> 110 </div>
111 </a> 111 </a>
112 </li> 112 </li>
113 <li class="divider"></li> 113 <li class="divider"></li>
114 <li> 114 <li>
115 <div class="text-center link-block"> 115 <div class="text-center link-block">
116 <a href="notifications.html"> 116 <a href="notifications.html">
117 <strong>See All Alerts</strong> 117 <strong>See All Alerts</strong>
118 <i class="fa fa-angle-right"></i> 118 <i class="fa fa-angle-right"></i>
119 </a> 119 </a>
120 </div> 120 </div>
121 </li> 121 </li>
122 </ul> 122 </ul>
123 </li> 123 </li>
124 124
125 125
126 <li> 126 <li>
127 <a ng-click="logout()"> 127 <a ng-click="logout()">
128 <i class="fa fa-sign-out"></i> Log out 128 <i class="fa fa-sign-out"></i> Log out
129 </a> 129 </a>
130 </li> 130 </li>
131 </ul> 131 </ul>
132 </nav> 132 </nav>
133 </div> 133 </div>
app/views/fbo-Clients/fboClient.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('fboClientsController', function($scope, $stateParams, FBOClient) { 6 .controller('fboClientsController', function($scope, $stateParams, FBOClient) {
7 $(document).ready(function(){ 7 $(document).ready(function(){
8 $('.tab-pane').slimScroll({ 8 $('.tab-pane').slimScroll({
9 height: '600px' 9 height: '600px'
10 }); 10 });
11 }); 11 });
12 $('#tab-2').css('display', 'none'); 12 $('#tab-2').css('display', 'none');
13 getAllFbo(); 13 getAllFbo();
14 function getAllFbo(){ 14 function getAllFbo(){
15 FBOClient.getALlFBOList().then(function(result) { 15 FBOClient.getALlFBOList().then(function(result) {
16 console.log(result) 16 console.log(result)
17 $scope.fboClient = result; 17 $scope.fboClient = result;
18 $scope.clientLength = result.length; 18 $scope.clientLength = result.length;
19 }) 19 })
20 } 20 }
21 21
22 $scope.searchData = function(){ 22 $scope.searchData = function(){
23 var userType = $('#tabClient > li.active > a').attr('id'); 23 var userType = $('#tabClient > li.active > a').attr('id');
24 searchClient($scope.searchQuery, userType); 24 searchClient($scope.searchQuery, userType);
25 } 25 }
26 26
27 function searchClient(searchData, userType){ 27 function searchClient(searchData, userType){
28 console.log(searchData)
29 console.log(userType) 28 console.log(userType)
30 var data = { 29 if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){
31 "query" : searchData, 30 getAllFbo();
32 "userType" : userType 31 }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){
33 } 32 $scope.fboDept();
34 FBOClient.getSearchClient(data).then(function(result) { 33 }else{
35 for(var i=0; i<result.length; i++){ 34 var data = {
36 result[i].user = []; 35 "query" : searchData,
37 result[i].user.companyName = result[i].companyName; 36 "userType" : userType
38 result[i].user.firstName = result[i].firstName;
39 result[i].user.lastName = result[i].lastName;
40 result[i].user.id = result[i].id;
41 result[i].user.account = [];
42 result[i].user.account.user = [];
43 result[i].user.account.user.status = result[i].account.user.status;
44 }
45 if(userType == 'fbo'){
46 $scope.fboClient = result;
47 console.log(result)
48 $scope.clientLength = result.length;
49 }else{
50 console.log("nai aaya")
51 $scope.fboDeptList = result;
52 $scope.clientLength = result.length;
53 } 37 }
54 }) 38 FBOClient.getSearchClient(data).then(function(result) {
39 for(var i=0; i<result.length; i++){
40 result[i].user = [];
41 result[i].user.companyName = result[i].companyName;
42 result[i].user.firstName = result[i].firstName;
43 result[i].user.lastName = result[i].lastName;
44 result[i].user.id = result[i].id;
45 result[i].user.account = [];
46 result[i].user.account.user = [];
47 result[i].user.account.user.status = result[i].account.user.status;
48 }
49 if(userType == 'fbo'){
50 $scope.fboClient = result;
51 console.log(result)
52 $scope.clientLength = result.length;
53 }else{
54 $scope.fboDeptList = result;
55 $scope.clientLength = result.length;
56 }
57 })
58 }
59
55 } 60 }
56 61
57 $scope.fboAdmin = function(){ 62 $scope.fboAdmin = function(){
58 getAllFbo(); 63 getAllFbo();
59 $('#tab-1').css('display', 'block'); 64 $('#tab-1').css('display', 'block');
60 $('#tab-2').css('display', 'none'); 65 $('#tab-2').css('display', 'none');
61 $('.customTab1').addClass('active'); 66 $('.customTab1').addClass('active');
62 $('.customTab2').removeClass('active'); 67 $('.customTab2').removeClass('active');
63 $('.slimScrollDiv:first-child').css('display', 'block'); 68 $('.slimScrollDiv:first-child').css('display', 'block');
64 69
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, 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 }); 12 });
13 13 $scope.showCompany = true;
14 $scope.userName = 'Dylan Goodwin'; 14 $scope.userName = 'Dylan Goodwin';
15 $scope.essAccountId = true; 15 $scope.essAccountId = true;
16 $("#esAccId").css({ opacity: 0.5 }); 16 $("#esAccId").css({ opacity: 0.5 });
17 $scope.user = {}; 17 $scope.user = {};
18 $scope.feature = {}; 18 $scope.feature = {};
19 $scope.feature.level = 'silver'; 19 $scope.feature.level = 'silver';
20 $scope.feature.essintaPosSystem = false; 20 $scope.feature.essintaPosSystem = false;
21 $scope.feature.acuQuote = false; 21 $scope.feature.acuQuote = false;
22 $scope.feature.acuTrack = false; 22 $scope.feature.acuTrack = false;
23 $scope.feature.fuelProgram = false; 23 $scope.feature.fuelProgram = false;
24 $scope.feature.amstatIntegration = false; 24 $scope.feature.amstatIntegration = false;
25 $scope.feature.posAccountingIntegration = false; 25 $scope.feature.posAccountingIntegration = false;
26 $scope.feature.posVeederRootIntegration = false; 26 $scope.feature.posVeederRootIntegration = false;
27 $scope.userData = function(){ 27 $scope.userData = function(){
28 console.log("daadada", $scope.feature) 28 if($scope.user.email == undefined || $scope.user.email == null){
29 29 toastr.error('Please enter your email first', {
30 closeButton: true
31 })
32 }else if($scope.user.firstName == undefined || $scope.user.firstName == null){
33 toastr.error('Please enter your First Name', {
34 closeButton: true
35 })
36 }else{
30 if($scope.status == true){ 37 if($scope.status == true){
31 $scope.user.status = 'active'; 38 $scope.user.status = 'active';
32 }else{ 39 }else{
33 $scope.user.status = 'inactive'; 40 $scope.user.status = 'inactive';
34 } 41 }
35 $scope.user.username = $scope.user.email; 42 $scope.user.username = $scope.user.email;
36 $scope.user.userType = 'fbo'; 43 $scope.user.userType = 'fbo';
37 console.log($scope.user) 44 console.log($scope.user)
38 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;
39 FBOAdmin.registerUser(formdata).then(function(result) { 46 FBOAdmin.registerUser(formdata).then(function(result) {
40 toastr.success('Created Successfully', { 47 toastr.success('Created Successfully', {
41 closeButton: true 48 closeButton: true
42 }) 49 })
43 $scope.feature.accountId = result; 50 $scope.feature.accountId = result;
44 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
45 + "&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="
46 + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration 53 + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration
47 + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; 54 + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences;
48 55
49 FBOAdmin.featureControl(featureControlData).then(function(response) { 56 FBOAdmin.featureControl(featureControlData).then(function(response) {
50 console.log(response) 57 console.log(response)
51 58
52 }) 59 })
60 $state.go('index.fboAdmin');
53 }, function (err) { 61 }, function (err) {
54 toastr.error('Error in registering', { 62 toastr.error('Error in registering', {
55 closeButton: true 63 closeButton: true
56 }) 64 })
57 }); 65 });
66 }
67
58 } 68 }
59 69
60 $scope.enableEssId = function(){ 70 $scope.enableEssId = function(){
61 if($scope.feature.essintaPosSystem == true){ 71 if($scope.feature.essintaPosSystem == true){
62 $scope.essAccountId = false; 72 $scope.essAccountId = false;
63 $("#esAccId").css({ opacity: 1 }); 73 $("#esAccId").css({ opacity: 1 });
64 }else{ 74 }else{
65 $scope.essAccountId = true; 75 $scope.essAccountId = true;
66 delete $scope.feature.essintaAccountUid; 76 delete $scope.feature.essintaAccountUid;
67 $("#esAccId").css({ opacity: 0.5 }); 77 $("#esAccId").css({ opacity: 0.5 });
68 } 78 }
69 } 79 }
70 80
81 $scope.editName = function(){
82 $scope.showCompany = false;
83
84 }
85
71 }); 86 });
app/views/fbo-admin/dashboard.html
1 </div> 1 </div>
2 <div class="row wrapper border-bottom white-bg page-heading"> 2 <div class="row wrapper border-bottom white-bg page-heading">
3 <div class="col-lg-8"> 3 <div class="col-lg-8">
4 <h2>Tellus Institute</h2> 4 <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2>
5 <div style="margin-top: 20px;" ng-hide="showCompany"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div>
5 </div> 6 </div>
6 <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> 7 <div class="col-lg-4" style="margin-top: 20px; text-align: right;">
7 <button type="button" class="btn btn-default btn-sm" ui-sref="index.fboAdmin">Cancel</button> 8 <button type="button" class="btn btn-default btn-sm" ui-sref="index.fboAdmin">Cancel</button>
8 <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> 9 <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button>
9 </div> 10 </div>
10 </div> 11 </div>
11 </div> 12 </div>
12 <div class="wrapper wrapper-content animated fadeInRight"> 13 <div class="wrapper wrapper-content animated fadeInRight">
13 <div class="row"> 14 <div class="row">
14 <div class="col-lg-7"> 15 <div class="col-lg-7">
15 <div class="ibox float-e-margins"> 16 <div class="ibox float-e-margins">
16 <div class="ibox-title"> 17 <div class="ibox-title">
17 <div class="pull-left"> 18 <div class="pull-left">
18 <h5>Contact Information</h5> 19 <h5>Contact Information</h5>
19 </div> 20 </div>
20 <div class="pull-right my-toggle-switch"> 21 <div class="pull-right my-toggle-switch">
21 <div class="switch"> 22 <div class="switch">
22 <div class="onoffswitch"> 23 <div class="onoffswitch">
23 <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> 24 <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1">
24 <label class="onoffswitch-label" for="example1"> 25 <label class="onoffswitch-label" for="example1">
25 <span class="onoffswitch-inner"></span> 26 <span class="onoffswitch-inner"></span>
26 <span class="onoffswitch-switch"></span> 27 <span class="onoffswitch-switch"></span>
27 </label> 28 </label>
28 </div> 29 </div>
29 </div> 30 </div>
30 </div> 31 </div>
31 <div class="clearfix"></div> 32 <div class="clearfix"></div>
32 </div> 33 </div>
33 <div class="ibox-content"> 34 <div class="ibox-content">
34 <div class="row"> 35 <div class="row">
35 <form role="form"> 36 <form role="form">
36 <div class="col-sm-6 b-r"> 37 <div class="col-sm-6 b-r">
37 <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> 38 <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> -->
38 <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> 39 <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div>
39 <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> 40 <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div>
40 <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> 41 <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div>
41 <!-- <div> 42 <!-- <div>
42 <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> 43 <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button>
43 <label> <input type="checkbox" class="i-checks"> Remember me </label> 44 <label> <input type="checkbox" class="i-checks"> Remember me </label>
44 </div> --> 45 </div> -->
45 46
46 </div> 47 </div>
47 <div class="col-sm-6"> 48 <div class="col-sm-6">
48 <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> 49 <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div>
49 <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div> 50 <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div>
50 <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> 51 <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div>
51 </div> 52 </div>
52 </form> 53 </form>
53 </div> 54 </div>
54 </div> 55 </div>
55 </div> 56 </div>
56 </div> 57 </div>
57 <div class="col-lg-5"> 58 <div class="col-lg-5">
58 <div class="ibox float-e-margins"> 59 <div class="ibox float-e-margins">
59 <div class="ibox-title"> 60 <div class="ibox-title">
60 <h5>Client Notes</h5> 61 <h5>Client Notes</h5>
61 62
62 </div> 63 </div>
63 <div class="ibox-content"> 64 <div class="ibox-content">
64 <div class="row"> 65 <div class="row">
65 <form role="form"> 66 <form role="form">
66 <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> 67 <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea>
67 </form> 68 </form>
68 </div> 69 </div>
69 </div> 70 </div>
70 71
71 </div> 72 </div>
72 </div> 73 </div>
73 </div> 74 </div>
74 </div> 75 </div>
75 76
76 <div class="wrapper wrapper-content animated fadeInRight"> 77 <div class="wrapper wrapper-content animated fadeInRight">
77 <div class="row"> 78 <div class="row">
78 <div class="col-lg-12"> 79 <div class="col-lg-12">
79 <div class="ibox float-e-margins"> 80 <div class="ibox float-e-margins">
80 <div class="ibox-title" style="padding: 5px 15px 5px 15px;"> 81 <div class="ibox-title" style="padding: 5px 15px 5px 15px;">
81 <div class="col-lg-8"> 82 <div class="col-lg-8">
82 <h5 style="line-height: 34px;margin-bottom: 0;">Feature Account Control</h5> 83 <h5 style="line-height: 34px;margin-bottom: 0;">Feature Account Control</h5>
83 </div> 84 </div>
84 <div class="col-lg-4"> 85 <div class="col-lg-4">
85 <div class="form-group"> 86 <div class="form-group">
86 <label class="col-sm-2 control-label" style="line-height: 34px;margin-bottom: 0;">Level</label> 87 <label class="col-sm-2 control-label" style="line-height: 34px;margin-bottom: 0;">Level</label>
87 <div class="col-sm-10"> 88 <div class="col-sm-10">
88 <select class="form-control m-b" name="account" ng-model="feature.level" style="margin-bottom: 0;"> 89 <select class="form-control m-b" name="account" ng-model="feature.level" style="margin-bottom: 0;">
89 <option value="silver" selected>Silver</option> 90 <option value="silver" selected>Silver</option>
90 <option value="gold">Gold</option> 91 <option value="gold">Gold</option>
91 </select> 92 </select>
92 </div> 93 </div>
93 </div> 94 </div>
94 </div> 95 </div>
95 <div class="clearfix"></div> 96 <div class="clearfix"></div>
96 </div> 97 </div>
97 <div class="ibox-content"> 98 <div class="ibox-content">
98 <div class="row"> 99 <div class="row">
99 <form role="form"> 100 <form role="form">
100 101
101 <div class="col-lg-3"> 102 <div class="col-lg-3">
102 <label style="color: #1ab394;">Modularized</label> 103 <label style="color: #1ab394;">Modularized</label>
103 <div> 104 <div>
104 <label> <input type="checkbox" class="i-checks" ng-change="enableEssId()" ng-model="feature.essintaPosSystem" icheck> Essinta POS system </label> 105 <label> <input type="checkbox" class="i-checks" ng-change="enableEssId()" ng-model="feature.essintaPosSystem" icheck> Essinta POS system </label>
105 </div> 106 </div>
106 <div> 107 <div>
107 <label> <input type="checkbox" class="i-checks" ng-model="feature.acuQuote" icheck> AcuQuote </label> 108 <label> <input type="checkbox" class="i-checks" ng-model="feature.acuQuote" icheck> AcuQuote </label>
108 </div> 109 </div>
109 <div> 110 <div>
110 <label> <input type="checkbox" class="i-checks" ng-model="feature.acuTrack" icheck> AcuTrack </label> 111 <label> <input type="checkbox" class="i-checks" ng-model="feature.acuTrack" icheck> AcuTrack </label>
111 </div> 112 </div>
112 <div> 113 <div>
113 <label> <input type="checkbox" class="i-checks" ng-model="feature.fuelProgram" icheck> Fuel Program </label> 114 <label> <input type="checkbox" class="i-checks" ng-model="feature.fuelProgram" icheck> Fuel Program </label>
114 </div> 115 </div>
115 <div> 116 <div>
116 <label> <input type="checkbox" class="i-checks" ng-model="feature.amstatIntegration" icheck> AMSTAT Integration </label> 117 <label> <input type="checkbox" class="i-checks" ng-model="feature.amstatIntegration" icheck> AMSTAT Integration </label>
117 </div> 118 </div>
118 <div> 119 <div>
119 <label> <input type="checkbox" class="i-checks" ng-model="feature.posAccountingIntegration" icheck> POS Accounting Integration </label> 120 <label> <input type="checkbox" class="i-checks" ng-model="feature.posAccountingIntegration" icheck> POS Accounting Integration </label>
120 </div> 121 </div>
121 <div> 122 <div>
122 <label> <input type="checkbox" class="i-checks" ng-model="feature.posVeederRootIntegration" icheck> POS VeederRoot Integration </label> 123 <label> <input type="checkbox" class="i-checks" ng-model="feature.posVeederRootIntegration" icheck> POS VeederRoot Integration </label>
123 </div> 124 </div>
124 </div> 125 </div>
125 <div class="col-lg-9" style="padding: 0;"> 126 <div class="col-lg-9" style="padding: 0;">
126 <div class="col-lg-6"> 127 <div class="col-lg-6">
127 <div class="form-group" style="margin-top: 18px;" id="esAccId"> 128 <div class="form-group" style="margin-top: 18px;" id="esAccId">
128 <label class="control-label pull-left" style="color: #1ab394;line-height: 34px;">Essinta Account UID</label> 129 <label class="control-label pull-left" style="color: #1ab394;line-height: 34px;">Essinta Account UID</label>
129 <div class="col-lg-6"> 130 <div class="col-lg-6">
130 <input type="text" placeholder="" ng-disabled="essAccountId" style="border-color: #1ab394;" class="form-control" ng-model="feature.essintaAccountUid"> 131 <input type="text" placeholder="" ng-disabled="essAccountId" style="border-color: #1ab394;" class="form-control" ng-model="feature.essintaAccountUid">
131 </div> 132 </div>
132 </div> 133 </div>
133 </div> 134 </div>
134 <div class="col-lg-6"> 135 <div class="col-lg-6">
135 <div class="form-group" style="margin-top: 18px;"> 136 <div class="form-group" style="margin-top: 18px;">
136 <label class="control-label pull-left" style="color: #ffa149;line-height: 34px;">Additional Device Licences</label> 137 <label class="control-label pull-left" style="color: #ffa149;line-height: 34px;">Additional Device Licences</label>
137 <div class="col-lg-6"> 138 <div class="col-lg-6">
138 <input type="text" placeholder="" style="border-color: #ffa149 !important;" ng-model="feature.additionalLicences" class="form-control"> 139 <input type="text" placeholder="" style="border-color: #ffa149 !important;" ng-model="feature.additionalLicences" class="form-control">
139 </div> 140 </div>
140 </div> 141 </div>
141 </div> 142 </div>
142 </div> 143 </div>
143 144
144 </form> 145 </form>
145 </div> 146 </div>
146 </div> 147 </div>
147 </div> 148 </div>
148 </div> 149 </div>
149 </div> 150 </div>
150 </div> 151 </div>
app/views/fbo-flight/flight.html
1 </div> 1 </div>
2 <div class="row wrapper border-bottom white-bg page-heading"> 2 <div class="row wrapper border-bottom white-bg page-heading">
3 <div class="col-lg-8"> 3 <div class="col-lg-8">
4 <h2>Tellus Institute</h2> 4 <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2>
5 <div style="margin-top: 20px;" ng-hide="showCompany"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div>
5 </div> 6 </div>
6 <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> 7 <div class="col-lg-4" style="margin-top: 20px; text-align: right;">
7 <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> 8 <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button>
8 <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> 9 <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button>
9 </div> 10 </div>
10 </div> 11 </div>
11 </div> 12 </div>
12 <div class="wrapper wrapper-content animated fadeInRight"> 13 <div class="wrapper wrapper-content animated fadeInRight">
13 <div class="row"> 14 <div class="row">
14 <div class="col-lg-7"> 15 <div class="col-lg-7">
15 <div class="ibox float-e-margins"> 16 <div class="ibox float-e-margins">
16 <div class="ibox-title"> 17 <div class="ibox-title">
17 <div class="pull-left"> 18 <div class="pull-left">
18 <h5>Contact Information</h5> 19 <h5>Contact Information</h5>
19 </div> 20 </div>
20 <div class="pull-right my-toggle-switch"> 21 <div class="pull-right my-toggle-switch">
21 <div class="switch"> 22 <div class="switch">
22 <div class="onoffswitch"> 23 <div class="onoffswitch">
23 <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> 24 <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1">
24 <label class="onoffswitch-label" for="example1"> 25 <label class="onoffswitch-label" for="example1">
25 <span class="onoffswitch-inner"></span> 26 <span class="onoffswitch-inner"></span>
26 <span class="onoffswitch-switch"></span> 27 <span class="onoffswitch-switch"></span>
27 </label> 28 </label>
28 </div> 29 </div>
29 </div> 30 </div>
30 </div> 31 </div>
31 <div class="clearfix"></div> 32 <div class="clearfix"></div>
32 </div> 33 </div>
33 <div class="ibox-content"> 34 <div class="ibox-content">
34 <div class="row"> 35 <div class="row">
35 <form role="form"> 36 <form role="form">
36 <div class="col-sm-6 b-r"> 37 <div class="col-sm-6 b-r">
37 <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> 38 <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> -->
38 <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> 39 <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div>
39 <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> 40 <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div>
40 <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> 41 <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div>
41 <!-- <div> 42 <!-- <div>
42 <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> 43 <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button>
43 <label> <input type="checkbox" class="i-checks"> Remember me </label> 44 <label> <input type="checkbox" class="i-checks"> Remember me </label>
44 </div> --> 45 </div> -->
45 46
46 </div> 47 </div>
47 <div class="col-sm-6"> 48 <div class="col-sm-6">
48 <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> 49 <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div>
49 <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div> 50 <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div>
50 <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> 51 <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div>
51 </div> 52 </div>
52 </form> 53 </form>
53 </div> 54 </div>
54 </div> 55 </div>
55 </div> 56 </div>
56 </div> 57 </div>
57 <div class="col-lg-5"> 58 <div class="col-lg-5">
58 <div class="ibox float-e-margins"> 59 <div class="ibox float-e-margins">
59 <div class="ibox-title"> 60 <div class="ibox-title">
60 <h5>Client Notes</h5> 61 <h5>Client Notes</h5>
61 62
62 </div> 63 </div>
63 <div class="ibox-content"> 64 <div class="ibox-content">
64 <div class="row"> 65 <div class="row">
65 <form role="form"> 66 <form role="form">
66 <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> 67 <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea>
67 </form> 68 </form>
68 </div> 69 </div>
69 </div> 70 </div>
70 71
71 </div> 72 </div>
72 </div> 73 </div>
73 </div> 74 </div>
74 </div> 75 </div>
75 76
76 <div> 77 <div>
77 <div class="row"> 78 <div class="row">
78 <div class="col-lg-7"> 79 <div class="col-lg-7">
79 <div class="ibox float-e-margins"> 80 <div class="ibox float-e-margins">
80 <div class="ibox-title"> 81 <div class="ibox-title">
81 <h5>Aircraft List</h5> 82 <h5>Aircraft List</h5>
82 <div class="pull-right"> 83 <div class="pull-right">
83 <button type="button" class="btn btn-primary btn-sm" ng-click="openModal()">+ Add</button> 84 <button type="button" class="btn btn-primary btn-sm" ng-click="openModal()">+ Add</button>
84 </div> 85 </div>
85 <div class="clearfix"></div> 86 <div class="clearfix"></div>
86 <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> 87 <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true">
87 <div class="modal-dialog"> 88 <div class="modal-dialog">
88 <div class="modal-content animated fadeIn"> 89 <div class="modal-content animated fadeIn">
89 <div class="modal-header"> 90 <div class="modal-header">
90 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 91 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
91 <!-- <i class="fa fa-clock-o modal-icon"></i> --> 92 <!-- <i class="fa fa-clock-o modal-icon"></i> -->
92 <h4 class="modal-title">Add Aircraft</h4> 93 <h4 class="modal-title">Add Aircraft</h4>
93 <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> 94 <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> -->
94 </div> 95 </div>
95 <div class="modal-body" style="padding: 15px;"> 96 <div class="modal-body" style="padding: 15px;">
96 <table class="table table-bordered table-hover table-striped"> 97 <table class="table table-bordered table-hover table-striped">
97 <thead> 98 <thead>
98 <tr> 99 <tr>
99 <th>Tail</th> 100 <th>Tail</th>
100 <th>Make</th> 101 <th>Make</th>
101 <th>Model</th> 102 <th>Model</th>
102 <th>Size</th> 103 <th>Size</th>
103 </tr> 104 </tr>
104 </thead> 105 </thead>
105 <tbody> 106 <tbody>
106 <tr> 107 <tr>
107 <td> 108 <td>
108 <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> 109 <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control">
109 </td> 110 </td>
110 <td style="width: 30%"> 111 <td style="width: 30%">
111 <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> 112 <select class="form-control" ng-model="aircraft.make" ng-change="getModal()">
112 <option ng-repeat="make in aircraftMakeList">{{make}}</option> 113 <option ng-repeat="make in aircraftMakeList">{{make}}</option>
113 </select> 114 </select>
114 </td> 115 </td>
115 <td style="width: 30%"> 116 <td style="width: 30%">
116 <select class="form-control"> 117 <select class="form-control" ng-model="aircraft.model" ng-change="getSize()">
117 <option ng-repeat="model in aircraftModalList" ng-model="aircraft.model">{{model}}</option> 118 <option ng-repeat="model in aircraftModalList">{{model}}</option>
118 </select> 119 </select>
119 </td> 120 </td>
120 <td style="width: 30%"> 121 <td style="width: 30%">
121 <select class="form-control"> 122 <select class="form-control" ng-model="aircraft.size">
122 <option ng-repeat="size in aircraftSizeList" ng-model="aircraft.size">{{size}}</option> 123 <option ng-repeat="size in aircraftSizeList">{{size}}</option>
123 </select> 124 </select>
124 </td> 125 </td>
125 </tr> 126 </tr>
126 </tbody> 127 </tbody>
127 </table> 128 </table>
128 </div> 129 </div>
129 <div class="modal-footer"> 130 <div class="modal-footer">
130 <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> 131 <button type="button" class="btn btn-white" data-dismiss="modal">Close</button>
131 <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> 132 <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button>
132 </div> 133 </div>
133 </div> 134 </div>
134 </div> 135 </div>
135 </div> 136 </div>
136 </div> 137 </div>
137 <div class="ibox-content"> 138 <div class="ibox-content">
138 <div class="table-responsive"> 139 <div class="table-responsive">
139 <table class="table table-bordered table-hover table-striped"> 140 <table class="table table-bordered table-hover table-striped">
140 <thead> 141 <thead>
141 <tr> 142 <tr>
142 <th>Tail</th> 143 <th>Tail</th>
143 <th>Make</th> 144 <th>Make</th>
144 <th>Model</th> 145 <th>Model</th>
145 <th>Size</th> 146 <th>Size</th>
146 </tr> 147 </tr>
147 </thead> 148 </thead>
148 <tbody> 149 <tbody>
149 <tr ng-repeat="airData in getCraftList track by $index"> 150 <tr ng-repeat="airData in getCraftList track by $index">
150 <td> 151 <td>
151 <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> 152 <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control">
152 </td> 153 </td>
153 <td> 154 <td>
154 <select class="form-control" ng-model="airData.make"> 155 <select class="form-control" ng-model="airData.make">
155 <option>{{airData.make}}</option> 156 <option>{{airData.make}}</option>
156 </select> 157 </select>
157 </td> 158 </td>
158 <td> 159 <td>
159 <select class="form-control" ng-model="airData.model"> 160 <select class="form-control" ng-model="airData.model">
160 <option>{{airData.model}}</option> 161 <option>{{airData.model}}</option>
161 </select> 162 </select>
162 </td> 163 </td>
163 <td> 164 <td>
164 <select class="form-control" ng-model="airData.size"> 165 <select class="form-control" ng-model="airData.size">
165 <option>{{airData.size}}</option> 166 <option>{{airData.size}}</option>
166 </select> 167 </select>
167 </td> 168 </td>
168 </tr> 169 </tr>
169 </tbody> 170 </tbody>
170 </table> 171 </table>
171 </div> 172 </div>
172 <div class="clearfix"></div> 173 <div class="clearfix"></div>
173 </div> 174 </div>
174 </div> 175 </div>
175 </div> 176 </div>
176 <div class="col-lg-5"> 177 <div class="col-lg-5">
177 <div class="ibox float-e-margins"> 178 <div class="ibox float-e-margins">
178 <div class="ibox-title"> 179 <div class="ibox-title">
179 <h5>Account Authenticatio & Payment Method</h5> 180 <h5>Account Authenticatio & Payment Method</h5>
180 181
181 </div> 182 </div>
182 <div class="ibox-content"> 183 <div class="ibox-content">
183 <!-- <div class="row"> 184 <!-- <div class="row">
184 <div class="col-md-3"> 185 <div class="col-md-3">
185 <img src="images/master.png"> 186 <img src="images/master.png">
186 </div> 187 </div>
187 <div class="col-md-9"> 188 <div class="col-md-9">
188 <div class="col"> 189 <div class="col">
189 <span style="font-size: large; color: #909394;">**** **** **** 7002</span> 190 <span style="font-size: large; color: #909394;">**** **** **** 7002</span>
190 </div> 191 </div>
191 <div class="col"> 192 <div class="col">
192 <span><strong>Expiry Date:</strong>10/16</span> 193 <span><strong>Expiry Date:</strong>10/16</span>
193 </div> 194 </div>
194 </div> 195 </div>
195 <div class="clearfix"></div> 196 <div class="clearfix"></div>
196 <br> 197 <br>
197 198
198 <div class="col-md-3"> 199 <div class="col-md-3">
199 <img src="images/visa1.png"> 200 <img src="images/visa1.png">
200 </div> 201 </div>
201 <div class="col-md-9"> 202 <div class="col-md-9">
202 <div class="col"> 203 <div class="col">
203 <span style="font-size: large; color: #909394;">**** **** **** 1060</span> 204 <span style="font-size: large; color: #909394;">**** **** **** 1060</span>
204 </div> 205 </div>
205 <div class="col"> 206 <div class="col">
206 <span><strong>Expiry Date:</strong>10/16</span> 207 <span><strong>Expiry Date:</strong>10/16</span>
207 </div> 208 </div>
208 </div> 209 </div>
209 <div class="clearfix"></div> 210 <div class="clearfix"></div>
210 </div> --> 211 </div> -->
211 212
212 213
213 <div class="row"> 214 <div class="row">
214 215
215 <!-- <form name="myForm"> 216 <!-- <form name="myForm">
216 217
217 <div class="span3"> 218 <div class="span3">
218 <label for="">Card number</label> 219 <label for="">Card number</label>
219 <input type="text" class="form-control" ng-model="number"> 220 <input type="text" class="form-control" ng-model="number">
220 </div> 221 </div>
221 222
222 <div class="span3"> 223 <div class="span3">
223 <label for="">Name on card </label> 224 <label for="">Name on card </label>
224 <input type="text" class="form-control"> 225 <input type="text" class="form-control">
225 </div> 226 </div>
226 227
227 <div class="row"> 228 <div class="row">
228 <div class="col-sm-6"> 229 <div class="col-sm-6">
229 <label for="">Expiry</label> 230 <label for="">Expiry</label>
230 <input type="text" class="form-control" ng-model="expiry"> 231 <input type="text" class="form-control" ng-model="expiry">
231 </div> 232 </div>
232 233
233 <div class="col-sm-6"> 234 <div class="col-sm-6">
234 <label for="">CVV</label> 235 <label for="">CVV</label>
235 <input type="text" class="form-control" ng-model="cvc"> 236 <input type="text" class="form-control" ng-model="cvc">
236 </div> 237 </div>
237 </div> 238 </div>
238 <div class="span4"> 239 <div class="span4">
239 <button type="submit" class="btn btn-primary btn-large">Add</button> 240 <button type="submit" class="btn btn-primary btn-large">Add</button>
240 </div> 241 </div>
241 242
242 </form> --> 243 </form> -->
243 244
244 <div class="container"> 245 <div class="container">
245 <div class="row"> 246 <div class="row">
246 <div class="col-xs-12 col-md-4"> 247 <div class="col-xs-12 col-md-4">
247 <div class="panel panel-default credit-card-box"> 248 <div class="panel panel-default credit-card-box">
248 <div class="panel-heading display-table" > 249 <div class="panel-heading display-table" >
249 <div class="row display-tr" > 250 <div class="row display-tr" >
250 <h3 class="panel-title display-td" >Payment Details</h3> 251 <h3 class="panel-title display-td" >Payment Details</h3>
251 <div class="display-td" > 252 <div class="display-td" >
252 <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> 253 <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png">
253 </div> 254 </div>
254 </div> 255 </div>
255 </div> 256 </div>
256 <div class="panel-body"> 257 <div class="panel-body">
257 <form role="form" id="payment-form"> 258 <form role="form" id="payment-form">
258 <div class="row"> 259 <div class="row">
259 <div class="col-xs-12"> 260 <div class="col-xs-12">
260 <div class="form-group"> 261 <div class="form-group">
261 <label for="cardNumber">CARD NUMBER</label> 262 <label for="cardNumber">CARD NUMBER</label>
262 <div class="input-group"> 263 <div class="input-group">
263 <input type="number" ng-model="data.cardNumber" maxlength="16" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardNumber" placeholder="Valid Card Number" autocomplete="cc-number" required autofocus> 264 <input type="number" ng-model="data.cardNumber" maxlength="16" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardNumber" placeholder="Valid Card Number" autocomplete="cc-number" required autofocus>
264 <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> 265 <span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
265 </div> 266 </div>
266 </div> 267 </div>
267 </div> 268 </div>
268 </div> 269 </div>
269 <div class="row"> 270 <div class="row">
270 <div class="col-xs-7 col-md-7"> 271 <div class="col-xs-7 col-md-7">
271 <div class="form-group"> 272 <div class="form-group">
272 <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> 273 <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label>
273 <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" 274 <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp"
274 required> 275 required>
275 </div> 276 </div>
276 </div> 277 </div>
277 <div class="col-xs-5 col-md-5 pull-right"> 278 <div class="col-xs-5 col-md-5 pull-right">
278 <div class="form-group"> 279 <div class="form-group">
279 <label for="cardCVC">CVV CODE</label> 280 <label for="cardCVC">CVV CODE</label>
280 <input type="number" maxlength="3" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardCVC" placeholder="CVC" autocomplete="cc-csc" 281 <input type="number" maxlength="3" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardCVC" placeholder="CVC" autocomplete="cc-csc"
281 required> 282 required>
282 </div> 283 </div>
283 </div> 284 </div>
284 </div> 285 </div>
285 <div class="row"> 286 <div class="row">
286 <div class="col-xs-12"> 287 <div class="col-xs-12">
287 <div class="form-group"> 288 <div class="form-group">
288 <label for="name">Card Type</label> 289 <label for="name">Card Type</label>
289 <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> 290 <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;">
290 <option value="creditCard" selected>Credit Card</option> 291 <option value="creditCard" selected>Credit Card</option>
291 <option value="debitCard">Debit Card</option> 292 <option value="debitCard">Debit Card</option>
292 </select> 293 </select>
293 </div> 294 </div>
294 </div> 295 </div>
295 </div> 296 </div>
296 <div class="row"> 297 <div class="row">
297 <div class="col-xs-12"> 298 <div class="col-xs-12">
298 <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="addCard()">Add</button> 299 <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="addCard()">Add</button>
299 </div> 300 </div>
300 </div> 301 </div>
301 <div class="row" style="display:none;"> 302 <div class="row" style="display:none;">
302 <div class="col-xs-12"> 303 <div class="col-xs-12">
303 <p class="payment-errors"></p> 304 <p class="payment-errors"></p>
304 </div> 305 </div>
305 </div> 306 </div>
306 </form> 307 </form>
307 </div> 308 </div>
308 </div> 309 </div>
309 </div> 310 </div>
310 </div> 311 </div>
311 </div> 312 </div>
312 </div> 313 </div>
313 </div> 314 </div>
314 </div> 315 </div>
315 </div> 316 </div>
316 </div> 317 </div>
317 </div> 318 </div>
318 </div> 319 </div>
319 <script type="text/javascript" src="https://js.stripe.com/v2/"></script> 320 <script type="text/javascript" src="https://js.stripe.com/v2/"></script>
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 $scope.showCompany = true;
8 $scope.editName = function(){
9 $scope.showCompany = false;
10
11 }
7 $scope.data = {}; 12 $scope.data = {};
8 $scope.user = {}; 13 $scope.user = {};
9 $scope.aircraft = {}; 14 $scope.aircraft = {};
10 $scope.userData = function(){ 15 $scope.userData = function(){
16 if($scope.user.email == undefined || $scope.user.email == null){
17 toastr.error('Please enter your email first', {
18 closeButton: true
19 })
20 }else if($scope.user.firstName == undefined || $scope.user.firstName == null){
21 toastr.error('Please enter your First Name', {
22 closeButton: true
23 })
24 }else{
11 if($scope.status == true){ 25 if($scope.status == true){
12 $scope.user.status = 'active'; 26 $scope.user.status = 'active';
13 }else{ 27 }else{
14 $scope.user.status = 'inactive'; 28 $scope.user.status = 'inactive';
15 } 29 }
16 $scope.user.username = $scope.user.email; 30 $scope.user.username = $scope.user.email;
17 $scope.user.userType = 'flightDetp'; 31 $scope.user.userType = 'flightDetp';
18 console.log($scope.user) 32 console.log($scope.user)
19 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; 33 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;
20 FBOFlight.registerUser(formdata).then(function(result) { 34 FBOFlight.registerUser(formdata).then(function(result) {
21 $scope.registerId = result; 35 $scope.registerId = result;
22 $scope.data.accountId = $scope.registerId; 36 $scope.data.accountId = $scope.registerId;
23 $scope.aircraft.accountId = $scope.registerId; 37 $scope.aircraft.accountId = $scope.registerId;
24 toastr.success('Created Successfully', { 38 toastr.success('Created Successfully', {
25 closeButton: true 39 closeButton: true
26 }) 40 })
41 $state.go('index.flightDept');
27 }, function (err) { 42 }, function (err) {
28 toastr.error('Error in registering', { 43 toastr.error('Error in registering', {
29 closeButton: true 44 closeButton: true
30 }) 45 })
31 }); 46 });
47 }
32 } 48 }
33 49
34 $scope.data.cardType = 'creditCard'; 50 $scope.data.cardType = 'creditCard';
35 var cardData = {} 51 var cardData = {}
36 cardData.paymentMethodList = []; 52 cardData.paymentMethodList = [];
37 $scope.addCard = function(){ 53 $scope.addCard = function(){
38 if($scope.aircraft.accountId == undefined){ 54 if($scope.aircraft.accountId == undefined){
39 toastr.error('Please Add Contact Information', { 55 toastr.error('Please Add Contact Information', {
40 closeButton: true 56 closeButton: true
41 }) 57 })
42 }else{ 58 }else{
43 cardData.paymentMethodList.push($scope.data); 59 cardData.paymentMethodList.push($scope.data);
44 console.log("cardData", cardData); 60 console.log("cardData", cardData);
45 FBOFlight.addCardInformation(cardData).then(function(result) { 61 FBOFlight.addCardInformation(cardData).then(function(result) {
46 console.log(result) 62 console.log(result)
47 toastr.success('Created Successfully', { 63 toastr.success('Created Successfully', {
48 closeButton: true 64 closeButton: true
49 }) 65 })
50 }) 66 })
51 } 67 }
52 68
53 } 69 }
54 70
55 getData(); 71 getData();
56 function getData(){ 72 function getData(){
57 FBOFlight.getAircraftMake().then(function(result) { 73 FBOFlight.getAircraftMake().then(function(result) {
58 $scope.aircraftMakeList = result; 74 $scope.aircraftMakeList = result;
59 $scope.aircraft.make = $scope.aircraftMakeList[0]; 75 $scope.aircraft.make = $scope.aircraftMakeList[0];
60 FBOFlight.getModal($scope.aircraft.make).then(function(result) { 76 FBOFlight.getModal($scope.aircraft.make).then(function(result) {
61 $scope.aircraftModalList = result; 77 $scope.aircraftModalList = result;
62 $scope.aircraft.model = $scope.aircraftModalList[0]; 78 $scope.aircraft.model = $scope.aircraftModalList[0];
63 79 FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
80 $scope.aircraftSizeList = result;
81 $scope.aircraft.size = $scope.aircraftSizeList[0];
82 })
64 }) 83 })
65 84
66 }) 85 })
67
68 FBOFlight.getAircraftSize().then(function(result) {
69 $scope.aircraftSizeList = result;
70 $scope.aircraft.size = $scope.aircraftSizeList[0];
71
72 })
73 } 86 }
74 87
75 88
76 $scope.getModal = function(){ 89 $scope.getModal = function(){
77 var modelId = $scope.aircraft.make 90 var makeId = $scope.aircraft.make;
78 FBOFlight.getModal(modelId).then(function(result) { 91 FBOFlight.getModal(makeId).then(function(result) {
79 $scope.aircraftModalList = result; 92 $scope.aircraftModalList = result;
80 $scope.aircraft.model = $scope.aircraftModalList[0]; 93 $scope.aircraft.model = $scope.aircraftModalList[0];
81 94 FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) {
95 $scope.aircraftSizeList = result;
96 $scope.aircraft.size = $scope.aircraftSizeList[0];
97 })
98 })
99 }
100
101 $scope.getSize = function(){
102 FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
103 $scope.aircraftSizeList = result;
104 $scope.aircraft.size = $scope.aircraftSizeList[0];
82 }) 105 })
83 } 106 }
84 107
85 $scope.openModal = function(){ 108 $scope.openModal = function(){
86 if($scope.aircraft.accountId == undefined){ 109 if($scope.aircraft.accountId == undefined){
87 toastr.error('Please Add Contact Information', { 110 toastr.error('Please Add Contact Information', {
88 closeButton: true 111 closeButton: true
89 }) 112 })
90 $('#myModal4').modal('hide'); 113 $('#myModal4').modal('show');
91 }else{ 114 }else{
92 $('#myModal4').modal('show'); 115 $('#myModal4').modal('show');
93 } 116 }
94 117
95 } 118 }
96 $scope.aircraftData = {}; 119 $scope.aircraftData = {};
97 $scope.aircraftData.aircraftList = []; 120 $scope.aircraftData.aircraftList = [];
98 $scope.getCraftList = []; 121 $scope.getCraftList = [];
99 $scope.addAircraft = function(){ 122 $scope.addAircraft = function(){
100 console.log($scope.aircraft.accountId)
101 $scope.aircraftData.aircraftList.push($scope.aircraft); 123 $scope.aircraftData.aircraftList.push($scope.aircraft);
102 console.log($scope.aircraftData.aircraftList)
103 if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { 124 if ($scope.getCraftList.indexOf($scope.aircraft) == -1) {
104 $scope.getCraftList.push($scope.aircraft); 125 $scope.getCraftList.push($scope.aircraft);
105
106 } 126 }
107 127
108 FBOFlight.addAircraft($scope.aircraftData).then(function(result) { 128 FBOFlight.addAircraft($scope.aircraftData).then(function(result) {
109 $('#myModal4').modal('hide'); 129 $('#myModal4').modal('hide');
110 $scope.reset(); 130 $scope.reset();
111 toastr.success('Created Successfully', { 131 toastr.success('Created Successfully', {
112 closeButton: true 132 closeButton: true
113 }) 133 })
114 }) 134 }, function (err) {
135 toastr.error('Error in Adding Aircraft', {
136 closeButton: true
137 })
138 $('#myModal4').modal('hide');
139 $scope.getCraftList.splice($scope.aircraft);
140 });
115 141
app/views/fbo-flight/flightDeptService.js
1 (function() { 1 (function() {
2 'use strict'; 2 'use strict';
3 3
4 angular.module('acuefuel') 4 angular.module('acuefuel')
5 .service('FBOFlight', ['$rootScope', '$q', '$http', 'BE', FBOFlight]) 5 .service('FBOFlight', ['$rootScope', '$q', '$http', 'BE', FBOFlight])
6 6
7 function FBOFlight($rootScope, $q, $http, BE) { 7 function FBOFlight($rootScope, $q, $http, BE) {
8 8
9 this.registerUser = function(data) { 9 this.registerUser = function(data) {
10 10
11 var deferred = $q.defer(); 11 var deferred = $q.defer();
12 $http({ 12 $http({
13 method : 'POST', 13 method : 'POST',
14 url : BE.url +'/account/user/registration', 14 url : BE.url +'/account/user/registration',
15 headers : {'Content-Type': 'application/x-www-form-urlencoded'}, 15 headers : {'Content-Type': 'application/x-www-form-urlencoded'},
16 data : data 16 data : data
17 }) 17 })
18 .success(function(result) { 18 .success(function(result) {
19 deferred.resolve(result); 19 deferred.resolve(result);
20 }).error(function(error){ 20 }).error(function(error){
21 deferred.reject(error); 21 deferred.reject(error);
22 }) 22 })
23 return deferred.promise; 23 return deferred.promise;
24 } 24 }
25 25
26 this.addCardInformation = function(data) { 26 this.addCardInformation = function(data) {
27 27
28 var deferred = $q.defer(); 28 var deferred = $q.defer();
29 $http({ 29 $http({
30 method : 'POST', 30 method : 'POST',
31 url : BE.url +'/account/user/addPaymentMethods', 31 url : BE.url +'/account/user/addPaymentMethods',
32 headers : {'Content-Type': 'application/json'}, 32 headers : {'Content-Type': 'application/json'},
33 data : data 33 data : data
34 }) 34 })
35 .success(function(result) { 35 .success(function(result) {
36 deferred.resolve(result); 36 deferred.resolve(result);
37 }) 37 })
38 return deferred.promise; 38 return deferred.promise;
39 } 39 }
40 40
41 this.getAircraftMake = function(){ 41 this.getAircraftMake = function(){
42 var deferred = $q.defer(); 42 var deferred = $q.defer();
43 $http({ 43 $http({
44 method : 'GET', 44 method : 'GET',
45 url : BE.url +'/fuelerlinx/acufuel/getAircraftMake', 45 url : BE.url +'/fuelerlinx/acufuel/getAircraftMake',
46 headers : {'Content-Type': 'application/json'}, 46 headers : {'Content-Type': 'application/json'},
47 }) 47 })
48 .success(function(result) { 48 .success(function(result) {
49 deferred.resolve(result); 49 deferred.resolve(result);
50 }) 50 })
51 return deferred.promise; 51 return deferred.promise;
52 } 52 }
53 53
54 this.getAircraftSize = function(){ 54 this.getAircraftSize = function(makeId, modelId){
55 var deferred = $q.defer(); 55 var deferred = $q.defer();
56 $http({ 56 $http({
57 method : 'GET', 57 method : 'GET',
58 url : BE.url +'/fuelerlinx/acufuel/getAircraftSize', 58 url : BE.url +'/fuelerlinx/acufuel/getAircraftSize/' +makeId + '/' +modelId,
59 headers : {'Content-Type': 'application/json'}, 59 headers : {'Content-Type': 'application/json'},
60 }) 60 })
61 .success(function(result) { 61 .success(function(result) {
62 deferred.resolve(result); 62 deferred.resolve(result);
63 }) 63 })
64 return deferred.promise; 64 return deferred.promise;
65 } 65 }
66 66
67 this.getModal = function(id){ 67 this.getModal = function(id){
68 var deferred = $q.defer(); 68 var deferred = $q.defer();
69 $http({ 69 $http({
70 method : 'GET', 70 method : 'GET',
71 url : BE.url +'/fuelerlinx/acufuel/getAircraftModel/' + id, 71 url : BE.url +'/fuelerlinx/acufuel/getAircraftModel/' + id,
72 headers : {'Content-Type': 'application/json'}, 72 headers : {'Content-Type': 'application/json'},
73 }) 73 })
74 .success(function(result) { 74 .success(function(result) {
75 deferred.resolve(result); 75 deferred.resolve(result);
76 }) 76 })
77 return deferred.promise; 77 return deferred.promise;
78 } 78 }
79 79
80 this.addAircraft = function(data){ 80 this.addAircraft = function(data){
81 var deferred = $q.defer(); 81 var deferred = $q.defer();
82 $http({ 82 $http({
83 method : 'POST', 83 method : 'POST',
84 url : BE.url +'/account/user/addAircraft', 84 url : BE.url +'/account/user/addAircraft',
85 headers : {'Content-Type': 'application/json'}, 85 headers : {'Content-Type': 'application/json'},
86 data: data 86 data: data
87 }) 87 })
88 .success(function(result) { 88 .success(function(result) {
89 deferred.resolve(result); 89 deferred.resolve(result);
90 }).error(function(error) {
91 deferred.reject(error);
90 }) 92 })
91 return deferred.promise; 93 return deferred.promise;
92 } 94 }
93 } 95 }
94 96
95 })(); 97 })();
app/views/flightDept/flightDeptController.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, $stateParams, FBOClient) { 6 .controller('flightDeptController', function($scope, $stateParams, FBOClient) {
7 $(document).ready(function(){ 7 $(document).ready(function(){
8 $('.tab-pane').slimScroll({ 8 $('.tab-pane').slimScroll({
9 height: '600px' 9 height: '600px'
10 }); 10 });
11 }); 11 });
12 //$('#tab-2').css('display', 'none'); 12 //$('#tab-2').css('display', 'none');
13 getAllFbo(); 13 getAllFbo();
14 function getAllFbo(){ 14 function getAllFbo(){
15 FBOClient.getAllFlightDeptList().then(function(result) { 15 FBOClient.getAllFlightDeptList().then(function(result) {
16 console.log(result) 16 console.log(result)
17 $scope.fboDeptList = result; 17 $scope.fboDeptList = result;
18 $scope.clientLength = result.length; 18 $scope.clientLength = result.length;
19 $('#tab-1').css('display', 'none'); 19 $('#tab-1').css('display', 'none');
20 $('#tab-2').css('display', 'block'); 20 $('#tab-2').css('display', 'block');
21 $('.customTab2').addClass('active'); 21 $('.customTab2').addClass('active');
22 $('.customTab1').removeClass('active'); 22 $('.customTab1').removeClass('active');
23 $('.slimScrollDiv:first-child').css('display', 'none'); 23 $('.slimScrollDiv:first-child').css('display', 'none');
24 }) 24 })
25 } 25 }
26 26
27 $scope.searchData = function(){ 27 $scope.searchData = function(){
28 var userType = $('#tabClient > li.active > a').attr('id'); 28 var userType = $('#tabClient > li.active > a').attr('id');
29 searchClient($scope.searchQuery, userType); 29 searchClient($scope.searchQuery, userType);
30 } 30 }
31 31
32 function searchClient(searchData, userType){ 32 function searchClient(searchData, userType){
33 console.log(searchData) 33 console.log(searchData)
34 console.log(userType) 34 console.log(userType)
35 var data = { 35 if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){
36 "query" : searchData, 36 $scope.fboAdmin();
37 "userType" : userType 37 }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){
38 } 38 getAllFbo();
39 FBOClient.getSearchClient(data).then(function(result) { 39 }else{
40 for(var i=0; i<result.length; i++){ 40 var data = {
41 result[i].user = []; 41 "query" : searchData,
42 result[i].user.companyName = result[i].companyName; 42 "userType" : userType
43 result[i].user.firstName = result[i].firstName;
44 result[i].user.lastName = result[i].lastName;
45 result[i].user.id = result[i].id;
46 result[i].user.account = [];
47 result[i].user.account.user = [];
48 result[i].user.account.user.status = result[i].account.user.status;
49 }
50 if(userType == 'fbo'){
51 $scope.fboClient = result;
52 console.log(result)
53 $scope.clientLength = result.length;
54 }else{
55 console.log("nai aaya")
56 $scope.fboDeptList = result;
57 $scope.clientLength = result.length;
58 } 43 }
59 }) 44 FBOClient.getSearchClient(data).then(function(result) {
45 for(var i=0; i<result.length; i++){
46 result[i].user = [];
47 result[i].user.companyName = result[i].companyName;
48 result[i].user.firstName = result[i].firstName;
49 result[i].user.lastName = result[i].lastName;
50 result[i].user.id = result[i].id;
51 result[i].user.account = [];
52 result[i].user.account.user = [];
53 result[i].user.account.user.status = result[i].account.user.status;
54 }
55 if(userType == 'fbo'){
56 $scope.fboClient = result;
57 console.log(result)
58 $scope.clientLength = result.length;
59 }else{
60 console.log("nai aaya")
61 $scope.fboDeptList = result;
62 $scope.clientLength = result.length;
63 }
64 })
65 }
60 } 66 }
61 67
62 $scope.fboAdmin = function(){ 68 $scope.fboAdmin = function(){
63 FBOClient.getALlFBOList().then(function(result) { 69 FBOClient.getALlFBOList().then(function(result) {
64 console.log(result) 70 console.log(result)
65 $scope.fboClient = result; 71 $scope.fboClient = result;
app/views/login/login.service.js
1 (function() { 1 (function() {
2 'use strict'; 2 'use strict';
3 3
4 angular.module('acuefuel') 4 angular.module('acuefuel')
5 .service('LoginService', ['$rootScope', '$q', '$http', 'BE', '$state', LoginService]) 5 .service('LoginService', ['$rootScope', '$q', '$http', 'BE', '$state', LoginService])
6 6
7 function LoginService($rootScope, $q, $http, BE, $state) { 7 function LoginService($rootScope, $q, $http, BE, $state) {
8 8
9 this.loginUser = function(data) { 9 this.loginUser = function(data) {
10 10
11 var deferred = $q.defer(); 11 var deferred = $q.defer();
12 $http({ 12 $http({
13 method : 'POST', 13 method : 'POST',
14 url : BE.url +'/login', 14 url : BE.url +'/login',
15 headers : {'Content-Type': 'application/x-www-form-urlencoded'}, 15 headers : {'Content-Type': 'application/x-www-form-urlencoded'},
16 data : data 16 data : data
17 }) 17 })
18 .success(function(result) { 18 .success(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.authenticate = function() { 24 this.authenticate = function() {
25 var deferred = $q.defer(); 25 var deferred = $q.defer();
26 $http({ 26 $http({
27 method : 'GET', 27 method : 'GET',
28 url : BE.url+'/user/authenticate', 28 url : BE.url+'/user/authenticate',
29 headers : {'Content-Type': 'application/x-www-form-urlencoded'} 29 headers : {'Content-Type': 'application/x-www-form-urlencoded'}
30 }).then(function (result){ 30 }).then(function (result){
31 console.log(result) 31 console.log(result)
32 if(result.data.user.admin == true){ 32 if(result.data.user.admin == true){
33 window.localStorage.setItem('loginId', result.data.id); 33 window.localStorage.setItem('loginId', result.data.id);
34 window.localStorage.setItem('loginData', JSON.stringify(result.data.userProfile)); 34 window.localStorage.setItem('loginData', JSON.stringify(result.data.userProfile));
35 $state.go('index.fboAdmin'); 35 $state.go('index.fboAdmin');
36 }else{ 36 }else{
37 localStorage.clear(); 37 localStorage.clear();
38 toastr.info("Unauthorized"); 38 toastr.info("Unauthorized");
39 } 39 }
40 deferred.resolve(result.data); 40 deferred.resolve(result.data);
41 },function (result){ 41 },function (result){
42 deferred.resolve(result.data); 42 deferred.resolve(result.data);
43 }); 43 });
44 return deferred.promise; 44 return deferred.promise;
45 } 45 }
46 46
47 this.setAuth = function(data) { 47 this.setAuth = function(data) {
48 localStorage.setItem('loginStatus', data); 48 localStorage.setItem('loginStatus', data);
49 } 49 }
50 50
51 this.logout = function(data) { 51 this.logout = function(data) {
52 52
53 var deferred = $q.defer(); 53 var deferred = $q.defer();
54 $http({ 54 $http({
55 method : 'POST', 55 method : 'POST',
56 url : BE.url +'/logout', 56 url : BE.url +'/logout',
57 headers : {'Content-Type': 'application/x-www-form-urlencoded'}, 57 headers : {'Content-Type': 'application/x-www-form-urlencoded'},
58 data : data 58 data : data
59 }) 59 })
60 .success(function(result) { 60 .success(function(result) {
61 deferred.resolve(result.data); 61 deferred.resolve(result.data);
62 }) 62 })
63 return deferred.promise; 63 return deferred.promise;
64 } 64 }
65
66 this.getActiveUser = function() {
67
68 var deferred = $q.defer();
69 $http({
70 method : 'GET',
71 url : BE.url +'/user/waitingForAuth/',
72 headers : {'Content-Type': 'application/json'}
73 })
74 .success(function(result) {
75 deferred.resolve(result);
76 })
77 return deferred.promise;
78 }
65 } 79 }
66 80
67 })(); 81 })();
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, UpdateAllFBO) { 6 .controller('updateAllFBOController', function($scope, $stateParams, 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 12
13 }); 13 });
14 $scope.showCompany = true;
15 $scope.editName = function(){
16 $scope.showCompany = false;
17
18 }
14 $scope.feature = {}; 19 $scope.feature = {};
15 var userProfileID = $stateParams.id; 20 var userProfileID = $stateParams.id;
16 UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { 21 UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) {
17 console.log(result) 22 console.log(result)
18 $scope.user = result; 23 $scope.user = result;
19 $scope.user.userTypeId = result.userType.id; 24 $scope.user.userTypeId = result.userType.id;
20 25
21 if(result.accountFeatureControl != null){ 26 if(result.accountFeatureControl != null){
22 $scope.feature = result.accountFeatureControl; 27 $scope.feature = result.accountFeatureControl;
23 $scope.feature.accountId = result.account.id; 28 $scope.feature.accountId = result.account.id;
24 console.log($scope.feature) 29 console.log($scope.feature)
25 if($scope.feature.essintaPosSystem == true){ 30 if($scope.feature.essintaPosSystem == true){
26 $scope.essAccountId = false; 31 $scope.essAccountId = false;
27 $("#esAccId").css({ opacity: 1 }); 32 $("#esAccId").css({ opacity: 1 });
28 }else{ 33 }else{
29 $scope.essAccountId = true; 34 $scope.essAccountId = true;
30 delete $scope.feature.essintaAccountUid; 35 delete $scope.feature.essintaAccountUid;
31 $("#esAccId").css({ opacity: 0.5 }); 36 $("#esAccId").css({ opacity: 0.5 });
32 } 37 }
33 }else{ 38 }else{
34 $scope.feature.accountId = result.account.id; 39 $scope.feature.accountId = result.account.id;
35 } 40 }
36 41
37 UpdateAllFBO.getNotes(userProfileID).then(function(response) { 42 UpdateAllFBO.getNotes(userProfileID).then(function(response) {
38 $scope.user.clientNote = response[0].notes 43 $scope.user.clientNote = response[0].notes
39 $scope.user.userNoteId = response[0].id; 44 $scope.user.userNoteId = response[0].id;
40 }) 45 })
41 console.log($scope.feature,"dsdsdsds") 46 console.log($scope.feature,"dsdsdsds")
42 if($scope.user.account.user.status == 'ACTIVE'){ 47 if($scope.user.account.user.status == 'ACTIVE'){
43 $scope.status = true; 48 $scope.status = true;
44 }else { 49 }else {
45 $scope.status = false; 50 $scope.status = false;
46 } 51 }
47 }) 52 })
48 53
49 $scope.enableEssId = function(){ 54 $scope.enableEssId = function(){
50 if($scope.feature.essintaPosSystem == true){ 55 if($scope.feature.essintaPosSystem == true){
51 $scope.essAccountId = false; 56 $scope.essAccountId = false;
52 $("#esAccId").css({ opacity: 1 }); 57 $("#esAccId").css({ opacity: 1 });
53 }else{ 58 }else{
54 $scope.essAccountId = true; 59 $scope.essAccountId = true;
55 delete $scope.feature.essintaAccountUid; 60 delete $scope.feature.essintaAccountUid;
56 $("#esAccId").css({ opacity: 0.5 }); 61 $("#esAccId").css({ opacity: 0.5 });
57 } 62 }
58 } 63 }
59 64
60 $scope.userData = function(){ 65 $scope.userData = function(){
61 console.log($scope.user.userTypeId) 66 console.log($scope.user.userTypeId)
62 67 if($scope.user.email == undefined || $scope.user.email == null){
68 toastr.error('Please enter your email first', {
69 closeButton: true
70 })
71 }else if($scope.user.firstName == undefined || $scope.user.firstName == null){
72 toastr.error('Please enter your First Name', {
73 closeButton: true
74 })
75 }else{
63 if($scope.status == true){ 76 if($scope.status == true){
64 $scope.user.status = 'active'; 77 $scope.user.status = 'active';
65 }else{ 78 }else{
66 $scope.user.status = 'inactive'; 79 $scope.user.status = 'inactive';
67 } 80 }
68 $scope.user.username = $scope.user.email; 81 $scope.user.username = $scope.user.email;
69 $scope.user.userType = 'fbo'; 82 $scope.user.userType = 'fbo';
70 console.log($scope.user) 83 console.log($scope.user)
71 // if($scope.user.userNoteId == undefined){ 84 // if($scope.user.userNoteId == undefined){
72 // $scope.user.userNoteId = null; 85 // $scope.user.userNoteId = null;
73 // } 86 // }
74 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; 87 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;
75 UpdateAllFBO.updateUser(updateData).then(function(result) { 88 UpdateAllFBO.updateUser(updateData).then(function(result) {
76 toastr.success(''+result.success+'', { 89 toastr.success(''+result.success+'', {
77 closeButton: true 90 closeButton: true
78 }) 91 })
79 var updatefeatureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem 92 var updatefeatureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem
80 + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" 93 + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration="
81 + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration 94 + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration
82 + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id; 95 + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id;
83 96
84 UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) { 97 UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) {
85 console.log(response) 98 console.log(response)
86 }) 99 })
87 }) 100 })
101 }
88 } 102 }
89 103
90 }); 104 });
app/views/updateAllFBO/updateAllFBO.html
1 </div> 1 </div>
2 <div class="row wrapper border-bottom white-bg page-heading"> 2 <div class="row wrapper border-bottom white-bg page-heading">
3 <div class="col-lg-2"> 3 <div class="col-lg-3">
4 <h2>{{user.companyName}}</h2> 4 <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2>
5 <div style="margin-top: 20px;" ng-hide="showCompany"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div>
5 </div> 6 </div>
6 <div class="col-lg-4" style="margin-top: 20px;"> 7 <div class="col-lg-3" style="margin-top: 20px;">
7 <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> 8 <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button>
8 </div> 9 </div>
9 <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> 10 <div class="col-lg-6" style="margin-top: 20px; text-align: right;">
10 <button type="button" class="btn btn-default btn-sm" ui-sref="index.fboAdmin">Cancel</button> 11 <button type="button" class="btn btn-default btn-sm" ui-sref="index.fboAdmin">Cancel</button>
11 <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> 12 <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button>
12 </div> 13 </div>
13 </div> 14 </div>
14 </div> 15 </div>
15 <div class="wrapper wrapper-content animated fadeInRight"> 16 <div class="wrapper wrapper-content animated fadeInRight">
16 <div class="row"> 17 <div class="row">
17 <div class="col-lg-7"> 18 <div class="col-lg-7">
18 <div class="ibox float-e-margins"> 19 <div class="ibox float-e-margins">
19 <div class="ibox-title"> 20 <div class="ibox-title">
20 <div class="pull-left"> 21 <div class="pull-left">
21 <h5>Contact Information</h5> 22 <h5>Contact Information</h5>
22 </div> 23 </div>
23 <div class="pull-right my-toggle-switch"> 24 <div class="pull-right my-toggle-switch">
24 <div class="switch"> 25 <div class="switch">
25 <div class="onoffswitch"> 26 <div class="onoffswitch">
26 <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> 27 <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1">
27 <label class="onoffswitch-label" for="example1"> 28 <label class="onoffswitch-label" for="example1">
28 <span class="onoffswitch-inner"></span> 29 <span class="onoffswitch-inner"></span>
29 <span class="onoffswitch-switch"></span> 30 <span class="onoffswitch-switch"></span>
30 </label> 31 </label>
31 </div> 32 </div>
32 </div> 33 </div>
33 </div> 34 </div>
34 <div class="clearfix"></div> 35 <div class="clearfix"></div>
35 </div> 36 </div>
36 <div class="ibox-content"> 37 <div class="ibox-content">
37 <div class="row"> 38 <div class="row">
38 <form role="form"> 39 <form role="form">
39 <div class="col-sm-6 b-r"> 40 <div class="col-sm-6 b-r">
40 <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> 41 <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> -->
41 <!-- <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> --> 42 <!-- <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> -->
42 <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> 43 <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div>
43 <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> 44 <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div>
44 <!-- <div> 45 <!-- <div>
45 <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> 46 <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button>
46 <label> <input type="checkbox" class="i-checks"> Remember me </label> 47 <label> <input type="checkbox" class="i-checks"> Remember me </label>
47 </div> --> 48 </div> -->
48 49
49 </div> 50 </div>
50 <div class="col-sm-6"> 51 <div class="col-sm-6">
51 <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> --> 52 <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> -->
52 <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div> 53 <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div>
53 <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> 54 <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div>
54 </div> 55 </div>
55 </form> 56 </form>
56 </div> 57 </div>
57 </div> 58 </div>
58 </div> 59 </div>
59 </div> 60 </div>
60 <div class="col-lg-5"> 61 <div class="col-lg-5">
61 <div class="ibox float-e-margins"> 62 <div class="ibox float-e-margins">
62 <div class="ibox-title"> 63 <div class="ibox-title">
63 <h5>Client Notes</h5> 64 <h5>Client Notes</h5>
64 65
65 </div> 66 </div>
66 <div class="ibox-content"> 67 <div class="ibox-content">
67 <div class="row"> 68 <div class="row">
68 <form role="form"> 69 <form role="form">
69 <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> 70 <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea>
70 </form> 71 </form>
71 </div> 72 </div>
72 </div> 73 </div>
73 74
74 </div> 75 </div>
75 </div> 76 </div>
76 </div> 77 </div>
77 </div> 78 </div>
78 79
79 <div class="wrapper wrapper-content animated fadeInRight"> 80 <div class="wrapper wrapper-content animated fadeInRight">
80 <div class="row"> 81 <div class="row">
81 <div class="col-lg-12"> 82 <div class="col-lg-12">
82 <div class="ibox float-e-margins"> 83 <div class="ibox float-e-margins">
83 <div class="ibox-title" style="padding: 5px 15px 5px 15px;"> 84 <div class="ibox-title" style="padding: 5px 15px 5px 15px;">
84 <div class="col-lg-8"> 85 <div class="col-lg-8">
85 <h5 style="line-height: 34px;margin-bottom: 0;">Feature Account Control</h5> 86 <h5 style="line-height: 34px;margin-bottom: 0;">Feature Account Control</h5>
86 </div> 87 </div>
87 <div class="col-lg-4"> 88 <div class="col-lg-4">
88 <div class="form-group"> 89 <div class="form-group">
89 <label class="col-sm-2 control-label" style="line-height: 34px;margin-bottom: 0;">Level</label> 90 <label class="col-sm-2 control-label" style="line-height: 34px;margin-bottom: 0;">Level</label>
90 <div class="col-sm-10"> 91 <div class="col-sm-10">
91 <select class="form-control m-b" name="account" ng-model="feature.level" style="margin-bottom: 0;"> 92 <select class="form-control m-b" name="account" ng-model="feature.level" style="margin-bottom: 0;">
92 <option value="silver" selected>Silver</option> 93 <option value="silver" selected>Silver</option>
93 <option value="gold">Gold</option> 94 <option value="gold">Gold</option>
94 </select> 95 </select>
95 </div> 96 </div>
96 </div> 97 </div>
97 </div> 98 </div>
98 <div class="clearfix"></div> 99 <div class="clearfix"></div>
99 </div> 100 </div>
100 <div class="ibox-content"> 101 <div class="ibox-content">
101 <div class="row"> 102 <div class="row">
102 <form role="form"> 103 <form role="form">
103 104
104 <div class="col-lg-3"> 105 <div class="col-lg-3">
105 <label style="color: #1ab394;">Modularized</label> 106 <label style="color: #1ab394;">Modularized</label>
106 <div> 107 <div>
107 <label> <input type="checkbox" class="i-checks" ng-change="enableEssId()" ng-model="feature.essintaPosSystem" icheck> Essinta POS system </label> 108 <label> <input type="checkbox" class="i-checks" ng-change="enableEssId()" ng-model="feature.essintaPosSystem" icheck> Essinta POS system </label>
108 </div> 109 </div>
109 <div> 110 <div>
110 <label> <input type="checkbox" class="i-checks" ng-model="feature.acuQuote" icheck> AcuQuote </label> 111 <label> <input type="checkbox" class="i-checks" ng-model="feature.acuQuote" icheck> AcuQuote </label>
111 </div> 112 </div>
112 <div> 113 <div>
113 <label> <input type="checkbox" class="i-checks" ng-model="feature.acuTrack" icheck> AcuTrack </label> 114 <label> <input type="checkbox" class="i-checks" ng-model="feature.acuTrack" icheck> AcuTrack </label>
114 </div> 115 </div>
115 <div> 116 <div>
116 <label> <input type="checkbox" class="i-checks" ng-model="feature.fuelProgram" icheck> Fuel Program </label> 117 <label> <input type="checkbox" class="i-checks" ng-model="feature.fuelProgram" icheck> Fuel Program </label>
117 </div> 118 </div>
118 <div> 119 <div>
119 <label> <input type="checkbox" class="i-checks" ng-model="feature.amstatIntegration" icheck> AMSTAT Integration </label> 120 <label> <input type="checkbox" class="i-checks" ng-model="feature.amstatIntegration" icheck> AMSTAT Integration </label>
120 </div> 121 </div>
121 <div> 122 <div>
122 <label> <input type="checkbox" class="i-checks" ng-model="feature.posAccountingIntegration" icheck> POS Accounting Integration </label> 123 <label> <input type="checkbox" class="i-checks" ng-model="feature.posAccountingIntegration" icheck> POS Accounting Integration </label>
123 </div> 124 </div>
124 <div> 125 <div>
125 <label> <input type="checkbox" class="i-checks" ng-model="feature.posVeederRootIntegration" icheck> POS VeederRoot Integration </label> 126 <label> <input type="checkbox" class="i-checks" ng-model="feature.posVeederRootIntegration" icheck> POS VeederRoot Integration </label>
126 </div> 127 </div>
127 </div> 128 </div>
128 <div class="col-lg-9" style="padding: 0;"> 129 <div class="col-lg-9" style="padding: 0;">
129 <div class="col-lg-6"> 130 <div class="col-lg-6">
130 <div class="form-group" style="margin-top: 18px;" id="esAccId"> 131 <div class="form-group" style="margin-top: 18px;" id="esAccId">
131 <label class="control-label pull-left" style="color: #1ab394;line-height: 34px;">Essinta Account UID</label> 132 <label class="control-label pull-left" style="color: #1ab394;line-height: 34px;">Essinta Account UID</label>
132 <div class="col-lg-6"> 133 <div class="col-lg-6">
133 <input type="text" placeholder="" ng-disabled="essAccountId" style="border-color: #1ab394;" class="form-control" ng-model="feature.essintaAccountUid"> 134 <input type="text" placeholder="" ng-disabled="essAccountId" style="border-color: #1ab394;" class="form-control" ng-model="feature.essintaAccountUid">
134 </div> 135 </div>
135 </div> 136 </div>
136 </div> 137 </div>
137 <div class="col-lg-6"> 138 <div class="col-lg-6">
138 <div class="form-group" style="margin-top: 18px;"> 139 <div class="form-group" style="margin-top: 18px;">
139 <label class="control-label pull-left" style="color: #ffa149;line-height: 34px;">Additional Device Licences</label> 140 <label class="control-label pull-left" style="color: #ffa149;line-height: 34px;">Additional Device Licences</label>
140 <div class="col-lg-6"> 141 <div class="col-lg-6">
141 <input type="text" placeholder="" style="border-color: #ffa149 !important;" ng-model="feature.additionalLicences" class="form-control"> 142 <input type="text" placeholder="" style="border-color: #ffa149 !important;" ng-model="feature.additionalLicences" class="form-control">
142 </div> 143 </div>
143 </div> 144 </div>
144 </div> 145 </div>
145 </div> 146 </div>
146 147
147 </form> 148 </form>
148 </div> 149 </div>
149 </div> 150 </div>
150 </div> 151 </div>
151 </div> 152 </div>
152 </div> 153 </div>
153 </div> 154 </div>
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, UpdateAllFBODept, UpdateAllFBO, FBOFlight) { 6 .controller('updateFBODeptController', function($scope, $stateParams, UpdateAllFBODept, UpdateAllFBO, FBOFlight) {
7 $scope.showCompany = true;
8 $scope.editName = function(){
9 $scope.showCompany = false;
10
11 }
7 $scope.showPayments = true; 12 $scope.showPayments = true;
8 $scope.aircraft = {}; 13 $scope.aircraft = {};
9 $scope.updateData = {}; 14 $scope.updateData = {};
10 var userProfileID = $stateParams.id; 15 var userProfileID = $stateParams.id;
11 UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { 16 UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) {
12 console.log(result) 17 console.log(result)
13 $scope.user = result; 18 $scope.user = result;
14 $scope.aircraft.accountId = result.account.id; 19 $scope.aircraft.accountId = result.account.id;
15 $scope.user.userTypeId = result.userType.id; 20 $scope.user.userTypeId = result.userType.id;
16 UpdateAllFBODept.getNotes(userProfileID).then(function(response) { 21 UpdateAllFBODept.getNotes(userProfileID).then(function(response) {
17 $scope.user.clientNote = response[0].notes 22 $scope.user.clientNote = response[0].notes
18 $scope.user.userNoteId = response[0].id; 23 $scope.user.userNoteId = response[0].id;
19 }) 24 })
20 // $scope.feature = result.accountFeatureControl; 25 // $scope.feature = result.accountFeatureControl;
21 // console.log($scope.feature,"dsdsdsds") 26 // console.log($scope.feature,"dsdsdsds")
22 if($scope.user.account.user.status == 'ACTIVE'){ 27 if($scope.user.account.user.status == 'ACTIVE'){
23 $scope.status = true; 28 $scope.status = true;
24 }else { 29 }else {
25 $scope.status = false; 30 $scope.status = false;
26 } 31 }
27 }) 32 })
28 33
29 getCrafts(); 34 getCrafts();
30 function getCrafts(){ 35 function getCrafts(){
31 UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { 36 UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) {
32 $scope.getCraftList = response; 37 $scope.getCraftList = response;
33 }) 38 })
34 } 39 }
35 40
36 UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { 41 UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) {
37 $scope.paymentList = response; 42 $scope.paymentList = response;
38 43
39 }) 44 })
40 45
41 $scope.openCard = function(payment){ 46 $scope.openCard = function(payment){
42 console.log(payment) 47 console.log(payment)
43 $scope.showPayments = false; 48 $scope.showPayments = false;
44 $scope.data = {}; 49 $scope.data = {};
45 $scope.data.cardNumber = payment.cardNumber; 50 $scope.data.cardNumber = payment.cardNumber;
46 $scope.data.cardType = payment.cardType; 51 $scope.data.cardType = payment.cardType;
47 $scope.data.expiryDate = payment.expiryDate; 52 $scope.data.expiryDate = payment.expiryDate;
48 $scope.data.id = payment.id; 53 $scope.data.id = payment.id;
49 $scope.data.accountId = payment.user.account.id; 54 $scope.data.accountId = payment.user.account.id;
50 } 55 }
51 56
52 var cardData = {} 57 var cardData = {}
53 cardData.paymentMethodList = []; 58 cardData.paymentMethodList = [];
54 $scope.updateCard = function(){ 59 $scope.updateCard = function(){
55 console.log($scope.data) 60 console.log($scope.data)
56 cardData.paymentMethodList.push($scope.data); 61 cardData.paymentMethodList.push($scope.data);
57 console.log("cardData", cardData); 62 console.log("cardData", cardData);
58 UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { 63 UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) {
59 console.log(result) 64 console.log(result)
60 toastr.success('Updated Successfully', { 65 toastr.success('Updated Successfully', {
61 closeButton: true 66 closeButton: true
62 }) 67 })
63 $scope.reset(); 68 $scope.reset();
64 }) 69 })
65 } 70 }
66 71
67 72
68 $scope.reset = function(){ 73 $scope.reset = function(){
69 cardData.paymentMethodList = []; 74 cardData.paymentMethodList = [];
70 } 75 }
71 76
72 $scope.userData = function(){ 77 $scope.userData = function(){
73 console.log($scope.user.userTypeId) 78 console.log($scope.user.userTypeId)
74 79 if($scope.user.email == undefined || $scope.user.email == null){
80 toastr.error('Please enter your email first', {
81 closeButton: true
82 })
83 }else if($scope.user.firstName == undefined || $scope.user.firstName == null){
84 toastr.error('Please enter your First Name', {
85 closeButton: true
86 })
87 }else{
75 if($scope.status == true){ 88 if($scope.status == true){
76 $scope.user.status = 'active'; 89 $scope.user.status = 'active';
77 }else{ 90 }else{
78 $scope.user.status = 'inactive'; 91 $scope.user.status = 'inactive';
79 } 92 }
80 $scope.user.username = $scope.user.email; 93 $scope.user.username = $scope.user.email;
81 $scope.user.userType = 'flightDetp'; 94 $scope.user.userType = 'flightDetp';
82 console.log($scope.user) 95 console.log($scope.user)
83 // if($scope.user.userNoteId == undefined){ 96 // if($scope.user.userNoteId == undefined){
84 // $scope.user.userNoteId = null; 97 // $scope.user.userNoteId = null;
85 // } 98 // }
86 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; 99 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;
87 UpdateAllFBO.updateUser(updateData).then(function(result) { 100 UpdateAllFBO.updateUser(updateData).then(function(result) {
88 toastr.success(''+result.success+'', { 101 toastr.success(''+result.success+'', {
89 closeButton: true 102 closeButton: true
90 }) 103 })
91 }) 104 })
105 }
92 } 106 }
93 107
94 getData(); 108 getData();
95 function getData(){ 109 function getData(){
96 FBOFlight.getAircraftMake().then(function(result) { 110 FBOFlight.getAircraftMake().then(function(result) {
97 $scope.aircraftMakeList = result; 111 $scope.aircraftMakeList = result;
98 $scope.aircraft.make = $scope.aircraftMakeList[0]; 112 $scope.aircraft.make = $scope.aircraftMakeList[0];
99 FBOFlight.getModal($scope.aircraft.make).then(function(result) { 113 FBOFlight.getModal($scope.aircraft.make).then(function(result) {
100 $scope.aircraftModalList = result; 114 $scope.aircraftModalList = result;
101 $scope.aircraft.model = $scope.aircraftModalList[0]; 115 $scope.aircraft.model = $scope.aircraftModalList[0];
102
103 })
104
105 })
106 116
107 FBOFlight.getAircraftSize().then(function(result) { 117 FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
108 $scope.aircraftSizeList = result; 118 $scope.aircraftSizeList = result;
109 $scope.aircraft.size = $scope.aircraftSizeList[0]; 119 $scope.aircraft.size = $scope.aircraftSizeList[0];
120
121 })
122 })
110 123
111 }) 124 })
112 } 125 }
113
114 126
115 $scope.getModal = function(){ 127 $scope.getModal = function(){
116 var modelId = $scope.aircraft.make 128 var makeId = $scope.aircraft.make
117 FBOFlight.getModal(modelId).then(function(result) { 129 FBOFlight.getModal(makeId).then(function(result) {
118 $scope.aircraftModalList = result; 130 $scope.aircraftModalList = result;
119 $scope.aircraft.model = $scope.aircraftModalList[0]; 131 $scope.aircraft.model = $scope.aircraftModalList[0];
132
133 FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) {
134 $scope.aircraftSizeList = result;
135 $scope.aircraft.size = $scope.aircraftSizeList[0];
136 })
120 }) 137 })
121 } 138 }
139
140 $scope.getSize = function(){
141 FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
142 $scope.aircraftSizeList = result;
143 $scope.aircraft.size = $scope.aircraftSizeList[0];
144 })
145 }
146
122 $scope.aircraftData = {}; 147 $scope.aircraftData = {};
123 $scope.aircraftData.aircraftList = []; 148 $scope.aircraftData.aircraftList = [];
124 $scope.addAircraft = function(){ 149 $scope.addAircraft = function(){
125 $scope.aircraftData.aircraftList.push($scope.aircraft); 150 $scope.aircraftData.aircraftList.push($scope.aircraft);
126 151
127 FBOFlight.addAircraft($scope.aircraftData).then(function(result) { 152 FBOFlight.addAircraft($scope.aircraftData).then(function(result) {
128 $('#myModal4').modal('hide'); 153 $('#myModal4').modal('hide');
129 getCrafts(); 154 getCrafts();
130 $scope.resetData(); 155 $scope.resetData();
131 toastr.success('Created Successfully', { 156 toastr.success('Created Successfully', {
132 closeButton: true 157 closeButton: true
133 }) 158 })
134 }) 159 }, function (err) {
160 toastr.error('Error in Adding Aircraft', {
161 closeButton: true
162 })
163 $('#myModal4').modal('hide');
164 $scope.getCraftList.splice($scope.aircraft);
165 });
135 } 166 }
136 167
137 $scope.closeModal = function(){ 168 $scope.closeModal = function(){
138 $("#myModal5").modal('hide'); 169 $("#myModal5").modal('hide');
139 $scope.resetData(); 170 $scope.resetData();
140 } 171 }
141 172
142 $scope.update = function(airdata){ 173 $scope.update = function(airdata){
143 console.log(airdata) 174 $("#myModal5").modal('show');
144 $scope.aircraft = airdata; 175 $scope.aircraft = airdata;
176 console.log($scope.aircraft)
145 $scope.aircraft.accountId = $scope.user.account.id; 177 $scope.aircraft.accountId = $scope.user.account.id;
146 $("#myModal5").modal('show'); 178
147 FBOFlight.getModal($scope.aircraft.make).then(function(result) { 179 FBOFlight.getModal($scope.aircraft.make).then(function(result) {
148 $scope.aircraftModalList = result; 180 $scope.aircraftModalList = result;
149 181 FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) {
182 $scope.aircraftSizeList = result;
183
184 })
150 }) 185 })
151 } 186 }
152 187
153 $scope.updatecraftData = {}; 188 $scope.updatecraftData = {};
154 $scope.updatecraftData.aircraftList = []; 189 $scope.updatecraftData.aircraftList = [];
155 $scope.updateAircraftData = {}; 190 $scope.updateAircraftData = {};
156 191
157 $scope.updateAircraft = function(updateAircraft){ 192 $scope.updateAircraft = function(updateAircraft){
158 $scope.updateAircraftData.id = updateAircraft.id; 193 $scope.updateAircraftData.id = updateAircraft.id;
159 $scope.updateAircraftData.make = updateAircraft.make; 194 $scope.updateAircraftData.make = updateAircraft.make;
160 $scope.updateAircraftData.model = updateAircraft.model; 195 $scope.updateAircraftData.model = updateAircraft.model;
161 $scope.updateAircraftData.size = updateAircraft.size; 196 $scope.updateAircraftData.size = updateAircraft.size;
162 $scope.updateAircraftData.tail = updateAircraft.tail; 197 $scope.updateAircraftData.tail = updateAircraft.tail;
163 $scope.updateAircraftData.accountId = updateAircraft.accountId; 198 $scope.updateAircraftData.accountId = updateAircraft.accountId;
164 console.log($scope.updateAircraftData) 199 console.log($scope.updateAircraftData)
165 200
166 $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); 201 $scope.updatecraftData.aircraftList.push($scope.updateAircraftData);
167 console.log($scope.updatecraftData.aircraftList) 202 console.log($scope.updatecraftData.aircraftList)
168 203
169 UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { 204 UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) {
170 $('#myModal5').modal('hide'); 205 $('#myModal5').modal('hide');
171 $scope.resetData(); 206 $scope.resetData();
172 toastr.success('Updated Successfully', { 207 toastr.success('Updated Successfully', {
173 closeButton: true 208 closeButton: true
174 }) 209 })
175 }) 210 }, function (err) {
211 toastr.error('Error in Updating Aircraft', {
212 closeButton: true
213 })
214 $('#myModal5').modal('hide');
215 $scope.getCraftList.splice($scope.aircraft);
216 });
176 } 217 }
177 218
178 $scope.remove = function(data){ 219 $scope.remove = function(data){
179 console.log(data) 220 console.log(data)
180 UpdateAllFBODept.removeAircraft(data.id).then(function(result) { 221 UpdateAllFBODept.removeAircraft(data.id).then(function(result) {
181 toastr.success(''+result.success+'', { 222 toastr.success(''+result.success+'', {
182 closeButton: true 223 closeButton: true
183 }) 224 })
184 getCrafts(); 225 getCrafts();
185 }) 226 })
186 } 227 }
187 228
188 $scope.resetData = function() { 229 $scope.resetData = function() {
189 $scope.aircraft = {}; 230 $scope.aircraft = {};
190 $scope.aircraft.accountId = $scope.user.account.id; 231 $scope.aircraft.accountId = $scope.user.account.id;
app/views/updateFBODept/updateFBODept.html
1 1
2 <div class="row wrapper border-bottom white-bg page-heading"> 2 <div class="row wrapper border-bottom white-bg page-heading">
3 <div class="col-lg-2"> 3 <div class="col-lg-3">
4 <h2>{{user.companyName}}</h2> 4 <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2>
5 <div style="margin-top: 20px;" ng-hide="showCompany"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div>
5 </div> 6 </div>
6 <div class="col-lg-4" style="margin-top: 20px;"> 7 <div class="col-lg-3" style="margin-top: 20px;">
7 <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button> 8 <button type="button" class="btn btn-w-m btn-danger" ng-click="deleteData()">Delete Account</button>
8 </div> 9 </div>
9 <div class="col-lg-6" style="margin-top: 20px; text-align: right;"> 10 <div class="col-lg-6" style="margin-top: 20px; text-align: right;">
10 <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> 11 <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button>
11 <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> 12 <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button>
12 </div> 13 </div>
13 </div> 14 </div>
14 <div class="wrapper wrapper-content animated fadeInRight"> 15 <div class="wrapper wrapper-content animated fadeInRight">
15 <div class="row"> 16 <div class="row">
16 <div class="col-lg-7"> 17 <div class="col-lg-7">
17 <div class="ibox float-e-margins"> 18 <div class="ibox float-e-margins">
18 <div class="ibox-title"> 19 <div class="ibox-title">
19 <div class="pull-left"> 20 <div class="pull-left">
20 <h5>Contact Information</h5> 21 <h5>Contact Information</h5>
21 </div> 22 </div>
22 <div class="pull-right my-toggle-switch"> 23 <div class="pull-right my-toggle-switch">
23 <div class="switch"> 24 <div class="switch">
24 <div class="onoffswitch"> 25 <div class="onoffswitch">
25 <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> 26 <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1">
26 <label class="onoffswitch-label" for="example1"> 27 <label class="onoffswitch-label" for="example1">
27 <span class="onoffswitch-inner"></span> 28 <span class="onoffswitch-inner"></span>
28 <span class="onoffswitch-switch"></span> 29 <span class="onoffswitch-switch"></span>
29 </label> 30 </label>
30 </div> 31 </div>
31 </div> 32 </div>
32 </div> 33 </div>
33 <div class="clearfix"></div> 34 <div class="clearfix"></div>
34 </div> 35 </div>
35 <div class="ibox-content"> 36 <div class="ibox-content">
36 <div class="row"> 37 <div class="row">
37 <form role="form"> 38 <form role="form">
38 <div class="col-sm-6 b-r"> 39 <div class="col-sm-6 b-r">
39 <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> 40 <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> -->
40 <!-- <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> --> 41 <!-- <div class="form-group"><label>Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> -->
41 <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> 42 <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div>
42 <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> 43 <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div>
43 <!-- <div> 44 <!-- <div>
44 <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> 45 <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button>
45 <label> <input type="checkbox" class="i-checks"> Remember me </label> 46 <label> <input type="checkbox" class="i-checks"> Remember me </label>
46 </div> --> 47 </div> -->
47 48
48 </div> 49 </div>
49 <div class="col-sm-6"> 50 <div class="col-sm-6">
50 <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> --> 51 <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> -->
51 <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div> 52 <div class="form-group"><label>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" class="form-control"></div>
52 <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> 53 <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div>
53 </div> 54 </div>
54 </form> 55 </form>
55 </div> 56 </div>
56 </div> 57 </div>
57 </div> 58 </div>
58 </div> 59 </div>
59 <div class="col-lg-5"> 60 <div class="col-lg-5">
60 <div class="ibox float-e-margins"> 61 <div class="ibox float-e-margins">
61 <div class="ibox-title"> 62 <div class="ibox-title">
62 <h5>Client Notes</h5> 63 <h5>Client Notes</h5>
63 64
64 </div> 65 </div>
65 <div class="ibox-content"> 66 <div class="ibox-content">
66 <div class="row"> 67 <div class="row">
67 <form role="form"> 68 <form role="form">
68 <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> 69 <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea>
69 </form> 70 </form>
70 </div> 71 </div>
71 </div> 72 </div>
72 73
73 </div> 74 </div>
74 </div> 75 </div>
75 </div> 76 </div>
76 </div> 77 </div>
77 78
78 <div> 79 <div>
79 <div class="row"> 80 <div class="row">
80 <div class="col-lg-7"> 81 <div class="col-lg-7">
81 <div class="ibox float-e-margins"> 82 <div class="ibox float-e-margins">
82 <div class="ibox-title"> 83 <div class="ibox-title">
83 <div> 84 <div>
84 <h3 style="float: left;">Aircraft List</h3> 85 <h3 style="float: left;">Aircraft List</h3>
85 </div> 86 </div>
86 <div class="pull-right"> 87 <div class="pull-right">
87 <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal4">+ Add</button> 88 <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal4">+ Add</button>
88 </div> 89 </div>
89 <div class="clearfix"></div> 90 <div class="clearfix"></div>
90 <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> 91 <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true">
91 <div class="modal-dialog"> 92 <div class="modal-dialog">
92 <div class="modal-content animated fadeIn"> 93 <div class="modal-content animated fadeIn">
93 <div class="modal-header"> 94 <div class="modal-header">
94 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 95 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
95 <!-- <i class="fa fa-clock-o modal-icon"></i> --> 96 <!-- <i class="fa fa-clock-o modal-icon"></i> -->
96 <h4 class="modal-title">Add Aircraft</h4> 97 <h4 class="modal-title">Add Aircraft</h4>
97 <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> 98 <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> -->
98 </div> 99 </div>
99 <div class="modal-body" style="padding: 15px;"> 100 <div class="modal-body" style="padding: 15px;">
100 <table class="table table-bordered table-hover table-striped"> 101 <table class="table table-bordered table-hover table-striped">
101 <thead> 102 <thead>
102 <tr> 103 <tr>
103 <th>Tail</th> 104 <th>Tail</th>
104 <th>Make</th> 105 <th>Make</th>
105 <th>Model</th> 106 <th>Model</th>
106 <th>Size</th> 107 <th>Size</th>
107 </tr> 108 </tr>
108 </thead> 109 </thead>
109 <tbody> 110 <tbody>
110 <tr> 111 <tr>
111 <td> 112 <td>
112 <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> 113 <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control">
113 </td> 114 </td>
114 <td style="width: 30%"> 115 <td style="width: 30%">
115 <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> 116 <select class="form-control" ng-model="aircraft.make" ng-change="getModal()">
116 <option ng-repeat="make in aircraftMakeList">{{make}}</option> 117 <option ng-repeat="make in aircraftMakeList">{{make}}</option>
117 </select> 118 </select>
118 </td> 119 </td>
119 <td style="width: 30%"> 120 <td style="width: 30%">
120 <select class="form-control" ng-model="aircraft.model"> 121 <select class="form-control" ng-model="aircraft.model" ng-change="getSize()">
121 <option ng-repeat="model in aircraftModalList">{{model}}</option> 122 <option ng-repeat="model in aircraftModalList">{{model}}</option>
122 </select> 123 </select>
123 </td> 124 </td>
124 <td style="width: 30%"> 125 <td style="width: 30%">
125 <select class="form-control" ng-model="aircraft.size"> 126 <select class="form-control" ng-model="aircraft.size">
126 <option ng-repeat="size in aircraftSizeList">{{size}}</option> 127 <option ng-repeat="size in aircraftSizeList">{{size}}</option>
127 </select> 128 </select>
128 </td> 129 </td>
129 </tr> 130 </tr>
130 </tbody> 131 </tbody>
131 </table> 132 </table>
132 </div> 133 </div>
133 <div class="modal-footer"> 134 <div class="modal-footer">
134 <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> 135 <button type="button" class="btn btn-white" data-dismiss="modal">Close</button>
135 <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> 136 <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button>
136 </div> 137 </div>
137 </div> 138 </div>
138 </div> 139 </div>
139 </div> 140 </div>
140 </div> 141 </div>
141 <div class="ibox-content"> 142 <div class="ibox-content">
142 <div class="table-responsive"> 143 <div class="table-responsive">
143 <table class="table table-bordered table-hover table-striped"> 144 <table class="table table-bordered table-hover table-striped">
144 <thead> 145 <thead>
145 <tr> 146 <tr>
146 <th>Tail</th> 147 <th>Tail</th>
147 <th>Make</th> 148 <th>Make</th>
148 <th>Model</th> 149 <th>Model</th>
149 <th>Size</th> 150 <th>Size</th>
150 <th>Actions</th> 151 <th>Actions</th>
151 </tr> 152 </tr>
152 </thead> 153 </thead>
153 <tbody> 154 <tbody>
154 <tr ng-repeat="airData in getCraftList track by $index"> 155 <tr ng-repeat="airData in getCraftList track by $index">
155 <td> 156 <td>
156 <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> 157 <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control">
157 </td> 158 </td>
158 <td> 159 <td>
159 <select class="form-control" ng-model="airData.make"> 160 <select class="form-control" ng-model="airData.make">
160 <option>{{airData.make}}</option> 161 <option>{{airData.make}}</option>
161 </select> 162 </select>
162 </td> 163 </td>
163 <td> 164 <td>
164 <select class="form-control" ng-model="airData.model"> 165 <select class="form-control" ng-model="airData.model">
165 <option>{{airData.model}}</option> 166 <option>{{airData.model}}</option>
166 </select> 167 </select>
167 </td> 168 </td>
168 <td> 169 <td>
169 <select class="form-control" ng-model="airData.size"> 170 <select class="form-control" ng-model="airData.size">
170 <option>{{airData.size}}</option> 171 <option>{{airData.size}}</option>
171 </select> 172 </select>
172 </td> 173 </td>
173 <td> 174 <td>
174 <i style="margin-top: 10px;" class="fa fa-pencil" ng-click="update(airData)"></i>&nbsp; 175 <i style="margin-top: 10px;" class="fa fa-pencil" ng-click="update(airData)"></i>&nbsp;
175 <i class="fa fa-trash" ng-click="remove(airData)"></i> 176 <i class="fa fa-trash" ng-click="remove(airData)"></i>
176 </td> 177 </td>
177 </tr> 178 </tr>
178 </tbody> 179 </tbody>
179 </table> 180 </table>
180 </div> 181 </div>
181 <div class="clearfix"></div> 182 <div class="clearfix"></div>
182 </div> 183 </div>
183 </div> 184 </div>
184 </div> 185 </div>
185 <div class="modal inmodal" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true"> 186 <div class="modal inmodal" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true">
186 <div class="modal-dialog"> 187 <div class="modal-dialog">
187 <div class="modal-content animated fadeIn"> 188 <div class="modal-content animated fadeIn">
188 <div class="modal-header"> 189 <div class="modal-header">
189 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 190 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
190 <!-- <i class="fa fa-clock-o modal-icon"></i> --> 191 <!-- <i class="fa fa-clock-o modal-icon"></i> -->
191 <h4 class="modal-title">Update Aircraft</h4> 192 <h4 class="modal-title">Update Aircraft</h4>
192 <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> 193 <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> -->
193 </div> 194 </div>
194 <div class="modal-body" style="padding: 15px;"> 195 <div class="modal-body" style="padding: 15px;">
195 <table class="table table-bordered table-hover table-striped"> 196 <table class="table table-bordered table-hover table-striped">
196 <thead> 197 <thead>
197 <tr> 198 <tr>
198 <th>Tail</th> 199 <th>Tail</th>
199 <th>Make</th> 200 <th>Make</th>
200 <th>Model</th> 201 <th>Model</th>
201 <th>Size</th> 202 <th>Size</th>
202 </tr> 203 </tr>
203 </thead> 204 </thead>
204 <tbody> 205 <tbody>
205 <tr> 206 <tr>
206 <td> 207 <td>
207 <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> 208 <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control">
208 </td> 209 </td>
209 <td style="width: 30%"> 210 <td style="width: 30%">
210 <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> 211 <select class="form-control" ng-model="aircraft.make" ng-change="getModal()">
211 <option ng-repeat="make in aircraftMakeList">{{make}}</option> 212 <option ng-repeat="make in aircraftMakeList">{{make}}</option>
212 </select> 213 </select>
213 </td> 214 </td>
214 <td style="width: 30%"> 215 <td style="width: 30%">
215 <select class="form-control" ng-model="aircraft.model"> 216 <select class="form-control" ng-model="aircraft.model" ng-change="getSize()">
216 <option ng-repeat="model in aircraftModalList">{{model}}</option> 217 <option ng-repeat="model in aircraftModalList">{{model}}</option>
217 </select> 218 </select>
218 </td> 219 </td>
219 <td style="width: 30%"> 220 <td style="width: 30%">
220 <select class="form-control" ng-model="aircraft.size"> 221 <select class="form-control" ng-model="aircraft.size">
221 <option ng-repeat="size in aircraftSizeList">{{size}}</option> 222 <option ng-repeat="size in aircraftSizeList">{{size}}</option>
222 </select> 223 </select>
223 </td> 224 </td>
224 </tr> 225 </tr>
225 </tbody> 226 </tbody>
226 </table> 227 </table>
227 </div> 228 </div>
228 <div class="modal-footer"> 229 <div class="modal-footer">
229 <button type="button" class="btn btn-white" ng-click="closeModal()">Close</button> 230 <button type="button" class="btn btn-white" ng-click="closeModal()">Close</button>
230 <button type="button" class="btn btn-primary" ng-click="updateAircraft(aircraft)">Save changes</button> 231 <button type="button" class="btn btn-primary" ng-click="updateAircraft(aircraft)">Save changes</button>
231 </div> 232 </div>
232 </div> 233 </div>
233 </div> 234 </div>
234 </div> 235 </div>
235 <div class="col-lg-5"> 236 <div class="col-lg-5">
236 <div class="ibox float-e-margins"> 237 <div class="ibox float-e-margins">
237 <div class="ibox-title"> 238 <div class="ibox-title">
238 <h5>Account Authenticatio & Payment Method</h5> 239 <h5>Account Authenticatio & Payment Method</h5>
239 240
240 </div> 241 </div>
241 <div class="ibox-content"> 242 <div class="ibox-content">
242 <div class="row" ng-repeat="payment in paymentList" ng-click="openCard(payment)" style="cursor: pointer;" ng-show="showPayments"> 243 <div class="row" ng-repeat="payment in paymentList" ng-click="openCard(payment)" style="cursor: pointer;" ng-show="showPayments">
243 <div class="col-md-3"> 244 <div class="col-md-3">
244 <img src="images/master.png"> 245 <img src="images/master.png">
245 </div> 246 </div>
246 <div class="col-md-9"> 247 <div class="col-md-9">
247 <div class="col"> 248 <div class="col">
248 <span style="font-size: large; color: #909394;">**** **** **** {{payment.cardNumber | limitTo: -4}}</span> 249 <span style="font-size: large; color: #909394;">**** **** **** {{payment.cardNumber | limitTo: -4}}</span>
249 </div> 250 </div>
250 <div class="col"> 251 <div class="col">
251 <span><strong>Expiry Date: </strong>{{payment.expiryDate}}</span> 252 <span><strong>Expiry Date: </strong>{{payment.expiryDate}}</span>
252 </div> 253 </div>
253 </div> 254 </div>
254 <div class="clearfix"></div> 255 <div class="clearfix"></div>
255 <!-- <br> 256 <!-- <br>
256 257
257 <div class="col-md-3"> 258 <div class="col-md-3">
258 <img src="images/visa1.png"> 259 <img src="images/visa1.png">
259 </div> 260 </div>
260 <div class="col-md-9"> 261 <div class="col-md-9">
261 <div class="col"> 262 <div class="col">
262 <span style="font-size: large; color: #909394;">**** **** **** 1060</span> 263 <span style="font-size: large; color: #909394;">**** **** **** 1060</span>
263 </div> 264 </div>
264 <div class="col"> 265 <div class="col">
265 <span><strong>Expiry Date:</strong>10/16</span> 266 <span><strong>Expiry Date:</strong>10/16</span>
266 </div> 267 </div>
267 </div> 268 </div>
268 <div class="clearfix"></div> --> 269 <div class="clearfix"></div> -->
269 </div> 270 </div>
270 <div class="row" ng-hide="showPayments"> 271 <div class="row" ng-hide="showPayments">
271 <div class="container"> 272 <div class="container">
272 <div class="row"> 273 <div class="row">
273 <div class="col-xs-12 col-md-4"> 274 <div class="col-xs-12 col-md-4">
274 <div class="panel panel-default credit-card-box"> 275 <div class="panel panel-default credit-card-box">
275 <div class="panel-heading display-table" > 276 <div class="panel-heading display-table" >
276 <div class="row display-tr" > 277 <div class="row display-tr" >
277 <h3 class="panel-title display-td" >Payment Details</h3> 278 <h3 class="panel-title display-td" >Payment Details</h3>
278 <div class="display-td" > 279 <div class="display-td" >
279 <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> 280 <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png">
280 </div> 281 </div>
281 </div> 282 </div>
282 </div> 283 </div>
283 <div class="panel-body"> 284 <div class="panel-body">
284 <form role="form" id="payment-form"> 285 <form role="form" id="payment-form">
285 <div class="row"> 286 <div class="row">
286 <div class="col-xs-12"> 287 <div class="col-xs-12">
287 <div class="form-group"> 288 <div class="form-group">
288 <label for="cardNumber">CARD NUMBER</label> 289 <label for="cardNumber">CARD NUMBER</label>
289 <div class="input-group"> 290 <div class="input-group">
290 <input type="tel" ng-model="data.cardNumber" maxlength="16" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardNumber" placeholder="Valid Card Number" autocomplete="cc-number" required autofocus> 291 <input type="tel" ng-model="data.cardNumber" maxlength="16" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardNumber" placeholder="Valid Card Number" autocomplete="cc-number" required autofocus>
291 <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> 292 <span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
292 </div> 293 </div>
293 </div> 294 </div>
294 </div> 295 </div>
295 </div> 296 </div>
296 <div class="row"> 297 <div class="row">
297 <div class="col-xs-7 col-md-7"> 298 <div class="col-xs-7 col-md-7">
298 <div class="form-group"> 299 <div class="form-group">
299 <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> 300 <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label>
300 <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" 301 <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp"
301 required> 302 required>
302 </div> 303 </div>
303 </div> 304 </div>
304 <div class="col-xs-5 col-md-5 pull-right"> 305 <div class="col-xs-5 col-md-5 pull-right">
305 <div class="form-group"> 306 <div class="form-group">
306 <label for="cardCVC">CVV CODE</label> 307 <label for="cardCVC">CVV CODE</label>
307 <input type="number" maxlength="3" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardCVC" placeholder="CVC" autocomplete="cc-csc" 308 <input type="number" maxlength="3" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" class="form-control" name="cardCVC" placeholder="CVC" autocomplete="cc-csc"
308 required> 309 required>
309 </div> 310 </div>
310 </div> 311 </div>
311 </div> 312 </div>
312 <div class="row"> 313 <div class="row">
313 <div class="col-xs-12"> 314 <div class="col-xs-12">
314 <div class="form-group"> 315 <div class="form-group">
315 <label for="name">Card Type</label> 316 <label for="name">Card Type</label>
316 <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> 317 <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;">
317 <option value="creditCard" selected>Credit Card</option> 318 <option value="creditCard" selected>Credit Card</option>
318 <option value="debitCard">Debit Card</option> 319 <option value="debitCard">Debit Card</option>
319 </select> 320 </select>
320 </div> 321 </div>
321 </div> 322 </div>
322 </div> 323 </div>
323 <div class="row"> 324 <div class="row">
324 <div class="col-xs-12"> 325 <div class="col-xs-12">
325 <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="updateCard()">Update Card</button> 326 <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="updateCard()">Update Card</button>
326 </div> 327 </div>
327 </div> 328 </div>
328 <div class="row" style="display:none;"> 329 <div class="row" style="display:none;">
329 <div class="col-xs-12"> 330 <div class="col-xs-12">
330 <p class="payment-errors"></p> 331 <p class="payment-errors"></p>
331 </div> 332 </div>
332 </div> 333 </div>
333 </form> 334 </form>
334 </div> 335 </div>
335 </div> 336 </div>
336 </div> 337 </div>
337 </div> 338 </div>
338 </div> 339 </div>
339 </div> 340 </div>
340 </div> 341 </div>
341 </div> 342 </div>
342 </div> 343 </div>
343 </div> 344 </div>
344 </div> 345 </div>
345 </div> 346 </div>
346 <script type="text/javascript" src="https://js.stripe.com/v2/"></script> 347 <script type="text/javascript" src="https://js.stripe.com/v2/"></script>
app/views/updateFBODept/updateFBODept.service.js
1 (function() { 1 (function() {
2 'use strict'; 2 'use strict';
3 3
4 angular.module('acuefuel') 4 angular.module('acuefuel')
5 .service('UpdateAllFBODept', ['$rootScope', '$q', '$http', 'BE', UpdateAllFBODept]) 5 .service('UpdateAllFBODept', ['$rootScope', '$q', '$http', 'BE', UpdateAllFBODept])
6 6
7 function UpdateAllFBODept($rootScope, $q, $http, BE) { 7 function UpdateAllFBODept($rootScope, $q, $http, BE) {
8 8
9 this.getALlFBOData = function(id) { 9 this.getALlFBOData = function(id) {
10 10
11 var deferred = $q.defer(); 11 var deferred = $q.defer();
12 $http({ 12 $http({
13 method : 'GET', 13 method : 'GET',
14 url : BE.url +'/account/user/'+id, 14 url : BE.url +'/account/user/'+id,
15 headers : {'Content-Type': 'application/json'}, 15 headers : {'Content-Type': 'application/json'},
16 }) 16 })
17 .success(function(result) { 17 .success(function(result) {
18 deferred.resolve(result); 18 deferred.resolve(result);
19 }) 19 })
20 return deferred.promise; 20 return deferred.promise;
21 } 21 }
22 22
23 this.getNotes = function(id) { 23 this.getNotes = function(id) {
24 24
25 var deferred = $q.defer(); 25 var deferred = $q.defer();
26 $http({ 26 $http({
27 method : 'GET', 27 method : 'GET',
28 url : BE.url +'/account/user/'+id + '/notes', 28 url : BE.url +'/account/user/'+id + '/notes',
29 headers : {'Content-Type': 'application/json'}, 29 headers : {'Content-Type': 'application/json'},
30 }) 30 })
31 .success(function(result) { 31 .success(function(result) {
32 deferred.resolve(result); 32 deferred.resolve(result);
33 }) 33 })
34 return deferred.promise; 34 return deferred.promise;
35 } 35 }
36 36
37 this.getAircrafts = function(id) { 37 this.getAircrafts = function(id) {
38 38
39 var deferred = $q.defer(); 39 var deferred = $q.defer();
40 $http({ 40 $http({
41 method : 'GET', 41 method : 'GET',
42 url : BE.url +'/account/user/'+id + '/airCrafts', 42 url : BE.url +'/account/user/'+id + '/airCrafts',
43 headers : {'Content-Type': 'application/json'}, 43 headers : {'Content-Type': 'application/json'},
44 }) 44 })
45 .success(function(result) { 45 .success(function(result) {
46 deferred.resolve(result); 46 deferred.resolve(result);
47 }) 47 })
48 return deferred.promise; 48 return deferred.promise;
49 } 49 }
50 50
51 this.getPaymentMethod = function(id) { 51 this.getPaymentMethod = function(id) {
52 52
53 var deferred = $q.defer(); 53 var deferred = $q.defer();
54 $http({ 54 $http({
55 method : 'GET', 55 method : 'GET',
56 url : BE.url +'/account/user/'+id + '/paymentMethods', 56 url : BE.url +'/account/user/'+id + '/paymentMethods',
57 headers : {'Content-Type': 'application/json'}, 57 headers : {'Content-Type': 'application/json'},
58 }) 58 })
59 .success(function(result) { 59 .success(function(result) {
60 deferred.resolve(result); 60 deferred.resolve(result);
61 }) 61 })
62 return deferred.promise; 62 return deferred.promise;
63 } 63 }
64 64
65 this.updatePaymentMethod = function(data) { 65 this.updatePaymentMethod = function(data) {
66 66
67 var deferred = $q.defer(); 67 var deferred = $q.defer();
68 $http({ 68 $http({
69 method : 'POST', 69 method : 'POST',
70 url : BE.url +'/account/user/updatePaymentMethods', 70 url : BE.url +'/account/user/updatePaymentMethods',
71 headers : {'Content-Type': 'application/json'}, 71 headers : {'Content-Type': 'application/json'},
72 data: data 72 data: data
73 }) 73 })
74 .success(function(result) { 74 .success(function(result) {
75 deferred.resolve(result); 75 deferred.resolve(result);
76 }) 76 })
77 return deferred.promise; 77 return deferred.promise;
78 } 78 }
79 79
80 this.updateAircraft = function(data) { 80 this.updateAircraft = function(data) {
81 81
82 var deferred = $q.defer(); 82 var deferred = $q.defer();
83 $http({ 83 $http({
84 method : 'PUT', 84 method : 'PUT',
85 url : BE.url +'/account/user/updateAircraft', 85 url : BE.url +'/account/user/updateAircraft',
86 headers : {'Content-Type': 'application/json'}, 86 headers : {'Content-Type': 'application/json'},
87 data: data 87 data: data
88 }) 88 })
89 .success(function(result) { 89 .success(function(result) {
90 deferred.resolve(result); 90 deferred.resolve(result);
91 }).error(function(error) {
92 deferred.reject(error);
91 }) 93 })
92 return deferred.promise; 94 return deferred.promise;
93 } 95 }
94 96
95 this.removeAircraft = function(id) { 97 this.removeAircraft = function(id) {
96 98
97 var deferred = $q.defer(); 99 var deferred = $q.defer();
98 $http({ 100 $http({
99 method : 'DELETE', 101 method : 'DELETE',
100 url : BE.url +'/account/user/airCraft/'+id, 102 url : BE.url +'/account/user/airCraft/'+id,
101 headers : {'Content-Type': 'application/json'}, 103 headers : {'Content-Type': 'application/json'},
102 }) 104 })
103 .success(function(result) { 105 .success(function(result) {
104 deferred.resolve(result); 106 deferred.resolve(result);
105 }) 107 })
106 return deferred.promise; 108 return deferred.promise;
107 } 109 }
108 110
109 } 111 }
110 112
111 })(); 113 })();