Commit 3b15a66d3390c6ea73f74f7d5ef5c77dce03bb9e
Exists in
master
Merge branch 'master' of git.viithiisys.com:viithiisys/acufuel
Showing
9 changed files
Show diff stats
app/partials/ContactView/ContactView.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | 5 | ||
6 | .controller('ContactViewController', ['$scope', '$uibModal', 'ContactViewService', 'ViewCompanyService', 'ViewcontactService', 'NgTableParams', function($scope, $uibModal, ContactViewService, ViewCompanyService, ViewcontactService, NgTableParams) { | 6 | .controller('ContactViewController', ['$scope', '$uibModal', 'ContactViewService', 'ViewCompanyService', 'ViewcontactService', 'NgTableParams', function($scope, $uibModal, ContactViewService, ViewCompanyService, ViewcontactService, NgTableParams) { |
7 | 7 | ||
8 | $(document).ready(function() { | 8 | $(document).ready(function() { |
9 | $('#contacts').DataTable(); | 9 | $('#contacts').DataTable(); |
10 | }); | 10 | }); |
11 | 11 | ||
12 | ContactViewService.getContacts().then(function(result) { | 12 | ContactViewService.getContacts().then(function(result) { |
13 | $scope.contactList = result; | 13 | $scope.contactList = result; |
14 | }) | 14 | }) |
15 | 15 | ||
16 | $scope.search = ""; | 16 | $scope.search = ""; |
17 | $scope.minlength = 2; | 17 | $scope.minlength = 2; |
18 | 18 | ||
19 | 19 | ||
20 | $scope.searchString= function(value){ | 20 | $scope.searchString= function(value){ |
21 | ContactViewService.getSearchResults(value).then(function(result) { | 21 | ContactViewService.getSearchResults(value).then(function(result) { |
22 | $scope.contactList = result; | 22 | $scope.contactList = result; |
23 | console.log("result", result); | 23 | console.log("result", result); |
24 | for (var i = 0; i < $scope.contactList.length; i++) { | 24 | for (var i = 0; i < $scope.contactList.length; i++) { |
25 | if ($scope.contactList[i].owner != null) { | 25 | if ($scope.contactList[i].owner != null) { |
26 | if ($scope.contactList[i].owner.companyName != null || $scope.contactList[i].owner.companyName != undefined) { | 26 | if ($scope.contactList[i].owner.companyName != null || $scope.contactList[i].owner.companyName != undefined) { |
27 | $scope.contactList[i].owner = $scope.contactList[i].owner.companyName; | 27 | $scope.contactList[i].owner = $scope.contactList[i].owner.companyName; |
28 | } | 28 | } |
29 | } | 29 | } |
30 | } | 30 | } |
31 | $scope.displayContactList = new NgTableParams({ | 31 | $scope.displayContactList = new NgTableParams({ |
32 | page: 1, | 32 | page: 1, |
33 | count: 10, | 33 | count: 10, |
34 | }, { | 34 | }, { |
35 | data: $scope.contactList | 35 | data: $scope.contactList |
36 | }); | 36 | }); |
37 | }) | 37 | }) |
38 | } | 38 | } |
39 | 39 | ||
40 | $scope.reset = function(){ | 40 | $scope.reset = function(){ |
41 | $("input").val(""); | 41 | $("input").val(""); |
42 | } | 42 | } |
43 | 43 | ||
44 | $scope.data = {}; | 44 | $scope.data = {}; |
45 | getAllContacts(); | 45 | getAllContacts(); |
46 | 46 | ||
47 | $scope.changePriceEmail = function(id, index){ | 47 | $scope.changePriceEmail = function(id, index){ |
48 | event.stopPropagation(); | 48 | event.stopPropagation(); |
49 | var contactId = id; | 49 | var contactId = id; |
50 | var statusData = "status=" + $scope.contactList[index].priceEmail; | 50 | var statusData = "status=" + $scope.contactList[index].priceEmail; |
51 | ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { | 51 | ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { |
52 | if(result.success){ | 52 | if(result.success){ |
53 | $('#toogleMail').css('display', 'block'); | 53 | $('#toogleMail').css('display', 'block'); |
54 | if($scope.contactList[index].priceEmail == true){ | 54 | if($scope.contactList[index].priceEmail == true){ |
55 | $scope.messageText = 'You have enabled price distribution for this contact'; | 55 | $scope.messageText = 'You have enabled price distribution for this contact'; |
56 | }else{ | 56 | }else{ |
57 | $scope.messageText = 'You have disabled price distribution for this contact'; | 57 | $scope.messageText = 'You have disabled price distribution for this contact'; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | }) | 60 | }) |
61 | } | 61 | } |
62 | 62 | ||
63 | $scope.cancelToogle = function(){ | 63 | $scope.cancelToogle = function(){ |
64 | $('#toogleMail').css('display', 'none'); | 64 | $('#toogleMail').css('display', 'none'); |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | function getAllContacts(){ | 68 | function getAllContacts(){ |
69 | ContactViewService.getContacts().then(function(result) { | 69 | ContactViewService.getContacts().then(function(result) { |
70 | console.log('log', result); | 70 | console.log('log', result); |
71 | $scope.contactList = result; | 71 | $scope.contactList = result; |
72 | for (var i = 0; i < $scope.contactList.length; i++) { | 72 | for (var i = 0; i < $scope.contactList.length; i++) { |
73 | if ($scope.contactList[i].owner != null) { | 73 | if ($scope.contactList[i].owner != null) { |
74 | if ($scope.contactList[i].owner.companyName != null || $scope.contactList[i].owner.companyName != undefined) { | 74 | if ($scope.contactList[i].owner.companyName != null || $scope.contactList[i].owner.companyName != undefined) { |
75 | $scope.contactList[i].owner = $scope.contactList[i].owner.companyName; | 75 | $scope.contactList[i].owner = $scope.contactList[i].owner.companyName; |
76 | } | 76 | } |
77 | } | 77 | } |
78 | } | 78 | } |
79 | $scope.displayContactList = new NgTableParams({ | 79 | $scope.displayContactList = new NgTableParams({ |
80 | page: 1, | 80 | page: 1, |
81 | count: 10, | 81 | count: 10, |
82 | }, { | 82 | }, { |
83 | data: $scope.contactList | 83 | data: $scope.contactList |
84 | }); | 84 | }); |
85 | }) | 85 | }) |
86 | } | 86 | } |
87 | 87 | ||
88 | 88 | ||
89 | ContactViewService.getCompanies().then(function(result) { | 89 | ContactViewService.getCompanies().then(function(result) { |
90 | $scope.companies = result; | 90 | $scope.companies = result; |
91 | 91 | ||
92 | }) | 92 | }) |
93 | 93 | ||
94 | $scope.contactData = {}; | 94 | $scope.contactData = {}; |
95 | $scope.contactData.contactList = []; | 95 | $scope.contactData.contactList = []; |
96 | $scope.addContact = function(){ | 96 | $scope.addContact = function(){ |
97 | $scope.contactData.contactList.push($scope.data); | 97 | $scope.contactData.contactList.push($scope.data); |
98 | ViewCompanyService.addContact($scope.contactData).then(function(result) { | 98 | ViewCompanyService.addContact($scope.contactData).then(function(result) { |
99 | if(result.success){ | 99 | if(result.success){ |
100 | toastr.success(''+result.success+'', { | 100 | toastr.success(''+result.success+'', { |
101 | closeButton: true | 101 | closeButton: true |
102 | }) | 102 | }) |
103 | $('#contact-modal-3').modal('hide'); | 103 | $('#contact-modal-3').modal('hide'); |
104 | }else{ | 104 | }else{ |
105 | toastr.error(''+result.statusText+'', { | 105 | toastr.error(''+result.statusText+'', { |
106 | closeButton: true | 106 | closeButton: true |
107 | }) | 107 | }) |
108 | } | 108 | } |
109 | }) | 109 | }) |
110 | } | 110 | } |
111 | |||
112 | $scope.exportContacts = function() { | ||
113 | $scope.showLoader = true; | ||
114 | var fileName = "contacts.csv"; | ||
115 | var a = document.createElement("a"); | ||
116 | document.body.appendChild(a); | ||
117 | ContactViewService.exportContacts().then(function(result) { | ||
118 | var file = new Blob([result], {type: 'application/csv'}); | ||
119 | var fileURL = URL.createObjectURL(file); | ||
120 | a.href = fileURL; | ||
121 | a.download = fileName; | ||
122 | a.click(); | ||
123 | $scope.showLoader = false; | ||
124 | }) | ||
125 | } | ||
111 | 126 | ||
112 | }]); | 127 | }]); |
app/partials/ContactView/ContactView.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:nth-child(3) > a{ | 2 | .subnavbar .mainnav > li:nth-child(3) > a{ |
3 | color: #ff9900; | 3 | color: #ff9900; |
4 | } | 4 | } |
5 | </style> | 5 | </style> |
6 | <div class="main"> | 6 | <div class="main"> |
7 | <div class="container"> | 7 | <div class="container"> |
8 | <div class="row"> | 8 | <div class="row"> |
9 | <div class="col-md-12"> | 9 | <div class="col-md-12"> |
10 | <div class="widget stacked "> | 10 | <div class="widget stacked "> |
11 | <div class="widget-content"> | 11 | <div class="widget-content"> |
12 | <div class="tabbable"> | 12 | <div class="tabbable"> |
13 | <ul class="nav nav-tabs"> | 13 | <ul class="nav nav-tabs"> |
14 | <li> | 14 | <li> |
15 | <a ui-sref="app.customers">Company View | 15 | <a ui-sref="app.customers">Company View |
16 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 16 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
17 | </a> | 17 | </a> |
18 | </li> | 18 | </li> |
19 | <li class="active"> | 19 | <li class="active"> |
20 | <a ui-sref="app.ContactView">Contact View | 20 | <a ui-sref="app.ContactView">Contact View |
21 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 21 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
22 | </a> | 22 | </a> |
23 | </li> | 23 | </li> |
24 | <li> | 24 | <li> |
25 | <a ui-sref="app.FuelVendors">Fuel Vendors | 25 | <a ui-sref="app.FuelVendors">Fuel Vendors |
26 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 26 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
27 | </a> | 27 | </a> |
28 | </li> | 28 | </li> |
29 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" name="name" id="name" placeholder="Search In Table" ng-model="search" ng-keyup="searchString(search)" ng-minlength="minlength"></li> | 29 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" ng-model="searchText" placeholder="Search In Table" ng-model="search" ng-minlength="minlength"></li> |
30 | <li><button type="button" class="btn btn-default btn-sm">Clear Search And Filters</button></li> | 30 | <li><button type="button" class="btn btn-default btn-sm" ng-click="displayContactList.filter({}); searchText=null">Clear Search And Filters</button></li> |
31 | <li style="float: right"> <button type="submit" data-toggle="modal" data-target="#contact-modal-3" class="btn btn-success btn-sm"> <i class="fa fa-plus" aria-hidden="true"></i> Add Contact </button></li> | 31 | <li style="float: right"> <button type="submit" data-toggle="modal" data-target="#contact-modal-3" class="btn btn-success btn-sm"> <i class="fa fa-plus" aria-hidden="true"></i> Add Contact </button></li> |
32 | </ul> | 32 | </ul> |
33 | <br> | 33 | <br> |
34 | <div class="tab-content customer-table" style="margin:0px"> | 34 | <div class="tab-content customer-table" style="margin:0px"> |
35 | <div class="tab-pane active" id="companyView"> | 35 | <div class="tab-pane active" id="companyView"> |
36 | <table ng-table="displayContactList" class="table table-striped table-condensed" show-filter="true"> | 36 | <table ng-table="displayContactList" class="table table-striped table-condensed" show-filter="true"> |
37 | <tr ng-repeat="row in $data track by row.id" style="cursor: pointer;" ui-sref="app.viewContact({id : row.id})"> | 37 | <tr ng-repeat="row in $data | filter:searchText" style="cursor: pointer;" ui-sref="app.viewContact({id : row.id})"> |
38 | <td data-title="'Last Name'" filter="{lastName: 'text'}" sortable="'lastName'"> | 38 | <td data-title="'Last Name'" filter="{lastName: 'text'}" sortable="'lastName'"> |
39 | {{row.lastName}} | 39 | {{row.lastName}} |
40 | </td> | 40 | </td> |
41 | <td data-title="'First Name'" filter="{firstName: 'text'}" sortable="'firstName'"> | 41 | <td data-title="'First Name'" filter="{firstName: 'text'}" sortable="'firstName'"> |
42 | {{row.firstName}} | 42 | {{row.firstName}} |
43 | </td> | 43 | </td> |
44 | <td data-title="'Company Name'" filter="{owner: 'text'}" sortable="'owner'"> | 44 | <td data-title="'Company Name'" filter="{owner: 'text'}" sortable="'owner'"> |
45 | {{row.owner}} | 45 | {{row.owner}} |
46 | </td> | 46 | </td> |
47 | <td data-title="'Work Phone'" filter="{workPhone: 'text'}" sortable="'workPhone'"> | 47 | <td data-title="'Work Phone'" filter="{workPhone: 'text'}" sortable="'workPhone'"> |
48 | {{row.workPhone}} | 48 | {{row.workPhone}} |
49 | </td> | 49 | </td> |
50 | <td data-title="'Mobile Phone'" filter="{mobilePhone: 'text'}" sortable="'mobilePhone'"> | 50 | <td data-title="'Mobile Phone'" filter="{mobilePhone: 'text'}" sortable="'mobilePhone'"> |
51 | {{row.mobilePhone}} | 51 | {{row.mobilePhone}} |
52 | </td> | 52 | </td> |
53 | <td data-title="'Title'" filter="{title: 'text'}" sortable="'title'"> | 53 | <td data-title="'Title'" filter="{title: 'text'}" sortable="'title'"> |
54 | {{row.title}} | 54 | {{row.title}} |
55 | </td> | 55 | </td> |
56 | <td data-title="'Pricing Email'"> | 56 | <td data-title="'Pricing Email'"> |
57 | <toggle ng-model="row.priceEmail" ng-change="changePriceEmail(row.id, $index)" size="customToogle"></toggle> | 57 | <toggle ng-model="row.priceEmail" ng-change="changePriceEmail(row.id, $index)" size="customToogle"></toggle> |
58 | </td> | 58 | </td> |
59 | <td data-title="'User Name'" filter="{userName: 'text'}" sortable="'userName'"> | 59 | <td data-title="'User Name'" filter="{userName: 'text'}" sortable="'userName'"> |
60 | {{row.userName}} | 60 | {{row.userName}} |
61 | </td> | 61 | </td> |
62 | </tr> | 62 | </tr> |
63 | </table> | 63 | </table> |
64 | 64 | ||
65 | <button type="button" class="btn btn-warning exportBtn">Export Customers</button> | 65 | <button type="button" ng-click="exportContacts()" class="btn btn-warning exportBtn">Export CSV</button> |
66 | 66 | ||
67 | <!-- <table class="table table-striped"> | 67 | <!-- <table class="table table-striped"> |
68 | <thead> | 68 | <thead> |
69 | <tr> | 69 | <tr> |
70 | <th> | 70 | <th> |
71 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 71 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
72 | <label class="font-company">Last Name <i class="fa fa-sort" aria-hidden="true"></i></label> | 72 | <label class="font-company">Last Name <i class="fa fa-sort" aria-hidden="true"></i></label> |
73 | </th> | 73 | </th> |
74 | 74 | ||
75 | <th> | 75 | <th> |
76 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 76 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
77 | <label class="font-company">First Phone <i class="fa fa-sort" aria-hidden="true"></i></label> | 77 | <label class="font-company">First Phone <i class="fa fa-sort" aria-hidden="true"></i></label> |
78 | </th> | 78 | </th> |
79 | <th> | 79 | <th> |
80 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 80 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
81 | <label class="font-company">Company Name <i class="fa fa-sort" aria-hidden="true"></i></label> | 81 | <label class="font-company">Company Name <i class="fa fa-sort" aria-hidden="true"></i></label> |
82 | </th> | 82 | </th> |
83 | 83 | ||
84 | <th> | 84 | <th> |
85 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 85 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
86 | <label class="font-company">Work Phone <i class="fa fa-sort" aria-hidden="true"></i></label> | 86 | <label class="font-company">Work Phone <i class="fa fa-sort" aria-hidden="true"></i></label> |
87 | <th> | 87 | <th> |
88 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 88 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
89 | <label class="font-company">Mobile Phone <i class="fa fa-sort" aria-hidden="true"></i></label> | 89 | <label class="font-company">Mobile Phone <i class="fa fa-sort" aria-hidden="true"></i></label> |
90 | </th> | 90 | </th> |
91 | <th> | 91 | <th> |
92 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 92 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
93 | <label class="font-company">Title <i class="fa fa-sort" aria-hidden="true"></i></label> | 93 | <label class="font-company">Title <i class="fa fa-sort" aria-hidden="true"></i></label> |
94 | </th> | 94 | </th> |
95 | 95 | ||
96 | <th> | 96 | <th> |
97 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 97 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
98 | <label class="font-company">Price Email<i class="fa fa-sort" aria-hidden="true"></i></label> | 98 | <label class="font-company">Price Email<i class="fa fa-sort" aria-hidden="true"></i></label> |
99 | </th> | 99 | </th> |
100 | <th> | 100 | <th> |
101 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 101 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
102 | <label class="font-company">Username<i class="fa fa-sort" aria-hidden="true"></i></label> | 102 | <label class="font-company">Username<i class="fa fa-sort" aria-hidden="true"></i></label> |
103 | </th> | 103 | </th> |
104 | </tr> | 104 | </tr> |
105 | </thead> | 105 | </thead> |
106 | <tbody> | 106 | <tbody> |
107 | <tr ng-repeat="contact in contactList" style="cursor: pointer;" ui-sref="app.viewContact({id : contact.id})"> | 107 | <tr ng-repeat="contact in contactList" style="cursor: pointer;" ui-sref="app.viewContact({id : contact.id})"> |
108 | <td>{{contact.lastName}}</td> | 108 | <td>{{contact.lastName}}</td> |
109 | <td>{{contact.firstName}}</td> | 109 | <td>{{contact.firstName}}</td> |
110 | <td>{{contact.owner.companyName}}</td> | 110 | <td>{{contact.owner.companyName}}</td> |
111 | <td>{{contact.workPhone}}</td> | 111 | <td>{{contact.workPhone}}</td> |
112 | <td>{{contact.mobilePhone}}</td> | 112 | <td>{{contact.mobilePhone}}</td> |
113 | <td>{{contact.title}}</td> | 113 | <td>{{contact.title}}</td> |
114 | <td> | 114 | <td> |
115 | <toggle ng-model="contact.priceEmail" ng-change="changePriceEmail(contact.id, $index)" size="customToogle"></toggle> | 115 | <toggle ng-model="contact.priceEmail" ng-change="changePriceEmail(contact.id, $index)" size="customToogle"></toggle> |
116 | </td> | 116 | </td> |
117 | <td>{{contact.userName}}</td> | 117 | <td>{{contact.userName}}</td> |
118 | </tr> | 118 | </tr> |
119 | </tbody> | 119 | </tbody> |
120 | </table> --> | 120 | </table> --> |
121 | <!-- <div class="row" style="margin-left: 0px;"> | 121 | <!-- <div class="row" style="margin-left: 0px;"> |
122 | <div class="col-md-2"> | 122 | <div class="col-md-2"> |
123 | <button type="button" class="btn btn-warning">Export Customers</button> | 123 | <button type="button" class="btn btn-warning">Export Customers</button> |
124 | </div> | 124 | </div> |
125 | <div class="col-md-10"> | 125 | <div class="col-md-10"> |
126 | <div class="row" style="margin-left: 0px;"> | 126 | <div class="row" style="margin-left: 0px;"> |
127 | <div class="col-md-6"> | 127 | <div class="col-md-6"> |
128 | </div> | 128 | </div> |
129 | <div class="col-md-2"> | 129 | <div class="col-md-2"> |
130 | <select class="form-control"> | 130 | <select class="form-control"> |
131 | <option>20 Records Per Page</option> | 131 | <option>20 Records Per Page</option> |
132 | <option>50 Records Per Page</option> | 132 | <option>50 Records Per Page</option> |
133 | <option>100 Records Per Page</option> | 133 | <option>100 Records Per Page</option> |
134 | </select> | 134 | </select> |
135 | </div> | 135 | </div> |
136 | <div class="col-md-4"> | 136 | <div class="col-md-4"> |
137 | <ul class="pagination" style="margin:0px"> | 137 | <ul class="pagination" style="margin:0px"> |
138 | <li><a href="javascript:;">ยซ</a></li> | 138 | <li><a href="javascript:;">ยซ</a></li> |
139 | <li class="active"><a href="#">1</a></li> | 139 | <li class="active"><a href="#">1</a></li> |
140 | <li><a href="javascript:;">2</a></li> | 140 | <li><a href="javascript:;">2</a></li> |
141 | <li><a href="javascript:;">3</a></li> | 141 | <li><a href="javascript:;">3</a></li> |
142 | <li><a href="javascript:;">4</a></li> | 142 | <li><a href="javascript:;">4</a></li> |
143 | <li><a href="javascript:;">5</a></li> | 143 | <li><a href="javascript:;">5</a></li> |
144 | <li><a href="javascript:;">ยป</a></li> | 144 | <li><a href="javascript:;">ยป</a></li> |
145 | </ul> | 145 | </ul> |
146 | </div> | 146 | </div> |
147 | </div> | 147 | </div> |
148 | </div> | 148 | </div> |
149 | </div> --> | 149 | </div> --> |
150 | </div> | 150 | </div> |
151 | </div> | 151 | </div> |
152 | </div> | 152 | </div> |
153 | </div> | 153 | </div> |
154 | <!-- /widget-content --> | 154 | <!-- /widget-content --> |
155 | </div> | 155 | </div> |
156 | <!-- /widget --> | 156 | <!-- /widget --> |
157 | </div> | 157 | </div> |
158 | <!-- /span8 --> | 158 | <!-- /span8 --> |
159 | </div> | 159 | </div> |
160 | <!-- /row --> | 160 | <!-- /row --> |
161 | </div> | 161 | </div> |
162 | <!-- /container --> | 162 | <!-- /container --> |
163 | </div> | 163 | </div> |
164 | <!-- /main --> | 164 | <!-- /main --> |
165 | <form class="modal multi-step" id="contact-modal-3" name="companyForm"> | 165 | <form class="modal multi-step" id="contact-modal-3" name="companyForm"> |
166 | <div class="modal-dialog modal-lg"> | 166 | <div class="modal-dialog modal-lg"> |
167 | <div class="modal-content"> | 167 | <div class="modal-content"> |
168 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 168 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
169 | <div> | 169 | <div> |
170 | <div class="row" style="margin: 0;"> | 170 | <div class="row" style="margin: 0;"> |
171 | <div> | 171 | <div> |
172 | <div class="widget" style="margin-bottom: 0; box-shadow: none;"> | 172 | <div class="widget" style="margin-bottom: 0; box-shadow: none;"> |
173 | <div class="widget-header"> | 173 | <div class="widget-header"> |
174 | <i class="icon-pencil"></i> | 174 | <i class="icon-pencil"></i> |
175 | <i class="fa fa-tasks" aria-hidden="true"></i> | 175 | <i class="fa fa-tasks" aria-hidden="true"></i> |
176 | <h3>Add a New Contact</h3> | 176 | <h3>Add a New Contact</h3> |
177 | <div class="clearfix"></div> | 177 | <div class="clearfix"></div> |
178 | </div> | 178 | </div> |
179 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 179 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
180 | <div class="col-xs-12"> | 180 | <div class="col-xs-12"> |
181 | <div class="col-md-6"> | 181 | <div class="col-md-6"> |
182 | <div class="pull-left" style="width: 110px;"> | 182 | <div class="pull-left" style="width: 110px;"> |
183 | <label class="new-input-label"><b>First Name</b></label> | 183 | <label class="new-input-label"><b>First Name</b></label> |
184 | </div> | 184 | </div> |
185 | <div class="pull-left" style="margin-left: 15px;"> | 185 | <div class="pull-left" style="margin-left: 15px;"> |
186 | <input type="tel" ng-model="data.firstName" class="form-control" placeholder=""> | 186 | <input type="tel" ng-model="data.firstName" class="form-control" placeholder=""> |
187 | </div> | 187 | </div> |
188 | <div class="clearfix"></div> | 188 | <div class="clearfix"></div> |
189 | </div> | 189 | </div> |
190 | <div class="col-md-6"> | 190 | <div class="col-md-6"> |
191 | 191 | ||
192 | <div class="pull-left" style="width: 110px;"> | 192 | <div class="pull-left" style="width: 110px;"> |
193 | <label class="new-input-label"><b>Last Name</b></label> | 193 | <label class="new-input-label"><b>Last Name</b></label> |
194 | </div> | 194 | </div> |
195 | <div class="pull-left" style="margin-left: 15px;"> | 195 | <div class="pull-left" style="margin-left: 15px;"> |
196 | <input type="tel" ng-model="data.lastName" class="form-control" id="Address" placeholder=""> | 196 | <input type="tel" ng-model="data.lastName" class="form-control" id="Address" placeholder=""> |
197 | </div> | 197 | </div> |
198 | <div class="clearfix"></div> | 198 | <div class="clearfix"></div> |
199 | </div> | 199 | </div> |
200 | </div> | 200 | </div> |
201 | <div class="clearfix"></div><br> | 201 | <div class="clearfix"></div><br> |
202 | <div class="col-xs-12"> | 202 | <div class="col-xs-12"> |
203 | <div class="col-md-6"> | 203 | <div class="col-md-6"> |
204 | <div class="pull-left" style="width: 110px;"> | 204 | <div class="pull-left" style="width: 110px;"> |
205 | <label class="new-input-label"><b>Title</b></label> | 205 | <label class="new-input-label"><b>Title</b></label> |
206 | </div> | 206 | </div> |
207 | <div class="pull-left" style="margin-left: 15px;"> | 207 | <div class="pull-left" style="margin-left: 15px;"> |
208 | <input type="tel" ng-model="data.title" class="form-control" id="Address" placeholder=""> | 208 | <input type="tel" ng-model="data.title" class="form-control" id="Address" placeholder=""> |
209 | </div> | 209 | </div> |
210 | <div class="clearfix"></div> | 210 | <div class="clearfix"></div> |
211 | </div> | 211 | </div> |
212 | <div class="col-md-6"> | 212 | <div class="col-md-6"> |
213 | 213 | ||
214 | <div class="pull-left" style="width: 110px;"> | 214 | <div class="pull-left" style="width: 110px;"> |
215 | <label class="new-input-label"><b>Email</b></label> | 215 | <label class="new-input-label"><b>Email</b></label> |
216 | </div> | 216 | </div> |
217 | <div class="pull-left" style="margin-left: 15px;"> | 217 | <div class="pull-left" style="margin-left: 15px;"> |
218 | <input type="email" ng-model="data.email" class="form-control" id="Address" placeholder=""> | 218 | <input type="email" ng-model="data.email" class="form-control" id="Address" placeholder=""> |
219 | </div> | 219 | </div> |
220 | <div class="clearfix"></div> | 220 | <div class="clearfix"></div> |
221 | </div> | 221 | </div> |
222 | </div> | 222 | </div> |
223 | <div class="clearfix"></div><br> | 223 | <div class="clearfix"></div><br> |
224 | <div class="col-xs-12"> | 224 | <div class="col-xs-12"> |
225 | <div class="col-md-6"> | 225 | <div class="col-md-6"> |
226 | <div class="pull-left" style="width: 110px;"> | 226 | <div class="pull-left" style="width: 110px;"> |
227 | <label class="new-input-label"><b>Username</b></label> | 227 | <label class="new-input-label"><b>Username</b></label> |
228 | </div> | 228 | </div> |
229 | <div class="pull-left" style="margin-left: 15px;"> | 229 | <div class="pull-left" style="margin-left: 15px;"> |
230 | <input type="tel" ng-model="data.userName" class="form-control" id="Address" placeholder=""> | 230 | <input type="tel" ng-model="data.userName" class="form-control" id="Address" placeholder=""> |
231 | </div> | 231 | </div> |
232 | <div class="clearfix"></div> | 232 | <div class="clearfix"></div> |
233 | </div> | 233 | </div> |
234 | <div class="col-md-6"> | 234 | <div class="col-md-6"> |
235 | 235 | ||
236 | <div class="pull-left" style="width: 110px;"> | 236 | <div class="pull-left" style="width: 110px;"> |
237 | <label class="new-input-label"><b>Password</b></label> | 237 | <label class="new-input-label"><b>Password</b></label> |
238 | </div> | 238 | </div> |
239 | <div class="pull-left" style="margin-left: 15px;"> | 239 | <div class="pull-left" style="margin-left: 15px;"> |
240 | <input type="password" ng-model="data.password" class="form-control" id="Address" placeholder=""> | 240 | <input type="password" ng-model="data.password" class="form-control" id="Address" placeholder=""> |
241 | </div> | 241 | </div> |
242 | <div class="clearfix"></div> | 242 | <div class="clearfix"></div> |
243 | </div> | 243 | </div> |
244 | </div> | 244 | </div> |
245 | <div class="clearfix"></div><br> | 245 | <div class="clearfix"></div><br> |
246 | <div class="col-xs-12"> | 246 | <div class="col-xs-12"> |
247 | <div class="col-md-6"> | 247 | <div class="col-md-6"> |
248 | <div class="pull-left" style="width: 110px;"> | 248 | <div class="pull-left" style="width: 110px;"> |
249 | <label class="new-input-label"><b>Work Phone</b></label> | 249 | <label class="new-input-label"><b>Work Phone</b></label> |
250 | </div> | 250 | </div> |
251 | <div class="pull-left" style="margin-left: 15px;"> | 251 | <div class="pull-left" style="margin-left: 15px;"> |
252 | <input type="tel" ng-model="data.workPhone" class="form-control" id="Address" placeholder=""> | 252 | <input type="tel" ng-model="data.workPhone" class="form-control" id="Address" placeholder=""> |
253 | </div> | 253 | </div> |
254 | <div class="clearfix"></div> | 254 | <div class="clearfix"></div> |
255 | </div> | 255 | </div> |
256 | <div class="col-md-6"> | 256 | <div class="col-md-6"> |
257 | 257 | ||
258 | <div class="pull-left" style="width: 110px;"> | 258 | <div class="pull-left" style="width: 110px;"> |
259 | <label class="new-input-label"><b>Mobile Phone</b></label> | 259 | <label class="new-input-label"><b>Mobile Phone</b></label> |
260 | </div> | 260 | </div> |
261 | <div class="pull-left" style="margin-left: 15px;"> | 261 | <div class="pull-left" style="margin-left: 15px;"> |
262 | <input type="tel" ng-model="data.mobilePhone" class="form-control" id="Address" placeholder=""> | 262 | <input type="tel" ng-model="data.mobilePhone" class="form-control" id="Address" placeholder=""> |
263 | </div> | 263 | </div> |
264 | <div class="clearfix"></div> | 264 | <div class="clearfix"></div> |
265 | </div> | 265 | </div> |
266 | </div> | 266 | </div> |
267 | <div class="clearfix"></div><br> | 267 | <div class="clearfix"></div><br> |
268 | <div class="col-xs-12"> | 268 | <div class="col-xs-12"> |
269 | <div class="col-md-12"> | 269 | <div class="col-md-12"> |
270 | <div class="pull-left" style="width: 110px;"> | 270 | <div class="pull-left" style="width: 110px;"> |
271 | <label class="new-input-label"><b>Address</b></label> | 271 | <label class="new-input-label"><b>Address</b></label> |
272 | </div> | 272 | </div> |
273 | <div class="pull-right" style="width: calc(100% - 123px);"> | 273 | <div class="pull-right" style="width: calc(100% - 123px);"> |
274 | <input type="tel" class="form-control" ng-model="data.address" id="Address" placeholder=""> | 274 | <input type="tel" class="form-control" ng-model="data.address" id="Address" placeholder=""> |
275 | </div> | 275 | </div> |
276 | <div class="clearfix"></div> | 276 | <div class="clearfix"></div> |
277 | </div> | 277 | </div> |
278 | </div> | 278 | </div> |
279 | <div class="clearfix"></div><br> | 279 | <div class="clearfix"></div><br> |
280 | <div class="col-xs-12"> | 280 | <div class="col-xs-12"> |
281 | <div class="col-md-12"> | 281 | <div class="col-md-12"> |
282 | <div class="pull-left" style="width: 110px;"> | 282 | <div class="pull-left" style="width: 110px;"> |
283 | <label class="new-input-label"><b>Company</b></label> | 283 | <label class="new-input-label"><b>Company</b></label> |
284 | </div> | 284 | </div> |
285 | <div class="pull-right" style="width: calc(100% - 123px);"> | 285 | <div class="pull-right" style="width: calc(100% - 123px);"> |
286 | <select class="form-control" ng-model="data.companyId"> | 286 | <select class="form-control" ng-model="data.companyId"> |
287 | <option value="{{company.id}}" ng-repeat="company in companies">{{company.companyName}}</option> | 287 | <option value="{{company.id}}" ng-repeat="company in companies">{{company.companyName}}</option> |
288 | </select> | 288 | </select> |
289 | </div> | 289 | </div> |
290 | <div class="clearfix"></div> | 290 | <div class="clearfix"></div> |
291 | </div> | 291 | </div> |
292 | </div> | 292 | </div> |
293 | 293 | ||
294 | 294 | ||
295 | <div class="clearfix"></div> | 295 | <div class="clearfix"></div> |
296 | <br/> | 296 | <br/> |
297 | <div class="col-xs-12"> | 297 | <div class="col-xs-12"> |
298 | <div class="col-md-3"> | 298 | <div class="col-md-3"> |
299 | <div class="pull-left my-toggle-switch"> | 299 | <div class="pull-left my-toggle-switch"> |
300 | <div style="color: #ff9a01;">Price Email     | 300 | <div style="color: #ff9a01;">Price Email     |
301 | <toggle ng-model="data.priceEmail" size="customToogle"></toggle> | 301 | <toggle ng-model="data.priceEmail" size="customToogle"></toggle> |
302 | </div> | 302 | </div> |
303 | </div> | 303 | </div> |
304 | <div class="clearfix"></div> | 304 | <div class="clearfix"></div> |
305 | </div> | 305 | </div> |
306 | <div class="col-md-3"> | 306 | <div class="col-md-3"> |
307 | <div class="pull-left my-toggle-switch"> | 307 | <div class="pull-left my-toggle-switch"> |
308 | <div style="color: #ff9a01;">Primary Contact     | 308 | <div style="color: #ff9a01;">Primary Contact     |
309 | <input type="checkbox" ng-model="data.primaryContact"> | 309 | <input type="checkbox" ng-model="data.primaryContact"> |
310 | </div> | 310 | </div> |
311 | </div> | 311 | </div> |
312 | <div class="clearfix"></div> | 312 | <div class="clearfix"></div> |
313 | </div> | 313 | </div> |
314 | <div class="col-md-6"> | 314 | <div class="col-md-6"> |
315 | <div class="pull-left" style="width: 110px;"> | 315 | <div class="pull-left" style="width: 110px;"> |
316 | <label class="new-input-label"><b>Internal Note</b></label> | 316 | <label class="new-input-label"><b>Internal Note</b></label> |
317 | </div> | 317 | </div> |
318 | <div class="pull-left" style="width: calc(100% - 110px);"> | 318 | <div class="pull-left" style="width: calc(100% - 110px);"> |
319 | <textarea name="message" ng-model="data.note" rows="4" cols="34"></textarea> | 319 | <textarea name="message" ng-model="data.note" rows="4" cols="34"></textarea> |
320 | </div> | 320 | </div> |
321 | </div> | 321 | </div> |
322 | <div class="clearfix"></div> | 322 | <div class="clearfix"></div> |
323 | </div> | 323 | </div> |
324 | <div class="clearfix"></div><br> | 324 | <div class="clearfix"></div><br> |
325 | </div> | 325 | </div> |
326 | </div> | 326 | </div> |
327 | <div class="clearfix"></div> | 327 | <div class="clearfix"></div> |
328 | </div> | 328 | </div> |
329 | </div> | 329 | </div> |
330 | </div> | 330 | </div> |
331 | </div> | 331 | </div> |
332 | <div class="modal-footer" style="border-top: 0;"> | 332 | <div class="modal-footer" style="border-top: 0;"> |
333 | <button type="button" class="btn btn-default" ng-click="reset()" data-dismiss="modal">Cancel</button> | 333 | <button type="button" class="btn btn-default" ng-click="reset()" data-dismiss="modal">Cancel</button> |
334 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addContact()">Save</button> | 334 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addContact()">Save</button> |
335 | </div> | 335 | </div> |
336 | </div> | 336 | </div> |
337 | </div> | 337 | </div> |
338 | </form> | 338 | </form> |
339 | 339 | ||
340 | <div class="customConfirmPopBackdrop" id="toogleMail"> | 340 | <div class="customConfirmPopBackdrop" id="toogleMail"> |
341 | <div class="customModalInner" style="max-width: 400px;"> | 341 | <div class="customModalInner" style="max-width: 400px;"> |
342 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 342 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
343 | <table> | 343 | <table> |
344 | <tr> | 344 | <tr> |
345 | <!-- <td> | 345 | <!-- <td> |
346 | <img src="" style="width: 50px;"> | 346 | <img src="" style="width: 50px;"> |
347 | </td> --> | 347 | </td> --> |
348 | <td> | 348 | <td> |
349 | <p style="padding: 5px 10px; margin-bottom: 0;text-align: center;">{{messageText}}</p> | 349 | <p style="padding: 5px 10px; margin-bottom: 0;text-align: center;">{{messageText}}</p> |
350 | </td> | 350 | </td> |
351 | </tr> | 351 | </tr> |
352 | </table> | 352 | </table> |
353 | </div> | 353 | </div> |
354 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 354 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
355 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelToogle()">Cancel</button> | 355 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelToogle()">Cancel</button> |
356 | </div> | 356 | </div> |
357 | </div> | 357 | </div> |
358 | </div> | 358 | </div> |
app/partials/ContactView/ContactView.service.js
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | .service('ContactViewService', ['$q', '$http', 'BASE_URL', ContactViewService]); | 4 | .service('ContactViewService', ['$q', '$http', 'BASE_URL', ContactViewService]); |
5 | 5 | ||
6 | function ContactViewService($q, $http, BASE_URL) { | 6 | function ContactViewService($q, $http, BASE_URL) { |
7 | var temp = {}; | 7 | var temp = {}; |
8 | 8 | ||
9 | this.getContacts = function() { | 9 | this.getContacts = function() { |
10 | 10 | ||
11 | var deferred = $q.defer(); | 11 | var deferred = $q.defer(); |
12 | $http({ | 12 | $http({ |
13 | method : 'GET', | 13 | method : 'GET', |
14 | url : BASE_URL.url +'/user/allContacts', | 14 | url : BASE_URL.url +'/user/allContacts', |
15 | headers : {'Content-Type': 'application/json'}, | 15 | headers : {'Content-Type': 'application/json'}, |
16 | }) | 16 | }) |
17 | .then(function (result){ | 17 | .then(function (result){ |
18 | deferred.resolve(result.data); | 18 | deferred.resolve(result.data); |
19 | },function (result){ | 19 | },function (result){ |
20 | deferred.resolve(result.data); | 20 | deferred.resolve(result.data); |
21 | }) | 21 | }) |
22 | return deferred.promise; | 22 | return deferred.promise; |
23 | } | 23 | } |
24 | 24 | ||
25 | this.getSearchResults = function(param) { | 25 | this.getSearchResults = function(param) { |
26 | 26 | ||
27 | var deferred = $q.defer(); | 27 | var deferred = $q.defer(); |
28 | $http({ | 28 | $http({ |
29 | method : 'GET', | 29 | method : 'GET', |
30 | url : BASE_URL.url +'/company/contact/search?param='+param, | 30 | url : BASE_URL.url +'/company/contact/search?param='+param, |
31 | headers : {'Content-Type': 'application/json'}, | 31 | headers : {'Content-Type': 'application/json'}, |
32 | }) | 32 | }) |
33 | .then(function (result){ | 33 | .then(function (result){ |
34 | deferred.resolve(result.data); | 34 | deferred.resolve(result.data); |
35 | },function (result){ | 35 | },function (result){ |
36 | deferred.resolve(result.data); | 36 | deferred.resolve(result.data); |
37 | }) | 37 | }) |
38 | return deferred.promise; | 38 | return deferred.promise; |
39 | } | 39 | } |
40 | 40 | ||
41 | this.getCompanies = function() { | 41 | this.getCompanies = function() { |
42 | 42 | ||
43 | var deferred = $q.defer(); | 43 | var deferred = $q.defer(); |
44 | $http({ | 44 | $http({ |
45 | method : 'GET', | 45 | method : 'GET', |
46 | url : BASE_URL.url +'/user/allCompanies', | 46 | url : BASE_URL.url +'/user/allCompanies', |
47 | headers : {'Content-Type': 'application/json'}, | 47 | headers : {'Content-Type': 'application/json'}, |
48 | }) | 48 | }) |
49 | .then(function (result){ | 49 | .then(function (result){ |
50 | deferred.resolve(result.data); | 50 | deferred.resolve(result.data); |
51 | },function (result){ | 51 | },function (result){ |
52 | deferred.resolve(result.data); | 52 | deferred.resolve(result.data); |
53 | }) | 53 | }) |
54 | return deferred.promise; | 54 | return deferred.promise; |
55 | } | 55 | } |
56 | |||
57 | this.exportContacts = function(){ | ||
58 | var deferred = $q.defer(); | ||
59 | $http({ | ||
60 | method : 'GET', | ||
61 | url : BASE_URL.url +'/company/contact/export' | ||
62 | }) | ||
63 | .then(function (result){ | ||
64 | deferred.resolve(result.data); | ||
65 | },function (result){ | ||
66 | console.log(result) | ||
67 | deferred.resolve(result.data); | ||
68 | }) | ||
69 | return deferred.promise; | ||
70 | } | ||
56 | } | 71 | } |
57 | 72 | ||
58 | })(); | 73 | })(); |
app/partials/FuelVendors/FuelVendors.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | 5 | ||
6 | .controller('FuelVendorsController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'FuelVendorsService', 'CustomersService', 'ViewFuelVendorService', 'NgTableParams', FuelVendorsController]); | 6 | .controller('FuelVendorsController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'FuelVendorsService', 'CustomersService', 'ViewFuelVendorService', 'NgTableParams', FuelVendorsController]); |
7 | 7 | ||
8 | function FuelVendorsController($scope, $rootScope, $uibModal, $filter, $http, FuelVendorsService, CustomersService, ViewFuelVendorService, NgTableParams) { | 8 | function FuelVendorsController($scope, $rootScope, $uibModal, $filter, $http, FuelVendorsService, CustomersService, ViewFuelVendorService, NgTableParams) { |
9 | 9 | ||
10 | $(document).ready(function() { | 10 | $(document).ready(function() { |
11 | $('#example').DataTable(); | 11 | $('#example').DataTable(); |
12 | }); | 12 | }); |
13 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) | 13 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) |
14 | $scope.reset = function(){ | 14 | $scope.reset = function(){ |
15 | $("input").val(""); | 15 | $("input").val(""); |
16 | $scope.removeMarginValidation(); | 16 | $scope.removeMarginValidation(); |
17 | } | 17 | } |
18 | 18 | ||
19 | $scope.data = {}; | 19 | $scope.data = {}; |
20 | $scope.data.activate = true; | 20 | $scope.data.activate = true; |
21 | $scope.showLoader = false; | 21 | $scope.showLoader = false; |
22 | getAllVendor(); | 22 | getAllVendor(); |
23 | 23 | ||
24 | function getAllVendor(){ | 24 | function getAllVendor(){ |
25 | FuelVendorsService.getAllVendor().then(function(result) { | 25 | FuelVendorsService.getAllVendor().then(function(result) { |
26 | console.log(result) | 26 | console.log(result) |
27 | $scope.companyList = result; | 27 | $scope.companyList = result; |
28 | for (var i = 0; i < $scope.companyList.length; i++) { | 28 | for (var i = 0; i < $scope.companyList.length; i++) { |
29 | if ($scope.companyList[i].companyContact != null) { | 29 | if ($scope.companyList[i].companyContact != null) { |
30 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { | 30 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { |
31 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; | 31 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; |
32 | } | 32 | } |
33 | } | 33 | } |
34 | if ($scope.companyList[i].primaryContact != null) { | 34 | if ($scope.companyList[i].primaryContact != null) { |
35 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { | 35 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { |
36 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; | 36 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; |
37 | } | 37 | } |
38 | } | 38 | } |
39 | if ($scope.companyList[i].margin != null) { | 39 | if ($scope.companyList[i].margin != null) { |
40 | if ($scope.companyList[i].margin.marginName != null) { | 40 | if ($scope.companyList[i].margin.marginName != null) { |
41 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 41 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
42 | } | 42 | } |
43 | } | 43 | } |
44 | $scope.companyList[i].source = "Vendor" | ||
44 | } | 45 | } |
45 | $scope.displayVendorList = new NgTableParams({ | 46 | $scope.displayVendorList = new NgTableParams({ |
46 | page: 1, | 47 | page: 1, |
47 | count: 10, | 48 | count: 10, |
48 | }, { | 49 | }, { |
49 | data: $scope.companyList | 50 | data: $scope.companyList |
50 | }); | 51 | }); |
51 | }) | 52 | }) |
52 | } | 53 | } |
53 | 54 | ||
54 | $scope.editMargin = function(vendor){ | 55 | $scope.editMargin = function(vendor){ |
55 | console.log(vendor.masterMargin) | 56 | console.log(vendor.masterMargin) |
56 | 57 | $scope.showLoader = true; | |
57 | var companyMargin = "vendorName=" + vendor.vendorName + "&masterMargin=" + vendor.masterMargin | 58 | var companyMargin = "vendorName=" + vendor.vendorName + "&masterMargin=" + vendor.masterMargin |
58 | + "&addressOne=" + vendor.addressOne + "&addressTwo=" + vendor.addressTwo + "&city=" + vendor.city + "&state=" | 59 | + "&addressOne=" + vendor.addressOne + "&addressTwo=" + vendor.addressTwo + "&city=" + vendor.city + "&state=" |
59 | + vendor.state + "&country=" + vendor.country + "&zipcode=" + vendor.zipcode + "&internalNote=" | 60 | + vendor.state + "&country=" + vendor.country + "&zipcode=" + vendor.zipcode + "&internalNote=" |
60 | + vendor.internalNote + "&certificateType=" + vendor.certificateType + "&baseTenant=" + vendor.baseTenant | 61 | + vendor.internalNote + "&certificateType=" + vendor.certificateType + "&baseTenant=" + vendor.baseTenant |
61 | + "&fuelerlinxvendor=" + vendor.fuelerlinxvendor + "&contractFuelVendor=" + vendor.contractFuelVendor | 62 | + "&fuelerlinxvendor=" + vendor.fuelerlinxvendor + "&contractFuelVendor=" + vendor.contractFuelVendor |
62 | + "&activate=" + vendor.activate + "&baseIcao=" + vendor.baseIcao + "&vendorId=" + vendor.id; | 63 | + "&activate=" + vendor.activate + "&baseIcao=" + vendor.baseIcao + "&vendorId=" + vendor.id; |
63 | 64 | ||
64 | ViewFuelVendorService.updateContact(companyMargin).then(function(result) { | 65 | ViewFuelVendorService.updateContact(companyMargin).then(function(result) { |
65 | if(result != null && result.success){ | 66 | if(result != null && result.success){ |
67 | $scope.showLoader = false; | ||
66 | toastr.success(''+result.success+'', { | 68 | toastr.success(''+result.success+'', { |
67 | closeButton: true | 69 | closeButton: true |
68 | }) | 70 | }) |
69 | }else{ | 71 | }else{ |
72 | $scope.showLoader = false; | ||
70 | toastr.error(''+result.statusText+'', { | 73 | toastr.error(''+result.statusText+'', { |
71 | closeButton: true | 74 | closeButton: true |
72 | }) | 75 | }) |
73 | } | 76 | } |
74 | }) | 77 | }) |
75 | } | 78 | } |
76 | 79 | ||
77 | // CustomersService.getMargin().then(function(result) { | 80 | // CustomersService.getMargin().then(function(result) { |
78 | // $scope.marginList = result; | 81 | // $scope.marginList = result; |
79 | // }) | 82 | // }) |
80 | 83 | ||
81 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 84 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
82 | $scope.jetMarginList = result; | 85 | $scope.jetMarginList = result; |
83 | }) | 86 | }) |
84 | 87 | ||
85 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | 88 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { |
86 | $scope.avgsMarginList = result; | 89 | $scope.avgsMarginList = result; |
87 | }) | 90 | }) |
88 | 91 | ||
89 | $scope.showCompanyError = false; | 92 | $scope.showCompanyError = false; |
90 | $scope.showMarginError = false; | 93 | $scope.showMarginError = false; |
91 | 94 | ||
92 | $scope.removeValidation = function(){ | 95 | $scope.removeValidation = function(){ |
93 | $scope.showCompanyError = false; | 96 | $scope.showCompanyError = false; |
94 | $('.companyNameInput').removeClass('customErrorInput'); | 97 | $('.companyNameInput').removeClass('customErrorInput'); |
95 | } | 98 | } |
96 | 99 | ||
97 | $scope.removeMarginValidation = function(){ | 100 | $scope.removeMarginValidation = function(){ |
98 | $scope.showMarginError = false; | 101 | $scope.showMarginError = false; |
99 | $('.marginSelectBox').removeClass('customErrorInput'); | 102 | $('.marginSelectBox').removeClass('customErrorInput'); |
100 | } | 103 | } |
101 | 104 | ||
102 | $scope.marginFilterOptions = []; | 105 | $scope.marginFilterOptions = []; |
103 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 106 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
104 | $scope.jetMarginList = result; | 107 | $scope.jetMarginList = result; |
105 | $scope.marginFilterOptions.push({ | 108 | $scope.marginFilterOptions.push({ |
106 | 'id': '', 'title': 'Show All' | 109 | 'id': '', 'title': 'Show All' |
107 | }); | 110 | }); |
108 | for (var i = 0; i < result.length; i++) { | 111 | for (var i = 0; i < result.length; i++) { |
109 | $scope.marginFilterOptions.push({ | 112 | $scope.marginFilterOptions.push({ |
110 | 'id': result[i].id, | 113 | 'id': result[i].id, |
111 | 'title': result[i].marginName | 114 | 'title': result[i].marginName |
112 | }) | 115 | }) |
113 | } | 116 | } |
114 | }) | 117 | }) |
115 | 118 | ||
116 | $scope.addFirstData = function(sel, step){ | 119 | $scope.addFirstData = function(sel, step){ |
117 | // console.log($scope.data) | 120 | // console.log($scope.data) |
118 | if($scope.data.vendorName == undefined){ | 121 | if($scope.data.vendorName == undefined){ |
119 | $scope.showCompanyError = true; | 122 | $scope.showCompanyError = true; |
120 | $('.companyNameInput').addClass('customErrorInput'); | 123 | $('.companyNameInput').addClass('customErrorInput'); |
121 | }else if($scope.data.masterMargin == undefined){ | 124 | }else if($scope.data.masterMargin == undefined){ |
122 | $scope.showMarginError = true; | 125 | $scope.showMarginError = true; |
123 | $('.marginSelectBox').addClass('customErrorInput'); | 126 | $('.marginSelectBox').addClass('customErrorInput'); |
124 | }else{ | 127 | }else{ |
125 | var vendorData = "vendorName=" + $scope.data.vendorName + "&masterMargin=" + $scope.data.masterMargin | 128 | var vendorData = "vendorName=" + $scope.data.vendorName + "&masterMargin=" + $scope.data.masterMargin |
126 | + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state=" | 129 | + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state=" |
127 | + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote=" | 130 | + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote=" |
128 | + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant | 131 | + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant |
129 | + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor | 132 | + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor |
130 | + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao; | 133 | + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao; |
131 | 134 | ||
132 | FuelVendorsService.addVendor(vendorData).then(function(result) { | 135 | FuelVendorsService.addVendor(vendorData).then(function(result) { |
133 | console.log("result",result) | 136 | console.log("result",result) |
134 | $scope.accountId = result; | 137 | $scope.accountId = result; |
135 | $('#vendor-modal-3').modal('hide'); | 138 | $('#vendor-modal-3').modal('hide'); |
136 | getAllVendor(); | 139 | getAllVendor(); |
137 | }) | 140 | }) |
138 | } | 141 | } |
139 | 142 | ||
140 | } | 143 | } |
144 | |||
145 | $scope.exportVendors = function() { | ||
146 | $scope.showLoader = true; | ||
147 | var fileName = "vendors.csv"; | ||
148 | var a = document.createElement("a"); | ||
149 | document.body.appendChild(a); | ||
150 | FuelVendorsService.exportVendors().then(function(result) { | ||
151 | var file = new Blob([result], {type: 'application/csv'}); | ||
152 | var fileURL = URL.createObjectURL(file); | ||
153 | a.href = fileURL; | ||
154 | a.download = fileName; | ||
155 | a.click(); | ||
156 | $scope.showLoader = false; | ||
157 | }) | ||
158 | } | ||
141 | 159 | ||
142 | } | 160 | } |
app/partials/FuelVendors/FuelVendors.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:nth-child(3) > a{ | 2 | .subnavbar .mainnav > li:nth-child(3) > a{ |
3 | color: #ff9900; | 3 | color: #ff9900; |
4 | } | 4 | } |
5 | 5 | ||
6 | .button1 { | 6 | .button1 { |
7 | display: inline-block; | 7 | display: inline-block; |
8 | height: 35px; | 8 | height: 35px; |
9 | line-height: 35px; | 9 | line-height: 35px; |
10 | padding-right: 15px; | 10 | padding-right: 15px; |
11 | padding-left: 50px; | 11 | padding-left: 50px; |
12 | position: relative; | 12 | position: relative; |
13 | background-color:rgb(41,127,184); | 13 | background-color:rgb(41,127,184); |
14 | color:rgb(255,255,255); | 14 | color:rgb(255,255,255); |
15 | text-decoration: none; | 15 | text-decoration: none; |
16 | text-transform: uppercase; | 16 | text-transform: uppercase; |
17 | letter-spacing: 1px; | 17 | letter-spacing: 1px; |
18 | margin-bottom: 15px; | 18 | margin-bottom: 15px; |
19 | border: 0; | 19 | border: 0; |
20 | 20 | ||
21 | 21 | ||
22 | border-radius: 5px; | 22 | border-radius: 5px; |
23 | -moz-border-radius: 5px; | 23 | -moz-border-radius: 5px; |
24 | -webkit-border-radius: 5px; | 24 | -webkit-border-radius: 5px; |
25 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); | 25 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); |
26 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | 26 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; |
27 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | 27 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); |
28 | 28 | ||
29 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 29 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
30 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 30 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
31 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 31 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
32 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | 32 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; |
33 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | 33 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); |
34 | } | 34 | } |
35 | 35 | ||
36 | .button1 span { | 36 | .button1 span { |
37 | position: absolute; | 37 | position: absolute; |
38 | left: 0; | 38 | left: 0; |
39 | top: 0; | 39 | top: 0; |
40 | width: 35px; | 40 | width: 35px; |
41 | background-color:rgba(0,0,0,0.5); | 41 | background-color:rgba(0,0,0,0.5); |
42 | 42 | ||
43 | -webkit-border-top-left-radius: 5px; | 43 | -webkit-border-top-left-radius: 5px; |
44 | -webkit-border-bottom-left-radius: 5px; | 44 | -webkit-border-bottom-left-radius: 5px; |
45 | -moz-border-radius-topleft: 5px; | 45 | -moz-border-radius-topleft: 5px; |
46 | -moz-border-radius-bottomleft: 5px; | 46 | -moz-border-radius-bottomleft: 5px; |
47 | border-top-left-radius: 5px; | 47 | border-top-left-radius: 5px; |
48 | border-bottom-left-radius: 5px; | 48 | border-bottom-left-radius: 5px; |
49 | border-right: 1px solid rgba(0,0,0,0.15); | 49 | border-right: 1px solid rgba(0,0,0,0.15); |
50 | } | 50 | } |
51 | 51 | ||
52 | .button1:hover span, .button1.active span { | 52 | .button1:hover span, .button1.active span { |
53 | background-color:rgb(0,102,26); | 53 | background-color:rgb(0,102,26); |
54 | border-right: 1px solid rgba(0,0,0,0.3); | 54 | border-right: 1px solid rgba(0,0,0,0.3); |
55 | } | 55 | } |
56 | 56 | ||
57 | .button1:active { | 57 | .button1:active { |
58 | margin-top: 2px; | 58 | margin-top: 2px; |
59 | margin-bottom: 13px; | 59 | margin-bottom: 13px; |
60 | 60 | ||
61 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 61 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
62 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 62 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
63 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 63 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
64 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | 64 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; |
65 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | 65 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); |
66 | } | 66 | } |
67 | 67 | ||
68 | .button1.turquoise { | 68 | .button1.turquoise { |
69 | background: #449d44; | 69 | background: #449d44; |
70 | } | 70 | } |
71 | 71 | ||
72 | </style> | 72 | </style> |
73 | <div class="main"> | 73 | <div class="main"> |
74 | <div class="container"> | 74 | <div class="container"> |
75 | <div class="row"> | 75 | <div class="row"> |
76 | <div class="col-md-12"> | 76 | <div class="col-md-12"> |
77 | <div class="widget stacked "> | 77 | <div class="widget stacked "> |
78 | <div class="widget-content"> | 78 | <div class="widget-content"> |
79 | <div class="tabbable"> | 79 | <div class="tabbable"> |
80 | <ul class="nav nav-tabs"> | 80 | <ul class="nav nav-tabs"> |
81 | <li> | 81 | <li> |
82 | <a ui-sref="app.customers">Company View | 82 | <a ui-sref="app.customers">Company View |
83 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 83 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
84 | </a> | 84 | </a> |
85 | </li> | 85 | </li> |
86 | <li> | 86 | <li> |
87 | <a ui-sref="app.ContactView">Contact View | 87 | <a ui-sref="app.ContactView">Contact View |
88 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 88 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
89 | </a> | 89 | </a> |
90 | </li> | 90 | </li> |
91 | <li class="active"> | 91 | <li class="active"> |
92 | <a ui-sref="app.FuelVendors">Fuel Vendors | 92 | <a ui-sref="app.FuelVendors">Fuel Vendors |
93 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 93 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
94 | </a> | 94 | </a> |
95 | </li> | 95 | </li> |
96 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" name="name" id="name" placeholder="Search In Table"></li> | 96 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" ng-model="searchText" placeholder="Search In Table"></li> |
97 | <li><button type="button" class="btn btn-default btn-sm">Clear Search And Filters</button></li> | 97 | <li><button type="button" class="btn btn-default btn-sm" ng-click="displayVendorList.filter({}); searchText=null">Clear Search And Filters</button></li> |
98 | <li style="float:right"><button type="submit" data-toggle="modal" data-target="#vendor-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Vendor</button></li> | 98 | <li style="float:right"><button type="submit" data-toggle="modal" data-target="#vendor-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Vendor</button></li> |
99 | </ul> | 99 | </ul> |
100 | <br> | 100 | <br> |
101 | <div class="tab-content customer-table" style="margin:0px"> | 101 | <div class="tab-content customer-table" style="margin:0px"> |
102 | <div class="tab-pane active" id="companyView"> | 102 | <div class="tab-pane active" id="companyView"> |
103 | <table ng-table="displayVendorList" class="table table-striped table-condensed" show-filter="true"> | 103 | <table ng-table="displayVendorList" class="table table-striped table-condensed" show-filter="true"> |
104 | <tr ng-repeat="row in $data track by row.id" style="cursor: pointer;" ui-sref="app.viewFuelVendor({id : row.id})"> | 104 | <tr ng-repeat="row in $data | filter:searchText" style="cursor: pointer;"> |
105 | <td data-title="'Vendor Name'" filter="{vendorName: 'text'}" sortable="'vendorName'"> | 105 | <td data-title="'Vendor Name'" filter="{vendorName: 'text'}" sortable="'vendorName'" ui-sref="app.viewFuelVendor({id : row.id})"> |
106 | {{row.vendorName}} | 106 | {{row.vendorName}} |
107 | </td> | 107 | </td> |
108 | <td data-title="'Main Phone'" filter="{newContactNumber: 'text'}" sortable="'newContactNumber'"> | 108 | <td data-title="'Main Phone'" filter="{newContactNumber: 'text'}" sortable="'newContactNumber'" ui-sref="app.viewFuelVendor({id : row.id})"> |
109 | {{row.newContactNumber}} | 109 | {{row.newContactNumber}} |
110 | </td> | 110 | </td> |
111 | <td data-title="'Primary Contact'" filter="{primaryContactName: 'text'}" sortable="'primaryContactName'"> | 111 | <td data-title="'Primary Contact'" filter="{primaryContactName: 'text'}" sortable="'primaryContactName'" ui-sref="app.viewFuelVendor({id : row.id})"> |
112 | {{row.primaryContactName}} | 112 | {{row.primaryContactName}} |
113 | </td> | 113 | </td> |
114 | 114 | ||
115 | <td data-title="'Status'" filter="{activate: 'select'}" filter-data="statusFilter" sortable="'activate'"> | 115 | <td data-title="'Status'" filter="{activate: 'select'}" filter-data="statusFilter" sortable="'activate'" ui-sref="app.viewFuelVendor({id : row.id})"> |
116 | <button type="button" ng-if="row.activate == true" class="btn btn-success btn-xs">Active</button> | 116 | <button type="button" ng-if="row.activate == true" class="btn btn-success btn-xs">Active</button> |
117 | <button type="button" ng-if="row.activate == false" class="btn btn-warning btn-xs">InActive</button> | 117 | <button type="button" ng-if="row.activate == false" class="btn btn-warning btn-xs">InActive</button> |
118 | </td> | 118 | </td> |
119 | <td data-title="'Source'" filter="{source: 'text'}" sortable="'source'"> | 119 | <td data-title="'Source'" filter="{source: 'text'}" sortable="'source'" ui-sref="app.viewFuelVendor({id : row.id})"> |
120 | Vendor | 120 | {{row.source}} |
121 | </td> | 121 | </td> |
122 | <td data-title="'Margin Setting'" filter="{masterMargin: 'select'}" filter-data="marginFilterOptions" sortable="'masterMargin'"> | 122 | <td data-title="'Margin Setting'" filter="{masterMargin: 'select'}" filter-data="marginFilterOptions" sortable="'masterMargin'"> |
123 | <select class="form-control" ng-change="editMargin(row)" style="height:31px;" ng-model="row.masterMargin" ng-selected="" ng-options="margin.id as margin.marginName for margin in jetMarginList" required></select> | 123 | <select class="form-control" ng-change="editMargin(row)" style="height:31px;" ng-model="row.masterMargin" ng-selected="" ng-options="margin.id as margin.marginName for margin in jetMarginList" required></select> |
124 | </td> | 124 | </td> |
125 | <td data-title="'All In'" filter="{allIn: 'text'}" sortable="'allIn'"> | 125 | <td data-title="'All In'" filter="{marginAllIn: 'text'}" sortable="'marginAllIn'" ui-sref="app.viewFuelVendor({id : row.id})"> |
126 | {{row.marginAllIn}} | 126 | {{row.marginAllIn}} |
127 | </td> | 127 | </td> |
128 | </tr> | 128 | </tr> |
129 | </table> | 129 | </table> |
130 | 130 | ||
131 | <button type="button" class="btn btn-warning exportBtn">Export Customers</button> | 131 | <button type="button" ng-click="exportVendors()" class="btn btn-warning exportBtn">Export CSV</button> |
132 | 132 | ||
133 | <!-- <table class="table table-striped"> | 133 | <!-- <table class="table table-striped"> |
134 | <thead> | 134 | <thead> |
135 | <tr> | 135 | <tr> |
136 | <th> | 136 | <th> |
137 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 137 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
138 | <label class="font-company">Vendor Name <i class="fa fa-sort" aria-hidden="true"></i></label> | 138 | <label class="font-company">Vendor Name <i class="fa fa-sort" aria-hidden="true"></i></label> |
139 | </th> | 139 | </th> |
140 | 140 | ||
141 | <th> | 141 | <th> |
142 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 142 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
143 | <label class="font-company">Main Phone <i class="fa fa-sort" aria-hidden="true"></i></label> | 143 | <label class="font-company">Main Phone <i class="fa fa-sort" aria-hidden="true"></i></label> |
144 | </th> | 144 | </th> |
145 | <th> | 145 | <th> |
146 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 146 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
147 | <label class="font-company">Primary Contact <i class="fa fa-sort" aria-hidden="true"></i></label> | 147 | <label class="font-company">Primary Contact <i class="fa fa-sort" aria-hidden="true"></i></label> |
148 | </th> | 148 | </th> |
149 | 149 | ||
150 | <th> | 150 | <th> |
151 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 151 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
152 | <label class="font-company">Status <i class="fa fa-sort" aria-hidden="true"></i></label> | 152 | <label class="font-company">Status <i class="fa fa-sort" aria-hidden="true"></i></label> |
153 | <th> | 153 | <th> |
154 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 154 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
155 | <label class="font-company">Source <i class="fa fa-sort" aria-hidden="true"></i></label> | 155 | <label class="font-company">Source <i class="fa fa-sort" aria-hidden="true"></i></label> |
156 | </th> | 156 | </th> |
157 | <th> | 157 | <th> |
158 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 158 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
159 | <label class="font-company">Margin Setting <i class="fa fa-sort" aria-hidden="true"></i></label> | 159 | <label class="font-company">Margin Setting <i class="fa fa-sort" aria-hidden="true"></i></label> |
160 | </th> | 160 | </th> |
161 | <th> | 161 | <th> |
162 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 162 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
163 | <label class="font-company">All In <i class="fa fa-sort" aria-hidden="true"></i></label> | 163 | <label class="font-company">All In <i class="fa fa-sort" aria-hidden="true"></i></label> |
164 | </th> | 164 | </th> |
165 | </tr> | 165 | </tr> |
166 | </thead> | 166 | </thead> |
167 | <tbody> | 167 | <tbody> |
168 | <tr ng-repeat="vendor in vendorList"> | 168 | <tr ng-repeat="vendor in vendorList"> |
169 | <td class="font-company"> | 169 | <td class="font-company"> |
170 | <a style="color: #333; text-decoration: none;" href="#!/viewFuelVendor/{{vendor.id}}">{{vendor.vendorName}}</a> | 170 | <a style="color: #333; text-decoration: none;" href="#!/viewFuelVendor/{{vendor.id}}">{{vendor.vendorName}}</a> |
171 | </td> | 171 | </td> |
172 | <td class="font-company">{{vendor.phone}}</td> | 172 | <td class="font-company">{{vendor.phone}}</td> |
173 | <td class="font-company">{{vendor.contact}}</td> | 173 | <td class="font-company">{{vendor.contact}}</td> |
174 | <td class="font-company"> | 174 | <td class="font-company"> |
175 | <button type="button" ng-if="vendor.activate == true" class="btn btn-success btn-xs">Active</button> | 175 | <button type="button" ng-if="vendor.activate == true" class="btn btn-success btn-xs">Active</button> |
176 | <button type="button" ng-if="vendor.activate == false" class="btn btn-warning btn-xs">InActive</button> | 176 | <button type="button" ng-if="vendor.activate == false" class="btn btn-warning btn-xs">InActive</button> |
177 | </td> | 177 | </td> |
178 | <td class="font-company">{{vendor.source}}</td> | 178 | <td class="font-company">{{vendor.source}}</td> |
179 | <td class="font-company"> | 179 | <td class="font-company"> |
180 | <select class="form-control" ng-blur="editMargin(vendor)" style="height:31px;" ng-model="vendor.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList" required></select> | 180 | <select class="form-control" ng-blur="editMargin(vendor)" style="height:31px;" ng-model="vendor.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList" required></select> |
181 | 181 | ||
182 | <select class="form-control" style="height:31px;"> | 182 | <select class="form-control" style="height:31px;"> |
183 | <option>Margin1</option> | 183 | <option>Margin1</option> |
184 | <option>Margin2</option> | 184 | <option>Margin2</option> |
185 | </select> | 185 | </select> |
186 | </td> | 186 | </td> |
187 | <td class="font-company">{{vendor.allIn}}</td> | 187 | <td class="font-company">{{vendor.allIn}}</td> |
188 | </tr> | 188 | </tr> |
189 | </tbody> | 189 | </tbody> |
190 | </table> --> | 190 | </table> --> |
191 | </div> | 191 | </div> |
192 | </div> | 192 | </div> |
193 | </div> | 193 | </div> |
194 | </div> | 194 | </div> |
195 | <!-- /widget-content --> | 195 | <!-- /widget-content --> |
196 | </div> | 196 | </div> |
197 | <!-- /widget --> | 197 | <!-- /widget --> |
198 | </div> | 198 | </div> |
199 | <!-- /span8 --> | 199 | <!-- /span8 --> |
200 | </div> | 200 | </div> |
201 | <!-- /row --> | 201 | <!-- /row --> |
202 | </div> | 202 | </div> |
203 | <!-- /container --> | 203 | <!-- /container --> |
204 | </div> | 204 | </div> |
205 | <!-- /main --> | 205 | <!-- /main --> |
206 | 206 | ||
207 | <form class="modal multi-step" id="vendor-modal-3" name="vendorForm"> | 207 | <form class="modal multi-step" id="vendor-modal-3" name="vendorForm"> |
208 | <div class="modal-dialog modal-lg"> | 208 | <div class="modal-dialog modal-lg"> |
209 | <div class="modal-content"> | 209 | <div class="modal-content"> |
210 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 210 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
211 | <div> | 211 | <div> |
212 | <div class="row" style="margin: 0;"> | 212 | <div class="row" style="margin: 0;"> |
213 | <div> | 213 | <div> |
214 | <div class="widget" style="margin-bottom: 0;"> | 214 | <div class="widget" style="margin-bottom: 0;"> |
215 | <div class="widget-header"> | 215 | <div class="widget-header"> |
216 | <i class="icon-pencil"></i> | 216 | <i class="icon-pencil"></i> |
217 | <i class="fa fa-tasks" aria-hidden="true"></i> | 217 | <i class="fa fa-tasks" aria-hidden="true"></i> |
218 | <h3>Add a New Vendor</h3> | 218 | <h3>Add a New Vendor</h3> |
219 | <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> | 219 | <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> |
220 | <div style="color: #ff9a01;">Activate     | 220 | <div style="color: #ff9a01;">Activate     |
221 | <toggle ng-model="data.activate" size="customToogle"></toggle> | 221 | <toggle ng-model="data.activate" size="customToogle"></toggle> |
222 | </div> | 222 | </div> |
223 | </div> | 223 | </div> |
224 | <div class="clearfix"></div> | 224 | <div class="clearfix"></div> |
225 | </div> | 225 | </div> |
226 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 226 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
227 | <div class="col-xs-12"> | 227 | <div class="col-xs-12"> |
228 | <div class="col-md-8"> | 228 | <div class="col-md-8"> |
229 | <div class="pull-left"> | 229 | <div class="pull-left"> |
230 | <label class="new-input-label"><b>Vendor Name</b></label> | 230 | <label class="new-input-label"><b>Vendor Name</b></label> |
231 | </div> | 231 | </div> |
232 | <div class="pull-left" style="margin-left: 15px;"> | 232 | <div class="pull-left" style="margin-left: 15px;"> |
233 | <input type="text" ng-model="data.vendorName" class="form-control companyNameInput" ng-keyup="removeValidation()" placeholder="" required> | 233 | <input type="text" ng-model="data.vendorName" class="form-control companyNameInput" ng-keyup="removeValidation()" placeholder="" required> |
234 | <label class="customErrorMessage" ng-show="showCompanyError">This field is required.</label> | 234 | <label class="customErrorMessage" ng-show="showCompanyError">This field is required.</label> |
235 | </div> | 235 | </div> |
236 | <div class="clearfix"></div> | 236 | <div class="clearfix"></div> |
237 | </div> | 237 | </div> |
238 | <div class="col-md-4"> | 238 | <div class="col-md-4"> |
239 | </div> | 239 | </div> |
240 | </div> | 240 | </div> |
241 | <div class="clearfix"></div><br> | 241 | <div class="clearfix"></div><br> |
242 | <br/> | 242 | <br/> |
243 | <div class="col-xs-12"> | 243 | <div class="col-xs-12"> |
244 | <div class="col-md-6"> | 244 | <div class="col-md-6"> |
245 | <div class="pull-left" style="width: 110px;"> | 245 | <div class="pull-left" style="width: 110px;"> |
246 | <b>JET A Margin</b> | 246 | <b>JET A Margin</b> |
247 | </div> | 247 | </div> |
248 | <div class="pull-left"> | 248 | <div class="pull-left"> |
249 | <select class="form-control marginSelectBox" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in jetMarginList" required ng-change="removeMarginValidation()"> | 249 | <select class="form-control marginSelectBox" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in jetMarginList" required ng-change="removeMarginValidation()"> |
250 | <option value="" disabled>Select...</option> | 250 | <option value="" disabled>Select...</option> |
251 | </select> | 251 | </select> |
252 | <label ng-show="showMarginError" class="customErrorMessage">This field is required.</label> | 252 | <label ng-show="showMarginError" class="customErrorMessage">This field is required.</label> |
253 | </div> | 253 | </div> |
254 | <div class="clearfix"></div> | 254 | <div class="clearfix"></div> |
255 | </div> | 255 | </div> |
256 | 256 | ||
257 | <div class="col-md-3 Airport" style="text-align: right;"> | 257 | <div class="col-md-3 Airport" style="text-align: right;"> |
258 | <b>AVGAS 100LL Margin</b> | 258 | <b>AVGAS 100LL Margin</b> |
259 | </div> | 259 | </div> |
260 | <div class="col-md-3 Airport"> | 260 | <div class="col-md-3 Airport"> |
261 | <select class="form-control" ng-model="data.avgasMargin" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> | 261 | <select class="form-control" ng-model="data.avgasMargin" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> |
262 | <option value="" disabled>Select...</option> | 262 | <option value="" disabled>Select...</option> |
263 | </select> | 263 | </select> |
264 | </div> | 264 | </div> |
265 | <div class="clearfix"></div> | 265 | <div class="clearfix"></div> |
266 | </div> | 266 | </div> |
267 | <div class="clearfix"></div> | 267 | <div class="clearfix"></div> |
268 | <br/> | 268 | <br/> |
269 | <div class="col-xs-12"> | 269 | <div class="col-xs-12"> |
270 | <div class="col-md-12"> | 270 | <div class="col-md-12"> |
271 | <div class="pull-left" style="width: 110px;"> | 271 | <div class="pull-left" style="width: 110px;"> |
272 | <label class="new-input-label"><b>Address</b></label> | 272 | <label class="new-input-label"><b>Address</b></label> |
273 | </div> | 273 | </div> |
274 | <div class="pull-left" style="width: calc(100% - 110px);"> | 274 | <div class="pull-left" style="width: calc(100% - 110px);"> |
275 | <input type="text" class="form-control" ng-model="data.addressOne" id="Address" placeholder=""> | 275 | <input type="text" class="form-control" ng-model="data.addressOne" id="Address" placeholder=""> |
276 | </div> | 276 | </div> |
277 | <div class="clearfix"></div> | 277 | <div class="clearfix"></div> |
278 | </div> | 278 | </div> |
279 | </div> | 279 | </div> |
280 | <div class="clearfix"></div> | 280 | <div class="clearfix"></div> |
281 | <br/> | 281 | <br/> |
282 | <div class="col-xs-12"> | 282 | <div class="col-xs-12"> |
283 | <div class="col-md-12"> | 283 | <div class="col-md-12"> |
284 | <div class="pull-left" style="width: 110px;"> | 284 | <div class="pull-left" style="width: 110px;"> |
285 | <label class="new-input-label"><b>Address2</b></label> | 285 | <label class="new-input-label"><b>Address2</b></label> |
286 | </div> | 286 | </div> |
287 | <div class="pull-left" style="width: calc(100% - 110px);"> | 287 | <div class="pull-left" style="width: calc(100% - 110px);"> |
288 | <input type="text" ng-model="data.addressTwo" class="form-control" id="Address" placeholder=""> | 288 | <input type="text" ng-model="data.addressTwo" class="form-control" id="Address" placeholder=""> |
289 | </div> | 289 | </div> |
290 | <div class="clearfix"></div> | 290 | <div class="clearfix"></div> |
291 | </div> | 291 | </div> |
292 | </div> | 292 | </div> |
293 | <div class="clearfix"></div> | 293 | <div class="clearfix"></div> |
294 | <br/> | 294 | <br/> |
295 | <div class="col-xs-12"> | 295 | <div class="col-xs-12"> |
296 | 296 | ||
297 | <div class="col-md-6"> | 297 | <div class="col-md-6"> |
298 | <div class="pull-left" style="width: 110px;"> | 298 | <div class="pull-left" style="width: 110px;"> |
299 | <label class="new-input-label"><b>City</b></label> | 299 | <label class="new-input-label"><b>City</b></label> |
300 | </div> | 300 | </div> |
301 | <div class="pull-left" style="width: calc(100% - 110px);"> | 301 | <div class="pull-left" style="width: calc(100% - 110px);"> |
302 | <input type="text" ng-model="data.city" class="form-control" id="Address" placeholder=""> | 302 | <input type="text" ng-model="data.city" class="form-control" id="Address" placeholder=""> |
303 | </div> | 303 | </div> |
304 | <div class="clearfix"></div> | 304 | <div class="clearfix"></div> |
305 | </div> | 305 | </div> |
306 | <div class="col-md-3"> | 306 | <div class="col-md-3"> |
307 | <div class="pull-left" style="width: 40px;"> | 307 | <div class="pull-left" style="width: 40px;"> |
308 | <label class="new-input-label"><b>State</b></label> | 308 | <label class="new-input-label"><b>State</b></label> |
309 | </div> | 309 | </div> |
310 | <div class="pull-left" style="width: calc(100% - 110px);"> | 310 | <div class="pull-left" style="width: calc(100% - 110px);"> |
311 | <input type="text" ng-model="data.state" class="form-control" id="Address" placeholder=""> | 311 | <input type="text" ng-model="data.state" class="form-control" id="Address" placeholder=""> |
312 | </div> | 312 | </div> |
313 | <div class="clearfix"></div> | 313 | <div class="clearfix"></div> |
314 | </div> | 314 | </div> |
315 | <div class="col-md-3"> | 315 | <div class="col-md-3"> |
316 | <div class="pull-left"> | 316 | <div class="pull-left"> |
317 | <label class="new-input-label"><b>Zip Code</b></label> | 317 | <label class="new-input-label"><b>Zip Code</b></label> |
318 | </div> | 318 | </div> |
319 | <div class="pull-right" style="width: calc(100% - 60px);"> | 319 | <div class="pull-right" style="width: calc(100% - 60px);"> |
320 | <input type="tel" ng-model="data.zipcode" class="form-control" id="Address" placeholder=""> | 320 | <input type="tel" ng-model="data.zipcode" class="form-control" id="Address" placeholder=""> |
321 | </div> | 321 | </div> |
322 | <div class="clearfix"></div> | 322 | <div class="clearfix"></div> |
323 | </div> | 323 | </div> |
324 | </div> | 324 | </div> |
325 | <div class="clearfix"></div> | 325 | <div class="clearfix"></div> |
326 | <br/> | 326 | <br/> |
327 | <div class="col-xs-12"> | 327 | <div class="col-xs-12"> |
328 | 328 | ||
329 | <div class="col-md-6"> | 329 | <div class="col-md-6"> |
330 | <div class="pull-left" style="width: 110px;"> | 330 | <div class="pull-left" style="width: 110px;"> |
331 | <label class="new-input-label"><b>Country</b></label> | 331 | <label class="new-input-label"><b>Country</b></label> |
332 | </div> | 332 | </div> |
333 | <div class="pull-left" style="width: calc(100% - 110px);"> | 333 | <div class="pull-left" style="width: calc(100% - 110px);"> |
334 | <input type="text" ng-model="data.country" class="form-control" id="Address" placeholder=""> | 334 | <input type="text" ng-model="data.country" class="form-control" id="Address" placeholder=""> |
335 | </div> | 335 | </div> |
336 | <div class="clearfix"></div> | 336 | <div class="clearfix"></div> |
337 | </div> | 337 | </div> |
338 | <div class="col-md-6"> | 338 | <div class="col-md-6"> |
339 | <div class="pull-left" style="width: 110px;"> | 339 | <div class="pull-left" style="width: 110px;"> |
340 | <label class="new-input-label"><b>Internal Note</b></label> | 340 | <label class="new-input-label"><b>Internal Note</b></label> |
341 | </div> | 341 | </div> |
342 | <div class="pull-left" style="width: calc(100% - 110px);"> | 342 | <div class="pull-left" style="width: calc(100% - 110px);"> |
343 | <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> | 343 | <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> |
344 | </div> | 344 | </div> |
345 | <div class="clearfix"></div> | 345 | <div class="clearfix"></div> |
346 | </div> | 346 | </div> |
347 | </div> | 347 | </div> |
348 | <div class="clearfix"></div> | 348 | <div class="clearfix"></div> |
349 | </div> | 349 | </div> |
350 | </div> | 350 | </div> |
351 | <div class="clearfix"></div> | 351 | <div class="clearfix"></div> |
352 | </div> | 352 | </div> |
353 | </div> | 353 | </div> |
354 | </div> | 354 | </div> |
355 | </div> | 355 | </div> |
356 | <div class="modal-footer" style="border-top: 0;"> | 356 | <div class="modal-footer" style="border-top: 0;"> |
357 | <button type="button" class="btn btn-default" ng-click="reset()" data-dismiss="modal">Cancel</button> | 357 | <button type="button" class="btn btn-default" ng-click="reset()" data-dismiss="modal">Cancel</button> |
358 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData()">Save</button> | 358 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData()">Save</button> |
359 | </div> | 359 | </div> |
360 | </div> | 360 | </div> |
361 | </div> | 361 | </div> |
362 | </form> | 362 | </form> |
363 | <div class="myLoader" ng-show="showLoader"> | 363 | <div class="myLoader" ng-show="showLoader"> |
364 | <img src="../img/hourglass.gif" width="50px;"> | 364 | <img src="../img/hourglass.gif" width="50px;"> |
365 | </div> | 365 | </div> |
366 | <script src="js/multi-step-modal.js"></script> | 366 | <script src="js/multi-step-modal.js"></script> |
367 | <script> | 367 | <script> |
368 | sendEvent = function(sel, step) { | 368 | sendEvent = function(sel, step) { |
369 | $(sel).trigger('next.m.' + step); | 369 | $(sel).trigger('next.m.' + step); |
370 | } | 370 | } |
371 | </script> | 371 | </script> |
app/partials/FuelVendors/FuelVendors.service.js
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | .service('FuelVendorsService', ['$q', '$http','BASE_URL', FuelVendorsService]); | 4 | .service('FuelVendorsService', ['$q', '$http','BASE_URL', FuelVendorsService]); |
5 | 5 | ||
6 | function FuelVendorsService($q, $http, BASE_URL) { | 6 | function FuelVendorsService($q, $http, BASE_URL) { |
7 | 7 | ||
8 | this.getAllVendor = function() { | 8 | this.getAllVendor = function() { |
9 | 9 | ||
10 | var deferred = $q.defer(); | 10 | var deferred = $q.defer(); |
11 | $http({ | 11 | $http({ |
12 | method : 'GET', | 12 | method : 'GET', |
13 | url : BASE_URL.url +'/user/allVendors', | 13 | url : BASE_URL.url +'/user/allVendors', |
14 | headers : {'Content-Type': 'application/json'}, | 14 | headers : {'Content-Type': 'application/json'}, |
15 | }) | 15 | }) |
16 | .then(function (result){ | 16 | .then(function (result){ |
17 | deferred.resolve(result.data); | 17 | deferred.resolve(result.data); |
18 | },function (result){ | 18 | },function (result){ |
19 | deferred.resolve(result.data); | 19 | deferred.resolve(result.data); |
20 | }) | 20 | }) |
21 | return deferred.promise; | 21 | return deferred.promise; |
22 | } | 22 | } |
23 | 23 | ||
24 | this.addVendor = function(data) { | 24 | this.addVendor = function(data) { |
25 | console.log("data",data); | 25 | console.log("data",data); |
26 | 26 | ||
27 | var deferred = $q.defer(); | 27 | var deferred = $q.defer(); |
28 | $http({ | 28 | $http({ |
29 | method : 'POST', | 29 | method : 'POST', |
30 | url : BASE_URL.url +'/vendor', | 30 | url : BASE_URL.url +'/vendor', |
31 | headers : {'Content-Type': 'application/json'}, | 31 | headers : {'Content-Type': 'application/json'}, |
32 | data: data | 32 | data: data |
33 | }) | 33 | }) |
34 | .then(function (result){ | 34 | .then(function (result){ |
35 | deferred.resolve(result.data); | 35 | deferred.resolve(result.data); |
36 | },function (result){ | 36 | },function (result){ |
37 | deferred.resolve(result.data); | 37 | deferred.resolve(result.data); |
38 | }) | 38 | }) |
39 | return deferred.promise; | 39 | return deferred.promise; |
40 | } | 40 | } |
41 | 41 | ||
42 | this.addVendorAicraft = function(data) { | 42 | this.addVendorAicraft = function(data) { |
43 | console.log("data",data); | 43 | console.log("data",data); |
44 | 44 | ||
45 | var deferred = $q.defer(); | 45 | var deferred = $q.defer(); |
46 | $http({ | 46 | $http({ |
47 | method : 'POST', | 47 | method : 'POST', |
48 | url : BASE_URL.url +'/vendor/add/aircrafts', | 48 | url : BASE_URL.url +'/vendor/add/aircrafts', |
49 | headers : {'Content-Type': 'application/json'}, | 49 | headers : {'Content-Type': 'application/json'}, |
50 | data: data | 50 | data: data |
51 | }) | 51 | }) |
52 | .then(function (result){ | 52 | .then(function (result){ |
53 | deferred.resolve(result.data); | 53 | deferred.resolve(result.data); |
54 | },function (result){ | 54 | },function (result){ |
55 | deferred.resolve(result.data); | 55 | deferred.resolve(result.data); |
56 | }) | 56 | }) |
57 | return deferred.promise; | 57 | return deferred.promise; |
58 | } | 58 | } |
59 | |||
60 | this.exportVendors = function(){ | ||
61 | var deferred = $q.defer(); | ||
62 | $http({ | ||
63 | method : 'GET', | ||
64 | url : BASE_URL.url +'/vendor/export' | ||
65 | }) | ||
66 | .then(function (result){ | ||
67 | deferred.resolve(result.data); | ||
68 | },function (result){ | ||
69 | console.log(result) | ||
70 | deferred.resolve(result.data); | ||
71 | }) | ||
72 | return deferred.promise; | ||
73 | } | ||
59 | } | 74 | } |
60 | 75 | ||
61 | })(); | 76 | })(); |
app/partials/customers/customers.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | .controller('customersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', '$state', 'CustomersService', 'ViewCompanyService', 'NgTableParams', customersController]); | 5 | .controller('customersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', '$state', 'CustomersService', 'ViewCompanyService', 'NgTableParams', customersController]); |
6 | 6 | ||
7 | function customersController($scope, $rootScope, $uibModal, $filter, $http, $state, CustomersService, ViewCompanyService, NgTableParams) { | 7 | function customersController($scope, $rootScope, $uibModal, $filter, $http, $state, CustomersService, ViewCompanyService, NgTableParams) { |
8 | $(document).ready(function() { | 8 | $(document).ready(function() { |
9 | $('#example').DataTable(); | 9 | $('#example').DataTable(); |
10 | }); | 10 | }); |
11 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) | 11 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) |
12 | $scope.reset2 = function(){ | 12 | $scope.reset2 = function(){ |
13 | $("input").val(""); | 13 | $("input").val(""); |
14 | $scope.removeMarginValidation(); | 14 | $scope.removeMarginValidation(); |
15 | } | 15 | } |
16 | 16 | ||
17 | $scope.data = {}; | 17 | $scope.data = {}; |
18 | $scope.aircraft = {}; | 18 | $scope.aircraft = {}; |
19 | $scope.data.activate = true; | 19 | $scope.data.activate = true; |
20 | $scope.showLoader = false; | 20 | $scope.showLoader = false; |
21 | getAllCompanies(); | 21 | getAllCompanies(); |
22 | 22 | ||
23 | /*function getAllCompanies(){ | 23 | /*function getAllCompanies(){ |
24 | CustomersService.getAllCompanies().then(function(result) { | 24 | CustomersService.getAllCompanies().then(function(result) { |
25 | $scope.companyList = result; | 25 | $scope.companyList = result; |
26 | for(var i=0; i<$scope.companyList.length; i++){ | 26 | for(var i=0; i<$scope.companyList.length; i++){ |
27 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 27 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
28 | } | 28 | } |
29 | }) | 29 | }) |
30 | 30 | ||
31 | }*/ | 31 | }*/ |
32 | 32 | ||
33 | $scope.statusFilter = [ | 33 | $scope.statusFilter = [ |
34 | {id: "", title: "Show All"}, | 34 | {id: "", title: "Show All"}, |
35 | {id: "true", title: "Active"}, | 35 | {id: "true", title: "Active"}, |
36 | {id: "false", title: "Inactive"} | 36 | {id: "false", title: "Inactive"} |
37 | ] | 37 | ] |
38 | 38 | ||
39 | /*function getAllCompanies(){ | 39 | /*function getAllCompanies(){ |
40 | $scope.displayCompanyList = new NgTableParams({ | 40 | $scope.displayCompanyList = new NgTableParams({ |
41 | page: 1, | 41 | page: 1, |
42 | count: 10 | 42 | count: 10 |
43 | }, { | 43 | }, { |
44 | total: 0, | 44 | total: 0, |
45 | getData: function($defer, params) { | 45 | getData: function($defer, params) { |
46 | CustomersService.getAllCompanies().then(function(result) { | 46 | CustomersService.getAllCompanies().then(function(result) { |
47 | $scope.companyList = result; | 47 | $scope.companyList = result; |
48 | for(var i=0; i<$scope.companyList.length; i++){ | 48 | for(var i=0; i<$scope.companyList.length; i++){ |
49 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 49 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
50 | } | 50 | } |
51 | var filteredData = params.filter() ? | 51 | var filteredData = params.filter() ? |
52 | $filter('filter')($scope.companyList, params.filter()) : $scope.companyList; | 52 | $filter('filter')($scope.companyList, params.filter()) : $scope.companyList; |
53 | var orderedData = params.sorting() ? | 53 | var orderedData = params.sorting() ? |
54 | $filter('orderBy')(filteredData, params.orderBy()) : $scope.companyList; | 54 | $filter('orderBy')(filteredData, params.orderBy()) : $scope.companyList; |
55 | 55 | ||
56 | params.total(orderedData.length); | 56 | params.total(orderedData.length); |
57 | $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count())); | 57 | $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count())); |
58 | }) | 58 | }) |
59 | } | 59 | } |
60 | }); | 60 | }); |
61 | }*/ | 61 | }*/ |
62 | 62 | ||
63 | function getAllCompanies(){ | 63 | function getAllCompanies(){ |
64 | CustomersService.getAllCompanies().then(function(result) { | 64 | CustomersService.getAllCompanies().then(function(result) { |
65 | console.log('log', result); | 65 | console.log('log', result); |
66 | $scope.companyList = result; | 66 | $scope.companyList = result; |
67 | for (var i = 0; i < $scope.companyList.length; i++) { | 67 | for (var i = 0; i < $scope.companyList.length; i++) { |
68 | if ($scope.companyList[i].companyContact != null) { | 68 | if ($scope.companyList[i].companyContact != null) { |
69 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { | 69 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { |
70 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; | 70 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | if ($scope.companyList[i].primaryContact != null) { | 73 | if ($scope.companyList[i].primaryContact != null) { |
74 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { | 74 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { |
75 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; | 75 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; |
76 | } | 76 | } |
77 | } | 77 | } |
78 | if ($scope.companyList[i].margin != null) { | 78 | if ($scope.companyList[i].margin != null) { |
79 | if ($scope.companyList[i].margin.marginName != null) { | 79 | if ($scope.companyList[i].margin.marginName != null) { |
80 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 80 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | } | 83 | } |
84 | $scope.displayCompanyList = new NgTableParams({ | 84 | $scope.displayCompanyList = new NgTableParams({ |
85 | page: 1, | 85 | page: 1, |
86 | count: 10, | 86 | count: 10, |
87 | }, { | 87 | }, { |
88 | data: $scope.companyList | 88 | data: $scope.companyList |
89 | }); | 89 | }); |
90 | }) | 90 | }) |
91 | } | 91 | } |
92 | 92 | ||
93 | $scope.editMargin = function(customer){ | 93 | $scope.editMargin = function(customer){ |
94 | console.log('customer', customer); | 94 | console.log('customer', customer); |
95 | $scope.showLoader = true; | ||
95 | event.stopPropagation(); | 96 | event.stopPropagation(); |
96 | 97 | ||
97 | var companyMargin = "companyName=" + customer.companyName + "&masterMargin=" + customer.masterMargin | 98 | var companyMargin = "companyName=" + customer.companyName + "&masterMargin=" + customer.masterMargin |
98 | + "&addressOne=" + customer.addressOne + "&addressTwo=" + customer.addressTwo + "&city=" + customer.city + "&state=" | 99 | + "&addressOne=" + customer.addressOne + "&addressTwo=" + customer.addressTwo + "&city=" + customer.city + "&state=" |
99 | + customer.state + "&country=" + customer.country + "&zipcode=" + customer.zipcode + "&internalNote=" | 100 | + customer.state + "&country=" + customer.country + "&zipcode=" + customer.zipcode + "&internalNote=" |
100 | + customer.internalNote + "&certificateType=" + customer.certificateType + "&baseTenant=" + customer.baseTenant | 101 | + customer.internalNote + "&certificateType=" + customer.certificateType + "&baseTenant=" + customer.baseTenant |
101 | + "&fuelerlinxCustomer=" + customer.fuelerlinxCustomer + "&contractFuelVendor=" + customer.contractFuelVendor | 102 | + "&fuelerlinxCustomer=" + customer.fuelerlinxCustomer + "&contractFuelVendor=" + customer.contractFuelVendor |
102 | + "&activate=" + customer.activate + "&baseIcao=" + customer.baseIcao + "&companyId=" + customer.id; | 103 | + "&activate=" + customer.activate + "&baseIcao=" + customer.baseIcao + "&companyId=" + customer.id; |
103 | 104 | ||
104 | ViewCompanyService.updateContact(companyMargin).then(function(result) { | 105 | ViewCompanyService.updateContact(companyMargin).then(function(result) { |
105 | if(result != null && result.success){ | 106 | if(result != null && result.success){ |
107 | $scope.showLoader = false; | ||
106 | toastr.success(''+result.success+'', { | 108 | toastr.success(''+result.success+'', { |
107 | closeButton: true | 109 | closeButton: true |
108 | }) | 110 | }) |
109 | }else{ | 111 | }else{ |
112 | $scope.showLoader = false; | ||
110 | toastr.error(''+result.statusText+'', { | 113 | toastr.error(''+result.statusText+'', { |
111 | closeButton: true | 114 | closeButton: true |
112 | }) | 115 | }) |
113 | } | 116 | } |
114 | }) | 117 | }) |
115 | } | 118 | } |
116 | 119 | ||
117 | getData(); | 120 | getData(); |
118 | function getData(){ | 121 | function getData(){ |
119 | CustomersService.getAircraftMake().then(function(result) { | 122 | CustomersService.getAircraftMake().then(function(result) { |
120 | $scope.aircraftMakeList = result; | 123 | $scope.aircraftMakeList = result; |
121 | }) | 124 | }) |
122 | } | 125 | } |
123 | 126 | ||
124 | 127 | ||
125 | // CustomersService.getMargin().then(function(result) { | 128 | // CustomersService.getMargin().then(function(result) { |
126 | // $scope.marginList = result; | 129 | // $scope.marginList = result; |
127 | // }) | 130 | // }) |
128 | $scope.marginFilterOptions = []; | 131 | $scope.marginFilterOptions = []; |
129 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 132 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
130 | $scope.jetMarginList = result; | 133 | $scope.jetMarginList = result; |
131 | $scope.marginFilterOptions.push({ | 134 | $scope.marginFilterOptions.push({ |
132 | 'id': '', 'title': 'Show All' | 135 | 'id': '', 'title': 'Show All' |
133 | }); | 136 | }); |
134 | for (var i = 0; i < result.length; i++) { | 137 | for (var i = 0; i < result.length; i++) { |
135 | $scope.marginFilterOptions.push({ | 138 | $scope.marginFilterOptions.push({ |
136 | 'id': result[i].id, | 139 | 'id': result[i].id, |
137 | 'title': result[i].marginName | 140 | 'title': result[i].marginName |
138 | }) | 141 | }) |
139 | } | 142 | } |
140 | }) | 143 | }) |
141 | 144 | ||
142 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | 145 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { |
143 | $scope.avgsMarginList = result; | 146 | $scope.avgsMarginList = result; |
144 | }) | 147 | }) |
145 | 148 | ||
146 | 149 | ||
147 | $scope.showCompanyError = false; | 150 | $scope.showCompanyError = false; |
148 | $scope.showMarginError = false; | 151 | $scope.showMarginError = false; |
149 | 152 | ||
150 | $scope.removeValidation = function(){ | 153 | $scope.removeValidation = function(){ |
151 | $scope.showCompanyError = false; | 154 | $scope.showCompanyError = false; |
152 | $('.companyNameInput').removeClass('customErrorInput'); | 155 | $('.companyNameInput').removeClass('customErrorInput'); |
153 | } | 156 | } |
154 | 157 | ||
155 | $scope.removeMarginValidation = function(){ | 158 | $scope.removeMarginValidation = function(){ |
156 | $scope.showMarginError = false; | 159 | $scope.showMarginError = false; |
157 | $('.marginSelectBox').removeClass('customErrorInput'); | 160 | $('.marginSelectBox').removeClass('customErrorInput'); |
158 | } | 161 | } |
159 | 162 | ||
160 | var companyData; | 163 | var companyData; |
161 | $scope.addFirstData = function(sel, step){ | 164 | $scope.addFirstData = function(sel, step){ |
162 | if($scope.data.companyName == undefined){ | 165 | if($scope.data.companyName == undefined){ |
163 | $scope.showCompanyError = true; | 166 | $scope.showCompanyError = true; |
164 | $('.companyNameInput').addClass('customErrorInput'); | 167 | $('.companyNameInput').addClass('customErrorInput'); |
165 | }else if($scope.data.masterMargin == undefined){ | 168 | }else if($scope.data.masterMargin == undefined){ |
166 | $scope.showMarginError = true; | 169 | $scope.showMarginError = true; |
167 | $('.marginSelectBox').addClass('customErrorInput'); | 170 | $('.marginSelectBox').addClass('customErrorInput'); |
168 | }else{ | 171 | }else{ |
169 | console.log($scope.data); | 172 | console.log($scope.data); |
170 | companyData = "companyName=" + $scope.data.companyName + "&masterMargin=" + $scope.data.masterMargin | 173 | companyData = "companyName=" + $scope.data.companyName + "&masterMargin=" + $scope.data.masterMargin |
171 | + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state=" | 174 | + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state=" |
172 | + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote=" | 175 | + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote=" |
173 | + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant | 176 | + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant |
174 | + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor | 177 | + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor |
175 | + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao + "&avgasMargin=" + $scope.data.avgasMargin; | 178 | + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao + "&avgasMargin=" + $scope.data.avgasMargin; |
176 | 179 | ||
177 | 180 | ||
178 | $(sel).trigger('next.m.' + step); | 181 | $(sel).trigger('next.m.' + step); |
179 | getData(); | 182 | getData(); |
180 | } | 183 | } |
181 | } | 184 | } |
182 | 185 | ||
183 | $scope.aircraftDetails = [{ | 186 | $scope.aircraftDetails = [{ |
184 | 'tail':'', | 187 | 'tail':'', |
185 | 'make': '', | 188 | 'make': '', |
186 | 'model': '', | 189 | 'model': '', |
187 | 'sizeId' : '', | 190 | 'sizeId' : '', |
188 | 'marginId': $scope.data.masterMargin, | 191 | 'marginId': $scope.data.masterMargin, |
189 | 'avgasMarginId': $scope.data.avgasMargin | 192 | 'avgasMarginId': $scope.data.avgasMargin |
190 | }]; | 193 | }]; |
191 | 194 | ||
192 | $scope.addNew = function(){ | 195 | $scope.addNew = function(){ |
193 | $scope.aircraftDetails.push({ | 196 | $scope.aircraftDetails.push({ |
194 | 'tail':'', | 197 | 'tail':'', |
195 | 'make': '', | 198 | 'make': '', |
196 | 'model': '', | 199 | 'model': '', |
197 | 'sizeId' : '', | 200 | 'sizeId' : '', |
198 | 'marginId': $scope.data.masterMargin, | 201 | 'marginId': $scope.data.masterMargin, |
199 | 'avgasMarginId': $scope.data.avgasMargin | 202 | 'avgasMarginId': $scope.data.avgasMargin |
200 | }); | 203 | }); |
201 | }; | 204 | }; |
202 | 205 | ||
203 | $scope.getModal = function(makeId, index){ | 206 | $scope.getModal = function(makeId, index){ |
204 | $scope.showLoader = true; | 207 | $scope.showLoader = true; |
205 | $scope.aircraft.make = makeId; | 208 | $scope.aircraft.make = makeId; |
206 | //var makeId = makeId; | 209 | //var makeId = makeId; |
207 | CustomersService.getModal($scope.aircraft.make).then(function(result) { | 210 | CustomersService.getModal($scope.aircraft.make).then(function(result) { |
208 | $scope.showLoader = false; | 211 | $scope.showLoader = false; |
209 | $scope.aircraftDetails[index].aircraftModalList = result; | 212 | $scope.aircraftDetails[index].aircraftModalList = result; |
210 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | 213 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; |
211 | }) | 214 | }) |
212 | } | 215 | } |
213 | 216 | ||
214 | $scope.getSize = function(model, index){ | 217 | $scope.getSize = function(model, index){ |
215 | $scope.showLoader = true; | 218 | $scope.showLoader = true; |
216 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | 219 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
217 | $scope.showLoader = false; | 220 | $scope.showLoader = false; |
218 | $scope.aircraftDetails[index].aircraftSizeList = result; | 221 | $scope.aircraftDetails[index].aircraftSizeList = result; |
219 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | 222 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; |
220 | }) | 223 | }) |
221 | } | 224 | } |
222 | 225 | ||
223 | $scope.aircraftListData = {}; | 226 | $scope.aircraftListData = {}; |
224 | $scope.addData = []; | 227 | $scope.addData = []; |
225 | $scope.saveCompanyData = function(){ | 228 | $scope.saveCompanyData = function(){ |
226 | CustomersService.addCompany(companyData).then(function(result) { | 229 | CustomersService.addCompany(companyData).then(function(result) { |
227 | $scope.accountId = result; | 230 | $scope.accountId = result; |
228 | $scope.aircraft.accountId = $scope.accountId; | 231 | $scope.aircraft.accountId = $scope.accountId; |
229 | 232 | ||
230 | for(var i=0; i<$scope.aircraftDetails.length;i++){ | 233 | for(var i=0; i<$scope.aircraftDetails.length;i++){ |
231 | $scope.addData.push({ | 234 | $scope.addData.push({ |
232 | 'tail': $scope.aircraftDetails[i].tail, | 235 | 'tail': $scope.aircraftDetails[i].tail, |
233 | 'make': $scope.aircraftDetails[i].make, | 236 | 'make': $scope.aircraftDetails[i].make, |
234 | 'model': $scope.aircraftDetails[i].model, | 237 | 'model': $scope.aircraftDetails[i].model, |
235 | 'sizeId' : $scope.aircraftDetails[i].sizeId, | 238 | 'sizeId' : $scope.aircraftDetails[i].sizeId, |
236 | 'marginId': $scope.aircraftDetails[i].marginId, | 239 | 'marginId': $scope.aircraftDetails[i].marginId, |
237 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId | 240 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId |
238 | }); | 241 | }); |
239 | } | 242 | } |
240 | $scope.aircraftListData.aircraftList = $scope.addData; | 243 | $scope.aircraftListData.aircraftList = $scope.addData; |
241 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; | 244 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; |
242 | 245 | ||
243 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { | 246 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { |
244 | 247 | ||
245 | if(result != null && result.success){ | 248 | if(result != null && result.success){ |
246 | toastr.success(''+result.success+'', { | 249 | toastr.success(''+result.success+'', { |
247 | closeButton: true | 250 | closeButton: true |
248 | }) | 251 | }) |
249 | $('#demo-modal-3').modal('hide'); | 252 | $('#demo-modal-3').modal('hide'); |
250 | getAllCompanies(); | 253 | getAllCompanies(); |
251 | }else{ | 254 | }else{ |
252 | toastr.error(''+result.statusText+'', { | 255 | toastr.error(''+result.statusText+'', { |
253 | closeButton: true | 256 | closeButton: true |
254 | }) | 257 | }) |
255 | } | 258 | } |
256 | }); | 259 | }); |
257 | }) | 260 | }) |
258 | 261 | ||
259 | 262 | ||
260 | } | 263 | } |
261 | 264 | ||
262 | // $scope.appendText = function() { | 265 | // $scope.appendText = function() { |
263 | // getData(); | 266 | // getData(); |
264 | // var newRow = $('<tr> <td> <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> </td> <td style="width: 25%;"> <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> <option ng-repeat="make in aircraftMakeList">{{make}}</option> </select> </td> <td style="width: 20%;"> <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> <option ng-repeat="model in aircraftModalList">{{model}}</option> </select> </td> <td style="width: 25%;"> <select class="form-control" ng-model="aircraft.size"> <option ng-repeat="size in aircraftSizeList">{{size}}</option> </select> </td> <td> <select class="form-control"> <option>Margin1</option> <option>Margin2</option> </select> </td> </tr>'); | 267 | // var newRow = $('<tr> <td> <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> </td> <td style="width: 25%;"> <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> <option ng-repeat="make in aircraftMakeList">{{make}}</option> </select> </td> <td style="width: 20%;"> <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> <option ng-repeat="model in aircraftModalList">{{model}}</option> </select> </td> <td style="width: 25%;"> <select class="form-control" ng-model="aircraft.size"> <option ng-repeat="size in aircraftSizeList">{{size}}</option> </select> </td> <td> <select class="form-control"> <option>Margin1</option> <option>Margin2</option> </select> </td> </tr>'); |
265 | // $('table.addRow').append(newRow); | 268 | // $('table.addRow').append(newRow); |
266 | // } | 269 | // } |
267 | 270 | ||
268 | $scope.setFuel = function(){ | 271 | $scope.setFuel = function(){ |
269 | event.stopPropagation(); | 272 | event.stopPropagation(); |
270 | $state.go('app.updateFuelManager'); | 273 | $state.go('app.updateFuelManager'); |
271 | } | 274 | } |
272 | 275 | ||
273 | /* ng table */ | 276 | /* ng table */ |
277 | |||
278 | $scope.exportCompany = function() { | ||
279 | $scope.showLoader = true; | ||
280 | var fileName = "companies.csv"; | ||
281 | var a = document.createElement("a"); | ||
282 | document.body.appendChild(a); | ||
283 | CustomersService.exportCompany().then(function(result) { | ||
284 | var file = new Blob([result], {type: 'application/csv'}); | ||
285 | var fileURL = URL.createObjectURL(file); | ||
286 | a.href = fileURL; | ||
287 | a.download = fileName; | ||
288 | a.click(); | ||
289 | $scope.showLoader = false; | ||
290 | }) | ||
291 | } | ||
274 | 292 | ||
275 | 293 | ||
276 | } | 294 | } |
app/partials/customers/customers.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:nth-child(3) > a{ | 2 | .subnavbar .mainnav > li:nth-child(3) > a{ |
3 | color: #ff9900; | 3 | color: #ff9900; |
4 | } | 4 | } |
5 | 5 | ||
6 | .button1 { | 6 | .button1 { |
7 | display: inline-block; | 7 | display: inline-block; |
8 | height: 35px; | 8 | height: 35px; |
9 | line-height: 35px; | 9 | line-height: 35px; |
10 | padding-right: 15px; | 10 | padding-right: 15px; |
11 | padding-left: 50px; | 11 | padding-left: 50px; |
12 | position: relative; | 12 | position: relative; |
13 | background-color:rgb(41,127,184); | 13 | background-color:rgb(41,127,184); |
14 | color:rgb(255,255,255); | 14 | color:rgb(255,255,255); |
15 | text-decoration: none; | 15 | text-decoration: none; |
16 | text-transform: uppercase; | 16 | text-transform: uppercase; |
17 | letter-spacing: 1px; | 17 | letter-spacing: 1px; |
18 | margin-bottom: 15px; | 18 | margin-bottom: 15px; |
19 | border: 0; | 19 | border: 0; |
20 | 20 | ||
21 | 21 | ||
22 | border-radius: 5px; | 22 | border-radius: 5px; |
23 | -moz-border-radius: 5px; | 23 | -moz-border-radius: 5px; |
24 | -webkit-border-radius: 5px; | 24 | -webkit-border-radius: 5px; |
25 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); | 25 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); |
26 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | 26 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; |
27 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | 27 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); |
28 | 28 | ||
29 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 29 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
30 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 30 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
31 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 31 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
32 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | 32 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; |
33 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | 33 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); |
34 | } | 34 | } |
35 | 35 | ||
36 | .button1 span { | 36 | .button1 span { |
37 | position: absolute; | 37 | position: absolute; |
38 | left: 0; | 38 | left: 0; |
39 | top: 0; | 39 | top: 0; |
40 | width: 35px; | 40 | width: 35px; |
41 | background-color:rgba(0,0,0,0.5); | 41 | background-color:rgba(0,0,0,0.5); |
42 | 42 | ||
43 | -webkit-border-top-left-radius: 5px; | 43 | -webkit-border-top-left-radius: 5px; |
44 | -webkit-border-bottom-left-radius: 5px; | 44 | -webkit-border-bottom-left-radius: 5px; |
45 | -moz-border-radius-topleft: 5px; | 45 | -moz-border-radius-topleft: 5px; |
46 | -moz-border-radius-bottomleft: 5px; | 46 | -moz-border-radius-bottomleft: 5px; |
47 | border-top-left-radius: 5px; | 47 | border-top-left-radius: 5px; |
48 | border-bottom-left-radius: 5px; | 48 | border-bottom-left-radius: 5px; |
49 | border-right: 1px solid rgba(0,0,0,0.15); | 49 | border-right: 1px solid rgba(0,0,0,0.15); |
50 | } | 50 | } |
51 | 51 | ||
52 | .button1:hover span, .button1.active span { | 52 | .button1:hover span, .button1.active span { |
53 | background-color:rgb(0,102,26); | 53 | background-color:rgb(0,102,26); |
54 | border-right: 1px solid rgba(0,0,0,0.3); | 54 | border-right: 1px solid rgba(0,0,0,0.3); |
55 | } | 55 | } |
56 | 56 | ||
57 | .button1:active { | 57 | .button1:active { |
58 | margin-top: 2px; | 58 | margin-top: 2px; |
59 | margin-bottom: 13px; | 59 | margin-bottom: 13px; |
60 | 60 | ||
61 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 61 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
62 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 62 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
63 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 63 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
64 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | 64 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; |
65 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | 65 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); |
66 | } | 66 | } |
67 | 67 | ||
68 | .button1.turquoise { | 68 | .button1.turquoise { |
69 | background: #449d44; | 69 | background: #449d44; |
70 | } | 70 | } |
71 | </style> | 71 | </style> |
72 | 72 | ||
73 | <div class="main"> | 73 | <div class="main"> |
74 | <div class="container"> | 74 | <div class="container"> |
75 | <div class="row"> | 75 | <div class="row"> |
76 | <div class="col-md-12"> | 76 | <div class="col-md-12"> |
77 | <div class="widget stacked "> | 77 | <div class="widget stacked "> |
78 | <div class="widget-content"> | 78 | <div class="widget-content"> |
79 | <div class="tabbable"> | 79 | <div class="tabbable"> |
80 | <ul class="nav nav-tabs"> | 80 | <ul class="nav nav-tabs"> |
81 | <li class="active"> | 81 | <li class="active"> |
82 | <a ui-sref="app.customers">Company View | 82 | <a ui-sref="app.customers">Company View |
83 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 83 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
84 | </a> | 84 | </a> |
85 | </li> | 85 | </li> |
86 | <li> | 86 | <li> |
87 | <a ui-sref="app.ContactView">Contact View | 87 | <a ui-sref="app.ContactView">Contact View |
88 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 88 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
89 | </a> | 89 | </a> |
90 | </li> | 90 | </li> |
91 | <li> | 91 | <li> |
92 | <a ui-sref="app.FuelVendors">Fuel Vendors | 92 | <a ui-sref="app.FuelVendors">Fuel Vendors |
93 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 93 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
94 | </a> | 94 | </a> |
95 | </li> | 95 | </li> |
96 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" name="name" id="name" placeholder="Search In Table"></li> | 96 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" ng-model="searchText" placeholder="Search In Table"></li> |
97 | <li><button type="button" class="btn btn-default btn-sm">Clear Search And Filters</button></li> | 97 | <li><button type="button" class="btn btn-default btn-sm" ng-click="displayCompanyList.filter({}); searchText=null">Clear Search And Filters</button></li> |
98 | <li style="float:right"><button type="submit" data-toggle="modal" data-target="#demo-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Company</button></li> | 98 | <li style="float:right"><button type="submit" data-toggle="modal" data-target="#demo-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Company</button></li> |
99 | </ul> | 99 | </ul> |
100 | <br> | 100 | <br> |
101 | <div class="tab-content customer-table" style="margin:0px"> | 101 | <div class="tab-content customer-table" style="margin:0px"> |
102 | <div class="tab-pane active" id="companyView"> | 102 | <div class="tab-pane active" id="companyView"> |
103 | <table ng-table="displayCompanyList" class="table table-striped table-condensed" show-filter="true"> | 103 | <table ng-table="displayCompanyList" class="table table-striped table-condensed" show-filter="true"> |
104 | <tr ng-repeat="row in $data track by row.id" style="cursor: pointer;" ui-sref="app.viewCompany({id : row.id})"> | 104 | <tr ng-repeat="row in $data | filter:searchText"" style="cursor: pointer;"> |
105 | <td data-title="'Company Name'" filter="{companyName: 'text'}" sortable="'companyName'"> | 105 | <td data-title="'Company Name'" filter="{companyName: 'text'}" sortable="'companyName'" ui-sref="app.viewCompany({id : row.id})"> |
106 | {{row.companyName}} | 106 | {{row.companyName}} |
107 | </td> | 107 | </td> |
108 | <td data-title="'Fleet'" filter="{companyAircraftSize: 'text'}" sortable="'companyAircraftSize'"> | 108 | <td data-title="'Fleet'" filter="{companyAircraftSize: 'text'}" sortable="'companyAircraftSize'" ui-sref="app.viewCompany({id : row.id})"> |
109 | {{row.companyAircraftSize}} | 109 | {{row.companyAircraftSize}} |
110 | </td> | 110 | </td> |
111 | <td data-title="'Main Phone'" filter="{newContactNumber: 'text'}" sortable="'newContactNumber'"> | 111 | <td data-title="'Main Phone'" filter="{newContactNumber: 'text'}" sortable="'newContactNumber'" ui-sref="app.viewCompany({id : row.id})"> |
112 | {{row.newContactNumber}} | 112 | {{row.newContactNumber}} |
113 | </td> | 113 | </td> |
114 | <td data-title="'Primary Contact'" filter="{primaryContactName: 'text'}" sortable="'primaryContactName'"> | 114 | <td data-title="'Primary Contact'" filter="{primaryContactName: 'text'}" sortable="'primaryContactName'" ui-sref="app.viewCompany({id : row.id})"> |
115 | {{row.primaryContactName}} | 115 | {{row.primaryContactName}} |
116 | </td> | 116 | </td> |
117 | <td data-title="'Base'" filter="{baseIcao: 'text'}" sortable="'baseIcao'"> | 117 | <td data-title="'Base'" filter="{baseIcao: 'text'}" sortable="'baseIcao'" ui-sref="app.viewCompany({id : row.id})"> |
118 | {{row.baseIcao}} | 118 | {{row.baseIcao}} |
119 | </td> | 119 | </td> |
120 | <td data-title="'Status'" filter="{activate: 'select'}" filter-data="statusFilter" sortable="'activate'"> | 120 | <td data-title="'Status'" filter="{activate: 'select'}" filter-data="statusFilter" sortable="'activate'" ui-sref="app.viewCompany({id : row.id})"> |
121 | <button type="button" ng-if="row.activate == true" class="btn btn-success btn-xs">Active</button> | 121 | <button type="button" ng-if="row.activate == true" class="btn btn-success btn-xs">Active</button> |
122 | <button type="button" ng-if="row.activate == false" class="btn btn-warning btn-xs">InActive</button> | 122 | <button type="button" ng-if="row.activate == false" class="btn btn-warning btn-xs">InActive</button> |
123 | </td> | 123 | </td> |
124 | <td data-title="'Margin Setting'" filter="{masterMargin: 'select'}" filter-data="marginFilterOptions" sortable="'masterMargin'"> | 124 | <td data-title="'Margin Setting'" filter="{masterMargin: 'select'}" filter-data="marginFilterOptions" sortable="'masterMargin'"> |
125 | <select class="form-control" ng-change="editMargin(row)" style="height:31px;" ng-model="row.masterMargin" ng-selected="" ng-options="margin.id as margin.marginName for margin in jetMarginList" required></select> | 125 | <select class="form-control" ng-change="editMargin(row)" style="height:31px;" ng-model="row.masterMargin" ng-selected="" ng-options="margin.id as margin.marginName for margin in jetMarginList" required></select> |
126 | </td> | 126 | </td> |
127 | <td data-title="'All In'" filter="{allIn: 'text'}" sortable="'allIn'"> | 127 | <td data-title="'All In'" filter="{marginAllIn: 'text'}" sortable="'marginAllIn'" ui-sref="app.viewCompany({id : row.id})"> |
128 | {{row.marginAllIn}} | 128 | {{row.marginAllIn}} |
129 | </td> | 129 | </td> |
130 | <td data-title="''"> | 130 | <td data-title="''"> |
131 | <button type="button" class="btn btn-info btn-xs" ng-click="setFuel()">Setup Fuel</button> | 131 | <button type="button" class="btn btn-info btn-xs" ng-click="setFuel()">Setup Fuel</button> |
132 | </td> | 132 | </td> |
133 | </tr> | 133 | </tr> |
134 | </table> | 134 | </table> |
135 | 135 | ||
136 | <button type="button" class="btn btn-warning exportBtn">Export Customers</button> | 136 | <button type="button" ng-click="exportCompany()" class="btn btn-warning exportBtn">Export CSV</button> |
137 | 137 | ||
138 | <!-- | 138 | <!-- |
139 | <table class="table table-striped"> | 139 | <table class="table table-striped"> |
140 | <thead> | 140 | <thead> |
141 | <tr> | 141 | <tr> |
142 | <th> | 142 | <th> |
143 | <input type="text" class="form-control" name="name" id="name"> | 143 | <input type="text" class="form-control" name="name" id="name"> |
144 | <label class="font-company">Company Name <i class="fa fa-sort" aria-hidden="true"></i></label> | 144 | <label class="font-company">Company Name <i class="fa fa-sort" aria-hidden="true"></i></label> |
145 | </th> | 145 | </th> |
146 | <th> | 146 | <th> |
147 | <input type="text" class="form-control" name="name" id="name"> | 147 | <input type="text" class="form-control" name="name" id="name"> |
148 | <label class="font-company">Fleet <i class="fa fa-sort" aria-hidden="true"></i></label> | 148 | <label class="font-company">Fleet <i class="fa fa-sort" aria-hidden="true"></i></label> |
149 | </th> | 149 | </th> |
150 | <th> | 150 | <th> |
151 | <input type="text" class="form-control" name="name" id="name"> | 151 | <input type="text" class="form-control" name="name" id="name"> |
152 | <label class="font-company">Main Phone <i class="fa fa-sort" aria-hidden="true"></i></label> | 152 | <label class="font-company">Main Phone <i class="fa fa-sort" aria-hidden="true"></i></label> |
153 | </th> | 153 | </th> |
154 | <th> | 154 | <th> |
155 | <input type="text" class="form-control" name="name" id="name"> | 155 | <input type="text" class="form-control" name="name" id="name"> |
156 | <label class="font-company">Primary Contact <i class="fa fa-sort" aria-hidden="true"></i></label> | 156 | <label class="font-company">Primary Contact <i class="fa fa-sort" aria-hidden="true"></i></label> |
157 | </th> | 157 | </th> |
158 | <th> | 158 | <th> |
159 | <input type="text" class="form-control" name="name" id="name"> | 159 | <input type="text" class="form-control" name="name" id="name"> |
160 | <label class="font-company">Base <i class="fa fa-sort" aria-hidden="true"></i></label> | 160 | <label class="font-company">Base <i class="fa fa-sort" aria-hidden="true"></i></label> |
161 | </th> | 161 | </th> |
162 | <th> | 162 | <th> |
163 | <select class="form-control"> | 163 | <select class="form-control"> |
164 | <option value="showAll" selected>Show All</option> | 164 | <option value="showAll" selected>Show All</option> |
165 | </select> | 165 | </select> |
166 | <label class="font-company">Status <i class="fa fa-sort" aria-hidden="true"></i></label> | 166 | <label class="font-company">Status <i class="fa fa-sort" aria-hidden="true"></i></label> |
167 | </th> | 167 | </th> |
168 | <th> | 168 | <th> |
169 | <select class="form-control"> | 169 | <select class="form-control"> |
170 | <option value="showAll" selected>Show All</option> | 170 | <option value="showAll" selected>Show All</option> |
171 | </select> | 171 | </select> |
172 | <label class="font-company">Margin Setting <i class="fa fa-sort" aria-hidden="true"></i></label> | 172 | <label class="font-company">Margin Setting <i class="fa fa-sort" aria-hidden="true"></i></label> |
173 | </th> | 173 | </th> |
174 | <th> | 174 | <th> |
175 | <input type="text" class="form-control" name="name" id="name"> | 175 | <input type="text" class="form-control" name="name" id="name"> |
176 | <label class="font-company">All In <i class="fa fa-sort" aria-hidden="true"></i></label> | 176 | <label class="font-company">All In <i class="fa fa-sort" aria-hidden="true"></i></label> |
177 | </th> | 177 | </th> |
178 | <th> </th> | 178 | <th> </th> |
179 | </thead> | 179 | </thead> |
180 | <tbody> | 180 | <tbody> |
181 | <tr ng-repeat="customer in companyList" style="cursor: pointer;" ui-sref="app.viewCompany({id : customer.id})"> | 181 | <tr ng-repeat="customer in companyList" style="cursor: pointer;" ui-sref="app.viewCompany({id : customer.id})"> |
182 | <td class="font-company"> | 182 | <td class="font-company"> |
183 | {{customer.companyName}} | 183 | {{customer.companyName}} |
184 | </td> | 184 | </td> |
185 | <td class="font-company">{{customer.companyAircraftSize}}</td> | 185 | <td class="font-company">{{customer.companyAircraftSize}}</td> |
186 | <td class="font-company">{{customer.companyCustomContacts[0].contactNumber}}</td> | 186 | <td class="font-company">{{customer.companyCustomContacts[0].contactNumber}}</td> |
187 | <td class="font-company">{{customer.companyPrimaryContacts[0].firstName}} {{customer.companyPrimaryContacts[0].lastName}}</td> | 187 | <td class="font-company">{{customer.companyPrimaryContacts[0].firstName}} {{customer.companyPrimaryContacts[0].lastName}}</td> |
188 | <td class="font-company">{{customer.baseIcao}}</td> | 188 | <td class="font-company">{{customer.baseIcao}}</td> |
189 | <td class="font-company"> | 189 | <td class="font-company"> |
190 | <button type="button" ng-if="customer.activate == true" class="btn btn-success btn-xs">Active</button> | 190 | <button type="button" ng-if="customer.activate == true" class="btn btn-success btn-xs">Active</button> |
191 | <button type="button" ng-if="customer.activate == false" class="btn btn-warning btn-xs">InActive</button> | 191 | <button type="button" ng-if="customer.activate == false" class="btn btn-warning btn-xs">InActive</button> |
192 | </td> | 192 | </td> |
193 | <td class="font-company"> | 193 | <td class="font-company"> |
194 | <select class="form-control" ng-click="editMargin(customer)" style="height:31px;" ng-model="customer.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList" required></select> | 194 | <select class="form-control" ng-click="editMargin(customer)" style="height:31px;" ng-model="customer.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList" required></select> |
195 | </td> | 195 | </td> |
196 | <td class="font-company">{{customer.allIn}}</td> | 196 | <td class="font-company">{{customer.allIn}}</td> |
197 | <td> | 197 | <td> |
198 | <button type="button" class="btn btn-info btn-xs" ng-click="setFuel()">Setup Fuel</button> | 198 | <button type="button" class="btn btn-info btn-xs" ng-click="setFuel()">Setup Fuel</button> |
199 | </td> | 199 | </td> |
200 | </tr> | 200 | </tr> |
201 | </tbody> | 201 | </tbody> |
202 | </table> | 202 | </table> |
203 | <div class="row" style="margin-left: 0px;"> | 203 | <div class="row" style="margin-left: 0px;"> |
204 | <div class="col-md-2"> | 204 | <div class="col-md-2"> |
205 | <button type="button" class="btn btn-warning">Export Customers</button> | 205 | <button type="button" class="btn btn-warning">Export Customers</button> |
206 | </div> | 206 | </div> |
207 | <div class="col-md-10"> | 207 | <div class="col-md-10"> |
208 | <div class="row" style="margin-left: 0px;"> | 208 | <div class="row" style="margin-left: 0px;"> |
209 | <div class="col-md-6"> | 209 | <div class="col-md-6"> |
210 | </div> | 210 | </div> |
211 | <div class="col-md-2"> | 211 | <div class="col-md-2"> |
212 | <select class="form-control"> | 212 | <select class="form-control"> |
213 | <option>20 Records Per Page</option> | 213 | <option>20 Records Per Page</option> |
214 | <option>50 Records Per Page</option> | 214 | <option>50 Records Per Page</option> |
215 | <option>100 Records Per Page</option> | 215 | <option>100 Records Per Page</option> |
216 | </select> | 216 | </select> |
217 | </div> | 217 | </div> |
218 | <div class="col-md-4"> | 218 | <div class="col-md-4"> |
219 | <ul class="pagination" style="margin:0px"> | 219 | <ul class="pagination" style="margin:0px"> |
220 | <li><a href="javascript:;">ยซ</a></li> | 220 | <li><a href="javascript:;">ยซ</a></li> |
221 | <li class="active"><a href="#">1</a></li> | 221 | <li class="active"><a href="#">1</a></li> |
222 | <li><a href="javascript:;">2</a></li> | 222 | <li><a href="javascript:;">2</a></li> |
223 | <li><a href="javascript:;">3</a></li> | 223 | <li><a href="javascript:;">3</a></li> |
224 | <li><a href="javascript:;">4</a></li> | 224 | <li><a href="javascript:;">4</a></li> |
225 | <li><a href="javascript:;">5</a></li> | 225 | <li><a href="javascript:;">5</a></li> |
226 | <li><a href="javascript:;">ยป</a></li> | 226 | <li><a href="javascript:;">ยป</a></li> |
227 | </ul> | 227 | </ul> |
228 | </div> | 228 | </div> |
229 | </div> | 229 | </div> |
230 | </div> | 230 | </div> |
231 | </div> | 231 | </div> |
232 | --></div> | 232 | --></div> |
233 | </div> | 233 | </div> |
234 | </div> | 234 | </div> |
235 | </div> | 235 | </div> |
236 | <!-- /widget-content --> | 236 | <!-- /widget-content --> |
237 | </div> | 237 | </div> |
238 | <!-- /widget --> | 238 | <!-- /widget --> |
239 | </div> | 239 | </div> |
240 | <!-- /span8 --> | 240 | <!-- /span8 --> |
241 | </div> | 241 | </div> |
242 | <!-- /row --> | 242 | <!-- /row --> |
243 | </div> | 243 | </div> |
244 | <!-- /container --> | 244 | <!-- /container --> |
245 | </div> | 245 | </div> |
246 | <!-- /main --> | 246 | <!-- /main --> |
247 | <form class="modal multi-step" id="demo-modal-3" name="companyForm"> | 247 | <form class="modal multi-step" id="demo-modal-3" name="companyForm"> |
248 | <div class="modal-dialog modal-lg"> | 248 | <div class="modal-dialog modal-lg"> |
249 | <div class="modal-content"> | 249 | <div class="modal-content"> |
250 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 250 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
251 | <div> | 251 | <div> |
252 | <div class="row" style="margin: 0;"> | 252 | <div class="row" style="margin: 0;"> |
253 | <div> | 253 | <div> |
254 | <div class="widget" style="margin-bottom: 0;"> | 254 | <div class="widget" style="margin-bottom: 0;"> |
255 | <div class="widget-header"> | 255 | <div class="widget-header"> |
256 | <i class="icon-pencil"></i> | 256 | <i class="icon-pencil"></i> |
257 | <i class="fa fa-tasks" aria-hidden="true"></i> | 257 | <i class="fa fa-tasks" aria-hidden="true"></i> |
258 | <h3>Add a New Company</h3> | 258 | <h3>Add a New Company</h3> |
259 | <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> | 259 | <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> |
260 | <div style="color: #ff9a01;">Activate     | 260 | <div style="color: #ff9a01;">Activate     |
261 | <toggle ng-model="data.activate" size="customToogle"></toggle> | 261 | <toggle ng-model="data.activate" size="customToogle"></toggle> |
262 | </div> | 262 | </div> |
263 | </div> | 263 | </div> |
264 | <div class="clearfix"></div> | 264 | <div class="clearfix"></div> |
265 | </div> | 265 | </div> |
266 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 266 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
267 | <div class="col-xs-12"> | 267 | <div class="col-xs-12"> |
268 | <div class="col-md-8"> | 268 | <div class="col-md-8"> |
269 | <div class="pull-left"> | 269 | <div class="pull-left"> |
270 | <label class="new-input-label"><b>Company Name *</b></label> | 270 | <label class="new-input-label"><b>Company Name *</b></label> |
271 | </div> | 271 | </div> |
272 | <div class="pull-left" style="margin-left: 15px;"> | 272 | <div class="pull-left" style="margin-left: 15px;"> |
273 | <input type="text" ng-model="data.companyName" class="form-control companyNameInput" ng-keyup="removeValidation()" placeholder="" required> | 273 | <input type="text" ng-model="data.companyName" class="form-control companyNameInput" ng-keyup="removeValidation()" placeholder="" required> |
274 | <label class="customErrorMessage" ng-show="showCompanyError">This field is required.</label> | 274 | <label class="customErrorMessage" ng-show="showCompanyError">This field is required.</label> |
275 | </div> | 275 | </div> |
276 | <div class="clearfix"></div> | 276 | <div class="clearfix"></div> |
277 | </div> | 277 | </div> |
278 | <div class="col-md-4"> | 278 | <div class="col-md-4"> |
279 | 279 | ||
280 | <div class="pull-right"> | 280 | <div class="pull-right"> |
281 | <input type="text" ng-model="data.baseIcao" style="width: 100px;" class="form-control" placeholder=""> | 281 | <input type="text" ng-model="data.baseIcao" style="width: 100px;" class="form-control" placeholder=""> |
282 | </div> | 282 | </div> |
283 | <div class="pull-right"> | 283 | <div class="pull-right"> |
284 | <label style="margin-right: 15px;" class="new-input-label"><b>Base ICAO</b></label> | 284 | <label style="margin-right: 15px;" class="new-input-label"><b>Base ICAO</b></label> |
285 | </div> | 285 | </div> |
286 | <div class="clearfix"></div> | 286 | <div class="clearfix"></div> |
287 | </div> | 287 | </div> |
288 | </div> | 288 | </div> |
289 | <div class="clearfix"></div><br> | 289 | <div class="clearfix"></div><br> |
290 | <div class="col-xs-12"> | 290 | <div class="col-xs-12"> |
291 | <div class="col-md-7"> | 291 | <div class="col-md-7"> |
292 | <div class="pull-left"> | 292 | <div class="pull-left"> |
293 | <label class="new-input-label"><b>Relationship </b></label> | 293 | <label class="new-input-label"><b>Relationship </b></label> |
294 | </div> | 294 | </div> |
295 | <div class="pull-left" style="margin-left: 32px;"> | 295 | <div class="pull-left" style="margin-left: 32px;"> |
296 | <input type="checkbox" ng-model="data.baseTenant" name="vehicle" value="Bike"> Check here if this is a Base Tenant<br> | 296 | <input type="checkbox" ng-model="data.baseTenant" name="vehicle" value="Bike"> Check here if this is a Base Tenant<br> |
297 | <input type="checkbox" ng-model="data.fuelerlinxCustomer" name="vehicle" value="Car" checked> Check here if this is a FuelerLinx Customer<br> | 297 | <input type="checkbox" ng-model="data.fuelerlinxCustomer" name="vehicle" value="Car" checked> Check here if this is a FuelerLinx Customer<br> |
298 | <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> Check here if this is a Contract Fuel Vendor | 298 | <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> Check here if this is a Contract Fuel Vendor |
299 | </div> | 299 | </div> |
300 | <div class="clearfix"></div> | 300 | <div class="clearfix"></div> |
301 | </div> | 301 | </div> |
302 | <div class="col-md-2 Airport" style="text-align: right;"> | 302 | <div class="col-md-2 Airport" style="text-align: right;"> |
303 | <b>Certificate Type</b> | 303 | <b>Certificate Type</b> |
304 | </div> | 304 | </div> |
305 | <div class="col-md-3 Airport"> | 305 | <div class="col-md-3 Airport"> |
306 | <select required class="form-control" ng-model="data.certificateType"> | 306 | <select required class="form-control" ng-model="data.certificateType"> |
307 | <option value="" disabled selected hidden>Select...</option> | 307 | <option value="" disabled selected hidden>Select...</option> |
308 | <option value="corporate">Part 91 (Corporate)</option> | 308 | <option value="corporate">Part 91 (Corporate)</option> |
309 | <option value="charter">Part 135 (Charter)</option> | 309 | <option value="charter">Part 135 (Charter)</option> |
310 | <option value="scheduled">Part 121 (Scheduled)</option> | 310 | <option value="scheduled">Part 121 (Scheduled)</option> |
311 | <option value="military">Military</option> | 311 | <option value="military">Military</option> |
312 | <option value="government">Government</option> | 312 | <option value="government">Government</option> |
313 | </select> | 313 | </select> |
314 | </div> | 314 | </div> |
315 | <div class="clearfix"></div> | 315 | <div class="clearfix"></div> |
316 | </div> | 316 | </div> |
317 | <div class="clearfix"></div> | 317 | <div class="clearfix"></div> |
318 | <br/> | 318 | <br/> |
319 | <div class="col-xs-12"> | 319 | <div class="col-xs-12"> |
320 | <div class="col-md-6"> | 320 | <div class="col-md-6"> |
321 | <div class="pull-left" style="width: 110px;"> | 321 | <div class="pull-left" style="width: 110px;"> |
322 | <b>JET A Margin *</b> | 322 | <b>JET A Margin *</b> |
323 | </div> | 323 | </div> |
324 | <div class="pull-left"> | 324 | <div class="pull-left"> |
325 | <select class="form-control marginSelectBox" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in jetMarginList" required ng-change="removeMarginValidation()"> | 325 | <select class="form-control marginSelectBox" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in jetMarginList" required ng-change="removeMarginValidation()"> |
326 | <option value="" disabled>Select...</option> | 326 | <option value="" disabled>Select...</option> |
327 | </select> | 327 | </select> |
328 | <label ng-show="showMarginError" class="customErrorMessage">This field is required.</label> | 328 | <label ng-show="showMarginError" class="customErrorMessage">This field is required.</label> |
329 | 329 | ||
330 | <div class="clearfix"></div> | 330 | <div class="clearfix"></div> |
331 | </div> | 331 | </div> |
332 | </div> | 332 | </div> |
333 | 333 | ||
334 | <div class="col-md-3 Airport" style="text-align: right;"> | 334 | <div class="col-md-3 Airport" style="text-align: right;"> |
335 | <b>AVGAS 100LL Margin</b> | 335 | <b>AVGAS 100LL Margin</b> |
336 | </div> | 336 | </div> |
337 | <div class="col-md-3 Airport"> | 337 | <div class="col-md-3 Airport"> |
338 | <select class="form-control" ng-model="data.avgasMargin" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> | 338 | <select class="form-control" ng-model="data.avgasMargin" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> |
339 | <option value="" disabled>Select...</option> | 339 | <option value="" disabled>Select...</option> |
340 | </select> | 340 | </select> |
341 | </div> | 341 | </div> |
342 | <div class="clearfix"></div> | 342 | <div class="clearfix"></div> |
343 | </div> | 343 | </div> |
344 | <div class="clearfix"></div> | 344 | <div class="clearfix"></div> |
345 | <br/> | 345 | <br/> |
346 | <div class="col-xs-12"> | 346 | <div class="col-xs-12"> |
347 | <div class="col-md-12"> | 347 | <div class="col-md-12"> |
348 | <div class="pull-left" style="width: 110px;"> | 348 | <div class="pull-left" style="width: 110px;"> |
349 | <label class="new-input-label"><b>Address</b></label> | 349 | <label class="new-input-label"><b>Address</b></label> |
350 | </div> | 350 | </div> |
351 | <div class="pull-left" style="width: calc(100% - 110px);"> | 351 | <div class="pull-left" style="width: calc(100% - 110px);"> |
352 | <input type="text" class="form-control" ng-model="data.addressOne" placeholder=""> | 352 | <input type="text" class="form-control" ng-model="data.addressOne" placeholder=""> |
353 | </div> | 353 | </div> |
354 | <div class="clearfix"></div> | 354 | <div class="clearfix"></div> |
355 | </div> | 355 | </div> |
356 | </div> | 356 | </div> |
357 | <div class="clearfix"></div> | 357 | <div class="clearfix"></div> |
358 | <br/> | 358 | <br/> |
359 | <div class="col-xs-12"> | 359 | <div class="col-xs-12"> |
360 | <div class="col-md-12"> | 360 | <div class="col-md-12"> |
361 | <div class="pull-left" style="width: 110px;"> | 361 | <div class="pull-left" style="width: 110px;"> |
362 | <label class="new-input-label"><b>Address2</b></label> | 362 | <label class="new-input-label"><b>Address2</b></label> |
363 | </div> | 363 | </div> |
364 | <div class="pull-left" style="width: calc(100% - 110px);"> | 364 | <div class="pull-left" style="width: calc(100% - 110px);"> |
365 | <input type="text" ng-model="data.addressTwo" class="form-control" placeholder=""> | 365 | <input type="text" ng-model="data.addressTwo" class="form-control" placeholder=""> |
366 | </div> | 366 | </div> |
367 | <div class="clearfix"></div> | 367 | <div class="clearfix"></div> |
368 | </div> | 368 | </div> |
369 | </div> | 369 | </div> |
370 | <div class="clearfix"></div> | 370 | <div class="clearfix"></div> |
371 | <br/> | 371 | <br/> |
372 | <div class="col-xs-12"> | 372 | <div class="col-xs-12"> |
373 | 373 | ||
374 | <div class="col-md-6"> | 374 | <div class="col-md-6"> |
375 | <div class="pull-left" style="width: 110px;"> | 375 | <div class="pull-left" style="width: 110px;"> |
376 | <label class="new-input-label"><b>City</b></label> | 376 | <label class="new-input-label"><b>City</b></label> |
377 | </div> | 377 | </div> |
378 | <div class="pull-left" style="width: calc(100% - 110px);"> | 378 | <div class="pull-left" style="width: calc(100% - 110px);"> |
379 | <input type="text" ng-model="data.city" class="form-control" placeholder=""> | 379 | <input type="text" ng-model="data.city" class="form-control" placeholder=""> |
380 | </div> | 380 | </div> |
381 | <div class="clearfix"></div> | 381 | <div class="clearfix"></div> |
382 | </div> | 382 | </div> |
383 | <div class="col-md-3"> | 383 | <div class="col-md-3"> |
384 | <div class="pull-left" style="width: 40px;"> | 384 | <div class="pull-left" style="width: 40px;"> |
385 | <label class="new-input-label"><b>State</b></label> | 385 | <label class="new-input-label"><b>State</b></label> |
386 | </div> | 386 | </div> |
387 | <div class="pull-left" style="width: calc(100% - 110px);"> | 387 | <div class="pull-left" style="width: calc(100% - 110px);"> |
388 | <input type="text" ng-model="data.state" class="form-control" placeholder=""> | 388 | <input type="text" ng-model="data.state" class="form-control" placeholder=""> |
389 | </div> | 389 | </div> |
390 | <div class="clearfix"></div> | 390 | <div class="clearfix"></div> |
391 | </div> | 391 | </div> |
392 | <div class="col-md-3"> | 392 | <div class="col-md-3"> |
393 | <div class="pull-left"> | 393 | <div class="pull-left"> |
394 | <label class="new-input-label"><b>Zip Code</b></label> | 394 | <label class="new-input-label"><b>Zip Code</b></label> |
395 | </div> | 395 | </div> |
396 | <div class="pull-right" style="width: calc(100% - 60px);"> | 396 | <div class="pull-right" style="width: calc(100% - 60px);"> |
397 | <input type="tel" ng-model="data.zipcode" class="form-control" placeholder=""> | 397 | <input type="tel" ng-model="data.zipcode" class="form-control" placeholder=""> |
398 | </div> | 398 | </div> |
399 | <div class="clearfix"></div> | 399 | <div class="clearfix"></div> |
400 | </div> | 400 | </div> |
401 | </div> | 401 | </div> |
402 | <div class="clearfix"></div> | 402 | <div class="clearfix"></div> |
403 | <br/> | 403 | <br/> |
404 | <div class="col-xs-12"> | 404 | <div class="col-xs-12"> |
405 | 405 | ||
406 | <div class="col-md-6"> | 406 | <div class="col-md-6"> |
407 | <div class="pull-left" style="width: 110px;"> | 407 | <div class="pull-left" style="width: 110px;"> |
408 | <label class="new-input-label"><b>Country</b></label> | 408 | <label class="new-input-label"><b>Country</b></label> |
409 | </div> | 409 | </div> |
410 | <div class="pull-left" style="width: calc(100% - 110px);"> | 410 | <div class="pull-left" style="width: calc(100% - 110px);"> |
411 | <input type="text" ng-model="data.country" class="form-control" placeholder=""> | 411 | <input type="text" ng-model="data.country" class="form-control" placeholder=""> |
412 | </div> | 412 | </div> |
413 | <div class="clearfix"></div> | 413 | <div class="clearfix"></div> |
414 | </div> | 414 | </div> |
415 | <div class="col-md-6"> | 415 | <div class="col-md-6"> |
416 | <div class="pull-left" style="width: 110px;"> | 416 | <div class="pull-left" style="width: 110px;"> |
417 | <label class="new-input-label"><b>Internal Note</b></label> | 417 | <label class="new-input-label"><b>Internal Note</b></label> |
418 | </div> | 418 | </div> |
419 | <div class="pull-left" style="width: calc(100% - 110px);"> | 419 | <div class="pull-left" style="width: calc(100% - 110px);"> |
420 | <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> | 420 | <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> |
421 | </div> | 421 | </div> |
422 | <div class="clearfix"></div> | 422 | <div class="clearfix"></div> |
423 | </div> | 423 | </div> |
424 | </div> | 424 | </div> |
425 | <div class="clearfix"></div> | 425 | <div class="clearfix"></div> |
426 | <!-- <br/> | 426 | <!-- <br/> |
427 | <div class="col-xs-12"> | 427 | <div class="col-xs-12"> |
428 | <div class="col-md-2 Airport"></div> | 428 | <div class="col-md-2 Airport"></div> |
429 | <div class="col-md-10 Airport"> | 429 | <div class="col-md-10 Airport"> |
430 | <div class="pull-right"> | 430 | <div class="pull-right"> |
431 | <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button> | 431 | <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button> |
432 | <button type="button" class="btn btn-warning" ng-click="addAircraft()">Next: Add Aircraft</button> | 432 | <button type="button" class="btn btn-warning" ng-click="addAircraft()">Next: Add Aircraft</button> |
433 | </div> | 433 | </div> |
434 | </div> | 434 | </div> |
435 | </div> --> | 435 | </div> --> |
436 | </div> | 436 | </div> |
437 | </div> | 437 | </div> |
438 | <div class="clearfix"></div> | 438 | <div class="clearfix"></div> |
439 | </div> | 439 | </div> |
440 | </div> | 440 | </div> |
441 | </div> | 441 | </div> |
442 | </div> | 442 | </div> |
443 | <div class="modal-body step-2" data-step="2" style="padding: 0;"> | 443 | <div class="modal-body step-2" data-step="2" style="padding: 0;"> |
444 | <div> | 444 | <div> |
445 | <div class="row" style="margin: 0;"> | 445 | <div class="row" style="margin: 0;"> |
446 | <div> | 446 | <div> |
447 | <div class="widget" style="margin-bottom: 0;"> | 447 | <div class="widget" style="margin-bottom: 0;"> |
448 | <div class="widget-header"> | 448 | <div class="widget-header"> |
449 | <i class="icon-pencil"></i> | 449 | <i class="icon-pencil"></i> |
450 | <i class="fa fa-tasks" aria-hidden="true"></i> | 450 | <i class="fa fa-tasks" aria-hidden="true"></i> |
451 | <h3>Add a New Company</h3> | 451 | <h3>Add a New Company</h3> |
452 | <div class="clearfix"></div> | 452 | <div class="clearfix"></div> |
453 | </div> | 453 | </div> |
454 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 454 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
455 | <div class="col-xs-12"> | 455 | <div class="col-xs-12"> |
456 | <div class="widget-header"> | 456 | <div class="widget-header"> |
457 | <i class="fa fa-list"></i> | 457 | <i class="fa fa-list"></i> |
458 | <h3>Aircraft List</h3> | 458 | <h3>Aircraft List</h3> |
459 | </div> | 459 | </div> |
460 | <div class="widget-content" style="padding:0px;border: 0px; "> | 460 | <div class="widget-content" style="padding:0px;border: 0px; "> |
461 | <div class="table-responsive"> | 461 | <div class="table-responsive"> |
462 | <!-- <table class="table table-bordered table-hover table-striped addRow" style="margin-bottom: 0px;"> | 462 | <!-- <table class="table table-bordered table-hover table-striped addRow" style="margin-bottom: 0px;"> |
463 | <thead> | 463 | <thead> |
464 | <tr> | 464 | <tr> |
465 | <th>Tail</th> | 465 | <th>Tail</th> |
466 | <th>Make</th> | 466 | <th>Make</th> |
467 | <th>Model</th> | 467 | <th>Model</th> |
468 | <th>Size</th> | 468 | <th>Size</th> |
469 | <th>Margin</th> | 469 | <th>Margin</th> |
470 | </tr> | 470 | </tr> |
471 | </thead> | 471 | </thead> |
472 | <tbody> | 472 | <tbody> |
473 | <tr> | 473 | <tr> |
474 | <td> | 474 | <td> |
475 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | 475 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> |
476 | </td> | 476 | </td> |
477 | <td style="width: 25%;"> | 477 | <td style="width: 25%;"> |
478 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | 478 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> |
479 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 479 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
480 | </select> | 480 | </select> |
481 | </td> | 481 | </td> |
482 | <td style="width: 20%;"> | 482 | <td style="width: 20%;"> |
483 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | 483 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> |
484 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | 484 | <option ng-repeat="model in aircraftModalList">{{model}}</option> |
485 | </select> | 485 | </select> |
486 | </td> | 486 | </td> |
487 | <td style="width: 25%;"> | 487 | <td style="width: 25%;"> |
488 | <select class="form-control" ng-model="aircraft.size"> | 488 | <select class="form-control" ng-model="aircraft.size"> |
489 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> | 489 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> |
490 | </select> | 490 | </select> |
491 | </td> | 491 | </td> |
492 | <td> | 492 | <td> |
493 | <select class="form-control"> | 493 | <select class="form-control"> |
494 | <option>Margin1</option> | 494 | <option>Margin1</option> |
495 | <option>Margin2</option> | 495 | <option>Margin2</option> |
496 | </select> | 496 | </select> |
497 | </td> | 497 | </td> |
498 | </tr> | 498 | </tr> |
499 | </tbody> | 499 | </tbody> |
500 | 500 | ||
501 | </table> --> | 501 | </table> --> |
502 | <table class="table table-striped table-bordered"> | 502 | <table class="table table-striped table-bordered"> |
503 | <thead> | 503 | <thead> |
504 | <tr> | 504 | <tr> |
505 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | 505 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> |
506 | <th>Tail</th> | 506 | <th>Tail</th> |
507 | <th>Make</th> | 507 | <th>Make</th> |
508 | <th>Model</th> | 508 | <th>Model</th> |
509 | <th>Size</th> | 509 | <th>Size</th> |
510 | <th>JET A Margin</th> | 510 | <th>JET A Margin</th> |
511 | <th>AVGS 100LL Margin</th> | 511 | <th>AVGS 100LL Margin</th> |
512 | </tr> | 512 | </tr> |
513 | </thead> | 513 | </thead> |
514 | <tbody> | 514 | <tbody> |
515 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | 515 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> |
516 | <!-- <td> | 516 | <!-- <td> |
517 | <input type="checkbox" ng-model="aircraftData.selected"/> | 517 | <input type="checkbox" ng-model="aircraftData.selected"/> |
518 | </td> --> | 518 | </td> --> |
519 | <td style="width: 15%"> | 519 | <td style="width: 15%"> |
520 | <input type="text" class="form-control" ng-model="aircraftData.tail" required/> | 520 | <input type="text" class="form-control" ng-model="aircraftData.tail" required/> |
521 | </td> | 521 | </td> |
522 | <td style="width: 17%"> | 522 | <td style="width: 17%"> |
523 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | 523 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> |
524 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | 524 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
525 | <option value="" disabled>Select...</option> | 525 | <option value="" disabled>Select...</option> |
526 | </select> | 526 | </select> |
527 | </td> | 527 | </td> |
528 | <td style="width: 17%"> | 528 | <td style="width: 17%"> |
529 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | 529 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> |
530 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> | 530 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> |
531 | <option value="" disabled>Select...</option> | 531 | <option value="" disabled>Select...</option> |
532 | </select> | 532 | </select> |
533 | </td> | 533 | </td> |
534 | <td style="width: 17%"> | 534 | <td style="width: 17%"> |
535 | <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"> | 535 | <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"> |
536 | <option value="" disabled>Select...</option> | 536 | <option value="" disabled>Select...</option> |
537 | </select> | 537 | </select> |
538 | <!-- <select class="form-control" ng-model="aircraftData.size"> | 538 | <!-- <select class="form-control" ng-model="aircraftData.size"> |
539 | <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | 539 | <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> |
540 | </select> --> | 540 | </select> --> |
541 | </td> | 541 | </td> |
542 | <td style="width: 17%"> | 542 | <td style="width: 17%"> |
543 | <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in jetMarginList"> | 543 | <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in jetMarginList"> |
544 | <option value="" disabled>Select...</option> | 544 | <option value="" disabled>Select...</option> |
545 | </select> | 545 | </select> |
546 | </td> | 546 | </td> |
547 | <td style="width: 17%"> | 547 | <td style="width: 17%"> |
548 | <select class="form-control marginSelectBox" ng-model="aircraftData.avgasMarginId" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> | 548 | <select class="form-control marginSelectBox" ng-model="aircraftData.avgasMarginId" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> |
549 | <option value="" disabled>Select...</option> | 549 | <option value="" disabled>Select...</option> |
550 | </select> | 550 | </select> |
551 | </td> | 551 | </td> |
552 | </tr> | 552 | </tr> |
553 | </tbody> | 553 | </tbody> |
554 | </table> | 554 | </table> |
555 | </div> | 555 | </div> |
556 | <div class="clearfix"></div> | 556 | <div class="clearfix"></div> |
557 | </div> | 557 | </div> |
558 | </div> | 558 | </div> |
559 | <div class="clearfix"></div> | 559 | <div class="clearfix"></div> |
560 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | 560 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> |
561 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | 561 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> |
562 | </div> | 562 | </div> |
563 | <!-- <div class="col-xs-12" style="margin-bottom: 20px;"> | 563 | <!-- <div class="col-xs-12" style="margin-bottom: 20px;"> |
564 | <div class="pull-right"> | 564 | <div class="pull-right"> |
565 | <button type="button" class="btn btn-default" ng-click="cancelCraft()">Cancel</button> | 565 | <button type="button" class="btn btn-default" ng-click="cancelCraft()">Cancel</button> |
566 | <button type="button" class="btn btn-warning" ng-click="goBack()">Go Back</button> | 566 | <button type="button" class="btn btn-warning" ng-click="goBack()">Go Back</button> |
567 | <button type="button" class="btn btn-success" ng-click="goBack()">Save</button> | 567 | <button type="button" class="btn btn-success" ng-click="goBack()">Save</button> |
568 | </div> | 568 | </div> |
569 | </div> --> | 569 | </div> --> |
570 | </div> | 570 | </div> |
571 | </div> | 571 | </div> |
572 | <div class="clearfix"></div> | 572 | <div class="clearfix"></div> |
573 | </div> | 573 | </div> |
574 | </div> | 574 | </div> |
575 | </div> | 575 | </div> |
576 | </div> | 576 | </div> |
577 | <!-- <div class="modal-body step-3" data-step="3"> | 577 | <!-- <div class="modal-body step-3" data-step="3"> |
578 | This is the final step. | 578 | This is the final step. |
579 | </div> --> | 579 | </div> --> |
580 | <div class="modal-footer" style="border-top: 0;"> | 580 | <div class="modal-footer" style="border-top: 0;"> |
581 | <button type="button" class="btn btn-default" ng-click="reset2()" data-dismiss="modal">Cancel</button> | 581 | <button type="button" class="btn btn-default" ng-click="reset2()" data-dismiss="modal">Cancel</button> |
582 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#demo-modal-3', 2)">Next: Add Aircraft</button> | 582 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#demo-modal-3', 2)">Next: Add Aircraft</button> |
583 | <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Go Back</button> | 583 | <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Go Back</button> |
584 | <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button> --> | 584 | <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button> --> |
585 | <button type="button" class="btn btn-success step step-2" data-step="2" ng-click="saveCompanyData()">Save</button> | 585 | <button type="button" class="btn btn-success step step-2" data-step="2" ng-click="saveCompanyData()">Save</button> |
586 | </div> | 586 | </div> |
587 | </div> | 587 | </div> |
588 | </div> | 588 | </div> |
589 | </form> | 589 | </form> |
590 | <div class="myLoader" ng-show="showLoader"> | 590 | <div class="myLoader" ng-show="showLoader"> |
591 | <img src="../img/hourglass.gif" width="50px;"> | 591 | <img src="../img/hourglass.gif" width="50px;"> |
592 | </div> | 592 | </div> |
593 | <script src="js/multi-step-modal.js"></script> | 593 | <script src="js/multi-step-modal.js"></script> |
594 | <script> | 594 | <script> |
595 | sendEvent = function(sel, step) { | 595 | sendEvent = function(sel, step) { |
596 | $(sel).trigger('next.m.' + step); | 596 | $(sel).trigger('next.m.' + step); |
597 | } | 597 | } |
598 | </script> | 598 | </script> |
599 | 599 |
app/partials/customers/customers.service.js
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | .service('CustomersService', ['$q', '$http', 'BASE_URL', CustomersService]); | 4 | .service('CustomersService', ['$q', '$http', 'BASE_URL', CustomersService]); |
5 | 5 | ||
6 | function CustomersService($q, $http, BASE_URL) { | 6 | function CustomersService($q, $http, BASE_URL) { |
7 | 7 | ||
8 | this.getAllCompanies = function() { | 8 | this.getAllCompanies = function() { |
9 | 9 | ||
10 | var deferred = $q.defer(); | 10 | var deferred = $q.defer(); |
11 | $http({ | 11 | $http({ |
12 | method : 'GET', | 12 | method : 'GET', |
13 | url : BASE_URL.url +'/user/allCompanies', | 13 | url : BASE_URL.url +'/user/allCompanies', |
14 | headers : {'Content-Type': 'application/json'}, | 14 | headers : {'Content-Type': 'application/json'}, |
15 | }) | 15 | }) |
16 | .then(function (result){ | 16 | .then(function (result){ |
17 | deferred.resolve(result.data); | 17 | deferred.resolve(result.data); |
18 | },function (result){ | 18 | },function (result){ |
19 | deferred.resolve(result.data); | 19 | deferred.resolve(result.data); |
20 | }) | 20 | }) |
21 | return deferred.promise; | 21 | return deferred.promise; |
22 | } | 22 | } |
23 | 23 | ||
24 | this.getMargin = function() { | 24 | this.getMargin = function() { |
25 | 25 | ||
26 | var deferred = $q.defer(); | 26 | var deferred = $q.defer(); |
27 | $http({ | 27 | $http({ |
28 | method : 'GET', | 28 | method : 'GET', |
29 | url : BASE_URL.url +'/user/margins', | 29 | url : BASE_URL.url +'/user/margins', |
30 | headers : {'Content-Type': 'application/json'}, | 30 | headers : {'Content-Type': 'application/json'}, |
31 | }) | 31 | }) |
32 | .then(function (result){ | 32 | .then(function (result){ |
33 | deferred.resolve(result.data); | 33 | deferred.resolve(result.data); |
34 | },function (result){ | 34 | },function (result){ |
35 | deferred.resolve(result.data); | 35 | deferred.resolve(result.data); |
36 | }) | 36 | }) |
37 | return deferred.promise; | 37 | return deferred.promise; |
38 | } | 38 | } |
39 | 39 | ||
40 | this.getJetMargin = function(id){ | 40 | this.getJetMargin = function(id){ |
41 | var deferred = $q.defer(); | 41 | var deferred = $q.defer(); |
42 | $http({ | 42 | $http({ |
43 | method : 'GET', | 43 | method : 'GET', |
44 | url : BASE_URL.url +'/margin/getJetAType/'+id, | 44 | url : BASE_URL.url +'/margin/getJetAType/'+id, |
45 | headers : {'Content-Type': 'application/json'}, | 45 | headers : {'Content-Type': 'application/json'}, |
46 | }) | 46 | }) |
47 | .then(function (result){ | 47 | .then(function (result){ |
48 | deferred.resolve(result.data); | 48 | deferred.resolve(result.data); |
49 | },function (result){ | 49 | },function (result){ |
50 | deferred.resolve(result.data); | 50 | deferred.resolve(result.data); |
51 | }) | 51 | }) |
52 | return deferred.promise; | 52 | return deferred.promise; |
53 | } | 53 | } |
54 | 54 | ||
55 | this.getAvgMargin = function(id){ | 55 | this.getAvgMargin = function(id){ |
56 | var deferred = $q.defer(); | 56 | var deferred = $q.defer(); |
57 | $http({ | 57 | $http({ |
58 | method : 'GET', | 58 | method : 'GET', |
59 | url : BASE_URL.url +'/margin/getAVGASType/'+id, | 59 | url : BASE_URL.url +'/margin/getAVGASType/'+id, |
60 | headers : {'Content-Type': 'application/json'}, | 60 | headers : {'Content-Type': 'application/json'}, |
61 | }) | 61 | }) |
62 | .then(function (result){ | 62 | .then(function (result){ |
63 | deferred.resolve(result.data); | 63 | deferred.resolve(result.data); |
64 | },function (result){ | 64 | },function (result){ |
65 | deferred.resolve(result.data); | 65 | deferred.resolve(result.data); |
66 | }) | 66 | }) |
67 | return deferred.promise; | 67 | return deferred.promise; |
68 | } | 68 | } |
69 | 69 | ||
70 | this.addCompany = function(data) { | 70 | this.addCompany = function(data) { |
71 | 71 | ||
72 | var deferred = $q.defer(); | 72 | var deferred = $q.defer(); |
73 | $http({ | 73 | $http({ |
74 | method : 'POST', | 74 | method : 'POST', |
75 | url : BASE_URL.url +'/company', | 75 | url : BASE_URL.url +'/company', |
76 | headers : {'Content-Type': 'application/json'}, | 76 | headers : {'Content-Type': 'application/json'}, |
77 | data: data | 77 | data: data |
78 | }) | 78 | }) |
79 | .then(function (result){ | 79 | .then(function (result){ |
80 | deferred.resolve(result.data); | 80 | deferred.resolve(result.data); |
81 | },function (result){ | 81 | },function (result){ |
82 | deferred.resolve(result.data); | 82 | deferred.resolve(result.data); |
83 | }) | 83 | }) |
84 | return deferred.promise; | 84 | return deferred.promise; |
85 | } | 85 | } |
86 | 86 | ||
87 | this.getAircraftMake = function(){ | 87 | this.getAircraftMake = function(){ |
88 | var deferred = $q.defer(); | 88 | var deferred = $q.defer(); |
89 | $http({ | 89 | $http({ |
90 | method : 'GET', | 90 | method : 'GET', |
91 | url : BASE_URL.url +'/fuelerlinx/acufuel/getAircraftMake', | 91 | url : BASE_URL.url +'/fuelerlinx/acufuel/getAircraftMake', |
92 | headers : {'Content-Type': 'application/json'}, | 92 | headers : {'Content-Type': 'application/json'}, |
93 | }) | 93 | }) |
94 | .then(function (result){ | 94 | .then(function (result){ |
95 | deferred.resolve(result.data); | 95 | deferred.resolve(result.data); |
96 | },function (result){ | 96 | },function (result){ |
97 | console.log(result) | 97 | console.log(result) |
98 | deferred.resolve(result.data); | 98 | deferred.resolve(result.data); |
99 | }) | 99 | }) |
100 | return deferred.promise; | 100 | return deferred.promise; |
101 | } | 101 | } |
102 | 102 | ||
103 | this.getAircraftSize = function(makeId, modelId){ | 103 | this.getAircraftSize = function(makeId, modelId){ |
104 | var deferred = $q.defer(); | 104 | var deferred = $q.defer(); |
105 | $http({ | 105 | $http({ |
106 | method : 'GET', | 106 | method : 'GET', |
107 | url : BASE_URL.url +'/fuelerlinx/acufuel/getAircraftSize/' +makeId + '/' +modelId, | 107 | url : BASE_URL.url +'/fuelerlinx/acufuel/getAircraftSize/' +makeId + '/' +modelId, |
108 | headers : {'Content-Type': 'application/json'}, | 108 | headers : {'Content-Type': 'application/json'}, |
109 | }) | 109 | }) |
110 | .then(function (result){ | 110 | .then(function (result){ |
111 | deferred.resolve(result.data); | 111 | deferred.resolve(result.data); |
112 | },function (result){ | 112 | },function (result){ |
113 | console.log(result) | 113 | console.log(result) |
114 | deferred.resolve(result.data); | 114 | deferred.resolve(result.data); |
115 | }) | 115 | }) |
116 | return deferred.promise; | 116 | return deferred.promise; |
117 | } | 117 | } |
118 | 118 | ||
119 | this.getModal = function(id){ | 119 | this.getModal = function(id){ |
120 | var deferred = $q.defer(); | 120 | var deferred = $q.defer(); |
121 | $http({ | 121 | $http({ |
122 | method : 'GET', | 122 | method : 'GET', |
123 | url : BASE_URL.url +'/fuelerlinx/acufuel/getAircraftModel/' + id, | 123 | url : BASE_URL.url +'/fuelerlinx/acufuel/getAircraftModel/' + id, |
124 | headers : {'Content-Type': 'application/json'}, | 124 | headers : {'Content-Type': 'application/json'}, |
125 | }) | 125 | }) |
126 | .then(function (result){ | 126 | .then(function (result){ |
127 | deferred.resolve(result.data); | 127 | deferred.resolve(result.data); |
128 | },function (result){ | 128 | },function (result){ |
129 | console.log(result) | 129 | console.log(result) |
130 | deferred.resolve(result.data); | 130 | deferred.resolve(result.data); |
131 | }) | 131 | }) |
132 | return deferred.promise; | 132 | return deferred.promise; |
133 | } | 133 | } |
134 | 134 | ||
135 | this.addAircraft = function(data){ | 135 | this.addAircraft = function(data){ |
136 | var deferred = $q.defer(); | 136 | var deferred = $q.defer(); |
137 | $http({ | 137 | $http({ |
138 | method : 'POST', | 138 | method : 'POST', |
139 | url : BASE_URL.url +'/company/add/aircrafts', | 139 | url : BASE_URL.url +'/company/add/aircrafts', |
140 | headers : {'Content-Type': 'application/json'}, | 140 | headers : {'Content-Type': 'application/json'}, |
141 | data: data | 141 | data: data |
142 | }) | 142 | }) |
143 | .then(function (result){ | 143 | .then(function (result){ |
144 | deferred.resolve(result.data); | 144 | deferred.resolve(result.data); |
145 | },function (result){ | 145 | },function (result){ |
146 | console.log(result) | 146 | console.log(result) |
147 | deferred.resolve(result.data); | 147 | deferred.resolve(result.data); |
148 | }) | 148 | }) |
149 | return deferred.promise; | 149 | return deferred.promise; |
150 | } | 150 | } |
151 | |||
152 | 151 | ||
152 | this.exportCompany = function(){ | ||
153 | var deferred = $q.defer(); | ||
154 | $http({ | ||
155 | method : 'GET', | ||
156 | url : BASE_URL.url +'/company/export' | ||
157 | }) | ||
158 | .then(function (result){ | ||
159 | deferred.resolve(result.data); | ||
160 | },function (result){ | ||
161 | console.log(result) | ||
162 | deferred.resolve(result.data); | ||
163 | }) | ||
164 | return deferred.promise; | ||
165 | } | ||
153 | 166 | ||
154 | } | 167 | } |
155 | 168 |