Commit 47541162edfd61e732f3f09ea6972c70b1ef6e28
1 parent
976f0b4a87
Exists in
master
airport upload prgress bar'
Showing
5 changed files
with
297 additions
and
30 deletions
Show diff stats
app/scripts/config.js
1 | /** | 1 | /** |
2 | * Acuefuel - Responsive Admin Theme | 2 | * Acuefuel - Responsive Admin Theme |
3 | * | 3 | * |
4 | * Acuefuel theme use AngularUI Router to manage routing and views | 4 | * Acuefuel theme use AngularUI Router to manage routing and views |
5 | * Each view are defined as state. | 5 | * Each view are defined as state. |
6 | * Initial there are written stat for all view in theme. | 6 | * Initial there are written stat for all view in theme. |
7 | * | 7 | * |
8 | */ | 8 | */ |
9 | function config($stateProvider, $urlRouterProvider) { | 9 | function config($stateProvider, $urlRouterProvider) { |
10 | $urlRouterProvider.otherwise("/login"); | 10 | $urlRouterProvider.otherwise("/login"); |
11 | 11 | ||
12 | $stateProvider | 12 | $stateProvider |
13 | 13 | ||
14 | .state('login', { | 14 | .state('login', { |
15 | //abstract: true, | 15 | //abstract: true, |
16 | url: "/login", | 16 | url: "/login", |
17 | templateUrl: "views/login/login.html", | 17 | templateUrl: "views/login/login.html", |
18 | controller: 'LoginController' | 18 | controller: 'LoginController' |
19 | }) | 19 | }) |
20 | 20 | ||
21 | .state('index', { | 21 | .state('index', { |
22 | abstract: true, | 22 | abstract: true, |
23 | url: "/index", | 23 | url: "/index", |
24 | templateUrl: "views/common/content.html", | 24 | templateUrl: "views/common/content.html", |
25 | }) | 25 | }) |
26 | .state('index.dashboard', { | 26 | .state('index.dashboard', { |
27 | url: "/dashboard", | 27 | url: "/dashboard", |
28 | templateUrl: "views/fbo-admin/dashboard.html", | 28 | templateUrl: "views/fbo-admin/dashboard.html", |
29 | controller: 'DashboardController' | 29 | controller: 'DashboardController' |
30 | }) | 30 | }) |
31 | .state('index.flight', { | 31 | .state('index.flight', { |
32 | url: "/flight", | 32 | url: "/flight", |
33 | templateUrl: "views/fbo-flight/flight.html", | 33 | templateUrl: "views/fbo-flight/flight.html", |
34 | controller: 'FlightDeptController' | 34 | controller: 'FlightDeptController' |
35 | }) | 35 | }) |
36 | .state('index.updateAirports', { | 36 | .state('index.updateAirports', { |
37 | url: "/updateAirports", | 37 | url: "/updateAirports", |
38 | templateUrl: "views/update-airports/update-airports.html", | 38 | templateUrl: "views/update-airports/update-airports.html", |
39 | controller: 'updateAirportController' | 39 | controller: 'updateAirportController' |
40 | }) | 40 | }) |
41 | .state('index.minor', { | 41 | .state('index.minor', { |
42 | url: "/minor", | 42 | url: "/minor", |
43 | templateUrl: "views/minor.html", | 43 | templateUrl: "views/minor.html", |
44 | data: { pageTitle: 'Example view' } | 44 | data: { pageTitle: 'Example view' } |
45 | }) | 45 | }) |
46 | .state('index.updateFBO', { | 46 | .state('index.updateFBO', { |
47 | url: "/updateFBO/:id", | 47 | url: "/updateFBO/:id", |
48 | templateUrl: "views/updateAllFBO/updateAllFBO.html", | 48 | templateUrl: "views/updateAllFBO/updateAllFBO.html", |
49 | controller: 'updateAllFBOController' | 49 | controller: 'updateAllFBOController' |
50 | }) | 50 | }) |
51 | .state('index.updateFBODept', { | 51 | .state('index.updateFBODept', { |
52 | url: "/updateFBODept/:id", | 52 | url: "/updateFBODept/:id", |
53 | templateUrl: "views/updateFBODept/updateFBODept.html", | 53 | templateUrl: "views/updateFBODept/updateFBODept.html", |
54 | controller: 'updateFBODeptController' | 54 | controller: 'updateFBODeptController' |
55 | }) | 55 | }) |
56 | // .state('index.fboClients', { | 56 | // .state('index.fboClients', { |
57 | // url: "/fboClients", | 57 | // url: "/fboClients", |
58 | // templateUrl: "views/fbo-Clients/fboClients.html", | 58 | // templateUrl: "views/fbo-Clients/fboClients.html", |
59 | // controller: 'fboClientsController' | 59 | // controller: 'fboClientsController' |
60 | // }) | 60 | // }) |
61 | .state('index.fboAdmin', { | 61 | .state('index.fboAdmin', { |
62 | url: "/fboAdmin", | 62 | url: "/fboAdmin", |
63 | templateUrl: "views/fbo-Clients/fboClients.html", | 63 | templateUrl: "views/fbo-Clients/fboClients.html", |
64 | controller: 'fboClientsController' | 64 | controller: 'fboClientsController' |
65 | }) | 65 | }) |
66 | .state('index.flightDept', { | 66 | .state('index.flightDept', { |
67 | url: "/flightDept", | 67 | url: "/flightDept", |
68 | templateUrl: "views/flightDept/flightDept.html", | 68 | templateUrl: "views/flightDept/flightDept.html", |
69 | controller: 'flightDeptController' | 69 | controller: 'flightDeptController' |
70 | }) | 70 | }) |
71 | } | 71 | } |
72 | angular | 72 | angular |
73 | .module('acuefuel') | 73 | .module('acuefuel') |
74 | .config(config) | 74 | .config(config) |
75 | .run(function($rootScope, $state) { | 75 | .run(['$rootScope', '$state', 'UpdateAirportService', function($rootScope, $state, UpdateAirportService) { |
76 | $rootScope.$state = $state; | 76 | $rootScope.$state = $state; |
77 | }); | ||
77 | $rootScope.record = {} | ||
78 | |||
79 | |||
80 | // var progress1 = ""; | ||
81 | // $(document).ready(function() { | ||
82 | // progress1 = setInterval(function(){ | ||
83 | // progressBar(); | ||
84 | // }, 3000); | ||
85 | |||
86 | // function progressBar(){ | ||
87 | // setInterval (function(){ | ||
88 | // $('.progress .progress-bar').progressbar({ | ||
89 | // display_text: 'none' | ||
90 | // }); | ||
91 | // },1) | ||
92 | // } | ||
93 | // }); | ||
94 | |||
95 | getAllUploadProgress(); | ||
96 | function getAllUploadProgress() { | ||
97 | UpdateAirportService.getAllUploadProgress().then(function(result) { | ||
98 | console.log("all results ",result) | ||
99 | for(var i =0 ; i<result.length; i++){ | ||
100 | if(result[i].filetype == 'Airports'){ | ||
101 | $rootScope.record.AirportCount = result[i].progress | ||
102 | $rootScope.record.AirportStatus = result[i].status | ||
103 | } | ||
104 | else if(result[i].filetype == 'Countries'){ | ||
105 | $rootScope.record.CountriesCount = result[i].progress | ||
106 | $rootScope.record.CountriesStatus = result[i].status | ||
107 | } | ||
108 | else if(result[i].filetype == 'SubdivisionStates'){ | ||
109 | $rootScope.record.SubdivisionStatesCount = result[i].progress | ||
110 | $rootScope.record.SubdivisionStatesStatus = result[i].status | ||
111 | } | ||
112 | else if(result[i].filetype == 'FBOHandlerDetail'){ | ||
113 | $rootScope.record.FBOHandlerDetailCount = result[i].progress | ||
114 | $rootScope.record.FBOHandlerDetailStatus = result[i].status | ||
115 | } | ||
116 | else if(result[i].filetype == 'SupplierDetail'){ | ||
117 | $rootScope.record.SupplierDetailCount = result[i].progress | ||
118 | $rootScope.record.SupplierDetailStatus = result[i].status | ||
119 | |||
120 | } | ||
121 | } | ||
122 | |||
123 | }) | ||
124 | |||
125 | } | ||
126 | |||
127 | |||
128 | |||
129 | var filetypeA = localStorage.getItem('filetypeA') | ||
130 | var filetypeC = localStorage.getItem('filetypeC') | ||
131 | var filetypeSS = localStorage.getItem('filetypeSS') | ||
132 | var filetypeFBO = localStorage.getItem('filetypeFBO') | ||
133 | var filetypeSD = localStorage.getItem('filetypeSD') | ||
134 | |||
135 | if(filetypeA != null) | ||
136 | var uploadStatusA =filetypeA.split(",")[1]; | ||
137 | if(filetypeC != null) | ||
138 | var uploadStatusC =filetypeC.split(",")[1]; | ||
139 | if(filetypeSS != null) | ||
140 | var uploadStatusSS =filetypeSS.split(",")[1]; | ||
141 | if(filetypeFBO != null) | ||
142 | var uploadStatusFBO =filetypeFBO.split(",")[1]; | ||
143 | if(filetypeSD != null) | ||
144 | var uploadStatusSD =filetypeSD.split(",")[1]; | ||
145 | |||
146 | |||
147 | |||
148 | if(uploadStatusA != 'Completed' || uploadStatusC != 'Completed' || uploadStatusSS != 'Completed' || uploadStatusFBO != 'Completed' || uploadStatusSD != 'Completed'){ | ||
149 | var uploadProgress = setInterval(function(){ | ||
150 | uploadData(); | ||
151 | }, 500); | ||
152 | |||
153 | function uploadData() { | ||
154 | if(filetypeA != null && filetypeA.split(",")[0] == 'Airports'){ | ||
155 | UpdateAirportService.getUploadProgress(filetypeA.split(",")[0]).then(function(result) { | ||
156 | if(result != null){ | ||
157 | $rootScope.record.AirportCount = result.progress | ||
158 | $rootScope.record.AirportStatus = result.status | ||
159 | if($rootScope.record.AirportStatus == 'Completed' || $rootScope.record.AirportStatus == 'Error'){ | ||
160 | $rootScope.showAirports = true; | ||
161 | localStorage.removeItem('filetypeA'); | ||
162 | localStorage.removeItem('airportLoader'); | ||
163 | } | ||
164 | } | ||
165 | }) | ||
166 | } | ||
167 | if(filetypeC != null && filetypeC.split(",")[0] == 'Countries'){ | ||
168 | UpdateAirportService.getUploadProgress(filetypeC.split(",")[0]).then(function(result) { | ||
169 | if(result != null){ | ||
170 | $rootScope.record.CountriesCount = result.progress | ||
171 | $rootScope.record.CountriesStatus = result.status | ||
172 | if($rootScope.record.CountriesStatus == 'Completed' || $rootScope.record.CountriesStatus == 'Error'){ | ||
173 | $rootScope.showCountries = true; | ||
174 | localStorage.removeItem('filetypeC'); | ||
175 | localStorage.removeItem('countryLoader'); | ||
176 | } | ||
177 | |||
178 | } | ||
179 | }) | ||
180 | } | ||
181 | if(filetypeSS != null && filetypeSS.split(",")[0] == 'SubdivisionStates'){ | ||
182 | UpdateAirportService.getUploadProgress(filetypeSS.split(",")[0]).then(function(result) { | ||
183 | if(result != null){ | ||
184 | $rootScope.record.SubdivisionStatesCount = result.progress | ||
185 | $rootScope.record.SubdivisionStatesStatus = result.status | ||
186 | if($rootScope.record.SubdivisionStatesStatus == 'Completed' || $rootScope.record.SubdivisionStatesStatus == 'Error'){ | ||
187 | $rootScope.subDivState = true; | ||
188 | localStorage.removeItem('filetypeSS'); | ||
189 | localStorage.removeItem('subDivStateLoader'); | ||
190 | } | ||
191 | } | ||
192 | }) | ||
193 | } | ||
194 | if(filetypeFBO != null && filetypeFBO.split(",")[0] == 'FBOHandlerDetail'){ | ||
195 | UpdateAirportService.getUploadProgress(filetypeFBO.split(",")[0] ).then(function(result) { | ||
196 | if(result != null){ | ||
197 | $rootScope.record.FBOHandlerDetailCount = result.progress | ||
198 | $rootScope.record.FBOHandlerDetailStatus = result.status | ||
199 | if($rootScope.record.FBOHandlerDetailStatus == 'Completed' || $rootScope.record.FBOHandlerDetailStatus == 'Error'){ | ||
200 | $rootScope.fboHandlerDetail = true; | ||
201 | localStorage.removeItem('filetypeFBO'); | ||
202 | localStorage.removeItem('fboHandleLoader'); | ||
203 | } | ||
204 | } | ||
205 | }) | ||
206 | } | ||
207 | if(filetypeSD != null && filetypeSD.split(",")[0] == 'SupplierDetail'){ | ||
208 | UpdateAirportService.getUploadProgress(filetypeSD.split(",")[0]).then(function(result) { | ||
209 | if(result != null){ | ||
210 | $rootScope.record.SupplierDetailCount = result.progress | ||
211 | $rootScope.record.SupplierDetailStatus = result.status | ||
212 | if($rootScope.record.SupplierDetailStatus == 'Completed' || $rootScope.record.SupplierDetailStatus == 'Error'){ | ||
213 | $rootScope.suppDetail = true; | ||
214 | localStorage.removeItem('filetypeSD'); | ||
215 | localStorage.removeItem('suppDetailLoader'); | ||
216 | } | ||
217 | } | ||
218 | }) | ||
219 | } | ||
220 | } | ||
221 | }else if(uploadStatusA == 'Completed' || uploadStatusC == 'Completed' || uploadStatusSS == 'Completed' || uploadStatusFBO == 'Completed' || uploadStatusSD == 'Completed'){ | ||
222 | clearInterval(uploadProgress); | ||
223 | } | ||
224 |
app/scripts/constant.js
1 | 1 | ||
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .constant('BE', { | 6 | .constant('BE', { |
7 | url: 'http://54.149.169.33:8080/ws' | 7 | // url: 'http://54.149.169.33:8080/ws' |
8 | // url: 'http://192.168.1.175:8080/ws' | ||
9 | url: 'http://192.168.2.137:8080/ws' | ||
8 | }); | 10 | }); |
9 | 11 |
app/views/update-airports/update-airports.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>Acukwik DropZone</h2> | 4 | <h2>Acukwik DropZone</h2> |
5 | </div> | 5 | </div> |
6 | </div> | 6 | </div> |
7 | </div> | 7 | </div> |
8 | <div class="wrapper wrapper-content animated fadeInRight"> | 8 | <div class="wrapper wrapper-content animated fadeInRight"> |
9 | <div class="row"> | 9 | <div class="row"> |
10 | <div class="col-lg-7"> | 10 | <div class="col-lg-7"> |
11 | <div class="ibox float-e-margins"> | 11 | <div class="ibox float-e-margins"> |
12 | <div> | 12 | <div> |
13 | <table class="table table-bordered "> | 13 | <table class="table table-bordered "> |
14 | <thead> | 14 | <thead> |
15 | <tr class="grad"> | 15 | <tr class="grad"> |
16 | <th style="background-color: transparent;" colspan="3"> | 16 | <th style="background-color: transparent;" colspan="5"> |
17 | <i class="fa fa-list" aria-hidden="true"></i> | 17 | <i class="fa fa-list" aria-hidden="true"></i> |
18 | <span style="font-size: 15px;font-weight: initial;margin-left: 5px;">Update Airport Data</span> | 18 | <span style="font-size: 15px;font-weight: initial;margin-left: 5px;">Update Airport Data</span> |
19 | </th> | 19 | </th> |
20 | </tr> | 20 | </tr> |
21 | <tr class="grad"> | 21 | <tr class="grad"> |
22 | <th style="background-color: transparent;">Table</th> | 22 | <th style="background-color: transparent;">Table</th> |
23 | <th style="background-color: transparent;">Drop Zone</th> | 23 | <th style="background-color: transparent;">Drop Zone</th> |
24 | <th style="background-color: transparent;">Updated</th> | 24 | <th style="background-color: transparent;">Updated</th> |
25 | <th style="background-color: transparent;">Status</th> | ||
26 | <th style="background-color: transparent;">Records</th> | ||
25 | </tr> | 27 | </tr> |
26 | </thead> | 28 | </thead> |
27 | <tbody> | 29 | <tbody> |
28 | <tr style="background: #f9f9f9;"> | 30 | <tr style="background: #f9f9f9;"> |
29 | <td>Airports</td> | 31 | <td>Airports</td> |
30 | <td> | 32 | <td> |
31 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="showAirports"> | 33 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="showAirports"> |
32 | <div ngf-drop="importAirportData($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> | 34 | <div ngf-drop="importAirportData($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> |
33 | <div class="dz-default dz-message drop-box" ngf-select="importAirportData($file)" ng-model="picFile"> | 35 | <div class="dz-default dz-message drop-box" ngf-select="importAirportData($file)" ng-model="picFile"> |
34 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="dropName">Drop files here or click to upload (Or Click)</span><span ng-hide="dropName">{{selectedFile.name}}</span><br></p> | 36 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="dropName">Drop files here or click to upload (Or Click)</span><span ng-hide="dropName">{{selectedFile.name}}</span><br></p> |
35 | </div> | 37 | </div> |
36 | </div> | 38 | </div> |
37 | </form> | 39 | </form> |
38 | <div class="spinner" ng-hide="showAirports" style="margin: 0px auto 0;"> | 40 | <div class="spinner" ng-hide="showAirports" style="margin: 0px auto 0;"> |
39 | <div class="bounce1"></div> | 41 | <div class="bounce1"></div> |
40 | <div class="bounce2"></div> | 42 | <div class="bounce2"></div> |
41 | <div class="bounce3"></div> | 43 | <div class="bounce3"></div> |
42 | </div> | 44 | </div> |
45 | |||
43 | </td> | 46 | </td> |
44 | <td>{{newDate}}</td> | 47 | <td>{{newDate}}</td> |
48 | <td>{{record.AirportStatus}}</td> | ||
49 | <td>{{record.AirportCount}}</td> | ||
45 | </tr> | 50 | </tr> |
46 | <tr style="background: #fff;"> | 51 | <tr style="background: #fff;"> |
47 | <td>Countries</td> | 52 | <td>Countries</td> |
48 | <td> | 53 | <td> |
49 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="showCountries"> | 54 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="showCountries"> |
50 | <div ngf-drop="importCountryData($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> | 55 | <div ngf-drop="importCountryData($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> |
51 | <div class="dz-default dz-message drop-box" ngf-select="importCountryData($file)" ng-model="countryFile"> | 56 | <div class="dz-default dz-message drop-box" ngf-select="importCountryData($file)" ng-model="countryFile"> |
52 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="countryName">Drop files here or click to upload (Or Click)</span><span ng-hide="countryName">{{selectedCountry.name}}</span><br></p> | 57 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="countryName">Drop files here or click to upload (Or Click)</span><span ng-hide="countryName">{{selectedCountry.name}}</span><br></p> |
53 | </div> | 58 | </div> |
54 | </div> | 59 | </div> |
55 | </form> | 60 | </form> |
56 | <div class="spinner" ng-hide="showCountries" style="margin: 0px auto 0;"> | 61 | <div class="spinner" ng-hide="showCountries" style="margin: 0px auto 0;"> |
57 | <div class="bounce1"></div> | 62 | <div class="bounce1"></div> |
58 | <div class="bounce2"></div> | 63 | <div class="bounce2"></div> |
59 | <div class="bounce3"></div> | 64 | <div class="bounce3"></div> |
60 | </div> | 65 | </div> |
61 | </td> | 66 | </td> |
62 | <td>{{newDate}}</td> | 67 | <td>{{newDate}}</td> |
68 | <td>{{record.CountriesStatus}}</td> | ||
69 | <td>{{record.CountriesCount}}</td> | ||
63 | </tr> | 70 | </tr> |
64 | <tr style="background: #f9f9f9;"> | 71 | <tr style="background: #f9f9f9;"> |
65 | <td>FBOHandlerDetail</td> | 72 | <td>FBOHandlerDetail</td> |
66 | <td> | 73 | <td> |
67 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="fboHandlerDetail"> | 74 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="fboHandlerDetail"> |
68 | <div ngf-drop="importFboHandler($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> | 75 | <div ngf-drop="importFboHandler($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> |
69 | <div class="dz-default dz-message drop-box" ngf-select="importFboHandler($file)" ng-model="FBOFile"> | 76 | <div class="dz-default dz-message drop-box" ngf-select="importFboHandler($file)" ng-model="FBOFile"> |
70 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="fboHandlerName">Drop files here or click to upload (Or Click)</span><span ng-hide="fboHandlerName">{{selectedFBO.name}}</span><br></p> | 77 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="fboHandlerName">Drop files here or click to upload (Or Click)</span><span ng-hide="fboHandlerName">{{selectedFBO.name}}</span><br></p> |
71 | </div> | 78 | </div> |
72 | </div> | 79 | </div> |
73 | </form> | 80 | </form> |
74 | <div class="spinner" ng-hide="fboHandlerDetail" style="margin: 0px auto 0;"> | 81 | <div class="spinner" ng-hide="fboHandlerDetail" style="margin: 0px auto 0;"> |
75 | <div class="bounce1"></div> | 82 | <div class="bounce1"></div> |
76 | <div class="bounce2"></div> | 83 | <div class="bounce2"></div> |
77 | <div class="bounce3"></div> | 84 | <div class="bounce3"></div> |
78 | </div> | 85 | </div> |
79 | </td> | 86 | </td> |
80 | <td>{{newDate}}</td> | 87 | <td>{{newDate}}</td> |
88 | <td>{{record.FBOHandlerDetailStatus}}</td> | ||
89 | <td>{{record.FBOHandlerDetailCount}}</td> | ||
81 | </tr> | 90 | </tr> |
82 | <tr style="background: #fff;"> | 91 | <tr style="background: #fff;"> |
83 | <td>SubdivisionStates</td> | 92 | <td>SubdivisionStates</td> |
84 | <td> | 93 | <td> |
85 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="subDivState"> | 94 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="subDivState"> |
86 | <div ngf-drop="importsubDivisionData($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> | 95 | <div ngf-drop="importsubDivisionData($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> |
87 | <div class="dz-default dz-message drop-box" ngf-select="importsubDivisionData($file)" ng-model="stateFile"> | 96 | <div class="dz-default dz-message drop-box" ngf-select="importsubDivisionData($file)" ng-model="stateFile"> |
88 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="subDivisionName">Drop files here or click to upload (Or Click)</span><span ng-hide="subDivisionName">{{selectedState.name}}</span><br></p> | 97 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="subDivisionName">Drop files here or click to upload (Or Click)</span><span ng-hide="subDivisionName">{{selectedState.name}}</span><br></p> |
89 | </div> | 98 | </div> |
90 | </div> | 99 | </div> |
91 | </form> | 100 | </form> |
92 | <div class="spinner" ng-hide="subDivState" style="margin: 0px auto 0;"> | 101 | <div class="spinner" ng-hide="subDivState" style="margin: 0px auto 0;"> |
93 | <div class="bounce1"></div> | 102 | <div class="bounce1"></div> |
94 | <div class="bounce2"></div> | 103 | <div class="bounce2"></div> |
95 | <div class="bounce3"></div> | 104 | <div class="bounce3"></div> |
96 | </div> | 105 | </div> |
97 | </td> | 106 | </td> |
98 | <td>{{newDate}}</td> | 107 | <td>{{newDate}}</td> |
108 | <td>{{record.SubdivisionStatesStatus}}</td> | ||
109 | <td>{{record.SubdivisionStatesCount}}</td> | ||
99 | </tr> | 110 | </tr> |
100 | <tr style="background: #f9f9f9;"> | 111 | <tr style="background: #f9f9f9;"> |
101 | <td>SupplierDetail</td> | 112 | <td>SupplierDetail</td> |
102 | <td> | 113 | <td> |
103 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="suppDetail"> | 114 | <form class="dropzone12 dz-clickable" id="dropzoneForm" style="cursor: pointer;" ng-show="suppDetail"> |
104 | <div ngf-drop="importSuppluerDetail($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> | 115 | <div ngf-drop="importSuppluerDetail($files)" class="drop-box" ngf-drag-over-class="'dragover'" ngf-multiple="true" ngf-pattern=""> |
105 | <div class="dz-default dz-message drop-box" ngf-select="importSuppluerDetail($file)"> | 116 | <div class="dz-default dz-message drop-box" ngf-select="importSuppluerDetail($file)"> |
106 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="supplierName">Drop files here or click to upload (Or Click)</span><span ng-hide="supplierName">{{selectedSuplier.name}}</span><br></p> | 117 | <p class="dpFiles"><i style="color: red;margin-right: 5px;" class="fa fa-caret-right" aria-hidden="true"></i><span ng-show="supplierName">Drop files here or click to upload (Or Click)</span><span ng-hide="supplierName">{{selectedSuplier.name}}</span><br></p> |
107 | </div> | 118 | </div> |
108 | </div> | 119 | </div> |
109 | </form> | 120 | </form> |
110 | <div class="spinner" ng-hide="suppDetail" style="margin: 0px auto 0;"> | 121 | <div class="spinner" ng-hide="suppDetail" style="margin: 0px auto 0;"> |
111 | <div class="bounce1"></div> | 122 | <div class="bounce1"></div> |
112 | <div class="bounce2"></div> | 123 | <div class="bounce2"></div> |
113 | <div class="bounce3"></div> | 124 | <div class="bounce3"></div> |
114 | </div> | 125 | </div> |
115 | </td> | 126 | </td> |
116 | <td>{{newDate}}</td> | 127 | <td>{{newDate}}</td> |
128 | <td>{{record.SupplierDetailStatus}}</td> | ||
129 | <td>{{record.SupplierDetailCount}}</td> | ||
117 | </tr> | 130 | </tr> |
118 | </tbody> | 131 | </tbody> |
119 | </table> | 132 | </table> |
120 | 133 | ||
121 | </div> | 134 | </div> |
122 | </div> | 135 | </div> |
123 | </div> | 136 | </div> |
124 | </div> | 137 | </div> |
125 | </div> | 138 | </div> |
app/views/update-airports/updateAirportController.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | angular.module('acuefuel') | 3 | angular.module('acuefuel') |
4 | 4 | ||
5 | .controller('updateAirportController', function ($scope, UpdateAirportService) { | 5 | .controller('updateAirportController', function ($scope, UpdateAirportService) { |
6 | $scope.dropName = true; | 6 | $scope.dropName = true; |
7 | $scope.supplierName = true; | 7 | $scope.supplierName = true; |
8 | $scope.countryName = true; | 8 | $scope.countryName = true; |
9 | $scope.subDivisionName = true; | 9 | $scope.subDivisionName = true; |
10 | $scope.fboHandlerName = true; | 10 | $scope.fboHandlerName = true; |
11 | console.log(localStorage.getItem('airportLoader')) | 11 | console.log(localStorage.getItem('airportLoader')) |
12 | if(localStorage.getItem('airportLoader') == 'false'){ | 12 | if(localStorage.getItem('airportLoader') == 'false'){ |
13 | $scope.showAirports = false; | 13 | $scope.showAirports = false; |
14 | }else{ | 14 | }else{ |
15 | $scope.showAirports = true; | 15 | $scope.showAirports = true; |
16 | } | 16 | } |
17 | console.log(localStorage.getItem('countryLoader')) | ||
17 | if(localStorage.getItem('countryLoader') == 'false'){ | 18 | if(localStorage.getItem('countryLoader') == 'false'){ |
18 | $scope.showCountries = false; | 19 | $scope.showCountries = false; |
19 | }else{ | 20 | }else{ |
20 | $scope.showCountries = true; | 21 | $scope.showCountries = true; |
21 | } | 22 | } |
23 | console.log(localStorage.getItem('fboHandleLoader')) | ||
22 | if(localStorage.getItem('fboHandleLoader') == 'false'){ | 24 | if(localStorage.getItem('fboHandleLoader') == 'false'){ |
23 | $scope.fboHandlerDetail = false; | 25 | $scope.fboHandlerDetail = false; |
24 | }else{ | 26 | }else{ |
25 | $scope.fboHandlerDetail = true; | 27 | $scope.fboHandlerDetail = true; |
26 | } | 28 | } |
29 | console.log(localStorage.getItem('subDivStateLoader')) | ||
27 | if(localStorage.getItem('subDivStateLoader') == 'false'){ | 30 | if(localStorage.getItem('subDivStateLoader') == 'false'){ |
28 | $scope.subDivState = false; | 31 | $scope.subDivState = false; |
29 | }else{ | 32 | }else{ |
30 | $scope.subDivState = true; | 33 | $scope.subDivState = true; |
31 | } | 34 | } |
32 | if(localStorage.getItem('suppDetailLoader') == 'false'){ | 35 | if(localStorage.getItem('suppDetailLoader') == 'false'){ |
33 | $scope.suppDetail = false; | 36 | $scope.suppDetail = false; |
34 | }else{ | 37 | }else{ |
35 | $scope.suppDetail = true; | 38 | $scope.suppDetail = true; |
36 | } | 39 | } |
37 | 40 | ||
38 | // Showing Date | 41 | // Showing Date |
39 | var today = new Date(); | 42 | var today = new Date(); |
40 | var dd = today.getDate(); | 43 | var dd = today.getDate(); |
41 | var mm = today.getMonth()+1; | 44 | var mm = today.getMonth()+1; |
42 | var yyyy = today.getFullYear(); | 45 | var yyyy = today.getFullYear(); |
43 | if(dd < 10){ | 46 | if(dd < 10){ |
44 | dd='0'+dd; | 47 | dd='0'+dd; |
45 | } | 48 | } |
46 | if(mm < 10){ | 49 | if(mm < 10){ |
47 | mm='0'+mm; | 50 | mm='0'+mm; |
48 | } | 51 | } |
49 | $scope.newDate = dd + '/' + mm + '/' + yyyy; | 52 | $scope.newDate = dd + '/' + mm + '/' + yyyy; |
50 | 53 | ||
51 | //Import Airport Data | 54 | //Import Airport Data |
52 | $scope.data = {}; | 55 | $scope.data = {}; |
53 | $scope.importAirportData = function(fileName) { | 56 | $scope.importAirportData = function(fileName) { |
54 | $scope.showAirports = false; | 57 | $scope.showAirports = false; |
55 | window.localStorage.setItem('airportLoader', false); | 58 | window.localStorage.setItem('airportLoader', false); |
56 | console.log(fileName) | 59 | console.log("fileName --- ",fileName) |
57 | if(fileName.name != undefined){ | 60 | if(fileName.name != undefined){ |
58 | $scope.dropName = false; | 61 | $scope.dropName = false; |
59 | $scope.selectedFile = fileName; | 62 | $scope.selectedFile = fileName; |
60 | $scope.data.airportFile = $scope.selectedFile; | 63 | $scope.data.airportFile = $scope.selectedFile; |
61 | }else if(fileName instanceof Array){ | 64 | }else if(fileName instanceof Array){ |
62 | $scope.dropName = false; | 65 | $scope.dropName = false; |
63 | $scope.selectedFile = fileName[0]; | 66 | $scope.selectedFile = fileName[0]; |
64 | $scope.data.airportFile = $scope.selectedFile; | 67 | $scope.data.airportFile = $scope.selectedFile; |
65 | } | 68 | } |
66 | var fileCheck = $scope.data.airportFile.name.split('.')[1]; | 69 | var fileCheck = $scope.data.airportFile.name.split('.')[1]; |
67 | console.log(fileCheck) | 70 | console.log(fileCheck) |
68 | if(fileCheck == 'csv'){ | 71 | if(fileCheck == 'csv'){ |
72 | $scope.setFileTypeLocal("Airports") | ||
69 | UpdateAirportService.updateAirportData($scope.data).then(function(result) { | 73 | UpdateAirportService.updateAirportData($scope.data).then(function(result) { |
70 | localStorage.removeItem('airportLoader'); | 74 | // localStorage.removeItem('airportLoader'); |
71 | $scope.showAirports = true; | 75 | $scope.showAirports = true; |
72 | console.log(result) | 76 | toastr.success('File Upload Successfully', { |
73 | toastr.success('Copied', { | ||
74 | closeButton: true | 77 | closeButton: true |
75 | }) | 78 | }) |
76 | }, function (err) { | 79 | }, function (err) { |
77 | localStorage.removeItem('airportLoader'); | 80 | localStorage.removeItem('airportLoader'); |
78 | $scope.showAirports = true; | 81 | $scope.showAirports = true; |
79 | toastr.error('Error in uploading', { | 82 | toastr.error('Error in uploading', { |
80 | closeButton: true | 83 | closeButton: true |
81 | }) | 84 | }) |
82 | }); | 85 | }); |
83 | }else { | 86 | }else { |
84 | localStorage.removeItem('airportLoader'); | 87 | localStorage.removeItem('airportLoader'); |
85 | $scope.showAirports = true; | 88 | $scope.showAirports = true; |
86 | $scope.dropName = true; | 89 | $scope.dropName = true; |
87 | toastr.error('Please select only csv file', { | 90 | toastr.error('Please select only csv file', { |
88 | closeButton: true | 91 | closeButton: true |
89 | }) | 92 | }) |
90 | } | 93 | } |
91 | 94 | ||
92 | } | 95 | } |
93 | 96 | ||
94 | //Import Supplier Detail Data | 97 | //Import Supplier Detail Data |
95 | $scope.supplierData = {}; | 98 | $scope.supplierData = {}; |
96 | $scope.importSuppluerDetail = function(fileName){ | 99 | $scope.importSuppluerDetail = function(fileName){ |
97 | $scope.suppDetail = false; | 100 | $scope.suppDetail = false; |
98 | window.localStorage.setItem('suppDetailLoader', false); | 101 | window.localStorage.setItem('suppDetailLoader', false); |
99 | console.log(fileName) | 102 | console.log(fileName) |
100 | if(fileName.name != undefined){ | 103 | if(fileName.name != undefined){ |
101 | $scope.supplierName = false; | 104 | $scope.supplierName = false; |
102 | $scope.selectedSuplier = fileName; | 105 | $scope.selectedSuplier = fileName; |
103 | $scope.supplierData.supplierDetailFile = $scope.selectedSuplier; | 106 | $scope.supplierData.supplierDetailFile = $scope.selectedSuplier; |
104 | }else if(fileName instanceof Array){ | 107 | }else if(fileName instanceof Array){ |
105 | $scope.supplierName = false; | 108 | $scope.supplierName = false; |
106 | $scope.selectedSuplier = fileName[0]; | 109 | $scope.selectedSuplier = fileName[0]; |
107 | $scope.supplierData.supplierDetailFile = $scope.selectedSuplier; | 110 | $scope.supplierData.supplierDetailFile = $scope.selectedSuplier; |
108 | } | 111 | } |
109 | var fileCheck = $scope.supplierData.supplierDetailFile.name.split('.')[1]; | 112 | var fileCheck = $scope.supplierData.supplierDetailFile.name.split('.')[1]; |
110 | console.log(fileCheck) | 113 | console.log(fileCheck) |
111 | if(fileCheck == 'csv'){ | 114 | if(fileCheck == 'csv'){ |
115 | $scope.setFileTypeLocal("SupplierDetail") | ||
112 | UpdateAirportService.updateSupplierDetail($scope.supplierData).then(function(result) { | 116 | UpdateAirportService.updateSupplierDetail($scope.supplierData).then(function(result) { |
113 | console.log(result) | 117 | console.log(result) |
114 | $scope.suppDetail = true; | 118 | $scope.suppDetail = true; |
115 | localStorage.removeItem('suppDetailLoader'); | 119 | // localStorage.removeItem('suppDetailLoader'); |
120 | console.log("row count ",result) | ||
116 | toastr.success('File Upload Successfully', { | 121 | toastr.success('File Upload Successfully', { |
117 | closeButton: true | 122 | closeButton: true |
118 | }) | 123 | }) |
119 | }, function (err) { | 124 | }, function (err) { |
120 | localStorage.removeItem('suppDetailLoader'); | 125 | localStorage.removeItem('suppDetailLoader'); |
121 | $scope.suppDetail = true; | 126 | $scope.suppDetail = true; |
122 | toastr.error('Error in uploading', { | 127 | toastr.error('Error in uploading', { |
123 | closeButton: true | 128 | closeButton: true |
124 | }) | 129 | }) |
125 | }); | 130 | }); |
126 | }else { | 131 | }else { |
127 | localStorage.removeItem('suppDetailLoader'); | 132 | localStorage.removeItem('suppDetailLoader'); |
128 | $scope.suppDetail = true; | 133 | $scope.suppDetail = true; |
129 | $scope.supplierName = true; | 134 | $scope.supplierName = true; |
130 | toastr.error('Please select only csv file', { | 135 | toastr.error('Please select only csv file', { |
131 | closeButton: true | 136 | closeButton: true |
132 | }) | 137 | }) |
133 | } | 138 | } |
134 | } | 139 | } |
135 | 140 | ||
136 | //Import Countries Data | 141 | //Import Countries Data |
137 | $scope.countryData = {}; | 142 | $scope.countryData = {}; |
138 | $scope.importCountryData = function(fileName){ | 143 | $scope.importCountryData = function(fileName){ |
139 | $scope.showCountries = false; | 144 | $scope.showCountries = false; |
140 | window.localStorage.setItem('countryLoader', false); | 145 | window.localStorage.setItem('countryLoader', false); |
141 | console.log(fileName) | 146 | console.log(fileName) |
142 | if(fileName.name != undefined){ | 147 | if(fileName.name != undefined){ |
143 | $scope.countryName = false; | 148 | $scope.countryName = false; |
144 | $scope.selectedCountry = fileName; | 149 | $scope.selectedCountry = fileName; |
145 | $scope.countryData.countrieFile = $scope.selectedCountry; | 150 | $scope.countryData.countrieFile = $scope.selectedCountry; |
146 | }else if(fileName instanceof Array){ | 151 | }else if(fileName instanceof Array){ |
147 | $scope.countryName = false; | 152 | $scope.countryName = false; |
148 | $scope.selectedCountry = fileName[0]; | 153 | $scope.selectedCountry = fileName[0]; |
149 | $scope.countryData.countrieFile = $scope.selectedCountry; | 154 | $scope.countryData.countrieFile = $scope.selectedCountry; |
150 | } | 155 | } |
151 | var fileCheck = $scope.countryData.countrieFile.name.split('.')[1]; | 156 | var fileCheck = $scope.countryData.countrieFile.name.split('.')[1]; |
152 | console.log(fileCheck) | 157 | console.log(fileCheck) |
153 | if(fileCheck == 'csv'){ | 158 | if(fileCheck == 'csv'){ |
159 | $scope.setFileTypeLocal("Countries") | ||
154 | UpdateAirportService.updateCountries($scope.countryData).then(function(result) { | 160 | UpdateAirportService.updateCountries($scope.countryData).then(function(result) { |
155 | console.log(result) | 161 | console.log(result) |
156 | $scope.showCountries = true; | 162 | $scope.showCountries = true; |
157 | localStorage.removeItem('countryLoader'); | 163 | // localStorage.removeItem('countryLoader'); |
158 | toastr.success('File Upload Successfully', { | 164 | toastr.success('File Upload Successfully', { |
159 | closeButton: true | 165 | closeButton: true |
160 | }) | 166 | }) |
161 | }, function (err) { | 167 | }, function (err) { |
162 | localStorage.removeItem('countryLoader'); | 168 | localStorage.removeItem('countryLoader'); |
163 | $scope.showCountries = true; | 169 | $scope.showCountries = true; |
164 | toastr.error('Error in uploading', { | 170 | toastr.error('Error in uploading', { |
165 | closeButton: true | 171 | closeButton: true |
166 | }) | 172 | }) |
167 | }); | 173 | }); |
168 | }else { | 174 | }else { |
169 | localStorage.removeItem('countryLoader'); | 175 | localStorage.removeItem('countryLoader'); |
170 | $scope.showCountries = true; | 176 | $scope.showCountries = true; |
171 | $scope.countryName = true; | 177 | $scope.countryName = true; |
172 | toastr.error('Please select only csv file', { | 178 | toastr.error('Please select only csv file', { |
173 | closeButton: true | 179 | closeButton: true |
174 | }) | 180 | }) |
175 | } | 181 | } |
176 | } | 182 | } |
177 | 183 | ||
178 | //Import Sub Divison State Data | 184 | //Import Sub Divison State Data |
179 | $scope.subDivisionData = {}; | 185 | $scope.subDivisionData = {}; |
180 | $scope.importsubDivisionData = function(fileName){ | 186 | $scope.importsubDivisionData = function(fileName){ |
181 | $scope.subDivState = false; | 187 | $scope.subDivState = false; |
182 | window.localStorage.setItem('subDivStateLoader', false); | 188 | window.localStorage.setItem('subDivStateLoader', false); |
183 | console.log(fileName) | 189 | console.log(fileName) |
184 | if(fileName.name != undefined){ | 190 | if(fileName.name != undefined){ |
185 | $scope.subDivisionName = false; | 191 | $scope.subDivisionName = false; |
186 | $scope.selectedState = fileName; | 192 | $scope.selectedState = fileName; |
187 | $scope.subDivisionData.subDivisionStateFile = $scope.selectedState; | 193 | $scope.subDivisionData.subDivisionStateFile = $scope.selectedState; |
188 | }else if(fileName instanceof Array){ | 194 | }else if(fileName instanceof Array){ |
189 | $scope.subDivisionName = false; | 195 | $scope.subDivisionName = false; |
190 | $scope.selectedState = fileName[0]; | 196 | $scope.selectedState = fileName[0]; |
191 | $scope.subDivisionData.subDivisionStateFile = $scope.selectedState; | 197 | $scope.subDivisionData.subDivisionStateFile = $scope.selectedState; |
192 | } | 198 | } |
193 | var fileCheck = $scope.subDivisionData.subDivisionStateFile.name.split('.')[1]; | 199 | var fileCheck = $scope.subDivisionData.subDivisionStateFile.name.split('.')[1]; |
194 | console.log(fileCheck) | 200 | console.log(fileCheck) |
195 | if(fileCheck == 'csv'){ | 201 | if(fileCheck == 'csv'){ |
202 | $scope.setFileTypeLocal("SubdivisionStates") | ||
196 | UpdateAirportService.updateSubDivisionState($scope.subDivisionData).then(function(result) { | 203 | UpdateAirportService.updateSubDivisionState($scope.subDivisionData).then(function(result) { |
197 | console.log(result) | 204 | // localStorage.removeItem('subDivStateLoader'); |
198 | localStorage.removeItem('subDivStateLoader'); | ||
199 | $scope.subDivState = true; | 205 | $scope.subDivState = true; |
200 | toastr.success('File Upload Successfully', { | 206 | toastr.success('File Upload Successfully', { |
201 | closeButton: true | 207 | closeButton: true |
202 | }) | 208 | }) |
203 | }, function (err) { | 209 | }, function (error) { |
210 | console.log("err",error) | ||
204 | localStorage.removeItem('subDivStateLoader'); | 211 | localStorage.removeItem('subDivStateLoader'); |
205 | $scope.subDivState = true; | 212 | $scope.subDivState = true; |
206 | toastr.error('Error in uploading', { | 213 | toastr.error('Error in uploading', { |
207 | closeButton: true | 214 | closeButton: true |
208 | }) | 215 | }) |
209 | }); | 216 | }); |
210 | }else { | 217 | }else { |
211 | localStorage.removeItem('subDivStateLoader'); | 218 | localStorage.removeItem('subDivStateLoader'); |
212 | $scope.subDivState = true; | 219 | $scope.subDivState = true; |
213 | $scope.subDivisionName = true; | 220 | $scope.subDivisionName = true; |
214 | toastr.error('Please select only csv file', { | 221 | toastr.error('Please select only csv file', { |
215 | closeButton: true | 222 | closeButton: true |
216 | }) | 223 | }) |
217 | } | 224 | } |
218 | } | 225 | } |
219 | 226 | ||
220 | //Import FBO Handler Data | 227 | //Import FBO Handler Data |
221 | $scope.fboHandlerData = {}; | 228 | $scope.fboHandlerData = {}; |
222 | $scope.importFboHandler = function(fileName){ | 229 | $scope.importFboHandler = function(fileName){ |
223 | $scope.fboHandlerDetail = false; | 230 | $scope.fboHandlerDetail = false; |
224 | window.localStorage.setItem('fboHandleLoader', false); | 231 | window.localStorage.setItem('fboHandleLoader', false); |
225 | console.log(fileName) | 232 | console.log(fileName) |
226 | if(fileName.name != undefined){ | 233 | if(fileName.name != undefined){ |
227 | $scope.fboHandlerName = false; | 234 | $scope.fboHandlerName = false; |
228 | $scope.selectedFBO = fileName; | 235 | $scope.selectedFBO = fileName; |
229 | $scope.fboHandlerData.FBOHandlerFile = $scope.selectedFBO; | 236 | $scope.fboHandlerData.FBOHandlerFile = $scope.selectedFBO; |
230 | }else if(fileName instanceof Array){ | 237 | }else if(fileName instanceof Array){ |
231 | $scope.fboHandlerName = false; | 238 | $scope.fboHandlerName = false; |
232 | $scope.selectedFBO = fileName[0]; | 239 | $scope.selectedFBO = fileName[0]; |
233 | $scope.fboHandlerData.FBOHandlerFile = $scope.selectedFBO; | 240 | $scope.fboHandlerData.FBOHandlerFile = $scope.selectedFBO; |
234 | } | 241 | } |
235 | var fileCheck = $scope.fboHandlerData.FBOHandlerFile.name.split('.')[1]; | 242 | var fileCheck = $scope.fboHandlerData.FBOHandlerFile.name.split('.')[1]; |
236 | console.log(fileCheck) | 243 | console.log(fileCheck) |
237 | if(fileCheck == 'csv'){ | 244 | if(fileCheck == 'csv'){ |
245 | $scope.setFileTypeLocal("FBOHandlerDetail") | ||
238 | UpdateAirportService.updateFBOHandler($scope.fboHandlerData).then(function(result) { | 246 | UpdateAirportService.updateFBOHandler($scope.fboHandlerData).then(function(result) { |
239 | console.log(result) | 247 | console.log(result) |
240 | localStorage.removeItem('fboHandleLoader'); | 248 | // localStorage.removeItem('fboHandleLoader'); |
241 | $scope.fboHandlerDetail = true; | 249 | $scope.fboHandlerDetail = true; |
242 | toastr.success('File Upload Successfully', { | 250 | toastr.success('File Upload Successfully', { |
243 | closeButton: true | 251 | closeButton: true |
244 | }) | 252 | }) |
245 | }, function (err) { | 253 | }, function (err) { |
246 | localStorage.removeItem('fboHandleLoader'); | 254 | localStorage.removeItem('fboHandleLoader'); |
247 | $scope.fboHandlerDetail = true; | 255 | $scope.fboHandlerDetail = true; |
248 | toastr.error('Error in uploading', { | 256 | toastr.error('Error in uploading', { |
249 | closeButton: true | 257 | closeButton: true |
250 | }) | 258 | }) |
251 | }); | 259 | }); |
252 | }else { | 260 | }else { |
253 | localStorage.removeItem('fboHandleLoader'); | 261 | localStorage.removeItem('fboHandleLoader'); |
254 | $scope.fboHandlerDetail = true; | 262 | $scope.fboHandlerDetail = true; |
255 | $scope.fboHandlerName = true; | 263 | $scope.fboHandlerName = true; |
256 | toastr.error('Please select only csv file', { | 264 | toastr.error('Please select only csv file', { |
257 | closeButton: true | 265 | closeButton: true |
258 | }) | 266 | }) |
259 | } | 267 | } |
260 | } | 268 | } |
269 | |||
270 | |||
271 | // $scope.getAllUploadProgress = function(){ | ||
272 | // UpdateAirportService.getAllUploadProgress().then(function(result) { | ||
273 | // console.log("all results ",result) | ||
274 | // for(var i =0 ; i<result.length; i++){ | ||
275 | // if(result[i].filetype == 'Airports'){ | ||
276 | // $scope.record.AirportCount = result[i].progress | ||
277 | // $scope.record.AirportStatus = result[i].status | ||
278 | // } | ||
279 | // else if(result[i].filetype == 'Countries'){ | ||
280 | // $scope.record.CountriesCount = result[i].progress | ||
281 | // $scope.record.CountriesStatus = result[i].status | ||
282 | // } | ||
283 | // else if(result[i].filetype == 'SubdivisionStates'){ | ||
284 | // $scope.record.SubdivisionStatesCount = result[i].progress | ||
285 | // $scope.record.SubdivisionStatesStatus = result[i].status | ||
286 | // } | ||
287 | // else if(result[i].filetype == 'FBOHandlerDetail'){ | ||
288 | // $scope.record.FBOHandlerDetailCount = result[i].progress | ||
289 | // $scope.record.FBOHandlerDetailStatus = result[i].status | ||
290 | // } | ||
291 | // else if(result[i].filetype == 'SupplierDetail'){ | ||
292 | // $scope.record.SupplierDetailCount = result[i].progress | ||
293 | // $scope.record.SupplierDetailStatus = result[i].status | ||
294 | |||
295 | // } | ||
296 | // } | ||
297 | |||
298 | // }) | ||
299 | |||
300 | // } | ||
301 | // $scope.getAllUploadProgress(); | ||
302 | |||
303 | $scope.setFileTypeLocal = function(value){ | ||
304 | if(value == 'Airports'){ | ||
305 | window.localStorage.setItem('filetypeA', value+",InProgress") | ||
306 | } | ||
307 | else if(value == 'Countries'){ | ||
308 | window.localStorage.setItem('filetypeC', value+",InProgress") | ||
309 | } | ||
310 | else if(value == 'SubdivisionStates'){ | ||
311 | window.localStorage.setItem('filetypeSS', value+",InProgress") | ||
312 | } | ||
313 | else if(value == 'FBOHandlerDetail'){ | ||
314 | window.localStorage.setItem('filetypeFBO', value+",InProgress") | ||
315 | } | ||
316 | else if(value == 'SupplierDetail'){ | ||
317 | window.localStorage.setItem('filetypeSD', value+",InProgress") | ||
318 | } | ||
319 | |||
320 | |||
321 | |||
322 | } | ||
323 | |||
324 |
app/views/update-airports/updateAirportService.js
1 | (function() { | 1 | (function() { |
2 | 'use strict'; | 2 | 'use strict'; |
3 | 3 | ||
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | .service('UpdateAirportService', ['$rootScope', '$q', '$http', 'BE', UpdateAirportService]) | 5 | .service('UpdateAirportService', ['$rootScope', '$q', '$http', 'BE', UpdateAirportService]) |
6 | 6 | ||
7 | function UpdateAirportService($rootScope, $q, $http, BE) { | 7 | function UpdateAirportService($rootScope, $q, $http, BE) { |
8 | 8 | ||
9 | this.updateAirportData = function(data) { | 9 | this.updateAirportData = function(data) { |
10 | 10 | ||
11 | var fd = new FormData(); | 11 | var fd = new FormData(); |
12 | 12 | ||
13 | angular.forEach(data, function(value, key) { | 13 | angular.forEach(data, function(value, key) { |
14 | fd.append(key, value); | 14 | fd.append(key, value); |
15 | }) | 15 | }) |
16 | 16 | ||
17 | var deferred = $q.defer(); | 17 | var deferred = $q.defer(); |
18 | $http({ | 18 | $http({ |
19 | method : 'POST', | 19 | method : 'POST', |
20 | transformRequest: angular.identity, | 20 | transformRequest: angular.identity, |
21 | url : BE.url +'/airport/upload/airports', | 21 | url : BE.url +'/airport/upload/airports', |
22 | headers : {'Content-Type': undefined}, | 22 | headers : {'Content-Type': undefined}, |
23 | data : fd | 23 | data : fd |
24 | }) | 24 | }) |
25 | .success(function(result) { | 25 | .then(function (result){ |
26 | deferred.resolve(result); | ||
27 | },function (result){ | ||
28 | console.log(result) | ||
26 | deferred.resolve(result); | 29 | deferred.resolve(result); |
27 | }).error(function(error){ | ||
28 | deferred.reject(error); | ||
29 | }) | 30 | }) |
30 | return deferred.promise; | 31 | return deferred.promise; |
31 | } | 32 | } |
32 | 33 | ||
33 | this.updateSupplierDetail = function(data) { | 34 | this.updateSupplierDetail = function(data) { |
34 | 35 | ||
35 | var fd = new FormData(); | 36 | var fd = new FormData(); |
36 | 37 | ||
37 | angular.forEach(data, function(value, key) { | 38 | angular.forEach(data, function(value, key) { |
38 | fd.append(key, value); | 39 | fd.append(key, value); |
39 | }) | 40 | }) |
40 | 41 | ||
41 | var deferred = $q.defer(); | 42 | var deferred = $q.defer(); |
42 | $http({ | 43 | $http({ |
43 | method : 'POST', | 44 | method : 'POST', |
44 | transformRequest: angular.identity, | 45 | transformRequest: angular.identity, |
45 | url : BE.url +'/airport/upload/supplierDetail', | 46 | url : BE.url +'/airport/upload/supplierDetail', |
46 | headers : {'Content-Type': undefined}, | 47 | headers : {'Content-Type': undefined}, |
47 | data : fd | 48 | data : fd |
48 | }) | 49 | }) |
49 | .success(function(result) { | 50 | .then(function (result){ |
51 | deferred.resolve(result); | ||
52 | },function (result){ | ||
53 | console.log(result) | ||
50 | deferred.resolve(result); | 54 | deferred.resolve(result); |
51 | }).error(function(error){ | ||
52 | deferred.reject(error); | ||
53 | }) | 55 | }) |
54 | return deferred.promise; | 56 | return deferred.promise; |
55 | } | 57 | } |
56 | 58 | ||
57 | this.updateCountries = function(data) { | 59 | this.updateCountries = function(data) { |
58 | 60 | ||
59 | var fd = new FormData(); | 61 | var fd = new FormData(); |
60 | 62 | ||
61 | angular.forEach(data, function(value, key) { | 63 | angular.forEach(data, function(value, key) { |
62 | fd.append(key, value); | 64 | fd.append(key, value); |
63 | }) | 65 | }) |
64 | 66 | ||
65 | var deferred = $q.defer(); | 67 | var deferred = $q.defer(); |
66 | $http({ | 68 | $http({ |
67 | method : 'POST', | 69 | method : 'POST', |
68 | transformRequest: angular.identity, | 70 | transformRequest: angular.identity, |
69 | url : BE.url +'/airport/upload/updateCountries', | 71 | url : BE.url +'/airport/upload/countries', |
70 | headers : {'Content-Type': undefined}, | 72 | headers : {'Content-Type': undefined}, |
71 | data : fd | 73 | data : fd |
72 | }) | 74 | }) |
73 | .success(function(result) { | 75 | .then(function (result){ |
76 | deferred.resolve(result); | ||
77 | },function (result){ | ||
78 | console.log(result) | ||
74 | deferred.resolve(result); | 79 | deferred.resolve(result); |
75 | }).error(function(error){ | ||
76 | deferred.reject(error); | ||
77 | }) | 80 | }) |
78 | return deferred.promise; | 81 | return deferred.promise; |
79 | } | 82 | } |
80 | 83 | ||
81 | this.updateSubDivisionState = function(data) { | 84 | this.updateSubDivisionState = function(data) { |
82 | 85 | ||
83 | var fd = new FormData(); | 86 | var fd = new FormData(); |
84 | 87 | ||
85 | angular.forEach(data, function(value, key) { | 88 | angular.forEach(data, function(value, key) { |
86 | fd.append(key, value); | 89 | fd.append(key, value); |
87 | }) | 90 | }) |
88 | 91 | ||
89 | var deferred = $q.defer(); | 92 | var deferred = $q.defer(); |
90 | $http({ | 93 | $http({ |
91 | method : 'POST', | 94 | method : 'POST', |
92 | transformRequest: angular.identity, | 95 | transformRequest: angular.identity, |
93 | url : BE.url +'/airport/upload/subDivisionState', | 96 | url : BE.url +'/airport/upload/subDivisionState', |
94 | headers : {'Content-Type': undefined}, | 97 | headers : {'Content-Type': undefined}, |
95 | data : fd | 98 | data : fd |
96 | }) | 99 | }) |
97 | .success(function(result) { | 100 | .then(function (result){ |
101 | deferred.resolve(result); | ||
102 | },function (result){ | ||
103 | console.log(result) | ||
98 | deferred.resolve(result); | 104 | deferred.resolve(result); |
99 | }).error(function(error){ | ||
100 | deferred.reject(error); | ||
101 | }) | 105 | }) |
102 | return deferred.promise; | 106 | return deferred.promise; |
103 | } | 107 | } |
108 | |||
109 | |||
104 | 110 | ||
105 | this.updateFBOHandler = function(data) { | 111 | this.updateFBOHandler = function(data) { |
106 | 112 | ||
107 | var fd = new FormData(); | 113 | var fd = new FormData(); |
108 | 114 | ||
109 | angular.forEach(data, function(value, key) { | 115 | angular.forEach(data, function(value, key) { |
110 | fd.append(key, value); | 116 | fd.append(key, value); |
111 | }) | 117 | }) |
112 | 118 | ||
113 | var deferred = $q.defer(); | 119 | var deferred = $q.defer(); |
114 | $http({ | 120 | $http({ |
115 | method : 'POST', | 121 | method : 'POST', |
116 | transformRequest: angular.identity, | 122 | transformRequest: angular.identity, |
117 | url : BE.url +'/airport/upload/FBOHandler', | 123 | url : BE.url +'/airport/upload/FBOHandler', |
118 | headers : {'Content-Type': undefined}, | 124 | headers : {'Content-Type': undefined}, |
119 | data : fd | 125 | data : fd |
120 | }) | 126 | }) |
121 | .success(function(result) { | 127 | .then(function (result){ |
128 | deferred.resolve(result); | ||
129 | },function (result){ | ||
130 | console.log(result) | ||
122 | deferred.resolve(result); | 131 | deferred.resolve(result); |
123 | }).error(function(error){ | ||
124 | deferred.reject(error); | ||
125 | }) | 132 | }) |
126 | return deferred.promise; | 133 | return deferred.promise; |
127 | } | 134 | } |
135 | |||
136 | this.getUploadProgress = function(filetype) { | ||
137 | |||
138 | var deferred = $q.defer(); | ||
139 | $http({ | ||
140 | method : 'GET', | ||
141 | url : BE.url +'/airport/export/records/'+filetype, | ||
142 | }) | ||
143 | .then(function (result){ | ||
144 | deferred.resolve(result.data); | ||
145 | },function (result){ | ||
146 | deferred.resolve(result.data); | ||
147 | }) | ||
148 | return deferred.promise; | ||
149 | } | ||
150 | |||
151 | this.getAllUploadProgress = function(filetype) { | ||
152 | |||
153 | var deferred = $q.defer(); | ||
154 | $http({ | ||
155 | method : 'GET', | ||
156 | url : BE.url +'/airport/export/records', | ||
157 | }) | ||
158 | .then(function (result){ | ||
159 | deferred.resolve(result.data); | ||
160 | },function (result){ |