Commit 1c749689b13f274a0e91cc4fa08948ddebcb82c2
1 parent
26e0d5d69e
Exists in
master
search issue solved
Showing
4 changed files
with
86 additions
and
84 deletions
Show diff stats
app/views/fbo-Clients/fboClient.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('fboClientsController', function($scope, $stateParams, FBOClient) { | 6 | .controller('fboClientsController', function($scope, $stateParams, FBOClient) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.tab-pane').slimScroll({ | 8 | $('.tab-pane').slimScroll({ |
9 | height: '600px' | 9 | height: '600px' |
10 | }); | 10 | }); |
11 | }); | 11 | }); |
12 | $('#tab-2').css('display', 'none'); | 12 | $('#tab-2').css('display', 'none'); |
13 | getAllFbo(); | 13 | getAllFbo(); |
14 | function getAllFbo(){ | 14 | function getAllFbo(){ |
15 | FBOClient.getALlFBOList().then(function(result) { | 15 | FBOClient.getALlFBOList().then(function(result) { |
16 | console.log(result) | 16 | console.log(result) |
17 | $scope.fboClient = result; | 17 | $scope.fboClient = result; |
18 | $scope.clientLength = result.length; | 18 | $scope.clientLength = result.length; |
19 | }) | 19 | }) |
20 | } | 20 | } |
21 | 21 | ||
22 | $scope.searchData = function(){ | 22 | // $scope.searchData = function(){ |
23 | var userType = $('#tabClient > li.active > a').attr('id'); | 23 | // var userType = $('#tabClient > li.active > a').attr('id'); |
24 | searchClient($scope.searchQuery, userType); | 24 | // searchClient($scope.searchQuery, userType); |
25 | } | 25 | // } |
26 | 26 | ||
27 | function searchClient(searchData, userType){ | 27 | // function searchClient(searchData, userType){ |
28 | console.log(userType) | 28 | // console.log(userType) |
29 | if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ | 29 | // if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ |
30 | getAllFbo(); | 30 | // getAllFbo(); |
31 | }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ | 31 | // }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ |
32 | $scope.fboDept(); | 32 | // $scope.fboDept(); |
33 | }else{ | 33 | // }else{ |
34 | var data = { | 34 | // var data = { |
35 | "query" : searchData, | 35 | // "query" : searchData, |
36 | "userType" : userType | 36 | // "userType" : userType |
37 | } | 37 | // } |
38 | FBOClient.getSearchClient(data).then(function(result) { | 38 | // FBOClient.getSearchClient(data).then(function(result) { |
39 | for(var i=0; i<result.length; i++){ | 39 | // for(var i=0; i<result.length; i++){ |
40 | result[i].user = []; | 40 | // result[i].user = []; |
41 | result[i].user.companyName = result[i].companyName; | 41 | // result[i].user.companyName = result[i].companyName; |
42 | result[i].user.firstName = result[i].firstName; | 42 | // result[i].user.firstName = result[i].firstName; |
43 | result[i].user.lastName = result[i].lastName; | 43 | // result[i].user.lastName = result[i].lastName; |
44 | result[i].user.id = result[i].id; | 44 | // result[i].user.id = result[i].id; |
45 | result[i].user.account = []; | 45 | // result[i].user.account = []; |
46 | result[i].user.account.user = []; | 46 | // result[i].user.account.user = []; |
47 | result[i].user.account.user.status = result[i].account.user.status; | 47 | // result[i].user.account.user.status = result[i].account.user.status; |
48 | } | 48 | // } |
49 | if(userType == 'fbo'){ | 49 | // if(userType == 'fbo'){ |
50 | $scope.fboClient = result; | 50 | // $scope.fboClient = result; |
51 | console.log(result) | 51 | // console.log(result) |
52 | $scope.clientLength = result.length; | 52 | // $scope.clientLength = result.length; |
53 | }else{ | 53 | // }else{ |
54 | $scope.fboDeptList = result; | 54 | // $scope.fboDeptList = result; |
55 | $scope.clientLength = result.length; | 55 | // $scope.clientLength = result.length; |
56 | } | 56 | // } |
57 | }) | 57 | // }) |
58 | } | 58 | // } |
59 | 59 | ||
60 | } | 60 | // } |
61 | 61 | ||
62 | $scope.fboAdmin = function(){ | 62 | $scope.fboAdmin = function(){ |
63 | getAllFbo(); | 63 | getAllFbo(); |
64 | $('#tab-1').css('display', 'block'); | 64 | $('#tab-1').css('display', 'block'); |
65 | $('#tab-2').css('display', 'none'); | 65 | $('#tab-2').css('display', 'none'); |
66 | $('.customTab1').addClass('active'); | 66 | $('.customTab1').addClass('active'); |
67 | $('.customTab2').removeClass('active'); | 67 | $('.customTab2').removeClass('active'); |
68 | $('.slimScrollDiv:first-child').css('display', 'block'); | 68 | $('.slimScrollDiv:first-child').css('display', 'block'); |
69 | 69 | ||
70 | } | 70 | } |
71 | 71 | ||
72 | $scope.fboDept = function(){ | 72 | $scope.fboDept = function(){ |
73 | FBOClient.getAllFlightDeptList().then(function(result) { | 73 | FBOClient.getAllFlightDeptList().then(function(result) { |
74 | console.log(result) | 74 | console.log(result) |
75 | $scope.fboDeptList = result; | 75 | $scope.fboDeptList = result; |
76 | $scope.clientLength = result.length; | 76 | $scope.clientLength = result.length; |
77 | }) | 77 | }) |
78 | $('#tab-1').css('display', 'none'); | 78 | $('#tab-1').css('display', 'none'); |
79 | $('#tab-2').css('display', 'block'); | 79 | $('#tab-2').css('display', 'block'); |
80 | $('.customTab2').addClass('active'); | 80 | $('.customTab2').addClass('active'); |
81 | $('.customTab1').removeClass('active'); | 81 | $('.customTab1').removeClass('active'); |
82 | $('.slimScrollDiv:first-child').css('display', 'none'); | 82 | $('.slimScrollDiv:first-child').css('display', 'none'); |
83 | } | 83 | } |
84 | 84 | ||
85 | }); | 85 | }); |
app/views/fbo-Clients/fboClients.html
1 | <div class="row wrapper border-bottom white-bg page-heading"> | 1 | <div class="row wrapper border-bottom white-bg page-heading"> |
2 | <div class="col-lg-10"> | 2 | <div class="col-lg-10"> |
3 | <h2>FBO Clients</h2> | 3 | <h2>FBO Clients</h2> |
4 | <!-- <ol class="breadcrumb"> | 4 | <!-- <ol class="breadcrumb"> |
5 | <li> | 5 | <li> |
6 | <a href="index.dashboard">Home</a> | 6 | <a href="index.dashboard">Home</a> |
7 | </li> | 7 | </li> |
8 | <li class="active"> | 8 | <li class="active"> |
9 | <strong>Clients</strong> | 9 | <strong>Clients</strong> |
10 | </li> | 10 | </li> |
11 | </ol> --> | 11 | </ol> --> |
12 | </div> | 12 | </div> |
13 | <div class="col-lg-2"> | 13 | <div class="col-lg-2"> |
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-sm-8"> | 18 | <div class="col-sm-8"> |
19 | <div class="ibox"> | 19 | <div class="ibox"> |
20 | 20 | ||
21 | <div class="ibox-content"> | 21 | <div class="ibox-content"> |
22 | <div class="pull-left"> | 22 | <div class="pull-left"> |
23 | <span class="text-muted small pull-right"></span> | 23 | <span class="text-muted small pull-right"></span> |
24 | <h5 style="font-size: 24px;font-weight: 100;">Clients</h5> | 24 | <h5 style="font-size: 24px;font-weight: 100;">Clients</h5> |
25 | </div> | 25 | </div> |
26 | <div class="pull-right"> | 26 | <div class="pull-right"> |
27 | <button type="button" class="btn btn-w-m btn-warning" ui-sref="index.dashboard">+ Add Client</button> | 27 | <button type="button" class="btn btn-w-m btn-warning" ui-sref="index.dashboard">+ Add Client</button> |
28 | </div> | 28 | </div> |
29 | <div class="clearfix"></div> | 29 | <div class="clearfix"></div> |
30 | 30 | ||
31 | 31 | ||
32 | <!-- <p> | 32 | <!-- <p> |
33 | All clients need to be verified before you can send email and set a project. | 33 | All clients need to be verified before you can send email and set a project. |
34 | </p> --> | 34 | </p> --> |
35 | <div class="input-group" style="width: 70%;"> | 35 | <div class="input-group" style="width: 70%;"> |
36 | 36 | ||
37 | <input type="text" placeholder="Search client " class="input form-control" ng-keyup="$event.keyCode == 13 && searchData()" ng-model="searchQuery"> | 37 | <!-- <input type="text" placeholder="Search client " class="input form-control" ng-keyup="$event.keyCode == 13 && searchData()" ng-model="searchQuery"> --> |
38 | <input type="text" placeholder="Search client " class="input form-control" ng-model="searchQuery"> | ||
38 | <span class="input-group-btn"> | 39 | <span class="input-group-btn"> |
39 | <button type="button" class="btn btn btn-primary" ng-click="searchData()"> <i class="fa fa-search"></i> Search</button> | 40 | <button type="button" class="btn btn btn-primary"> <i class="fa fa-search"></i> Search</button> |
40 | </span> | 41 | </span> |
41 | </div> | 42 | </div> |
42 | <div class="clients-list"> | 43 | <div class="clients-list"> |
43 | <ul class="nav nav-tabs" id="tabClient"> | 44 | <ul class="nav nav-tabs" id="tabClient"> |
44 | <span class="pull-right small text-muted">{{clientLength}} Clients</span> | 45 | <span class="pull-right small text-muted">{{clientLength}} Clients</span> |
45 | <li class="active customTab1"><a data-toggle="tab" ng-click="fboAdmin()" id="fbo"><i class="fa fa-user"></i> FBO Clients</a></li> | 46 | <li class="active customTab1"><a data-toggle="tab" ng-click="fboAdmin()" id="fbo"><i class="fa fa-user"></i> FBO Clients</a></li> |
46 | <li class="customTab2"><a data-toggle="tab" ng-click="fboDept()" id="flightDetp"><i class="fa fa-briefcase"></i> FBO Department Clients</a></li> | 47 | <li class="customTab2"><a data-toggle="tab" ng-click="fboDept()" id="flightDetp"><i class="fa fa-briefcase"></i> FBO Department Clients</a></li> |
47 | </ul> | 48 | </ul> |
48 | <div class="tab-content"> | 49 | <div class="tab-content"> |
49 | <div id="tab-1" class="tab-pane"> | 50 | <div id="tab-1" class="tab-pane"> |
50 | <div class="full-height-scroll"> | 51 | <div class="full-height-scroll"> |
51 | <div class="table-responsive"> | 52 | <div class="table-responsive"> |
52 | <table class="table table-striped table-hover"> | 53 | <table class="table table-striped table-hover"> |
53 | <tbody> | 54 | <tbody> |
54 | <tr ng-repeat="client in fboClient" ui-sref="index.updateFBO({id: client.user.id})" style="cursor: pointer;"> | 55 | <tr ng-repeat="client in fboClient | filter : searchQuery" ui-sref="index.updateFBO({id: client.user.id})" style="cursor: pointer;"> |
55 | <td class="client-link">{{client.user.companyName}}</td> | 56 | <td class="client-link">{{client.user.companyName}}</td> |
56 | <td> {{client.user.firstName}}</td> | 57 | <td> {{client.user.firstName}}</td> |
57 | <td><i class="fa fa-flag"></i> {{client.user.lastName}}</td> | 58 | <td><i class="fa fa-flag"></i> {{client.user.lastName}}</td> |
58 | <td class="client-status"><span ng-if="client.user.account.user.status == 'ACTIVE'" class="label label-primary">{{client.user.account.user.status}}</span><span ng-if="client.user.account.user.status == 'INACTIVE'" class="label label-danger">{{client.user.account.user.status}}</span><span ng-if="client.user.account.user.status == 'PENDING'" class="label label-default">{{client.user.account.user.status}}</span></td> | 59 | <td class="client-status"><span ng-if="client.user.account.user.status == 'ACTIVE'" class="label label-primary">{{client.user.account.user.status}}</span><span ng-if="client.user.account.user.status == 'INACTIVE'" class="label label-danger">{{client.user.account.user.status}}</span><span ng-if="client.user.account.user.status == 'PENDING'" class="label label-default">{{client.user.account.user.status}}</span></td> |
59 | </tr> | 60 | </tr> |
60 | 61 | ||
61 | </tbody> | 62 | </tbody> |
62 | </table> | 63 | </table> |
63 | </div> | 64 | </div> |
64 | </div> | 65 | </div> |
65 | </div> | 66 | </div> |
66 | <div id="tab-2" class="tab-pane"> | 67 | <div id="tab-2" class="tab-pane"> |
67 | <div class="full-height-scroll"> | 68 | <div class="full-height-scroll"> |
68 | <div class="table-responsive"> | 69 | <div class="table-responsive"> |
69 | <table class="table table-striped table-hover"> | 70 | <table class="table table-striped table-hover"> |
70 | <tbody> | 71 | <tbody> |
71 | <tr ng-repeat="dept in fboDeptList" ui-sref="index.updateFBODept({id: dept.user.id})" style="cursor: pointer;"> | 72 | <tr ng-repeat="dept in fboDeptList | filter : searchQuery" ui-sref="index.updateFBODept({id: dept.user.id})" style="cursor: pointer;"> |
72 | <td><a data-toggle="tab" href="#company-1" class="client-link">{{dept.user.companyName}}</a></td> | 73 | <td><a data-toggle="tab" href="#company-1" class="client-link">{{dept.user.companyName}}</a></td> |
73 | <td>{{dept.user.firstName}}</td> | 74 | <td>{{dept.user.firstName}}</td> |
74 | <td><i class="fa fa-flag"></i> {{dept.user.lastName}}</td> | 75 | <td><i class="fa fa-flag"></i> {{dept.user.lastName}}</td> |
75 | <td class="client-status"><span ng-if="dept.user.account.user.status == 'ACTIVE'" class="label label-primary">{{dept.user.account.user.status}}</span><span ng-if="dept.user.account.user.status == 'INACTIVE'" class="label label-danger">{{dept.user.account.user.status}}</span><span ng-if="dept.user.account.user.status == 'PENDING'" class="label label-default">{{dept.user.account.user.status}}</span></td> | 76 | <td class="client-status"><span ng-if="dept.user.account.user.status == 'ACTIVE'" class="label label-primary">{{dept.user.account.user.status}}</span><span ng-if="dept.user.account.user.status == 'INACTIVE'" class="label label-danger">{{dept.user.account.user.status}}</span><span ng-if="dept.user.account.user.status == 'PENDING'" class="label label-default">{{dept.user.account.user.status}}</span></td> |
76 | </tr> | 77 | </tr> |
77 | </tbody> | 78 | </tbody> |
78 | </table> | 79 | </table> |
79 | </div> | 80 | </div> |
80 | </div> | 81 | </div> |
81 | </div> | 82 | </div> |
82 | </div> | 83 | </div> |
83 | </div> | 84 | </div> |
84 | </div> | 85 | </div> |
85 | </div> | 86 | </div> |
86 | </div> | 87 | </div> |
87 | </div> | 88 | </div> |
88 | </div> | 89 | </div> |
app/views/flightDept/flightDept.html
1 | <div class="row wrapper border-bottom white-bg page-heading"> | 1 | <div class="row wrapper border-bottom white-bg page-heading"> |
2 | <div class="col-lg-10"> | 2 | <div class="col-lg-10"> |
3 | <h2>FBO Clients</h2> | 3 | <h2>FBO Clients</h2> |
4 | <!-- <ol class="breadcrumb"> | 4 | <!-- <ol class="breadcrumb"> |
5 | <li> | 5 | <li> |
6 | <a href="index.dashboard">Home</a> | 6 | <a href="index.dashboard">Home</a> |
7 | </li> | 7 | </li> |
8 | <li class="active"> | 8 | <li class="active"> |
9 | <strong>Clients</strong> | 9 | <strong>Clients</strong> |
10 | </li> | 10 | </li> |
11 | </ol> --> | 11 | </ol> --> |
12 | </div> | 12 | </div> |
13 | <div class="col-lg-2"> | 13 | <div class="col-lg-2"> |
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-sm-8"> | 18 | <div class="col-sm-8"> |
19 | <div class="ibox"> | 19 | <div class="ibox"> |
20 | 20 | ||
21 | <div class="ibox-content"> | 21 | <div class="ibox-content"> |
22 | <div class="pull-left"> | 22 | <div class="pull-left"> |
23 | <span class="text-muted small pull-right"></span> | 23 | <span class="text-muted small pull-right"></span> |
24 | <h5 style="font-size: 24px;font-weight: 100;">Clients</h5> | 24 | <h5 style="font-size: 24px;font-weight: 100;">Clients</h5> |
25 | </div> | 25 | </div> |
26 | <div class="pull-right"> | 26 | <div class="pull-right"> |
27 | <button type="button" class="btn btn-w-m btn-warning" ui-sref="index.flight">+ Add Client</button> | 27 | <button type="button" class="btn btn-w-m btn-warning" ui-sref="index.flight">+ Add Client</button> |
28 | </div> | 28 | </div> |
29 | <div class="clearfix"></div> | 29 | <div class="clearfix"></div> |
30 | 30 | ||
31 | 31 | ||
32 | <!-- <p> | 32 | <!-- <p> |
33 | All clients need to be verified before you can send email and set a project. | 33 | All clients need to be verified before you can send email and set a project. |
34 | </p> --> | 34 | </p> --> |
35 | <div class="input-group" style="width: 70%;"> | 35 | <div class="input-group" style="width: 70%;"> |
36 | 36 | ||
37 | <input type="text" placeholder="Search client " class="input form-control" ng-keyup="$event.keyCode == 13 && searchData()" ng-model="searchQuery"> | 37 | <input type="text" placeholder="Search client " class="input form-control" ng-model="searchQuery"> |
38 | <span class="input-group-btn"> | 38 | <span class="input-group-btn"> |
39 | <button type="button" class="btn btn btn-primary" ng-click="searchData()"> <i class="fa fa-search"></i> Search</button> | 39 | <button type="button" class="btn btn btn-primary"> <i class="fa fa-search"></i> Search</button> |
40 | </span> | 40 | </span> |
41 | </div> | 41 | </div> |
42 | <div class="clients-list"> | 42 | <div class="clients-list"> |
43 | <ul class="nav nav-tabs" id="tabClient"> | 43 | <ul class="nav nav-tabs" id="tabClient"> |
44 | <span class="pull-right small text-muted">{{clientLength}} Clients</span> | 44 | <span class="pull-right small text-muted">{{clientLength}} Clients</span> |
45 | <li class="customTab1"><a data-toggle="tab" ng-click="fboAdmin()" id="fbo"><i class="fa fa-user"></i> FBO Clients</a></li> | 45 | <li class="customTab1"><a data-toggle="tab" ng-click="fboAdmin()" id="fbo"><i class="fa fa-user"></i> FBO Clients</a></li> |
46 | <li class="active customTab2"><a data-toggle="tab" ng-click="fboDept()" id="flightDetp"><i class="fa fa-briefcase"></i> FBO Department Clients</a></li> | 46 | <li class="active customTab2"><a data-toggle="tab" ng-click="fboDept()" id="flightDetp"><i class="fa fa-briefcase"></i> FBO Department Clients</a></li> |
47 | </ul> | 47 | </ul> |
48 | <div class="tab-content"> | 48 | <div class="tab-content"> |
49 | <div id="tab-1" class="tab-pane"> | 49 | <div id="tab-1" class="tab-pane"> |
50 | <div class="full-height-scroll"> | 50 | <div class="full-height-scroll"> |
51 | <div class="table-responsive"> | 51 | <div class="table-responsive"> |
52 | <table class="table table-striped table-hover"> | 52 | <table class="table table-striped table-hover"> |
53 | <tbody> | 53 | <tbody> |
54 | <tr ng-repeat="client in fboClient" ui-sref="index.updateFBO({id: client.user.id})" style="cursor: pointer;"> | 54 | <tr ng-repeat="client in fboClient | filter : searchQuery" ui-sref="index.updateFBO({id: client.user.id})" style="cursor: pointer;"> |
55 | <td class="client-link">{{client.user.companyName}}</td> | 55 | <td class="client-link">{{client.user.companyName}}</td> |
56 | <td> {{client.user.firstName}}</td> | 56 | <td> {{client.user.firstName}}</td> |
57 | <td><i class="fa fa-flag"></i> {{client.user.lastName}}</td> | 57 | <td><i class="fa fa-flag"></i> {{client.user.lastName}}</td> |
58 | <td class="client-status"><span ng-if="client.user.account.user.status == 'ACTIVE'" class="label label-primary">{{client.user.account.user.status}}</span><span ng-if="client.user.account.user.status == 'INACTIVE'" class="label label-danger">{{client.user.account.user.status}}</span><span ng-if="client.user.account.user.status == 'PENDING'" class="label label-default">{{client.user.account.user.status}}</span></td> | 58 | <td class="client-status"><span ng-if="client.user.account.user.status == 'ACTIVE'" class="label label-primary">{{client.user.account.user.status}}</span><span ng-if="client.user.account.user.status == 'INACTIVE'" class="label label-danger">{{client.user.account.user.status}}</span><span ng-if="client.user.account.user.status == 'PENDING'" class="label label-default">{{client.user.account.user.status}}</span></td> |
59 | </tr> | 59 | </tr> |
60 | 60 | ||
61 | </tbody> | 61 | </tbody> |
62 | </table> | 62 | </table> |
63 | </div> | 63 | </div> |
64 | </div> | 64 | </div> |
65 | </div> | 65 | </div> |
66 | <div id="tab-2" class="tab-pane"> | 66 | <div id="tab-2" class="tab-pane"> |
67 | <div class="full-height-scroll"> | 67 | <div class="full-height-scroll"> |
68 | <div class="table-responsive"> | 68 | <div class="table-responsive"> |
69 | <table class="table table-striped table-hover"> | 69 | <table class="table table-striped table-hover"> |
70 | <tbody> | 70 | <tbody> |
71 | <tr ng-repeat="dept in fboDeptList" ui-sref="index.updateFBODept({id: dept.user.id})" style="cursor: pointer;"> | 71 | <tr ng-repeat="dept in fboDeptList | filter : searchQuery" ui-sref="index.updateFBODept({id: dept.user.id})" style="cursor: pointer;"> |
72 | <td><a data-toggle="tab" href="#company-1" class="client-link">{{dept.user.companyName}}</a></td> | 72 | <td><a data-toggle="tab" href="#company-1" class="client-link">{{dept.user.companyName}}</a></td> |
73 | <td>{{dept.user.firstName}}</td> | 73 | <td>{{dept.user.firstName}}</td> |
74 | <td><i class="fa fa-flag"></i> {{dept.user.lastName}}</td> | 74 | <td><i class="fa fa-flag"></i> {{dept.user.lastName}}</td> |
75 | <td class="client-status"><span ng-if="dept.user.account.user.status == 'ACTIVE'" class="label label-primary">{{dept.user.account.user.status}}</span><span ng-if="dept.user.account.user.status == 'INACTIVE'" class="label label-danger">{{dept.user.account.user.status}}</span><span ng-if="dept.user.account.user.status == 'PENDING'" class="label label-default">{{dept.user.account.user.status}}</span></td> | 75 | <td class="client-status"><span ng-if="dept.user.account.user.status == 'ACTIVE'" class="label label-primary">{{dept.user.account.user.status}}</span><span ng-if="dept.user.account.user.status == 'INACTIVE'" class="label label-danger">{{dept.user.account.user.status}}</span><span ng-if="dept.user.account.user.status == 'PENDING'" class="label label-default">{{dept.user.account.user.status}}</span></td> |
76 | </tr> | 76 | </tr> |
77 | </tbody> | 77 | </tbody> |
78 | </table> | 78 | </table> |
79 | </div> | 79 | </div> |
80 | </div> | 80 | </div> |
81 | </div> | 81 | </div> |
82 | </div> | 82 | </div> |
83 | </div> | 83 | </div> |
84 | </div> | 84 | </div> |
85 | </div> | 85 | </div> |
86 | </div> | 86 | </div> |
87 | </div> | 87 | </div> |
88 | </div> | 88 | </div> |
app/views/flightDept/flightDeptController.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acuefuel') | 4 | angular.module('acuefuel') |
5 | 5 | ||
6 | .controller('flightDeptController', function($scope, $stateParams, FBOClient) { | 6 | .controller('flightDeptController', function($scope, $stateParams, FBOClient) { |
7 | $(document).ready(function(){ | 7 | $(document).ready(function(){ |
8 | $('.tab-pane').slimScroll({ | 8 | $('.tab-pane').slimScroll({ |
9 | height: '600px' | 9 | height: '600px' |
10 | }); | 10 | }); |
11 | }); | 11 | }); |
12 | //$('#tab-2').css('display', 'none'); | 12 | //$('#tab-2').css('display', 'none'); |
13 | getAllFbo(); | 13 | getAllFbo(); |
14 | function getAllFbo(){ | 14 | function getAllFbo(){ |
15 | FBOClient.getAllFlightDeptList().then(function(result) { | 15 | FBOClient.getAllFlightDeptList().then(function(result) { |
16 | console.log(result) | 16 | console.log(result) |
17 | $scope.fboDeptList = result; | 17 | $scope.fboDeptList = result; |
18 | $scope.clientLength = result.length; | 18 | $scope.clientLength = result.length; |
19 | $('#tab-1').css('display', 'none'); | 19 | $('#tab-1').css('display', 'none'); |
20 | $('#tab-2').css('display', 'block'); | 20 | $('#tab-2').css('display', 'block'); |
21 | $('.customTab2').addClass('active'); | 21 | $('.customTab2').addClass('active'); |
22 | $('.customTab1').removeClass('active'); | 22 | $('.customTab1').removeClass('active'); |
23 | $('.slimScrollDiv:first-child').css('display', 'none'); | 23 | $('.slimScrollDiv:first-child').css('display', 'none'); |
24 | }) | 24 | }) |
25 | } | 25 | } |
26 | 26 | ||
27 | $scope.searchData = function(){ | 27 | // $scope.searchData = function(){ |
28 | var userType = $('#tabClient > li.active > a').attr('id'); | 28 | // console.log($scope.searchQuery) |
29 | searchClient($scope.searchQuery, userType); | 29 | // var userType = $('#tabClient > li.active > a').attr('id'); |
30 | } | 30 | // searchClient($scope.searchQuery, userType); |
31 | // } | ||
31 | 32 | ||
32 | function searchClient(searchData, userType){ | 33 | // function searchClient(searchData, userType){ |
33 | console.log(searchData) | 34 | // console.log(searchData) |
34 | console.log(userType) | 35 | // console.log(userType) |
35 | if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ | 36 | // if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ |
36 | $scope.fboAdmin(); | 37 | // $scope.fboAdmin(); |
37 | }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ | 38 | // }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ |
38 | getAllFbo(); | 39 | // getAllFbo(); |
39 | }else{ | 40 | // }else{ |
40 | var data = { | 41 | // var data = { |
41 | "query" : searchData, | 42 | // "query" : searchData, |
42 | "userType" : userType | 43 | // "userType" : userType |
43 | } | 44 | // } |
44 | FBOClient.getSearchClient(data).then(function(result) { | 45 | // FBOClient.getSearchClient(data).then(function(result) { |
45 | for(var i=0; i<result.length; i++){ | 46 | // for(var i=0; i<result.length; i++){ |
46 | result[i].user = []; | 47 | // result[i].user = []; |
47 | result[i].user.companyName = result[i].companyName; | 48 | // result[i].user.companyName = result[i].companyName; |
48 | result[i].user.firstName = result[i].firstName; | 49 | // result[i].user.firstName = result[i].firstName; |
49 | result[i].user.lastName = result[i].lastName; | 50 | // result[i].user.lastName = result[i].lastName; |
50 | result[i].user.id = result[i].id; | 51 | // result[i].user.id = result[i].id; |
51 | result[i].user.account = []; | 52 | // result[i].user.account = []; |
52 | result[i].user.account.user = []; | 53 | // result[i].user.account.user = []; |
53 | result[i].user.account.user.status = result[i].account.user.status; | 54 | // result[i].user.account.user.status = result[i].account.user.status; |
54 | } | 55 | // } |
55 | if(userType == 'fbo'){ | 56 | // if(userType == 'fbo'){ |
56 | $scope.fboClient = result; | 57 | // $scope.fboClient = result; |
57 | console.log(result) | 58 | // console.log(result) |
58 | $scope.clientLength = result.length; | 59 | // $scope.clientLength = result.length; |
59 | }else{ | 60 | // }else{ |
60 | console.log("nai aaya") | 61 | // console.log("nai aaya") |
61 | $scope.fboDeptList = result; | 62 | // $scope.fboDeptList = result; |
62 | $scope.clientLength = result.length; | 63 | // $scope.clientLength = result.length; |
63 | } | 64 | // } |
64 | }) | 65 | // }) |
65 | } | 66 | // } |
66 | } | 67 | // } |
67 | 68 | ||
68 | $scope.fboAdmin = function(){ | 69 | $scope.fboAdmin = function(){ |
69 | FBOClient.getALlFBOList().then(function(result) { | 70 | FBOClient.getALlFBOList().then(function(result) { |
70 | console.log(result) | 71 | console.log(result) |
71 | $scope.fboClient = result; | 72 | $scope.fboClient = result; |
72 | $scope.clientLength = result.length; | 73 | $scope.clientLength = result.length; |
73 | }) | 74 | }) |
74 | $('#tab-1').css('display', 'block'); | 75 | $('#tab-1').css('display', 'block'); |
75 | $('#tab-2').css('display', 'none'); | 76 | $('#tab-2').css('display', 'none'); |
76 | $('.customTab1').addClass('active'); | 77 | $('.customTab1').addClass('active'); |
77 | $('.customTab2').removeClass('active'); | 78 | $('.customTab2').removeClass('active'); |
78 | $('.slimScrollDiv:first-child').css('display', 'block'); | 79 | $('.slimScrollDiv:first-child').css('display', 'block'); |
79 | 80 | ||
80 | } | 81 | } |
81 | 82 | ||
82 | $scope.fboDept = function(){ | 83 | $scope.fboDept = function(){ |
83 | getAllFbo(); | 84 | getAllFbo(); |
84 | } | 85 | } |
85 | 86 | ||
86 | }); | 87 | }); |