Commit 089f3a3c290d0fb2434193b8d25a006f73fdfc84
1 parent
16fa2ad104
Exists in
master
check username available
Showing
9 changed files
with
68 additions
and
7 deletions
Show diff stats
app/views/fbo-admin/dashboard.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('DashboardController', function($scope, $state, FBOAdmin) { | 6 | .controller('DashboardController', function($scope, $state, FBOAdmin) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.i-checks').iCheck({ | 8 | $('.i-checks').iCheck({ |
9 | checkboxClass: 'icheckbox_square-green', | 9 | checkboxClass: 'icheckbox_square-green', |
10 | radioClass: 'iradio_square-green', | 10 | radioClass: 'iradio_square-green', |
11 | }); | 11 | }); |
12 | $('.fboadmin').addClass('active'); | 12 | $('.fboadmin').addClass('active'); |
13 | }); | 13 | }); |
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 | |||
28 | $scope.checkUsername = function(){ | ||
29 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | ||
30 | console.log(status) | ||
31 | if(status != 200){ | ||
32 | toastr.error('This email has alreay taken', { | ||
33 | closeButton: true | ||
34 | }) | ||
35 | } | ||
36 | }) | ||
37 | } | ||
38 | |||
27 | $scope.userData = function(){ | 39 | $scope.userData = function(){ |
28 | if($scope.user.email == undefined || $scope.user.email == null){ | 40 | if($scope.user.email == undefined || $scope.user.email == null){ |
29 | toastr.error('Please enter your email first', { | 41 | toastr.error('Please enter your email first', { |
30 | closeButton: true | 42 | closeButton: true |
31 | }) | 43 | }) |
32 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 44 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
33 | toastr.error('Please enter your First Name', { | 45 | toastr.error('Please enter your First Name', { |
34 | closeButton: true | 46 | closeButton: true |
35 | }) | 47 | }) |
36 | }else{ | 48 | }else{ |
37 | if($scope.status == true){ | 49 | if($scope.status == true){ |
38 | $scope.user.status = 'active'; | 50 | $scope.user.status = 'active'; |
39 | }else{ | 51 | }else{ |
40 | $scope.user.status = 'inactive'; | 52 | $scope.user.status = 'inactive'; |
41 | } | 53 | } |
42 | $scope.user.username = $scope.user.email; | 54 | $scope.user.username = $scope.user.email; |
43 | $scope.user.userType = 'fbo'; | 55 | $scope.user.userType = 'fbo'; |
44 | console.log($scope.user) | 56 | console.log($scope.user) |
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; | 57 | 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; |
46 | FBOAdmin.registerUser(formdata).then(function(result) { | 58 | FBOAdmin.registerUser(formdata).then(function(result) { |
47 | toastr.success('Created Successfully', { | 59 | toastr.success('Created Successfully', { |
48 | closeButton: true | 60 | closeButton: true |
49 | }) | 61 | }) |
50 | $scope.feature.accountId = result; | 62 | $scope.feature.accountId = result; |
51 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem | 63 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem |
52 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" | 64 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" |
53 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration | 65 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration |
54 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; | 66 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences; |
55 | 67 | ||
56 | FBOAdmin.featureControl(featureControlData).then(function(response) { | 68 | FBOAdmin.featureControl(featureControlData).then(function(response) { |
57 | console.log(response) | 69 | console.log(response) |
58 | 70 | ||
59 | }) | 71 | }) |
60 | $state.go('index.fboAdmin'); | 72 | $state.go('index.fboAdmin'); |
61 | }, function (err) { | 73 | }, function (err) { |
62 | toastr.error('Error in registeration', { | 74 | toastr.error('Error in registeration', { |
63 | closeButton: true | 75 | closeButton: true |
64 | }) | 76 | }) |
65 | }); | 77 | }); |
66 | } | 78 | } |
67 | 79 | ||
68 | } | 80 | } |
69 | 81 | ||
70 | $scope.enableEssId = function(){ | 82 | $scope.enableEssId = function(){ |
71 | if($scope.feature.essintaPosSystem == true){ | 83 | if($scope.feature.essintaPosSystem == true){ |
72 | $scope.essAccountId = false; | 84 | $scope.essAccountId = false; |
73 | $("#esAccId").css({ opacity: 1 }); | 85 | $("#esAccId").css({ opacity: 1 }); |
74 | }else{ | 86 | }else{ |
75 | $scope.essAccountId = true; | 87 | $scope.essAccountId = true; |
76 | delete $scope.feature.essintaAccountUid; | 88 | delete $scope.feature.essintaAccountUid; |
77 | $("#esAccId").css({ opacity: 0.5 }); | 89 | $("#esAccId").css({ opacity: 0.5 }); |
78 | } | 90 | } |
79 | } | 91 | } |
80 | 92 | ||
81 | }); | 93 | }); |
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 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> --> | 4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> --> |
5 | <div style="margin-top: 20px;"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | 5 | <div style="margin-top: 20px;"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> |
6 | </div> | 6 | </div> |
7 | <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;"> |
8 | <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> |
9 | <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> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
12 | </div> | 12 | </div> |
13 | <div class="wrapper wrapper-content animated fadeInRight"> | 13 | <div class="wrapper wrapper-content animated fadeInRight"> |
14 | <div class="row"> | 14 | <div class="row"> |
15 | <div class="col-lg-7"> | 15 | <div class="col-lg-7"> |
16 | <div class="ibox float-e-margins"> | 16 | <div class="ibox float-e-margins"> |
17 | <div class="ibox-title"> | 17 | <div class="ibox-title"> |
18 | <div class="pull-left"> | 18 | <div class="pull-left"> |
19 | <h5>Contact Information</h5> | 19 | <h5>Contact Information</h5> |
20 | </div> | 20 | </div> |
21 | <div class="pull-right my-toggle-switch"> | 21 | <div class="pull-right my-toggle-switch"> |
22 | <div class="switch"> | 22 | <div class="switch"> |
23 | <div class="onoffswitch"> | 23 | <div class="onoffswitch"> |
24 | <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"> |
25 | <label class="onoffswitch-label" for="example1"> | 25 | <label class="onoffswitch-label" for="example1"> |
26 | <span class="onoffswitch-inner"></span> | 26 | <span class="onoffswitch-inner"></span> |
27 | <span class="onoffswitch-switch"></span> | 27 | <span class="onoffswitch-switch"></span> |
28 | </label> | 28 | </label> |
29 | </div> | 29 | </div> |
30 | </div> | 30 | </div> |
31 | </div> | 31 | </div> |
32 | <div class="clearfix"></div> | 32 | <div class="clearfix"></div> |
33 | </div> | 33 | </div> |
34 | <div class="ibox-content"> | 34 | <div class="ibox-content"> |
35 | <div class="row"> | 35 | <div class="row"> |
36 | <form role="form"> | 36 | <form role="form"> |
37 | <div class="col-sm-6 b-r"> | 37 | <div class="col-sm-6 b-r"> |
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>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> |
39 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> | 39 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control" ng-blur="checkUsername()"></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>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" 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 class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
42 | <!-- <div> | 42 | <!-- <div> |
43 | <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> |
44 | <label> <input type="checkbox" class="i-checks"> Remember me </label> | 44 | <label> <input type="checkbox" class="i-checks"> Remember me </label> |
45 | </div> --> | 45 | </div> --> |
46 | 46 | ||
47 | </div> | 47 | </div> |
48 | <div class="col-sm-6"> | 48 | <div class="col-sm-6"> |
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>Password</label> <input type="password" ng-model="user.password" placeholder="Password" 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>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" 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 class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> |
52 | </div> | 52 | </div> |
53 | </form> | 53 | </form> |
54 | </div> | 54 | </div> |
55 | </div> | 55 | </div> |
56 | </div> | 56 | </div> |
57 | </div> | 57 | </div> |
58 | <div class="col-lg-5"> | 58 | <div class="col-lg-5"> |
59 | <div class="ibox float-e-margins"> | 59 | <div class="ibox float-e-margins"> |
60 | <div class="ibox-title"> | 60 | <div class="ibox-title"> |
61 | <h5>Client Notes</h5> | 61 | <h5>Client Notes</h5> |
62 | 62 | ||
63 | </div> | 63 | </div> |
64 | <div class="ibox-content"> | 64 | <div class="ibox-content"> |
65 | <div class="row"> | 65 | <div class="row"> |
66 | <form role="form"> | 66 | <form role="form"> |
67 | <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> |
68 | </form> | 68 | </form> |
69 | </div> | 69 | </div> |
70 | </div> | 70 | </div> |
71 | 71 | ||
72 | </div> | 72 | </div> |
73 | </div> | 73 | </div> |
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | 76 | ||
77 | <div class="wrapper wrapper-content animated fadeInRight"> | 77 | <div class="wrapper wrapper-content animated fadeInRight"> |
78 | <div class="row"> | 78 | <div class="row"> |
79 | <div class="col-lg-12"> | 79 | <div class="col-lg-12"> |
80 | <div class="ibox float-e-margins"> | 80 | <div class="ibox float-e-margins"> |
81 | <div class="ibox-title" style="padding: 5px 15px 5px 15px;"> | 81 | <div class="ibox-title" style="padding: 5px 15px 5px 15px;"> |
82 | <div class="col-lg-8"> | 82 | <div class="col-lg-8"> |
83 | <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> |
84 | </div> | 84 | </div> |
85 | <div class="col-lg-4"> | 85 | <div class="col-lg-4"> |
86 | <div class="form-group"> | 86 | <div class="form-group"> |
87 | <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> |
88 | <div class="col-sm-10"> | 88 | <div class="col-sm-10"> |
89 | <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;"> |
90 | <option value="silver" selected>Silver</option> | 90 | <option value="silver" selected>Silver</option> |
91 | <option value="gold">Gold</option> | 91 | <option value="gold">Gold</option> |
92 | </select> | 92 | </select> |
93 | </div> | 93 | </div> |
94 | </div> | 94 | </div> |
95 | </div> | 95 | </div> |
96 | <div class="clearfix"></div> | 96 | <div class="clearfix"></div> |
97 | </div> | 97 | </div> |
98 | <div class="ibox-content"> | 98 | <div class="ibox-content"> |
99 | <div class="row"> | 99 | <div class="row"> |
100 | <form role="form"> | 100 | <form role="form"> |
101 | 101 | ||
102 | <div class="col-lg-3"> | 102 | <div class="col-lg-3"> |
103 | <label style="color: #1ab394;">Modularized</label> | 103 | <label style="color: #1ab394;">Modularized</label> |
104 | <div> | 104 | <div> |
105 | <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> |
106 | </div> | 106 | </div> |
107 | <div> | 107 | <div> |
108 | <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> |
109 | </div> | 109 | </div> |
110 | <div> | 110 | <div> |
111 | <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> |
112 | </div> | 112 | </div> |
113 | <div> | 113 | <div> |
114 | <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> |
115 | </div> | 115 | </div> |
116 | <div> | 116 | <div> |
117 | <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> |
118 | </div> | 118 | </div> |
119 | <div> | 119 | <div> |
120 | <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> |
121 | </div> | 121 | </div> |
122 | <div> | 122 | <div> |
123 | <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> |
124 | </div> | 124 | </div> |
125 | </div> | 125 | </div> |
126 | <div class="col-lg-9" style="padding: 0;"> | 126 | <div class="col-lg-9" style="padding: 0;"> |
127 | <div class="col-lg-6"> | 127 | <div class="col-lg-6"> |
128 | <div class="form-group" style="margin-top: 18px;" id="esAccId"> | 128 | <div class="form-group" style="margin-top: 18px;" id="esAccId"> |
129 | <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> |
130 | <div class="col-lg-6"> | 130 | <div class="col-lg-6"> |
131 | <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"> |
132 | </div> | 132 | </div> |
133 | </div> | 133 | </div> |
134 | </div> | 134 | </div> |
135 | <div class="col-lg-6"> | 135 | <div class="col-lg-6"> |
136 | <div class="form-group" style="margin-top: 18px;"> | 136 | <div class="form-group" style="margin-top: 18px;"> |
137 | <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> |
138 | <div class="col-lg-6"> | 138 | <div class="col-lg-6"> |
139 | <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"> |
140 | </div> | 140 | </div> |
141 | </div> | 141 | </div> |
142 | </div> | 142 | </div> |
143 | </div> | 143 | </div> |
144 | 144 | ||
145 | </form> | 145 | </form> |
146 | </div> | 146 | </div> |
147 | </div> | 147 | </div> |
148 | </div> | 148 | </div> |
149 | </div> | 149 | </div> |
150 | </div> | 150 | </div> |
151 | </div> | 151 | </div> |
app/views/fbo-admin/dashboard.service.js
1 | (function() { | 1 | (function() { |
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | .service('FBOAdmin', ['$rootScope', '$q', '$http', 'BE', FBOAdmin]) | 5 | .service('FBOAdmin', ['$rootScope', '$q', '$http', 'BE', FBOAdmin]) |
6 | 6 | ||
7 | function FBOAdmin($rootScope, $q, $http, BE) { | 7 | function FBOAdmin($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.featureControl = function(data) { | 26 | this.featureControl = 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/accountFeatureControl', | 31 | url : BE.url +'/account/user/accountFeatureControl', |
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 | |||
41 | this.checkUsernameEmail = function(email){ | ||
42 | var deferred = $q.defer(); | ||
43 | $http({ | ||
44 | method : 'GET', | ||
45 | url : BE.url +'/account/user/checkUserNameAvail/'+email, | ||
46 | headers : {'Content-Type': 'application/json'}, | ||
47 | }) | ||
48 | .then(function (result){ | ||
49 | deferred.resolve(result.status); | ||
50 | },function (result){ | ||
51 | deferred.resolve(result.status); | ||
52 | }) | ||
53 | return deferred.promise; | ||
54 | } | ||
40 | } | 55 | } |
41 | 56 | ||
42 | })(); | 57 | })(); |
app/views/fbo-flight/flight.html
1 | <style> | 1 | <style> |
2 | .button1 { | 2 | .button1 { |
3 | display: inline-block; | 3 | display: inline-block; |
4 | height: 35px; | 4 | height: 35px; |
5 | line-height: 35px; | 5 | line-height: 35px; |
6 | padding-right: 15px; | 6 | padding-right: 15px; |
7 | padding-left: 50px; | 7 | padding-left: 50px; |
8 | position: relative; | 8 | position: relative; |
9 | background-color:rgb(41,127,184); | 9 | background-color:rgb(41,127,184); |
10 | color:rgb(255,255,255); | 10 | color:rgb(255,255,255); |
11 | text-decoration: none; | 11 | text-decoration: none; |
12 | text-transform: uppercase; | 12 | text-transform: uppercase; |
13 | letter-spacing: 1px; | 13 | letter-spacing: 1px; |
14 | margin-bottom: 15px; | 14 | margin-bottom: 15px; |
15 | border: 0; | 15 | border: 0; |
16 | 16 | ||
17 | 17 | ||
18 | border-radius: 5px; | 18 | border-radius: 5px; |
19 | -moz-border-radius: 5px; | 19 | -moz-border-radius: 5px; |
20 | -webkit-border-radius: 5px; | 20 | -webkit-border-radius: 5px; |
21 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); | 21 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); |
22 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | 22 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; |
23 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | 23 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); |
24 | 24 | ||
25 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 25 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
26 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 26 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
27 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 27 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
28 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | 28 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; |
29 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | 29 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); |
30 | } | 30 | } |
31 | 31 | ||
32 | .button1 span { | 32 | .button1 span { |
33 | position: absolute; | 33 | position: absolute; |
34 | left: 0; | 34 | left: 0; |
35 | top: 0; | 35 | top: 0; |
36 | width: 35px; | 36 | width: 35px; |
37 | background-color:rgba(0,0,0,0.5); | 37 | background-color:rgba(0,0,0,0.5); |
38 | 38 | ||
39 | -webkit-border-top-left-radius: 5px; | 39 | -webkit-border-top-left-radius: 5px; |
40 | -webkit-border-bottom-left-radius: 5px; | 40 | -webkit-border-bottom-left-radius: 5px; |
41 | -moz-border-radius-topleft: 5px; | 41 | -moz-border-radius-topleft: 5px; |
42 | -moz-border-radius-bottomleft: 5px; | 42 | -moz-border-radius-bottomleft: 5px; |
43 | border-top-left-radius: 5px; | 43 | border-top-left-radius: 5px; |
44 | border-bottom-left-radius: 5px; | 44 | border-bottom-left-radius: 5px; |
45 | border-right: 1px solid rgba(0,0,0,0.15); | 45 | border-right: 1px solid rgba(0,0,0,0.15); |
46 | } | 46 | } |
47 | 47 | ||
48 | .button1:hover span, .button1.active span { | 48 | .button1:hover span, .button1.active span { |
49 | background-color:rgb(0,102,26); | 49 | background-color:rgb(0,102,26); |
50 | border-right: 1px solid rgba(0,0,0,0.3); | 50 | border-right: 1px solid rgba(0,0,0,0.3); |
51 | } | 51 | } |
52 | 52 | ||
53 | .button1:active { | 53 | .button1:active { |
54 | margin-top: 2px; | 54 | margin-top: 2px; |
55 | margin-bottom: 13px; | 55 | margin-bottom: 13px; |
56 | 56 | ||
57 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 57 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
58 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 58 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
59 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 59 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
60 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | 60 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; |
61 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | 61 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); |
62 | } | 62 | } |
63 | 63 | ||
64 | .button1.turquoise { | 64 | .button1.turquoise { |
65 | background: #449d44; | 65 | background: #449d44; |
66 | } | 66 | } |
67 | 67 | ||
68 | </style> | 68 | </style> |
69 | <div class="row wrapper border-bottom white-bg page-heading"> | 69 | <div class="row wrapper border-bottom white-bg page-heading"> |
70 | <div class="col-lg-8"> | 70 | <div class="col-lg-8"> |
71 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> --> | 71 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> --> |
72 | <div style="margin-top: 20px;"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | 72 | <div style="margin-top: 20px;"><input type="text" style="width:50%;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> |
73 | </div> | 73 | </div> |
74 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> | 74 | <div class="col-lg-4" style="margin-top: 20px; text-align: right;"> |
75 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> | 75 | <button type="button" class="btn btn-default btn-sm" ui-sref="index.flightDept">Cancel</button> |
76 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> | 76 | <button type="button" class="btn btn-primary btn-sm" ng-click="userData()">Save Changes</button> |
77 | </div> | 77 | </div> |
78 | </div> | 78 | </div> |
79 | <div class="wrapper wrapper-content animated fadeInRight"> | 79 | <div class="wrapper wrapper-content animated fadeInRight"> |
80 | <div class="row"> | 80 | <div class="row"> |
81 | <div class="col-lg-7"> | 81 | <div class="col-lg-7"> |
82 | <div class="ibox float-e-margins"> | 82 | <div class="ibox float-e-margins"> |
83 | <div class="ibox-title"> | 83 | <div class="ibox-title"> |
84 | <div class="pull-left"> | 84 | <div class="pull-left"> |
85 | <h5>Contact Information</h5> | 85 | <h5>Contact Information</h5> |
86 | </div> | 86 | </div> |
87 | <div class="pull-right my-toggle-switch"> | 87 | <div class="pull-right my-toggle-switch"> |
88 | <div class="switch"> | 88 | <div class="switch"> |
89 | <div class="onoffswitch"> | 89 | <div class="onoffswitch"> |
90 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> | 90 | <input type="checkbox" ng-checked="status === true" ng-model="status" ng-init="status = true" class="onoffswitch-checkbox" id="example1"> |
91 | <label class="onoffswitch-label" for="example1"> | 91 | <label class="onoffswitch-label" for="example1"> |
92 | <span class="onoffswitch-inner"></span> | 92 | <span class="onoffswitch-inner"></span> |
93 | <span class="onoffswitch-switch"></span> | 93 | <span class="onoffswitch-switch"></span> |
94 | </label> | 94 | </label> |
95 | </div> | 95 | </div> |
96 | </div> | 96 | </div> |
97 | </div> | 97 | </div> |
98 | <div class="clearfix"></div> | 98 | <div class="clearfix"></div> |
99 | </div> | 99 | </div> |
100 | <div class="ibox-content"> | 100 | <div class="ibox-content"> |
101 | <div class="row"> | 101 | <div class="row"> |
102 | <form role="form"> | 102 | <form role="form"> |
103 | <div class="col-sm-6 b-r"> | 103 | <div class="col-sm-6 b-r"> |
104 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> | 104 | <!-- <div class="form-group"><label>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> |
105 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> | 105 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control" ng-blur="checkUsername()"></div> |
106 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> | 106 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div> |
107 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> | 107 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
108 | <!-- <div> | 108 | <!-- <div> |
109 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> | 109 | <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>Log in</strong></button> |
110 | <label> <input type="checkbox" class="i-checks"> Remember me </label> | 110 | <label> <input type="checkbox" class="i-checks"> Remember me </label> |
111 | </div> --> | 111 | </div> --> |
112 | 112 | ||
113 | </div> | 113 | </div> |
114 | <div class="col-sm-6"> | 114 | <div class="col-sm-6"> |
115 | <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> | 115 | <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div> |
116 | <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div> | 116 | <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div> |
117 | <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> | 117 | <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> |
118 | </div> | 118 | </div> |
119 | </form> | 119 | </form> |
120 | </div> | 120 | </div> |
121 | </div> | 121 | </div> |
122 | </div> | 122 | </div> |
123 | </div> | 123 | </div> |
124 | <div class="col-lg-5"> | 124 | <div class="col-lg-5"> |
125 | <div class="ibox float-e-margins"> | 125 | <div class="ibox float-e-margins"> |
126 | <div class="ibox-title"> | 126 | <div class="ibox-title"> |
127 | <h5>Client Notes</h5> | 127 | <h5>Client Notes</h5> |
128 | 128 | ||
129 | </div> | 129 | </div> |
130 | <div class="ibox-content"> | 130 | <div class="ibox-content"> |
131 | <div class="row"> | 131 | <div class="row"> |
132 | <form role="form"> | 132 | <form role="form"> |
133 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> | 133 | <textarea class="form-control" rows="10" ng-model="user.clientNote" id="comment"></textarea> |
134 | </form> | 134 | </form> |
135 | </div> | 135 | </div> |
136 | </div> | 136 | </div> |
137 | 137 | ||
138 | </div> | 138 | </div> |
139 | </div> | 139 | </div> |
140 | </div> | 140 | </div> |
141 | </div> | 141 | </div> |
142 | 142 | ||
143 | <div> | 143 | <div> |
144 | <div class="row"> | 144 | <div class="row"> |
145 | <div class="col-lg-7"> | 145 | <div class="col-lg-7"> |
146 | <div class="ibox float-e-margins"> | 146 | <div class="ibox float-e-margins"> |
147 | <div class="ibox-title"> | 147 | <div class="ibox-title"> |
148 | <h5>Aircraft List</h5> | 148 | <h5>Aircraft List</h5> |
149 | <!-- <div class="pull-right"> | 149 | <!-- <div class="pull-right"> |
150 | <button type="button" class="btn btn-primary btn-sm" ng-click="openModal()">+ Add</button> | 150 | <button type="button" class="btn btn-primary btn-sm" ng-click="openModal()">+ Add</button> |
151 | </div> | 151 | </div> |
152 | <div class="clearfix"></div> | 152 | <div class="clearfix"></div> |
153 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> | 153 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> |
154 | <div class="modal-dialog"> | 154 | <div class="modal-dialog"> |
155 | <div class="modal-content animated fadeIn"> | 155 | <div class="modal-content animated fadeIn"> |
156 | <div class="modal-header"> | 156 | <div class="modal-header"> |
157 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | 157 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
158 | <h4 class="modal-title">Add Aircraft</h4> | 158 | <h4 class="modal-title">Add Aircraft</h4> |
159 | </div> | 159 | </div> |
160 | <div class="modal-body" style="padding: 15px;"> | 160 | <div class="modal-body" style="padding: 15px;"> |
161 | <table class="table table-bordered table-hover table-striped"> | 161 | <table class="table table-bordered table-hover table-striped"> |
162 | <thead> | 162 | <thead> |
163 | <tr> | 163 | <tr> |
164 | <th>Tail</th> | 164 | <th>Tail</th> |
165 | <th>Make</th> | 165 | <th>Make</th> |
166 | <th>Model</th> | 166 | <th>Model</th> |
167 | <th>Size</th> | 167 | <th>Size</th> |
168 | </tr> | 168 | </tr> |
169 | </thead> | 169 | </thead> |
170 | <tbody> | 170 | <tbody> |
171 | <tr> | 171 | <tr> |
172 | <td> | 172 | <td> |
173 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | 173 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> |
174 | </td> | 174 | </td> |
175 | <td style="width: 30%"> | 175 | <td style="width: 30%"> |
176 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | 176 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> |
177 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 177 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
178 | </select> | 178 | </select> |
179 | </td> | 179 | </td> |
180 | <td style="width: 30%"> | 180 | <td style="width: 30%"> |
181 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | 181 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> |
182 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | 182 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
183 | </select> | 183 | </select> |
184 | </td> | 184 | </td> |
185 | <td style="width: 30%"> | 185 | <td style="width: 30%"> |
186 | <select class="form-control" ng-model="aircraft.size"> | 186 | <select class="form-control" ng-model="aircraft.size"> |
187 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> | 187 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> |
188 | </select> | 188 | </select> |
189 | </td> | 189 | </td> |
190 | </tr> | 190 | </tr> |
191 | </tbody> | 191 | </tbody> |
192 | </table> | 192 | </table> |
193 | </div> | 193 | </div> |
194 | <div class="modal-footer"> | 194 | <div class="modal-footer"> |
195 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> | 195 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> |
196 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> | 196 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> |
197 | </div> | 197 | </div> |
198 | </div> | 198 | </div> |
199 | </div> | 199 | </div> |
200 | </div> --> | 200 | </div> --> |
201 | </div> | 201 | </div> |
202 | <div class="ibox-content"> | 202 | <div class="ibox-content"> |
203 | <div class="table-responsive"> | 203 | <div class="table-responsive"> |
204 | <!-- <table class="table table-bordered table-hover table-striped"> | 204 | <!-- <table class="table table-bordered table-hover table-striped"> |
205 | <thead> | 205 | <thead> |
206 | <tr> | 206 | <tr> |
207 | <th>Tail</th> | 207 | <th>Tail</th> |
208 | <th>Make</th> | 208 | <th>Make</th> |
209 | <th>Model</th> | 209 | <th>Model</th> |
210 | <th>Size</th> | 210 | <th>Size</th> |
211 | </tr> | 211 | </tr> |
212 | </thead> | 212 | </thead> |
213 | <tbody> | 213 | <tbody> |
214 | <tr ng-repeat="airData in getCraftList track by $index"> | 214 | <tr ng-repeat="airData in getCraftList track by $index"> |
215 | <td> | 215 | <td> |
216 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> | 216 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> |
217 | </td> | 217 | </td> |
218 | <td> | 218 | <td> |
219 | <select class="form-control" ng-model="airData.make"> | 219 | <select class="form-control" ng-model="airData.make"> |
220 | <option>{{airData.make}}</option> | 220 | <option>{{airData.make}}</option> |
221 | </select> | 221 | </select> |
222 | </td> | 222 | </td> |
223 | <td> | 223 | <td> |
224 | <select class="form-control" ng-model="airData.model"> | 224 | <select class="form-control" ng-model="airData.model"> |
225 | <option>{{airData.model}}</option> | 225 | <option>{{airData.model}}</option> |
226 | </select> | 226 | </select> |
227 | </td> | 227 | </td> |
228 | <td> | 228 | <td> |
229 | <select class="form-control" ng-model="airData.size"> | 229 | <select class="form-control" ng-model="airData.size"> |
230 | <option>{{airData.size}}</option> | 230 | <option>{{airData.size}}</option> |
231 | </select> | 231 | </select> |
232 | </td> | 232 | </td> |
233 | </tr> | 233 | </tr> |
234 | </tbody> | 234 | </tbody> |
235 | </table> --> | 235 | </table> --> |
236 | <table class="table table-striped table-bordered"> | 236 | <table class="table table-striped table-bordered"> |
237 | <thead> | 237 | <thead> |
238 | <tr> | 238 | <tr> |
239 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | 239 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> |
240 | <th>Tail</th> | 240 | <th>Tail</th> |
241 | <th>Make</th> | 241 | <th>Make</th> |
242 | <th>Model</th> | 242 | <th>Model</th> |
243 | <th>Size</th> | 243 | <th>Size</th> |
244 | </tr> | 244 | </tr> |
245 | </thead> | 245 | </thead> |
246 | <tbody> | 246 | <tbody> |
247 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | 247 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> |
248 | <!-- <td> | 248 | <!-- <td> |
249 | <input type="checkbox" ng-model="aircraftData.selected"/> | 249 | <input type="checkbox" ng-model="aircraftData.selected"/> |
250 | </td> --> | 250 | </td> --> |
251 | <td style="width: 20%"> | 251 | <td style="width: 20%"> |
252 | <input type="text" class="form-control" ng-model="aircraftData.tail" required/> | 252 | <input type="text" class="form-control" ng-model="aircraftData.tail" required/> |
253 | </td> | 253 | </td> |
254 | <td style="width: 20%"> | 254 | <td style="width: 20%"> |
255 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | 255 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> |
256 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 256 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
257 | </select> | 257 | </select> |
258 | </td> | 258 | </td> |
259 | <td style="width: 20%"> | 259 | <td style="width: 20%"> |
260 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | 260 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> |
261 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> | 261 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> |
262 | </select> | 262 | </select> |
263 | </td> | 263 | </td> |
264 | <td style="width: 20%"> | 264 | <td style="width: 20%"> |
265 | <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> | 265 | <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> |
266 | <!-- <select class="form-control" ng-model="aircraftData.size"> | 266 | <!-- <select class="form-control" ng-model="aircraftData.size"> |
267 | <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | 267 | <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> |
268 | </select> --> | 268 | </select> --> |
269 | </td> | 269 | </td> |
270 | </tr> | 270 | </tr> |
271 | </tbody> | 271 | </tbody> |
272 | </table> | 272 | </table> |
273 | </div> | 273 | </div> |
274 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | 274 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> |
275 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | 275 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> |
276 | </div> | 276 | </div> |
277 | <div class="clearfix"></div> | 277 | <div class="clearfix"></div> |
278 | </div> | 278 | </div> |
279 | </div> | 279 | </div> |
280 | </div> | 280 | </div> |
281 | <div class="col-lg-5"> | 281 | <div class="col-lg-5"> |
282 | <div class="ibox float-e-margins"> | 282 | <div class="ibox float-e-margins"> |
283 | <div class="ibox-title"> | 283 | <div class="ibox-title"> |
284 | <h5>Account Authenticatio & Payment Method</h5> | 284 | <h5>Account Authenticatio & Payment Method</h5> |
285 | 285 | ||
286 | </div> | 286 | </div> |
287 | <div class="ibox-content"> | 287 | <div class="ibox-content"> |
288 | <!-- <div class="row"> | 288 | <!-- <div class="row"> |
289 | <div class="col-md-3"> | 289 | <div class="col-md-3"> |
290 | <img src="images/master.png"> | 290 | <img src="images/master.png"> |
291 | </div> | 291 | </div> |
292 | <div class="col-md-9"> | 292 | <div class="col-md-9"> |
293 | <div class="col"> | 293 | <div class="col"> |
294 | <span style="font-size: large; color: #909394;">**** **** **** 7002</span> | 294 | <span style="font-size: large; color: #909394;">**** **** **** 7002</span> |
295 | </div> | 295 | </div> |
296 | <div class="col"> | 296 | <div class="col"> |
297 | <span><strong>Expiry Date:</strong>10/16</span> | 297 | <span><strong>Expiry Date:</strong>10/16</span> |
298 | </div> | 298 | </div> |
299 | </div> | 299 | </div> |
300 | <div class="clearfix"></div> | 300 | <div class="clearfix"></div> |
301 | <br> | 301 | <br> |
302 | 302 | ||
303 | <div class="col-md-3"> | 303 | <div class="col-md-3"> |
304 | <img src="images/visa1.png"> | 304 | <img src="images/visa1.png"> |
305 | </div> | 305 | </div> |
306 | <div class="col-md-9"> | 306 | <div class="col-md-9"> |
307 | <div class="col"> | 307 | <div class="col"> |
308 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> | 308 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> |
309 | </div> | 309 | </div> |
310 | <div class="col"> | 310 | <div class="col"> |
311 | <span><strong>Expiry Date:</strong>10/16</span> | 311 | <span><strong>Expiry Date:</strong>10/16</span> |
312 | </div> | 312 | </div> |
313 | </div> | 313 | </div> |
314 | <div class="clearfix"></div> | 314 | <div class="clearfix"></div> |
315 | </div> --> | 315 | </div> --> |
316 | 316 | ||
317 | 317 | ||
318 | <div class="row"> | 318 | <div class="row"> |
319 | 319 | ||
320 | <!-- <form name="myForm"> | 320 | <!-- <form name="myForm"> |
321 | 321 | ||
322 | <div class="span3"> | 322 | <div class="span3"> |
323 | <label for="">Card number</label> | 323 | <label for="">Card number</label> |
324 | <input type="text" class="form-control" ng-model="number"> | 324 | <input type="text" class="form-control" ng-model="number"> |
325 | </div> | 325 | </div> |
326 | 326 | ||
327 | <div class="span3"> | 327 | <div class="span3"> |
328 | <label for="">Name on card </label> | 328 | <label for="">Name on card </label> |
329 | <input type="text" class="form-control"> | 329 | <input type="text" class="form-control"> |
330 | </div> | 330 | </div> |
331 | 331 | ||
332 | <div class="row"> | 332 | <div class="row"> |
333 | <div class="col-sm-6"> | 333 | <div class="col-sm-6"> |
334 | <label for="">Expiry</label> | 334 | <label for="">Expiry</label> |
335 | <input type="text" class="form-control" ng-model="expiry"> | 335 | <input type="text" class="form-control" ng-model="expiry"> |
336 | </div> | 336 | </div> |
337 | 337 | ||
338 | <div class="col-sm-6"> | 338 | <div class="col-sm-6"> |
339 | <label for="">CVV</label> | 339 | <label for="">CVV</label> |
340 | <input type="text" class="form-control" ng-model="cvc"> | 340 | <input type="text" class="form-control" ng-model="cvc"> |
341 | </div> | 341 | </div> |
342 | </div> | 342 | </div> |
343 | <div class="span4"> | 343 | <div class="span4"> |
344 | <button type="submit" class="btn btn-primary btn-large">Add</button> | 344 | <button type="submit" class="btn btn-primary btn-large">Add</button> |
345 | </div> | 345 | </div> |
346 | 346 | ||
347 | </form> --> | 347 | </form> --> |
348 | 348 | ||
349 | <div class="container"> | 349 | <div class="container"> |
350 | <div class="row"> | 350 | <div class="row"> |
351 | <div class="col-xs-12 col-md-4"> | 351 | <div class="col-xs-12 col-md-4"> |
352 | <div class="panel panel-default credit-card-box"> | 352 | <div class="panel panel-default credit-card-box"> |
353 | <div class="panel-heading display-table" > | 353 | <div class="panel-heading display-table" > |
354 | <div class="row display-tr" > | 354 | <div class="row display-tr" > |
355 | <h3 class="panel-title display-td" >Payment Details</h3> | 355 | <h3 class="panel-title display-td" >Payment Details</h3> |
356 | <div class="display-td" > | 356 | <div class="display-td" > |
357 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> | 357 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> |
358 | </div> | 358 | </div> |
359 | </div> | 359 | </div> |
360 | </div> | 360 | </div> |
361 | <div class="panel-body"> | 361 | <div class="panel-body"> |
362 | <form role="form" id="payment-form"> | 362 | <form role="form" id="payment-form"> |
363 | <div class="row"> | 363 | <div class="row"> |
364 | <div class="col-xs-12"> | 364 | <div class="col-xs-12"> |
365 | <div class="form-group"> | 365 | <div class="form-group"> |
366 | <label for="cardNumber">CARD NUMBER</label> | 366 | <label for="cardNumber">CARD NUMBER</label> |
367 | <div class="input-group"> | 367 | <div class="input-group"> |
368 | <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> | 368 | <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> |
369 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> | 369 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> |
370 | </div> | 370 | </div> |
371 | </div> | 371 | </div> |
372 | </div> | 372 | </div> |
373 | </div> | 373 | </div> |
374 | <div class="row"> | 374 | <div class="row"> |
375 | <div class="col-xs-7 col-md-7"> | 375 | <div class="col-xs-7 col-md-7"> |
376 | <div class="form-group"> | 376 | <div class="form-group"> |
377 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> | 377 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> |
378 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" | 378 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" |
379 | required> | 379 | required> |
380 | </div> | 380 | </div> |
381 | </div> | 381 | </div> |
382 | <div class="col-xs-5 col-md-5 pull-right"> | 382 | <div class="col-xs-5 col-md-5 pull-right"> |
383 | <div class="form-group"> | 383 | <div class="form-group"> |
384 | <label for="cardCVC">CVV CODE</label> | 384 | <label for="cardCVC">CVV CODE</label> |
385 | <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" | 385 | <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" |
386 | required> | 386 | required> |
387 | </div> | 387 | </div> |
388 | </div> | 388 | </div> |
389 | </div> | 389 | </div> |
390 | <div class="row"> | 390 | <div class="row"> |
391 | <div class="col-xs-12"> | 391 | <div class="col-xs-12"> |
392 | <div class="form-group"> | 392 | <div class="form-group"> |
393 | <label for="name">Card Type</label> | 393 | <label for="name">Card Type</label> |
394 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> | 394 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> |
395 | <option value="creditCard" selected>Credit Card</option> | 395 | <option value="creditCard" selected>Credit Card</option> |
396 | <option value="debitCard">Debit Card</option> | 396 | <option value="debitCard">Debit Card</option> |
397 | </select> | 397 | </select> |
398 | </div> | 398 | </div> |
399 | </div> | 399 | </div> |
400 | </div> | 400 | </div> |
401 | <div class="row"> | 401 | <div class="row"> |
402 | <div class="col-xs-12"> | 402 | <div class="col-xs-12"> |
403 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="addCard()">Add</button> | 403 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="addCard()">Add</button> |
404 | </div> | 404 | </div> |
405 | </div> | 405 | </div> |
406 | <div class="row" style="display:none;"> | 406 | <div class="row" style="display:none;"> |
407 | <div class="col-xs-12"> | 407 | <div class="col-xs-12"> |
408 | <p class="payment-errors"></p> | 408 | <p class="payment-errors"></p> |
409 | </div> | 409 | </div> |
410 | </div> | 410 | </div> |
411 | </form> | 411 | </form> |
412 | </div> | 412 | </div> |
413 | </div> | 413 | </div> |
414 | </div> | 414 | </div> |
415 | </div> | 415 | </div> |
416 | </div> | 416 | </div> |
417 | </div> | 417 | </div> |
418 | </div> | 418 | </div> |
419 | </div> | 419 | </div> |
420 | </div> | 420 | </div> |
421 | </div> | 421 | </div> |
422 | </div> | 422 | </div> |
423 | </div> | 423 | </div> |
424 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> | 424 | <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, $state, FBOFlight) { | 6 | .controller('FlightDeptController', function ($scope, $uibModal, $state, FBOFlight, FBOAdmin) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.fboflight').addClass('active'); | 8 | $('.fboflight').addClass('active'); |
9 | }); | 9 | }); |
10 | $scope.data = {}; | 10 | $scope.data = {}; |
11 | $scope.user = {}; | 11 | $scope.user = {}; |
12 | $scope.aircraft = {}; | 12 | $scope.aircraft = {}; |
13 | |||
14 | $scope.checkUsername = function(){ | ||
15 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | ||
16 | console.log(status) | ||
17 | if(status != 200){ | ||
18 | toastr.error('This email has alreay taken', { | ||
19 | closeButton: true | ||
20 | }) | ||
21 | } | ||
22 | }) | ||
23 | } | ||
24 | |||
13 | $scope.userData = function(){ | 25 | $scope.userData = function(){ |
14 | 26 | ||
15 | if($scope.user.email == undefined || $scope.user.email == null){ | 27 | if($scope.user.email == undefined || $scope.user.email == null){ |
16 | toastr.error('Please enter your email first', { | 28 | toastr.error('Please enter your email first', { |
17 | closeButton: true | 29 | closeButton: true |
18 | }) | 30 | }) |
19 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 31 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
20 | toastr.error('Please enter your First Name', { | 32 | toastr.error('Please enter your First Name', { |
21 | closeButton: true | 33 | closeButton: true |
22 | }) | 34 | }) |
23 | }else{ | 35 | }else{ |
24 | if($scope.status == true){ | 36 | if($scope.status == true){ |
25 | $scope.user.status = 'active'; | 37 | $scope.user.status = 'active'; |
26 | }else{ | 38 | }else{ |
27 | $scope.user.status = 'inactive'; | 39 | $scope.user.status = 'inactive'; |
28 | } | 40 | } |
29 | $scope.user.username = $scope.user.email; | 41 | $scope.user.username = $scope.user.email; |
30 | $scope.user.userType = 'flightDetp'; | 42 | $scope.user.userType = 'flightDetp'; |
31 | console.log($scope.user) | 43 | console.log($scope.user) |
32 | 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; | 44 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; |
33 | FBOFlight.registerUser(formdata).then(function(result) { | 45 | FBOFlight.registerUser(formdata).then(function(result) { |
34 | $scope.registerId = result; | 46 | $scope.registerId = result; |
35 | $scope.data.accountId = $scope.registerId; | 47 | $scope.data.accountId = $scope.registerId; |
36 | $scope.aircraft.accountId = $scope.registerId; | 48 | $scope.aircraft.accountId = $scope.registerId; |
37 | if($scope.aircraft.accountId == $scope.registerId){ | 49 | if($scope.aircraft.accountId == $scope.registerId){ |
38 | $scope.saveCompanyData(); | 50 | $scope.saveCompanyData(); |
39 | } | 51 | } |
40 | toastr.success('Created Successfully', { | 52 | toastr.success('Created Successfully', { |
41 | closeButton: true | 53 | closeButton: true |
42 | }) | 54 | }) |
43 | $state.go('index.flightDept'); | 55 | $state.go('index.flightDept'); |
44 | }, function (err) { | 56 | }, function (err) { |
45 | toastr.error('Error in registeration', { | 57 | toastr.error('Error in registeration', { |
46 | closeButton: true | 58 | closeButton: true |
47 | }) | 59 | }) |
48 | }); | 60 | }); |
49 | } | 61 | } |
50 | } | 62 | } |
51 | 63 | ||
52 | $scope.data.cardType = 'creditCard'; | 64 | $scope.data.cardType = 'creditCard'; |
53 | var cardData = {} | 65 | var cardData = {} |
54 | cardData.paymentMethodList = []; | 66 | cardData.paymentMethodList = []; |
55 | $scope.addCard = function(){ | 67 | $scope.addCard = function(){ |
56 | if($scope.aircraft.accountId == undefined){ | 68 | if($scope.aircraft.accountId == undefined){ |
57 | toastr.error('Please Add Contact Information', { | 69 | toastr.error('Please Add Contact Information', { |
58 | closeButton: true | 70 | closeButton: true |
59 | }) | 71 | }) |
60 | }else{ | 72 | }else{ |
61 | cardData.paymentMethodList.push($scope.data); | 73 | cardData.paymentMethodList.push($scope.data); |
62 | console.log("cardData", cardData); | 74 | console.log("cardData", cardData); |
63 | FBOFlight.addCardInformation(cardData).then(function(result) { | 75 | FBOFlight.addCardInformation(cardData).then(function(result) { |
64 | console.log(result) | 76 | console.log(result) |
65 | toastr.success('Created Successfully', { | 77 | toastr.success('Created Successfully', { |
66 | closeButton: true | 78 | closeButton: true |
67 | }) | 79 | }) |
68 | }) | 80 | }) |
69 | } | 81 | } |
70 | 82 | ||
71 | } | 83 | } |
72 | 84 | ||
73 | getData(); | 85 | getData(); |
74 | function getData(){ | 86 | function getData(){ |
75 | FBOFlight.getAircraftMake().then(function(result) { | 87 | FBOFlight.getAircraftMake().then(function(result) { |
76 | $scope.aircraftMakeList = result; | 88 | $scope.aircraftMakeList = result; |
77 | }) | 89 | }) |
78 | } | 90 | } |
79 | 91 | ||
80 | $scope.aircraftDetails = [{ | 92 | $scope.aircraftDetails = [{ |
81 | 'tail':'', | 93 | 'tail':'', |
82 | 'make': '', | 94 | 'make': '', |
83 | 'model': '', | 95 | 'model': '', |
84 | 'sizeId' : '' | 96 | 'sizeId' : '' |
85 | }]; | 97 | }]; |
86 | 98 | ||
87 | $scope.addNew = function(){ | 99 | $scope.addNew = function(){ |
88 | $scope.aircraftDetails.push({ | 100 | $scope.aircraftDetails.push({ |
89 | 'tail':'', | 101 | 'tail':'', |
90 | 'make': '', | 102 | 'make': '', |
91 | 'model': '', | 103 | 'model': '', |
92 | 'sizeId' : '' | 104 | 'sizeId' : '' |
93 | }); | 105 | }); |
94 | console.log($scope.aircraftDetails) | 106 | console.log($scope.aircraftDetails) |
95 | }; | 107 | }; |
96 | 108 | ||
97 | $scope.getModal = function(makeId, index){ | 109 | $scope.getModal = function(makeId, index){ |
98 | $scope.aircraft.make = makeId; | 110 | $scope.aircraft.make = makeId; |
99 | //var makeId = makeId; | 111 | //var makeId = makeId; |
100 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 112 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
101 | $scope.aircraftDetails[index].aircraftModalList = result; | 113 | $scope.aircraftDetails[index].aircraftModalList = result; |
102 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | 114 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; |
103 | }) | 115 | }) |
104 | } | 116 | } |
105 | 117 | ||
106 | $scope.getSize = function(model, index){ | 118 | $scope.getSize = function(model, index){ |
107 | FBOFlight.getAircraftSize($scope.aircraft.make, model).then(function(result) { | 119 | FBOFlight.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
108 | $scope.aircraftDetails[index].aircraftSizeList = result; | 120 | $scope.aircraftDetails[index].aircraftSizeList = result; |
109 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | 121 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; |
110 | console.log($scope.aircraftDetails[index]) | 122 | console.log($scope.aircraftDetails[index]) |
111 | }) | 123 | }) |
112 | } | 124 | } |
113 | 125 | ||
114 | $scope.aircraftListData = {}; | 126 | $scope.aircraftListData = {}; |
115 | $scope.addData = []; | 127 | $scope.addData = []; |
116 | 128 | ||
117 | $scope.saveCompanyData = function(){ | 129 | $scope.saveCompanyData = function(){ |
118 | for(var i=0; i<$scope.aircraftDetails.length;i++){ | 130 | for(var i=0; i<$scope.aircraftDetails.length;i++){ |
119 | $scope.addData.push({ | 131 | $scope.addData.push({ |
120 | 'tail': $scope.aircraftDetails[i].tail, | 132 | 'tail': $scope.aircraftDetails[i].tail, |
121 | 'make': $scope.aircraftDetails[i].make, | 133 | 'make': $scope.aircraftDetails[i].make, |
122 | 'model': $scope.aircraftDetails[i].model, | 134 | 'model': $scope.aircraftDetails[i].model, |
123 | 'sizeId' : $scope.aircraftDetails[i].sizeId | 135 | 'sizeId' : $scope.aircraftDetails[i].sizeId |
124 | }); | 136 | }); |
125 | } | 137 | } |
126 | $scope.aircraftListData.aircraftList = $scope.addData; | 138 | $scope.aircraftListData.aircraftList = $scope.addData; |
127 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; | 139 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; |
128 | 140 | ||
129 | FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { | 141 | FBOFlight.addAircraft($scope.aircraftListData).then(function(result) { |
130 | console.log(result) | 142 | console.log(result) |
131 | if(result != null && result.success){ | 143 | if(result != null && result.success){ |
132 | toastr.success(''+result.success+'', { | 144 | toastr.success(''+result.success+'', { |
133 | closeButton: true | 145 | closeButton: true |
134 | }) | 146 | }) |
135 | }else{ | 147 | }else{ |
136 | toastr.error(''+result.statusText+'', { | 148 | toastr.error(''+result.statusText+'', { |
137 | closeButton: true | 149 | closeButton: true |
138 | }) | 150 | }) |
139 | } | 151 | } |
140 | }); | 152 | }); |
141 | 153 | ||
142 | } | 154 | } |
143 | 155 | ||
144 | // getData(); | 156 | // getData(); |
145 | // function getData(){ | 157 | // function getData(){ |
146 | // FBOFlight.getAircraftMake().then(function(result) { | 158 | // FBOFlight.getAircraftMake().then(function(result) { |
147 | // $scope.aircraftMakeList = result; | 159 | // $scope.aircraftMakeList = result; |
148 | // $scope.aircraft.make = $scope.aircraftMakeList[0]; | 160 | // $scope.aircraft.make = $scope.aircraftMakeList[0]; |
149 | // FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 161 | // FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
150 | // $scope.aircraftModalList = result; | 162 | // $scope.aircraftModalList = result; |
151 | // $scope.aircraft.model = $scope.aircraftModalList[0]; | 163 | // $scope.aircraft.model = $scope.aircraftModalList[0]; |
152 | // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 164 | // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
153 | // $scope.aircraftSizeList = result; | 165 | // $scope.aircraftSizeList = result; |
154 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; | 166 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; |
155 | // }) | 167 | // }) |
156 | // }) | 168 | // }) |
157 | 169 | ||
158 | // }) | 170 | // }) |
159 | // } | 171 | // } |
160 | 172 | ||
161 | 173 | ||
162 | // $scope.getModal = function(){ | 174 | // $scope.getModal = function(){ |
163 | // var makeId = $scope.aircraft.make; | 175 | // var makeId = $scope.aircraft.make; |
164 | // FBOFlight.getModal(makeId).then(function(result) { | 176 | // FBOFlight.getModal(makeId).then(function(result) { |
165 | // $scope.aircraftModalList = result; | 177 | // $scope.aircraftModalList = result; |
166 | // $scope.aircraft.model = $scope.aircraftModalList[0]; | 178 | // $scope.aircraft.model = $scope.aircraftModalList[0]; |
167 | // FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | 179 | // FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { |
168 | // $scope.aircraftSizeList = result; | 180 | // $scope.aircraftSizeList = result; |
169 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; | 181 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; |
170 | // }) | 182 | // }) |
171 | // }) | 183 | // }) |
172 | // } | 184 | // } |
173 | 185 | ||
174 | // $scope.getSize = function(){ | 186 | // $scope.getSize = function(){ |
175 | // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 187 | // FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
176 | // $scope.aircraftSizeList = result; | 188 | // $scope.aircraftSizeList = result; |
177 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; | 189 | // $scope.aircraft.size = $scope.aircraftSizeList[0]; |
178 | // }) | 190 | // }) |
179 | // } | 191 | // } |
180 | 192 | ||
181 | // $scope.openModal = function(){ | 193 | // $scope.openModal = function(){ |
182 | // if($scope.aircraft.accountId == undefined){ | 194 | // if($scope.aircraft.accountId == undefined){ |
183 | // toastr.error('Please Add Contact Information', { | 195 | // toastr.error('Please Add Contact Information', { |
184 | // closeButton: true | 196 | // closeButton: true |
185 | // }) | 197 | // }) |
186 | // $('#myModal4').modal('hide'); | 198 | // $('#myModal4').modal('hide'); |
187 | // }else{ | 199 | // }else{ |
188 | // $('#myModal4').modal('show'); | 200 | // $('#myModal4').modal('show'); |
189 | // } | 201 | // } |
190 | 202 | ||
191 | // } | 203 | // } |
192 | // $scope.aircraftData = {}; | 204 | // $scope.aircraftData = {}; |
193 | // $scope.aircraftData.aircraftList = []; | 205 | // $scope.aircraftData.aircraftList = []; |
194 | // $scope.getCraftList = []; | 206 | // $scope.getCraftList = []; |
195 | // $scope.addAircraft = function(){ | 207 | // $scope.addAircraft = function(){ |
196 | // $scope.aircraftData.aircraftList.push($scope.aircraft); | 208 | // $scope.aircraftData.aircraftList.push($scope.aircraft); |
197 | // if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { | 209 | // if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { |
198 | // $scope.getCraftList.push($scope.aircraft); | 210 | // $scope.getCraftList.push($scope.aircraft); |
199 | // } | 211 | // } |
200 | 212 | ||
201 | // FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | 213 | // FBOFlight.addAircraft($scope.aircraftData).then(function(result) { |
202 | // $('#myModal4').modal('hide'); | 214 | // $('#myModal4').modal('hide'); |
203 | // $scope.reset(); | 215 | // $scope.reset(); |
204 | // toastr.success('Created Successfully', { | 216 | // toastr.success('Created Successfully', { |
205 | // closeButton: true | 217 | // closeButton: true |
206 | // }) | 218 | // }) |
207 | // }, function (err) { | 219 | // }, function (err) { |
208 | // toastr.error('Error in Adding Aircraft', { | 220 | // toastr.error('Error in Adding Aircraft', { |
209 | // closeButton: true | 221 | // closeButton: true |
210 | // }) | 222 | // }) |
211 | // $('#myModal4').modal('hide'); | 223 | // $('#myModal4').modal('hide'); |
212 | // $scope.getCraftList.splice($scope.aircraft); | 224 | // $scope.getCraftList.splice($scope.aircraft); |
213 | // }); | 225 | // }); |
214 | 226 | ||
215 | // } | 227 | // } |
216 | 228 | ||
217 | // $scope.reset = function() { | 229 | // $scope.reset = function() { |
218 | // $scope.aircraft = {}; | 230 | // $scope.aircraft = {}; |
219 | // $scope.aircraft.accountId = $scope.data.accountId; | 231 | // $scope.aircraft.accountId = $scope.data.accountId; |
220 | // $scope.aircraftData.aircraftList = []; | 232 | // $scope.aircraftData.aircraftList = []; |
221 | // getData(); | 233 | // getData(); |
222 | // } | 234 | // } |
223 | }); | 235 | }); |
app/views/updateAllFBO/updateAllFBO.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('updateAllFBOController', function($scope, $stateParams, $state, UpdateAllFBO) { | 6 | .controller('updateAllFBOController', function($scope, $stateParams, $state, UpdateAllFBO, FBOAdmin) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.i-checks').iCheck({ | 8 | $('.i-checks').iCheck({ |
9 | checkboxClass: 'icheckbox_square-green', | 9 | checkboxClass: 'icheckbox_square-green', |
10 | radioClass: 'iradio_square-green', | 10 | radioClass: 'iradio_square-green', |
11 | }); | 11 | }); |
12 | $('.fboadmin').addClass('active'); | 12 | $('.fboadmin').addClass('active'); |
13 | 13 | ||
14 | }); | 14 | }); |
15 | 15 | ||
16 | $scope.feature = {}; | 16 | $scope.feature = {}; |
17 | var userProfileID = $stateParams.id; | 17 | var userProfileID = $stateParams.id; |
18 | UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { | 18 | UpdateAllFBO.getALlFBOData(userProfileID).then(function(result) { |
19 | console.log(result) | 19 | console.log(result) |
20 | $scope.user = result; | 20 | $scope.user = result; |
21 | $scope.user.userTypeId = result.userType.id; | 21 | $scope.user.userTypeId = result.userType.id; |
22 | 22 | ||
23 | if(result.accountFeatureControl != null){ | 23 | if(result.accountFeatureControl != null){ |
24 | $scope.feature = result.accountFeatureControl; | 24 | $scope.feature = result.accountFeatureControl; |
25 | $scope.feature.accountId = result.account.id; | 25 | $scope.feature.accountId = result.account.id; |
26 | console.log($scope.feature) | 26 | console.log($scope.feature) |
27 | if($scope.feature.essintaPosSystem == true){ | 27 | if($scope.feature.essintaPosSystem == true){ |
28 | $scope.essAccountId = false; | 28 | $scope.essAccountId = false; |
29 | $("#esAccId").css({ opacity: 1 }); | 29 | $("#esAccId").css({ opacity: 1 }); |
30 | }else{ | 30 | }else{ |
31 | $scope.essAccountId = true; | 31 | $scope.essAccountId = true; |
32 | delete $scope.feature.essintaAccountUid; | 32 | delete $scope.feature.essintaAccountUid; |
33 | $("#esAccId").css({ opacity: 0.5 }); | 33 | $("#esAccId").css({ opacity: 0.5 }); |
34 | } | 34 | } |
35 | }else{ | 35 | }else{ |
36 | $scope.feature.accountId = result.account.id; | 36 | $scope.feature.accountId = result.account.id; |
37 | } | 37 | } |
38 | 38 | ||
39 | UpdateAllFBO.getNotes(userProfileID).then(function(response) { | 39 | UpdateAllFBO.getNotes(userProfileID).then(function(response) { |
40 | $scope.user.clientNote = response[0].notes | 40 | $scope.user.clientNote = response[0].notes |
41 | $scope.user.userNoteId = response[0].id; | 41 | $scope.user.userNoteId = response[0].id; |
42 | }) | 42 | }) |
43 | console.log($scope.feature,"dsdsdsds") | 43 | console.log($scope.feature,"dsdsdsds") |
44 | if($scope.user.account.user.status == 'ACTIVE'){ | 44 | if($scope.user.account.user.status == 'ACTIVE'){ |
45 | $scope.status = true; | 45 | $scope.status = true; |
46 | }else { | 46 | }else { |
47 | $scope.status = false; | 47 | $scope.status = false; |
48 | } | 48 | } |
49 | }) | 49 | }) |
50 | 50 | ||
51 | $scope.enableEssId = function(){ | 51 | $scope.enableEssId = function(){ |
52 | if($scope.feature.essintaPosSystem == true){ | 52 | if($scope.feature.essintaPosSystem == true){ |
53 | $scope.essAccountId = false; | 53 | $scope.essAccountId = false; |
54 | $("#esAccId").css({ opacity: 1 }); | 54 | $("#esAccId").css({ opacity: 1 }); |
55 | }else{ | 55 | }else{ |
56 | $scope.essAccountId = true; | 56 | $scope.essAccountId = true; |
57 | delete $scope.feature.essintaAccountUid; | 57 | delete $scope.feature.essintaAccountUid; |
58 | $("#esAccId").css({ opacity: 0.5 }); | 58 | $("#esAccId").css({ opacity: 0.5 }); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | $scope.checkUsername = function(){ | ||
63 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | ||
64 | console.log(status) | ||
65 | if(status != 200){ | ||
66 | toastr.error('This email has alreay taken', { | ||
67 | closeButton: true | ||
68 | }) | ||
69 | } | ||
70 | }) | ||
71 | } | ||
72 | |||
62 | $scope.userData = function(){ | 73 | $scope.userData = function(){ |
63 | console.log($scope.user.userTypeId) | 74 | console.log($scope.user.userTypeId) |
64 | if($scope.user.email == undefined || $scope.user.email == null){ | 75 | if($scope.user.email == undefined || $scope.user.email == null){ |
65 | toastr.error('Please enter your email first', { | 76 | toastr.error('Please enter your email first', { |
66 | closeButton: true | 77 | closeButton: true |
67 | }) | 78 | }) |
68 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 79 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
69 | toastr.error('Please enter your First Name', { | 80 | toastr.error('Please enter your First Name', { |
70 | closeButton: true | 81 | closeButton: true |
71 | }) | 82 | }) |
72 | }else{ | 83 | }else{ |
73 | if($scope.status == true){ | 84 | if($scope.status == true){ |
74 | $scope.user.status = 'active'; | 85 | $scope.user.status = 'active'; |
75 | }else{ | 86 | }else{ |
76 | $scope.user.status = 'inactive'; | 87 | $scope.user.status = 'inactive'; |
77 | } | 88 | } |
78 | $scope.user.username = $scope.user.email; | 89 | $scope.user.username = $scope.user.email; |
79 | $scope.user.userType = 'fbo'; | 90 | $scope.user.userType = 'fbo'; |
80 | console.log($scope.user) | 91 | console.log($scope.user) |
81 | // if($scope.user.userNoteId == undefined){ | 92 | // if($scope.user.userNoteId == undefined){ |
82 | // $scope.user.userNoteId = null; | 93 | // $scope.user.userNoteId = null; |
83 | // } | 94 | // } |
84 | var updateData = "companyName=" + $scope.user.companyName + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&userNote=" + $scope.user.clientNote + "&userNoteId=" + $scope.user.userNoteId + "&userTypeId=" + $scope.user.userTypeId + "&userProfileId=" + userProfileID; | 95 | var updateData = "companyName=" + $scope.user.companyName + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&userNote=" + $scope.user.clientNote + "&userNoteId=" + $scope.user.userNoteId + "&userTypeId=" + $scope.user.userTypeId + "&userProfileId=" + userProfileID; |
85 | UpdateAllFBO.updateUser(updateData).then(function(result) { | 96 | UpdateAllFBO.updateUser(updateData).then(function(result) { |
86 | toastr.success(''+result.success+'', { | 97 | toastr.success(''+result.success+'', { |
87 | closeButton: true | 98 | closeButton: true |
88 | }) | 99 | }) |
89 | var updatefeatureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem | 100 | var updatefeatureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem |
90 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" | 101 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" |
91 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration | 102 | + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration |
92 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id; | 103 | + "&essintaAccountUid=" + $scope.feature.essintaAccountUid + "&additionalLicences=" + $scope.feature.additionalLicences + "&accountFeatureControlId=" + $scope.feature.id; |
93 | 104 | ||
94 | UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) { | 105 | UpdateAllFBO.updatefeatureControl(updatefeatureControlData).then(function(response) { |
95 | console.log(response) | 106 | console.log(response) |
96 | }) | 107 | }) |
97 | $state.go('index.fboAdmin'); | 108 | $state.go('index.fboAdmin'); |
98 | }) | 109 | }) |
99 | } | 110 | } |
100 | } | 111 | } |
101 | 112 | ||
102 | }); | 113 | }); |
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-3"> | 3 | <div class="col-lg-3"> |
4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> --> | 4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> --> |
5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | 5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> |
6 | </div> | 6 | </div> |
7 | <div class="col-lg-3" style="margin-top: 20px;"> | 7 | <div class="col-lg-3" style="margin-top: 20px;"> |
8 | <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> |
9 | </div> | 9 | </div> |
10 | <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;"> |
11 | <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> |
12 | <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> |
13 | </div> | 13 | </div> |
14 | </div> | 14 | </div> |
15 | </div> | 15 | </div> |
16 | <div class="wrapper wrapper-content animated fadeInRight"> | 16 | <div class="wrapper wrapper-content animated fadeInRight"> |
17 | <div class="row"> | 17 | <div class="row"> |
18 | <div class="col-lg-7"> | 18 | <div class="col-lg-7"> |
19 | <div class="ibox float-e-margins"> | 19 | <div class="ibox float-e-margins"> |
20 | <div class="ibox-title"> | 20 | <div class="ibox-title"> |
21 | <div class="pull-left"> | 21 | <div class="pull-left"> |
22 | <h5>Contact Information</h5> | 22 | <h5>Contact Information</h5> |
23 | </div> | 23 | </div> |
24 | <div class="pull-right my-toggle-switch"> | 24 | <div class="pull-right my-toggle-switch"> |
25 | <div class="switch"> | 25 | <div class="switch"> |
26 | <div class="onoffswitch"> | 26 | <div class="onoffswitch"> |
27 | <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"> |
28 | <label class="onoffswitch-label" for="example1"> | 28 | <label class="onoffswitch-label" for="example1"> |
29 | <span class="onoffswitch-inner"></span> | 29 | <span class="onoffswitch-inner"></span> |
30 | <span class="onoffswitch-switch"></span> | 30 | <span class="onoffswitch-switch"></span> |
31 | </label> | 31 | </label> |
32 | </div> | 32 | </div> |
33 | </div> | 33 | </div> |
34 | </div> | 34 | </div> |
35 | <div class="clearfix"></div> | 35 | <div class="clearfix"></div> |
36 | </div> | 36 | </div> |
37 | <div class="ibox-content"> | 37 | <div class="ibox-content"> |
38 | <div class="row"> | 38 | <div class="row"> |
39 | <form role="form"> | 39 | <form role="form"> |
40 | <div class="col-sm-6 b-r"> | 40 | <div class="col-sm-6 b-r"> |
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>Company Name</label> <input type="text" placeholder="Company Name" ng-model="user.companyName" class="form-control"></div> --> |
42 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> | 42 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control" ng-blur="checkUsername()"></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>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" 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 class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div> |
45 | <!-- <div> | 45 | <!-- <div> |
46 | <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> |
47 | <label> <input type="checkbox" class="i-checks"> Remember me </label> | 47 | <label> <input type="checkbox" class="i-checks"> Remember me </label> |
48 | </div> --> | 48 | </div> --> |
49 | 49 | ||
50 | </div> | 50 | </div> |
51 | <div class="col-sm-6"> | 51 | <div class="col-sm-6"> |
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>Password</label> <input type="password" ng-model="user.password" placeholder="Password" 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>Phone</label> <input type="tel" ng-model="user.phone" placeholder="Phone" 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 class="form-group"><label>Mobile</label> <input type="tel" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div> |
55 | </div> | 55 | </div> |
56 | </form> | 56 | </form> |
57 | </div> | 57 | </div> |
58 | </div> | 58 | </div> |
59 | </div> | 59 | </div> |
60 | </div> | 60 | </div> |
61 | <div class="col-lg-5"> | 61 | <div class="col-lg-5"> |
62 | <div class="ibox float-e-margins"> | 62 | <div class="ibox float-e-margins"> |
63 | <div class="ibox-title"> | 63 | <div class="ibox-title"> |
64 | <h5>Client Notes</h5> | 64 | <h5>Client Notes</h5> |
65 | 65 | ||
66 | </div> | 66 | </div> |
67 | <div class="ibox-content"> | 67 | <div class="ibox-content"> |
68 | <div class="row"> | 68 | <div class="row"> |
69 | <form role="form"> | 69 | <form role="form"> |
70 | <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> |
71 | </form> | 71 | </form> |
72 | </div> | 72 | </div> |
73 | </div> | 73 | </div> |
74 | 74 | ||
75 | </div> | 75 | </div> |
76 | </div> | 76 | </div> |
77 | </div> | 77 | </div> |
78 | </div> | 78 | </div> |
79 | 79 | ||
80 | <div class="wrapper wrapper-content animated fadeInRight"> | 80 | <div class="wrapper wrapper-content animated fadeInRight"> |
81 | <div class="row"> | 81 | <div class="row"> |
82 | <div class="col-lg-12"> | 82 | <div class="col-lg-12"> |
83 | <div class="ibox float-e-margins"> | 83 | <div class="ibox float-e-margins"> |
84 | <div class="ibox-title" style="padding: 5px 15px 5px 15px;"> | 84 | <div class="ibox-title" style="padding: 5px 15px 5px 15px;"> |
85 | <div class="col-lg-8"> | 85 | <div class="col-lg-8"> |
86 | <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> |
87 | </div> | 87 | </div> |
88 | <div class="col-lg-4"> | 88 | <div class="col-lg-4"> |
89 | <div class="form-group"> | 89 | <div class="form-group"> |
90 | <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> |
91 | <div class="col-sm-10"> | 91 | <div class="col-sm-10"> |
92 | <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;"> |
93 | <option value="silver" selected>Silver</option> | 93 | <option value="silver" selected>Silver</option> |
94 | <option value="gold">Gold</option> | 94 | <option value="gold">Gold</option> |
95 | </select> | 95 | </select> |
96 | </div> | 96 | </div> |
97 | </div> | 97 | </div> |
98 | </div> | 98 | </div> |
99 | <div class="clearfix"></div> | 99 | <div class="clearfix"></div> |
100 | </div> | 100 | </div> |
101 | <div class="ibox-content"> | 101 | <div class="ibox-content"> |
102 | <div class="row"> | 102 | <div class="row"> |
103 | <form role="form"> | 103 | <form role="form"> |
104 | 104 | ||
105 | <div class="col-lg-3"> | 105 | <div class="col-lg-3"> |
106 | <label style="color: #1ab394;">Modularized</label> | 106 | <label style="color: #1ab394;">Modularized</label> |
107 | <div> | 107 | <div> |
108 | <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> |
109 | </div> | 109 | </div> |
110 | <div> | 110 | <div> |
111 | <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> |
112 | </div> | 112 | </div> |
113 | <div> | 113 | <div> |
114 | <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> |
115 | </div> | 115 | </div> |
116 | <div> | 116 | <div> |
117 | <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> |
118 | </div> | 118 | </div> |
119 | <div> | 119 | <div> |
120 | <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> |
121 | </div> | 121 | </div> |
122 | <div> | 122 | <div> |
123 | <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> |
124 | </div> | 124 | </div> |
125 | <div> | 125 | <div> |
126 | <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> |
127 | </div> | 127 | </div> |
128 | </div> | 128 | </div> |
129 | <div class="col-lg-9" style="padding: 0;"> | 129 | <div class="col-lg-9" style="padding: 0;"> |
130 | <div class="col-lg-6"> | 130 | <div class="col-lg-6"> |
131 | <div class="form-group" style="margin-top: 18px;" id="esAccId"> | 131 | <div class="form-group" style="margin-top: 18px;" id="esAccId"> |
132 | <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> |
133 | <div class="col-lg-6"> | 133 | <div class="col-lg-6"> |
134 | <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"> |
135 | </div> | 135 | </div> |
136 | </div> | 136 | </div> |
137 | </div> | 137 | </div> |
138 | <div class="col-lg-6"> | 138 | <div class="col-lg-6"> |
139 | <div class="form-group" style="margin-top: 18px;"> | 139 | <div class="form-group" style="margin-top: 18px;"> |
140 | <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> |
141 | <div class="col-lg-6"> | 141 | <div class="col-lg-6"> |
142 | <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"> |
143 | </div> | 143 | </div> |
144 | </div> | 144 | </div> |
145 | </div> | 145 | </div> |
146 | </div> | 146 | </div> |
147 | 147 | ||
148 | </form> | 148 | </form> |
149 | </div> | 149 | </div> |
150 | </div> | 150 | </div> |
151 | </div> | 151 | </div> |
152 | </div> | 152 | </div> |
153 | </div> | 153 | </div> |
154 | </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, $state, UpdateAllFBODept, UpdateAllFBO, FBOFlight) { | 6 | .controller('updateFBODeptController', function($scope, $stateParams, $state, UpdateAllFBODept, UpdateAllFBO, FBOFlight, FBOAdmin) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.fboflight').addClass('active'); | 8 | $('.fboflight').addClass('active'); |
9 | }); | 9 | }); |
10 | $scope.showPayments = true; | 10 | $scope.showPayments = true; |
11 | $scope.aircraft = {}; | 11 | $scope.aircraft = {}; |
12 | $scope.updateData = {}; | 12 | $scope.updateData = {}; |
13 | var userProfileID = $stateParams.id; | 13 | var userProfileID = $stateParams.id; |
14 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { | 14 | UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) { |
15 | console.log(result) | 15 | console.log(result) |
16 | $scope.user = result; | 16 | $scope.user = result; |
17 | $scope.aircraft.accountId = result.account.id; | 17 | $scope.aircraft.accountId = result.account.id; |
18 | $scope.user.userTypeId = result.userType.id; | 18 | $scope.user.userTypeId = result.userType.id; |
19 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { | 19 | UpdateAllFBODept.getNotes(userProfileID).then(function(response) { |
20 | $scope.user.clientNote = response[0].notes | 20 | $scope.user.clientNote = response[0].notes |
21 | $scope.user.userNoteId = response[0].id; | 21 | $scope.user.userNoteId = response[0].id; |
22 | }) | 22 | }) |
23 | // $scope.feature = result.accountFeatureControl; | 23 | // $scope.feature = result.accountFeatureControl; |
24 | // console.log($scope.feature,"dsdsdsds") | 24 | // console.log($scope.feature,"dsdsdsds") |
25 | if($scope.user.account.user.status == 'ACTIVE'){ | 25 | if($scope.user.account.user.status == 'ACTIVE'){ |
26 | $scope.status = true; | 26 | $scope.status = true; |
27 | }else { | 27 | }else { |
28 | $scope.status = false; | 28 | $scope.status = false; |
29 | } | 29 | } |
30 | }) | 30 | }) |
31 | 31 | ||
32 | getCrafts(); | 32 | getCrafts(); |
33 | function getCrafts(){ | 33 | function getCrafts(){ |
34 | UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { | 34 | UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) { |
35 | $scope.getCraftList = response; | 35 | $scope.getCraftList = response; |
36 | for(var i=0;i<$scope.getCraftList.length;i++){ | 36 | for(var i=0;i<$scope.getCraftList.length;i++){ |
37 | $scope.getCraftList[i].sizeId = $scope.getCraftList[i].userAircraftSize.id; | 37 | $scope.getCraftList[i].sizeId = $scope.getCraftList[i].userAircraftSize.id; |
38 | $scope.getCraftList[i].size = $scope.getCraftList[i].userAircraftSize.size; | 38 | $scope.getCraftList[i].size = $scope.getCraftList[i].userAircraftSize.size; |
39 | } | 39 | } |
40 | }) | 40 | }) |
41 | } | 41 | } |
42 | 42 | ||
43 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { | 43 | UpdateAllFBODept.getPaymentMethod(userProfileID).then(function(response) { |
44 | $scope.paymentList = response; | 44 | $scope.paymentList = response; |
45 | 45 | ||
46 | }) | 46 | }) |
47 | 47 | ||
48 | $scope.openCard = function(payment){ | 48 | $scope.openCard = function(payment){ |
49 | console.log(payment) | 49 | console.log(payment) |
50 | $scope.showPayments = false; | 50 | $scope.showPayments = false; |
51 | $scope.data = {}; | 51 | $scope.data = {}; |
52 | $scope.data.cardNumber = payment.cardNumber; | 52 | $scope.data.cardNumber = payment.cardNumber; |
53 | $scope.data.cardType = payment.cardType; | 53 | $scope.data.cardType = payment.cardType; |
54 | $scope.data.expiryDate = payment.expiryDate; | 54 | $scope.data.expiryDate = payment.expiryDate; |
55 | $scope.data.id = payment.id; | 55 | $scope.data.id = payment.id; |
56 | $scope.data.accountId = payment.user.account.id; | 56 | $scope.data.accountId = payment.user.account.id; |
57 | } | 57 | } |
58 | 58 | ||
59 | var cardData = {} | 59 | var cardData = {} |
60 | cardData.paymentMethodList = []; | 60 | cardData.paymentMethodList = []; |
61 | $scope.updateCard = function(){ | 61 | $scope.updateCard = function(){ |
62 | console.log($scope.data) | 62 | console.log($scope.data) |
63 | cardData.paymentMethodList.push($scope.data); | 63 | cardData.paymentMethodList.push($scope.data); |
64 | console.log("cardData", cardData); | 64 | console.log("cardData", cardData); |
65 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { | 65 | UpdateAllFBODept.updatePaymentMethod(cardData).then(function(result) { |
66 | console.log(result) | 66 | console.log(result) |
67 | toastr.success('Updated Successfully', { | 67 | toastr.success('Updated Successfully', { |
68 | closeButton: true | 68 | closeButton: true |
69 | }) | 69 | }) |
70 | $scope.reset(); | 70 | $scope.reset(); |
71 | }) | 71 | }) |
72 | } | 72 | } |
73 | 73 | ||
74 | 74 | ||
75 | $scope.reset = function(){ | 75 | $scope.reset = function(){ |
76 | cardData.paymentMethodList = []; | 76 | cardData.paymentMethodList = []; |
77 | } | 77 | } |
78 | 78 | ||
79 | $scope.checkUsername = function(){ | ||
80 | FBOAdmin.checkUsernameEmail($scope.user.email).then(function(status) { | ||
81 | console.log(status) | ||
82 | if(status != 200){ | ||
83 | toastr.error('This email has alreay taken', { | ||
84 | closeButton: true | ||
85 | }) | ||
86 | } | ||
87 | }) | ||
88 | } | ||
89 | |||
79 | $scope.userData = function(){ | 90 | $scope.userData = function(){ |
80 | console.log($scope.user.userTypeId) | 91 | console.log($scope.user.userTypeId) |
81 | if($scope.user.email == undefined || $scope.user.email == null){ | 92 | if($scope.user.email == undefined || $scope.user.email == null){ |
82 | toastr.error('Please enter your email first', { | 93 | toastr.error('Please enter your email first', { |
83 | closeButton: true | 94 | closeButton: true |
84 | }) | 95 | }) |
85 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ | 96 | }else if($scope.user.firstName == undefined || $scope.user.firstName == null){ |
86 | toastr.error('Please enter your First Name', { | 97 | toastr.error('Please enter your First Name', { |
87 | closeButton: true | 98 | closeButton: true |
88 | }) | 99 | }) |
89 | }else{ | 100 | }else{ |
90 | if($scope.status == true){ | 101 | if($scope.status == true){ |
91 | $scope.user.status = 'active'; | 102 | $scope.user.status = 'active'; |
92 | }else{ | 103 | }else{ |
93 | $scope.user.status = 'inactive'; | 104 | $scope.user.status = 'inactive'; |
94 | } | 105 | } |
95 | $scope.user.username = $scope.user.email; | 106 | $scope.user.username = $scope.user.email; |
96 | $scope.user.userType = 'flightDetp'; | 107 | $scope.user.userType = 'flightDetp'; |
97 | console.log($scope.user) | 108 | console.log($scope.user) |
98 | // if($scope.user.userNoteId == undefined){ | 109 | // if($scope.user.userNoteId == undefined){ |
99 | // $scope.user.userNoteId = null; | 110 | // $scope.user.userNoteId = null; |
100 | // } | 111 | // } |
101 | 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; | 112 | 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; |
102 | UpdateAllFBO.updateUser(updateData).then(function(result) { | 113 | UpdateAllFBO.updateUser(updateData).then(function(result) { |
103 | toastr.success(''+result.success+'', { | 114 | toastr.success(''+result.success+'', { |
104 | closeButton: true | 115 | closeButton: true |
105 | }) | 116 | }) |
106 | }) | 117 | }) |
107 | $state.go('index.flightDept'); | 118 | $state.go('index.flightDept'); |
108 | } | 119 | } |
109 | } | 120 | } |
110 | 121 | ||
111 | getData(); | 122 | getData(); |
112 | function getData(){ | 123 | function getData(){ |
113 | FBOFlight.getAircraftMake().then(function(result) { | 124 | FBOFlight.getAircraftMake().then(function(result) { |
114 | $scope.aircraftMakeList = result; | 125 | $scope.aircraftMakeList = result; |
115 | $scope.aircraft.make = $scope.aircraftMakeList[0]; | 126 | $scope.aircraft.make = $scope.aircraftMakeList[0]; |
116 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 127 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
117 | $scope.aircraftModalList = result; | 128 | $scope.aircraftModalList = result; |
118 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 129 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
119 | 130 | ||
120 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 131 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
121 | $scope.aircraftSizeList = result; | 132 | $scope.aircraftSizeList = result; |
122 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 133 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
123 | 134 | ||
124 | }) | 135 | }) |
125 | }) | 136 | }) |
126 | 137 | ||
127 | }) | 138 | }) |
128 | } | 139 | } |
129 | 140 | ||
130 | $scope.getModal = function(){ | 141 | $scope.getModal = function(){ |
131 | var makeId = $scope.aircraft.make | 142 | var makeId = $scope.aircraft.make |
132 | FBOFlight.getModal(makeId).then(function(result) { | 143 | FBOFlight.getModal(makeId).then(function(result) { |
133 | $scope.aircraftModalList = result; | 144 | $scope.aircraftModalList = result; |
134 | $scope.aircraft.model = $scope.aircraftModalList[0]; | 145 | $scope.aircraft.model = $scope.aircraftModalList[0]; |
135 | 146 | ||
136 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { | 147 | FBOFlight.getAircraftSize(makeId, $scope.aircraft.model).then(function(result) { |
137 | $scope.aircraftSizeList = result; | 148 | $scope.aircraftSizeList = result; |
138 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 149 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
139 | }) | 150 | }) |
140 | }) | 151 | }) |
141 | } | 152 | } |
142 | 153 | ||
143 | $scope.getSize = function(){ | 154 | $scope.getSize = function(){ |
144 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 155 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
145 | $scope.aircraftSizeList = result; | 156 | $scope.aircraftSizeList = result; |
146 | console.log($scope.aircraftSizeList) | 157 | console.log($scope.aircraftSizeList) |
147 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 158 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
148 | console.log($scope.aircraft.sizeId) | 159 | console.log($scope.aircraft.sizeId) |
149 | }) | 160 | }) |
150 | } | 161 | } |
151 | 162 | ||
152 | $scope.aircraftData = {}; | 163 | $scope.aircraftData = {}; |
153 | $scope.aircraftData.aircraftList = []; | 164 | $scope.aircraftData.aircraftList = []; |
154 | $scope.addAircraft = function(){ | 165 | $scope.addAircraft = function(){ |
155 | console.log($scope.aircraft) | 166 | console.log($scope.aircraft) |
156 | $scope.aircraftData.aircraftList.push($scope.aircraft); | 167 | $scope.aircraftData.aircraftList.push($scope.aircraft); |
157 | 168 | ||
158 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { | 169 | FBOFlight.addAircraft($scope.aircraftData).then(function(result) { |
159 | $('#myModal4').modal('hide'); | 170 | $('#myModal4').modal('hide'); |
160 | getCrafts(); | 171 | getCrafts(); |
161 | $scope.resetData(); | 172 | $scope.resetData(); |
162 | toastr.success('Created Successfully', { | 173 | toastr.success('Created Successfully', { |
163 | closeButton: true | 174 | closeButton: true |
164 | }) | 175 | }) |
165 | }, function (err) { | 176 | }, function (err) { |
166 | toastr.error('Error in Adding Aircraft', { | 177 | toastr.error('Error in Adding Aircraft', { |
167 | closeButton: true | 178 | closeButton: true |
168 | }) | 179 | }) |
169 | $('#myModal4').modal('hide'); | 180 | $('#myModal4').modal('hide'); |
170 | $scope.getCraftList.splice($scope.aircraft); | 181 | $scope.getCraftList.splice($scope.aircraft); |
171 | }); | 182 | }); |
172 | } | 183 | } |
173 | 184 | ||
174 | $scope.closeModal = function(){ | 185 | $scope.closeModal = function(){ |
175 | $("#myModal5").modal('hide'); | 186 | $("#myModal5").modal('hide'); |
176 | $scope.resetData(); | 187 | $scope.resetData(); |
177 | } | 188 | } |
178 | 189 | ||
179 | $scope.update = function(airdata){ | 190 | $scope.update = function(airdata){ |
180 | $("#myModal5").modal('show'); | 191 | $("#myModal5").modal('show'); |
181 | $scope.aircraft = airdata; | 192 | $scope.aircraft = airdata; |
182 | console.log($scope.aircraft) | 193 | console.log($scope.aircraft) |
183 | $scope.aircraft.accountId = $scope.user.account.id; | 194 | $scope.aircraft.accountId = $scope.user.account.id; |
184 | 195 | ||
185 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { | 196 | FBOFlight.getModal($scope.aircraft.make).then(function(result) { |
186 | $scope.aircraftModalList = result; | 197 | $scope.aircraftModalList = result; |
187 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { | 198 | FBOFlight.getAircraftSize($scope.aircraft.make, $scope.aircraft.model).then(function(result) { |
188 | $scope.aircraftSizeList = result; | 199 | $scope.aircraftSizeList = result; |
189 | console.log($scope.aircraftSizeList) | 200 | console.log($scope.aircraftSizeList) |
190 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; | 201 | $scope.aircraft.sizeId = $scope.aircraftSizeList[0].aircraftSize.id; |
191 | }) | 202 | }) |
192 | }) | 203 | }) |
193 | } | 204 | } |
194 | 205 | ||
195 | $scope.updatecraftData = {}; | 206 | $scope.updatecraftData = {}; |
196 | $scope.updatecraftData.aircraftList = []; | 207 | $scope.updatecraftData.aircraftList = []; |
197 | $scope.updateAircraftData = {}; | 208 | $scope.updateAircraftData = {}; |
198 | 209 | ||
199 | $scope.updateAircraft = function(updateAircraft){ | 210 | $scope.updateAircraft = function(updateAircraft){ |
200 | $scope.updateAircraftData.id = updateAircraft.id; | 211 | $scope.updateAircraftData.id = updateAircraft.id; |
201 | $scope.updateAircraftData.make = updateAircraft.make; | 212 | $scope.updateAircraftData.make = updateAircraft.make; |
202 | $scope.updateAircraftData.model = updateAircraft.model; | 213 | $scope.updateAircraftData.model = updateAircraft.model; |
203 | $scope.updateAircraftData.sizeId = updateAircraft.sizeId; | 214 | $scope.updateAircraftData.sizeId = updateAircraft.sizeId; |
204 | $scope.updateAircraftData.tail = updateAircraft.tail; | 215 | $scope.updateAircraftData.tail = updateAircraft.tail; |
205 | $scope.updateAircraftData.accountId = updateAircraft.accountId; | 216 | $scope.updateAircraftData.accountId = updateAircraft.accountId; |
206 | console.log($scope.updateAircraftData) | 217 | console.log($scope.updateAircraftData) |
207 | 218 | ||
208 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); | 219 | $scope.updatecraftData.aircraftList.push($scope.updateAircraftData); |
209 | console.log($scope.updatecraftData.aircraftList) | 220 | console.log($scope.updatecraftData.aircraftList) |
210 | 221 | ||
211 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { | 222 | UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) { |
212 | $('#myModal5').modal('hide'); | 223 | $('#myModal5').modal('hide'); |
213 | $scope.resetData(); | 224 | $scope.resetData(); |
214 | getCrafts(); | 225 | getCrafts(); |
215 | toastr.success('Updated Successfully', { | 226 | toastr.success('Updated Successfully', { |
216 | closeButton: true | 227 | closeButton: true |
217 | }) | 228 | }) |
218 | }, function (err) { | 229 | }, function (err) { |
219 | toastr.error('Error in Updating Aircraft', { | 230 | toastr.error('Error in Updating Aircraft', { |
220 | closeButton: true | 231 | closeButton: true |
221 | }) | 232 | }) |
222 | $('#myModal5').modal('hide'); | 233 | $('#myModal5').modal('hide'); |
223 | $scope.getCraftList.splice($scope.aircraft); | 234 | $scope.getCraftList.splice($scope.aircraft); |
224 | }); | 235 | }); |
225 | } | 236 | } |
226 | 237 | ||
227 | $scope.remove = function(data){ | 238 | $scope.remove = function(data){ |
228 | console.log(data) | 239 | console.log(data) |
229 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { | 240 | UpdateAllFBODept.removeAircraft(data.id).then(function(result) { |
230 | toastr.success(''+result.success+'', { | 241 | toastr.success(''+result.success+'', { |
231 | closeButton: true | 242 | closeButton: true |
232 | }) | 243 | }) |
233 | getCrafts(); | 244 | getCrafts(); |
234 | }) | 245 | }) |
235 | } | 246 | } |
236 | 247 | ||
237 | $scope.resetData = function() { | 248 | $scope.resetData = function() { |
238 | $scope.aircraft = {}; | 249 | $scope.aircraft = {}; |
239 | $scope.aircraft.accountId = $scope.user.account.id; | 250 | $scope.aircraft.accountId = $scope.user.account.id; |
240 | $scope.aircraftData.aircraftList = []; | 251 | $scope.aircraftData.aircraftList = []; |
241 | getData(); | 252 | getData(); |
242 | } | 253 | } |
243 | 254 | ||
244 | }); | 255 | }); |
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-3"> | 3 | <div class="col-lg-3"> |
4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> --> | 4 | <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">{{user.companyName}}</h2> --> |
5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> | 5 | <div style="margin-top: 20px;"><input type="text" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control"></div> |
6 | </div> | 6 | </div> |
7 | <div class="col-lg-3" style="margin-top: 20px;"> | 7 | <div class="col-lg-3" style="margin-top: 20px;"> |
8 | <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> |
9 | </div> | 9 | </div> |
10 | <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;"> |
11 | <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> |
12 | <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> |
13 | </div> | 13 | </div> |
14 | </div> | 14 | </div> |
15 | <div class="wrapper wrapper-content animated fadeInRight"> | 15 | <div class="wrapper wrapper-content animated fadeInRight"> |
16 | <div class="row"> | 16 | <div class="row"> |
17 | <div class="col-lg-7"> | 17 | <div class="col-lg-7"> |
18 | <div class="ibox float-e-margins"> | 18 | <div class="ibox float-e-margins"> |
19 | <div class="ibox-title"> | 19 | <div class="ibox-title"> |
20 | <div class="pull-left"> | 20 | <div class="pull-left"> |
21 | <h5>Contact Information</h5> | 21 | <h5>Contact Information</h5> |
22 | </div> | 22 | </div> |
23 | <div class="pull-right my-toggle-switch"> | 23 | <div class="pull-right my-toggle-switch"> |
24 | <div class="switch"> | 24 | <div class="switch"> |
25 | <div class="onoffswitch"> | 25 | <div class="onoffswitch"> |
26 | <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"> |
27 | <label class="onoffswitch-label" for="example1"> | 27 | <label class="onoffswitch-label" for="example1"> |
28 | <span class="onoffswitch-inner"></span> | 28 | <span class="onoffswitch-inner"></span> |
29 | <span class="onoffswitch-switch"></span> | 29 | <span class="onoffswitch-switch"></span> |
30 | </label> | 30 | </label> |
31 | </div> | 31 | </div> |
32 | </div> | 32 | </div> |
33 | </div> | 33 | </div> |
34 | <div class="clearfix"></div> | 34 | <div class="clearfix"></div> |
35 | </div> | 35 | </div> |
36 | <div class="ibox-content"> | 36 | <div class="ibox-content"> |
37 | <div class="row"> | 37 | <div class="row"> |
38 | <form role="form"> | 38 | <form role="form"> |
39 | <div class="col-sm-6 b-r"> | 39 | <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> --> | 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>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control"></div> | 41 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Email Username" ng-model="user.email" class="form-control" ng-blur="checkUsername()"></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>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> | 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> | 44 | <!-- <div> |
45 | <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> |
46 | <label> <input type="checkbox" class="i-checks"> Remember me </label> | 46 | <label> <input type="checkbox" class="i-checks"> Remember me </label> |
47 | </div> --> | 47 | </div> --> |
48 | 48 | ||
49 | </div> | 49 | </div> |
50 | <div class="col-sm-6"> | 50 | <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> --> | 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>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> |
53 | <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> |
54 | </div> | 54 | </div> |
55 | </form> | 55 | </form> |
56 | </div> | 56 | </div> |
57 | </div> | 57 | </div> |
58 | </div> | 58 | </div> |
59 | </div> | 59 | </div> |
60 | <div class="col-lg-5"> | 60 | <div class="col-lg-5"> |
61 | <div class="ibox float-e-margins"> | 61 | <div class="ibox float-e-margins"> |
62 | <div class="ibox-title"> | 62 | <div class="ibox-title"> |
63 | <h5>Client Notes</h5> | 63 | <h5>Client Notes</h5> |
64 | 64 | ||
65 | </div> | 65 | </div> |
66 | <div class="ibox-content"> | 66 | <div class="ibox-content"> |
67 | <div class="row"> | 67 | <div class="row"> |
68 | <form role="form"> | 68 | <form role="form"> |
69 | <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> |
70 | </form> | 70 | </form> |
71 | </div> | 71 | </div> |
72 | </div> | 72 | </div> |
73 | 73 | ||
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | </div> | 76 | </div> |
77 | </div> | 77 | </div> |
78 | 78 | ||
79 | <div> | 79 | <div> |
80 | <div class="row"> | 80 | <div class="row"> |
81 | <div class="col-lg-7"> | 81 | <div class="col-lg-7"> |
82 | <div class="ibox float-e-margins"> | 82 | <div class="ibox float-e-margins"> |
83 | <div class="ibox-title"> | 83 | <div class="ibox-title"> |
84 | <div> | 84 | <div> |
85 | <h3 style="float: left;">Aircraft List</h3> | 85 | <h3 style="float: left;">Aircraft List</h3> |
86 | </div> | 86 | </div> |
87 | <div class="pull-right"> | 87 | <div class="pull-right"> |
88 | <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> |
89 | </div> | 89 | </div> |
90 | <div class="clearfix"></div> | 90 | <div class="clearfix"></div> |
91 | <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"> |
92 | <div class="modal-dialog"> | 92 | <div class="modal-dialog"> |
93 | <div class="modal-content animated fadeIn"> | 93 | <div class="modal-content animated fadeIn"> |
94 | <div class="modal-header"> | 94 | <div class="modal-header"> |
95 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | 95 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
96 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> | 96 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> |
97 | <h4 class="modal-title">Add Aircraft</h4> | 97 | <h4 class="modal-title">Add Aircraft</h4> |
98 | <!-- <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> --> |
99 | </div> | 99 | </div> |
100 | <div class="modal-body" style="padding: 15px;"> | 100 | <div class="modal-body" style="padding: 15px;"> |
101 | <table class="table table-bordered table-hover table-striped"> | 101 | <table class="table table-bordered table-hover table-striped"> |
102 | <thead> | 102 | <thead> |
103 | <tr> | 103 | <tr> |
104 | <th>Tail</th> | 104 | <th>Tail</th> |
105 | <th>Make</th> | 105 | <th>Make</th> |
106 | <th>Model</th> | 106 | <th>Model</th> |
107 | <th>Size</th> | 107 | <th>Size</th> |
108 | </tr> | 108 | </tr> |
109 | </thead> | 109 | </thead> |
110 | <tbody> | 110 | <tbody> |
111 | <tr> | 111 | <tr> |
112 | <td> | 112 | <td> |
113 | <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"> |
114 | </td> | 114 | </td> |
115 | <td style="width: 30%"> | 115 | <td style="width: 30%"> |
116 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | 116 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> |
117 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 117 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
118 | </select> | 118 | </select> |
119 | </td> | 119 | </td> |
120 | <td style="width: 30%"> | 120 | <td style="width: 30%"> |
121 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | 121 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> |
122 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | 122 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
123 | </select> | 123 | </select> |
124 | </td> | 124 | </td> |
125 | <td style="width: 30%"> | 125 | <td style="width: 30%"> |
126 | <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> | 126 | <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> |
127 | 127 | ||
128 | <!-- <select class="form-control" ng-model="aircraft.size"> | 128 | <!-- <select class="form-control" ng-model="aircraft.size"> |
129 | <option ng-repeat="size in aircraftSizeList">{{size.aircraftSize.size}}</option> | 129 | <option ng-repeat="size in aircraftSizeList">{{size.aircraftSize.size}}</option> |
130 | </select> --> | 130 | </select> --> |
131 | </td> | 131 | </td> |
132 | </tr> | 132 | </tr> |
133 | </tbody> | 133 | </tbody> |
134 | </table> | 134 | </table> |
135 | </div> | 135 | </div> |
136 | <div class="modal-footer"> | 136 | <div class="modal-footer"> |
137 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> | 137 | <button type="button" class="btn btn-white" data-dismiss="modal">Close</button> |
138 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> | 138 | <button type="button" class="btn btn-primary" ng-click="addAircraft()">Save changes</button> |
139 | </div> | 139 | </div> |
140 | </div> | 140 | </div> |
141 | </div> | 141 | </div> |
142 | </div> | 142 | </div> |
143 | </div> | 143 | </div> |
144 | <div class="ibox-content"> | 144 | <div class="ibox-content"> |
145 | <div class="table-responsive"> | 145 | <div class="table-responsive"> |
146 | <table class="table table-bordered table-hover table-striped"> | 146 | <table class="table table-bordered table-hover table-striped"> |
147 | <thead> | 147 | <thead> |
148 | <tr> | 148 | <tr> |
149 | <th>Tail</th> | 149 | <th>Tail</th> |
150 | <th>Make</th> | 150 | <th>Make</th> |
151 | <th>Model</th> | 151 | <th>Model</th> |
152 | <th>Size</th> | 152 | <th>Size</th> |
153 | <th>Actions</th> | 153 | <th>Actions</th> |
154 | </tr> | 154 | </tr> |
155 | </thead> | 155 | </thead> |
156 | <tbody> | 156 | <tbody> |
157 | <tr ng-repeat="airData in getCraftList track by $index"> | 157 | <tr ng-repeat="airData in getCraftList track by $index"> |
158 | <td> | 158 | <td> |
159 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> | 159 | <input type="text" style="width:100px;" ng-model="airData.tail" class="form-control"> |
160 | </td> | 160 | </td> |
161 | <td> | 161 | <td> |
162 | <select class="form-control" ng-model="airData.make"> | 162 | <select class="form-control" ng-model="airData.make"> |
163 | <option>{{airData.make}}</option> | 163 | <option>{{airData.make}}</option> |
164 | </select> | 164 | </select> |
165 | </td> | 165 | </td> |
166 | <td> | 166 | <td> |
167 | <select class="form-control" ng-model="airData.model"> | 167 | <select class="form-control" ng-model="airData.model"> |
168 | <option>{{airData.model}}</option> | 168 | <option>{{airData.model}}</option> |
169 | </select> | 169 | </select> |
170 | </td> | 170 | </td> |
171 | <td> | 171 | <td> |
172 | <!-- <select class="form-control" ng-model="airData.sizeId" ng-options="airData.userAircraftSize.id as airData.userAircraftSize.size for airData in getCraftList"></select> --> | 172 | <!-- <select class="form-control" ng-model="airData.sizeId" ng-options="airData.userAircraftSize.id as airData.userAircraftSize.size for airData in getCraftList"></select> --> |
173 | <select class="form-control" ng-model="airData.sizeId"> | 173 | <select class="form-control" ng-model="airData.sizeId"> |
174 | <option value="{{airData.sizeId}}">{{airData.size}}</option> | 174 | <option value="{{airData.sizeId}}">{{airData.size}}</option> |
175 | </select> | 175 | </select> |
176 | </td> | 176 | </td> |
177 | <td> | 177 | <td> |
178 | <i style="margin-top: 10px;" class="fa fa-pencil" ng-click="update(airData)"></i> | 178 | <i style="margin-top: 10px;" class="fa fa-pencil" ng-click="update(airData)"></i> |
179 | <i class="fa fa-trash" ng-click="remove(airData)"></i> | 179 | <i class="fa fa-trash" ng-click="remove(airData)"></i> |
180 | </td> | 180 | </td> |
181 | </tr> | 181 | </tr> |
182 | </tbody> | 182 | </tbody> |
183 | </table> | 183 | </table> |
184 | </div> | 184 | </div> |
185 | <div class="clearfix"></div> | 185 | <div class="clearfix"></div> |
186 | </div> | 186 | </div> |
187 | </div> | 187 | </div> |
188 | </div> | 188 | </div> |
189 | <div class="modal inmodal" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true"> | 189 | <div class="modal inmodal" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true"> |
190 | <div class="modal-dialog"> | 190 | <div class="modal-dialog"> |
191 | <div class="modal-content animated fadeIn"> | 191 | <div class="modal-content animated fadeIn"> |
192 | <div class="modal-header"> | 192 | <div class="modal-header"> |
193 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | 193 | <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
194 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> | 194 | <!-- <i class="fa fa-clock-o modal-icon"></i> --> |
195 | <h4 class="modal-title">Update Aircraft</h4> | 195 | <h4 class="modal-title">Update Aircraft</h4> |
196 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> | 196 | <!-- <small>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</small> --> |
197 | </div> | 197 | </div> |
198 | <div class="modal-body" style="padding: 15px;"> | 198 | <div class="modal-body" style="padding: 15px;"> |
199 | <table class="table table-bordered table-hover table-striped"> | 199 | <table class="table table-bordered table-hover table-striped"> |
200 | <thead> | 200 | <thead> |
201 | <tr> | 201 | <tr> |
202 | <th>Tail</th> | 202 | <th>Tail</th> |
203 | <th>Make</th> | 203 | <th>Make</th> |
204 | <th>Model</th> | 204 | <th>Model</th> |
205 | <th>Size</th> | 205 | <th>Size</th> |
206 | </tr> | 206 | </tr> |
207 | </thead> | 207 | </thead> |
208 | <tbody> | 208 | <tbody> |
209 | <tr> | 209 | <tr> |
210 | <td> | 210 | <td> |
211 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | 211 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> |
212 | </td> | 212 | </td> |
213 | <td style="width: 30%"> | 213 | <td style="width: 30%"> |
214 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | 214 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> |
215 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 215 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
216 | </select> | 216 | </select> |
217 | </td> | 217 | </td> |
218 | <td style="width: 30%"> | 218 | <td style="width: 30%"> |
219 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | 219 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> |
220 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | 220 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
221 | </select> | 221 | </select> |
222 | </td> | 222 | </td> |
223 | <td style="width: 30%"> | 223 | <td style="width: 30%"> |
224 | <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> | 224 | <select class="form-control" ng-model="aircraft.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftSizeList"></select> |
225 | 225 | ||
226 | <!-- <select class="form-control" ng-model="aircraft.size"> | 226 | <!-- <select class="form-control" ng-model="aircraft.size"> |
227 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> | 227 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> |
228 | </select> --> | 228 | </select> --> |
229 | </td> | 229 | </td> |
230 | </tr> | 230 | </tr> |
231 | </tbody> | 231 | </tbody> |
232 | </table> | 232 | </table> |
233 | </div> | 233 | </div> |
234 | <div class="modal-footer"> | 234 | <div class="modal-footer"> |
235 | <button type="button" class="btn btn-white" ng-click="closeModal()">Close</button> | 235 | <button type="button" class="btn btn-white" ng-click="closeModal()">Close</button> |
236 | <button type="button" class="btn btn-primary" ng-click="updateAircraft(aircraft)">Save changes</button> | 236 | <button type="button" class="btn btn-primary" ng-click="updateAircraft(aircraft)">Save changes</button> |
237 | </div> | 237 | </div> |
238 | </div> | 238 | </div> |
239 | </div> | 239 | </div> |
240 | </div> | 240 | </div> |
241 | <div class="col-lg-5"> | 241 | <div class="col-lg-5"> |
242 | <div class="ibox float-e-margins"> | 242 | <div class="ibox float-e-margins"> |
243 | <div class="ibox-title"> | 243 | <div class="ibox-title"> |
244 | <h5>Account Authenticatio & Payment Method</h5> | 244 | <h5>Account Authenticatio & Payment Method</h5> |
245 | 245 | ||
246 | </div> | 246 | </div> |
247 | <div class="ibox-content"> | 247 | <div class="ibox-content"> |
248 | <div class="row" ng-repeat="payment in paymentList" ng-click="openCard(payment)" style="cursor: pointer;" ng-show="showPayments"> | 248 | <div class="row" ng-repeat="payment in paymentList" ng-click="openCard(payment)" style="cursor: pointer;" ng-show="showPayments"> |
249 | <div class="col-md-3"> | 249 | <div class="col-md-3"> |
250 | <img src="images/master.png"> | 250 | <img src="images/master.png"> |
251 | </div> | 251 | </div> |
252 | <div class="col-md-9"> | 252 | <div class="col-md-9"> |
253 | <div class="col"> | 253 | <div class="col"> |
254 | <span style="font-size: large; color: #909394;">**** **** **** {{payment.cardNumber | limitTo: -4}}</span> | 254 | <span style="font-size: large; color: #909394;">**** **** **** {{payment.cardNumber | limitTo: -4}}</span> |
255 | </div> | 255 | </div> |
256 | <div class="col"> | 256 | <div class="col"> |
257 | <span><strong>Expiry Date: </strong>{{payment.expiryDate}}</span> | 257 | <span><strong>Expiry Date: </strong>{{payment.expiryDate}}</span> |
258 | </div> | 258 | </div> |
259 | </div> | 259 | </div> |
260 | <div class="clearfix"></div> | 260 | <div class="clearfix"></div> |
261 | <!-- <br> | 261 | <!-- <br> |
262 | 262 | ||
263 | <div class="col-md-3"> | 263 | <div class="col-md-3"> |
264 | <img src="images/visa1.png"> | 264 | <img src="images/visa1.png"> |
265 | </div> | 265 | </div> |
266 | <div class="col-md-9"> | 266 | <div class="col-md-9"> |
267 | <div class="col"> | 267 | <div class="col"> |
268 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> | 268 | <span style="font-size: large; color: #909394;">**** **** **** 1060</span> |
269 | </div> | 269 | </div> |
270 | <div class="col"> | 270 | <div class="col"> |
271 | <span><strong>Expiry Date:</strong>10/16</span> | 271 | <span><strong>Expiry Date:</strong>10/16</span> |
272 | </div> | 272 | </div> |
273 | </div> | 273 | </div> |
274 | <div class="clearfix"></div> --> | 274 | <div class="clearfix"></div> --> |
275 | </div> | 275 | </div> |
276 | <div class="row" ng-hide="showPayments"> | 276 | <div class="row" ng-hide="showPayments"> |
277 | <div class="container"> | 277 | <div class="container"> |
278 | <div class="row"> | 278 | <div class="row"> |
279 | <div class="col-xs-12 col-md-4"> | 279 | <div class="col-xs-12 col-md-4"> |
280 | <div class="panel panel-default credit-card-box"> | 280 | <div class="panel panel-default credit-card-box"> |
281 | <div class="panel-heading display-table" > | 281 | <div class="panel-heading display-table" > |
282 | <div class="row display-tr" > | 282 | <div class="row display-tr" > |
283 | <h3 class="panel-title display-td" >Payment Details</h3> | 283 | <h3 class="panel-title display-td" >Payment Details</h3> |
284 | <div class="display-td" > | 284 | <div class="display-td" > |
285 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> | 285 | <img class="img-responsive pull-right" src="http://i76.imgup.net/accepted_c22e0.png"> |
286 | </div> | 286 | </div> |
287 | </div> | 287 | </div> |
288 | </div> | 288 | </div> |
289 | <div class="panel-body"> | 289 | <div class="panel-body"> |
290 | <form role="form" id="payment-form"> | 290 | <form role="form" id="payment-form"> |
291 | <div class="row"> | 291 | <div class="row"> |
292 | <div class="col-xs-12"> | 292 | <div class="col-xs-12"> |
293 | <div class="form-group"> | 293 | <div class="form-group"> |
294 | <label for="cardNumber">CARD NUMBER</label> | 294 | <label for="cardNumber">CARD NUMBER</label> |
295 | <div class="input-group"> | 295 | <div class="input-group"> |
296 | <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> | 296 | <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> |
297 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> | 297 | <span class="input-group-addon"><i class="fa fa-credit-card"></i></span> |
298 | </div> | 298 | </div> |
299 | </div> | 299 | </div> |
300 | </div> | 300 | </div> |
301 | </div> | 301 | </div> |
302 | <div class="row"> | 302 | <div class="row"> |
303 | <div class="col-xs-7 col-md-7"> | 303 | <div class="col-xs-7 col-md-7"> |
304 | <div class="form-group"> | 304 | <div class="form-group"> |
305 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> | 305 | <label for="cardExpiry"><span class="hidden-xs">EXPIRATION</span><span class="visible-xs-inline">EXP</span> DATE</label> |
306 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" | 306 | <input type="text" ng-model="data.expiryDate" class="form-control" name="cardExpiry" placeholder="MM / YY" autocomplete="cc-exp" |
307 | required> | 307 | required> |
308 | </div> | 308 | </div> |
309 | </div> | 309 | </div> |
310 | <div class="col-xs-5 col-md-5 pull-right"> | 310 | <div class="col-xs-5 col-md-5 pull-right"> |
311 | <div class="form-group"> | 311 | <div class="form-group"> |
312 | <label for="cardCVC">CVV CODE</label> | 312 | <label for="cardCVC">CVV CODE</label> |
313 | <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" | 313 | <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" |
314 | required> | 314 | required> |
315 | </div> | 315 | </div> |
316 | </div> | 316 | </div> |
317 | </div> | 317 | </div> |
318 | <div class="row"> | 318 | <div class="row"> |
319 | <div class="col-xs-12"> | 319 | <div class="col-xs-12"> |
320 | <div class="form-group"> | 320 | <div class="form-group"> |
321 | <label for="name">Card Type</label> | 321 | <label for="name">Card Type</label> |
322 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> | 322 | <select class="form-control m-b" name="account" ng-model="data.cardType" style="margin-bottom: 0;"> |
323 | <option value="creditCard" selected>Credit Card</option> | 323 | <option value="creditCard" selected>Credit Card</option> |
324 | <option value="debitCard">Debit Card</option> | 324 | <option value="debitCard">Debit Card</option> |
325 | </select> | 325 | </select> |
326 | </div> | 326 | </div> |
327 | </div> | 327 | </div> |
328 | </div> | 328 | </div> |
329 | <div class="row"> | 329 | <div class="row"> |
330 | <div class="col-xs-12"> | 330 | <div class="col-xs-12"> |
331 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="updateCard()">Update Card</button> | 331 | <button class="btn btn-success btn-lg btn-block" type="submit" ng-click="updateCard()">Update Card</button> |
332 | </div> | 332 | </div> |
333 | </div> | 333 | </div> |
334 | <div class="row" style="display:none;"> | 334 | <div class="row" style="display:none;"> |
335 | <div class="col-xs-12"> | 335 | <div class="col-xs-12"> |
336 | <p class="payment-errors"></p> | 336 | <p class="payment-errors"></p> |
337 | </div> | 337 | </div> |
338 | </div> | 338 | </div> |
339 | </form> | 339 | </form> |
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 | </div> |
347 | </div> | 347 | </div> |
348 | </div> | 348 | </div> |
349 | </div> | 349 | </div> |
350 | </div> | 350 | </div> |
351 | </div> | 351 | </div> |
352 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> | 352 | <script type="text/javascript" src="https://js.stripe.com/v2/"></script> |