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
... | ... | @@ -19,45 +19,45 @@ |
19 | 19 | }) |
20 | 20 | } |
21 | 21 | |
22 | - $scope.searchData = function(){ | |
23 | - var userType = $('#tabClient > li.active > a').attr('id'); | |
24 | - searchClient($scope.searchQuery, userType); | |
25 | - } | |
22 | + // $scope.searchData = function(){ | |
23 | + // var userType = $('#tabClient > li.active > a').attr('id'); | |
24 | + // searchClient($scope.searchQuery, userType); | |
25 | + // } | |
26 | 26 | |
27 | - function searchClient(searchData, userType){ | |
28 | - console.log(userType) | |
29 | - if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ | |
30 | - getAllFbo(); | |
31 | - }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ | |
32 | - $scope.fboDept(); | |
33 | - }else{ | |
34 | - var data = { | |
35 | - "query" : searchData, | |
36 | - "userType" : userType | |
37 | - } | |
38 | - FBOClient.getSearchClient(data).then(function(result) { | |
39 | - for(var i=0; i<result.length; i++){ | |
40 | - result[i].user = []; | |
41 | - result[i].user.companyName = result[i].companyName; | |
42 | - result[i].user.firstName = result[i].firstName; | |
43 | - result[i].user.lastName = result[i].lastName; | |
44 | - result[i].user.id = result[i].id; | |
45 | - result[i].user.account = []; | |
46 | - result[i].user.account.user = []; | |
47 | - result[i].user.account.user.status = result[i].account.user.status; | |
48 | - } | |
49 | - if(userType == 'fbo'){ | |
50 | - $scope.fboClient = result; | |
51 | - console.log(result) | |
52 | - $scope.clientLength = result.length; | |
53 | - }else{ | |
54 | - $scope.fboDeptList = result; | |
55 | - $scope.clientLength = result.length; | |
56 | - } | |
57 | - }) | |
58 | - } | |
27 | + // function searchClient(searchData, userType){ | |
28 | + // console.log(userType) | |
29 | + // if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ | |
30 | + // getAllFbo(); | |
31 | + // }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ | |
32 | + // $scope.fboDept(); | |
33 | + // }else{ | |
34 | + // var data = { | |
35 | + // "query" : searchData, | |
36 | + // "userType" : userType | |
37 | + // } | |
38 | + // FBOClient.getSearchClient(data).then(function(result) { | |
39 | + // for(var i=0; i<result.length; i++){ | |
40 | + // result[i].user = []; | |
41 | + // result[i].user.companyName = result[i].companyName; | |
42 | + // result[i].user.firstName = result[i].firstName; | |
43 | + // result[i].user.lastName = result[i].lastName; | |
44 | + // result[i].user.id = result[i].id; | |
45 | + // result[i].user.account = []; | |
46 | + // result[i].user.account.user = []; | |
47 | + // result[i].user.account.user.status = result[i].account.user.status; | |
48 | + // } | |
49 | + // if(userType == 'fbo'){ | |
50 | + // $scope.fboClient = result; | |
51 | + // console.log(result) | |
52 | + // $scope.clientLength = result.length; | |
53 | + // }else{ | |
54 | + // $scope.fboDeptList = result; | |
55 | + // $scope.clientLength = result.length; | |
56 | + // } | |
57 | + // }) | |
58 | + // } | |
59 | 59 | |
60 | - } | |
60 | + // } | |
61 | 61 | |
62 | 62 | $scope.fboAdmin = function(){ |
63 | 63 | getAllFbo(); | ... | ... |
app/views/fbo-Clients/fboClients.html
... | ... | @@ -34,9 +34,10 @@ |
34 | 34 | </p> --> |
35 | 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 | 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 | 41 | </span> |
41 | 42 | </div> |
42 | 43 | <div class="clients-list"> |
... | ... | @@ -51,7 +52,7 @@ |
51 | 52 | <div class="table-responsive"> |
52 | 53 | <table class="table table-striped table-hover"> |
53 | 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 | 56 | <td class="client-link">{{client.user.companyName}}</td> |
56 | 57 | <td> {{client.user.firstName}}</td> |
57 | 58 | <td><i class="fa fa-flag"></i> {{client.user.lastName}}</td> |
... | ... | @@ -68,7 +69,7 @@ |
68 | 69 | <div class="table-responsive"> |
69 | 70 | <table class="table table-striped table-hover"> |
70 | 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 | 73 | <td><a data-toggle="tab" href="#company-1" class="client-link">{{dept.user.companyName}}</a></td> |
73 | 74 | <td>{{dept.user.firstName}}</td> |
74 | 75 | <td><i class="fa fa-flag"></i> {{dept.user.lastName}}</td> | ... | ... |
app/views/flightDept/flightDept.html
... | ... | @@ -34,9 +34,9 @@ |
34 | 34 | </p> --> |
35 | 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 | 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 | 40 | </span> |
41 | 41 | </div> |
42 | 42 | <div class="clients-list"> |
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | <div class="table-responsive"> |
52 | 52 | <table class="table table-striped table-hover"> |
53 | 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 | 55 | <td class="client-link">{{client.user.companyName}}</td> |
56 | 56 | <td> {{client.user.firstName}}</td> |
57 | 57 | <td><i class="fa fa-flag"></i> {{client.user.lastName}}</td> |
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 | <div class="table-responsive"> |
69 | 69 | <table class="table table-striped table-hover"> |
70 | 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 | 72 | <td><a data-toggle="tab" href="#company-1" class="client-link">{{dept.user.companyName}}</a></td> |
73 | 73 | <td>{{dept.user.firstName}}</td> |
74 | 74 | <td><i class="fa fa-flag"></i> {{dept.user.lastName}}</td> | ... | ... |
app/views/flightDept/flightDeptController.js
... | ... | @@ -24,46 +24,47 @@ |
24 | 24 | }) |
25 | 25 | } |
26 | 26 | |
27 | - $scope.searchData = function(){ | |
28 | - var userType = $('#tabClient > li.active > a').attr('id'); | |
29 | - searchClient($scope.searchQuery, userType); | |
30 | - } | |
27 | + // $scope.searchData = function(){ | |
28 | + // console.log($scope.searchQuery) | |
29 | + // var userType = $('#tabClient > li.active > a').attr('id'); | |
30 | + // searchClient($scope.searchQuery, userType); | |
31 | + // } | |
31 | 32 | |
32 | - function searchClient(searchData, userType){ | |
33 | - console.log(searchData) | |
34 | - console.log(userType) | |
35 | - if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ | |
36 | - $scope.fboAdmin(); | |
37 | - }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ | |
38 | - getAllFbo(); | |
39 | - }else{ | |
40 | - var data = { | |
41 | - "query" : searchData, | |
42 | - "userType" : userType | |
43 | - } | |
44 | - FBOClient.getSearchClient(data).then(function(result) { | |
45 | - for(var i=0; i<result.length; i++){ | |
46 | - result[i].user = []; | |
47 | - result[i].user.companyName = result[i].companyName; | |
48 | - result[i].user.firstName = result[i].firstName; | |
49 | - result[i].user.lastName = result[i].lastName; | |
50 | - result[i].user.id = result[i].id; | |
51 | - result[i].user.account = []; | |
52 | - result[i].user.account.user = []; | |
53 | - result[i].user.account.user.status = result[i].account.user.status; | |
54 | - } | |
55 | - if(userType == 'fbo'){ | |
56 | - $scope.fboClient = result; | |
57 | - console.log(result) | |
58 | - $scope.clientLength = result.length; | |
59 | - }else{ | |
60 | - console.log("nai aaya") | |
61 | - $scope.fboDeptList = result; | |
62 | - $scope.clientLength = result.length; | |
63 | - } | |
64 | - }) | |
65 | - } | |
66 | - } | |
33 | + // function searchClient(searchData, userType){ | |
34 | + // console.log(searchData) | |
35 | + // console.log(userType) | |
36 | + // if(searchData == null || searchData == undefined || searchData == "" && userType == 'fbo'){ | |
37 | + // $scope.fboAdmin(); | |
38 | + // }else if(searchData == null || searchData == undefined || searchData == "" && userType == 'flightDetp'){ | |
39 | + // getAllFbo(); | |
40 | + // }else{ | |
41 | + // var data = { | |
42 | + // "query" : searchData, | |
43 | + // "userType" : userType | |
44 | + // } | |
45 | + // FBOClient.getSearchClient(data).then(function(result) { | |
46 | + // for(var i=0; i<result.length; i++){ | |
47 | + // result[i].user = []; | |
48 | + // result[i].user.companyName = result[i].companyName; | |
49 | + // result[i].user.firstName = result[i].firstName; | |
50 | + // result[i].user.lastName = result[i].lastName; | |
51 | + // result[i].user.id = result[i].id; | |
52 | + // result[i].user.account = []; | |
53 | + // result[i].user.account.user = []; | |
54 | + // result[i].user.account.user.status = result[i].account.user.status; | |
55 | + // } | |
56 | + // if(userType == 'fbo'){ | |
57 | + // $scope.fboClient = result; | |
58 | + // console.log(result) | |
59 | + // $scope.clientLength = result.length; | |
60 | + // }else{ | |
61 | + // console.log("nai aaya") | |
62 | + // $scope.fboDeptList = result; | |
63 | + // $scope.clientLength = result.length; | |
64 | + // } | |
65 | + // }) | |
66 | + // } | |
67 | + // } | |
67 | 68 | |
68 | 69 | $scope.fboAdmin = function(){ |
69 | 70 | FBOClient.getALlFBOList().then(function(result) { | ... | ... |