Commit 3a9f4472b736929dd12f5dc4056ee53ad728a8a5

Authored by Rishav
1 parent 05c2f6fb3b
Exists in master

Implement contact, status, edit and other apis

app/css/custom.css
... ... @@ -606,7 +606,7 @@ font-size: 10px !important;
606 606 left: 0;
607 607 width: 100%;
608 608 height: 100%;
609   - z-index: 999;
  609 + z-index: 999999999;
610 610 display: none;
611 611 }
612 612 .customConfirmPopBackdrop .customModalInner{
... ...
... ... @@ -126,6 +126,7 @@
126 126 <script src="partials/pricingcontact/pricingcontact.controller.js"></script>
127 127 <script src="partials/viewcontact/viewcontact.controller.js"></script>
128 128 <script src="partials/viewFuelVendor/viewFuelVendor.controller.js"></script>
  129 + <script src="partials/accountSetting/accountSetting.Controller.js"></script>
129 130  
130 131 <script src="partials/main/main.controller.js"></script>
131 132 <div ui-view></div>
... ... @@ -160,6 +161,7 @@
160 161 <script src="partials/pricingcontact/pricingcontact.service.js"></script>
161 162 <script src="partials/viewcontact/viewcontact.service.js"></script>
162 163 <script src="partials/viewFuelVendor/viewFuelVendor.service.js"></script>
  164 + <script src="partials/accountSetting/accountSetting.Service.js"></script>
163 165  
164 166 <script src="partials/main/main.service.js"></script>
165 167 </body>
... ...
... ... @@ -82,6 +82,13 @@
82 82 templateUrl: "partials/customers/customers.html",
83 83 controller: "customersController"
84 84 })
  85 +
  86 + .state("app.accountSetting", {
  87 + url: "/accountSetting",
  88 + templateUrl: "partials/accountSetting/accountSetting.html",
  89 + controller: "AccountSettingController"
  90 + })
  91 +
85 92 .state("app.ContactView", {
86 93 url: "/ContactView",
87 94 templateUrl: "partials/ContactView/ContactView.html",
... ... @@ -105,7 +112,7 @@
105 112 controller: "accountController"
106 113 })
107 114  
108   - .state("app.dashboard", {
  115 + .state("app.dashboard", {
109 116 url: "/dashboard",
110 117 templateUrl: "partials/dashboard/dashboard.html",
111 118 controller: "dashboardController"
... ... @@ -117,13 +124,6 @@
117 124 controller: "elementsController"
118 125 })
119 126  
120   - .state("app.charts", {
121   - url: "/charts",
122   - templateUrl: "partials/charts/charts.html",
123   - controller: "chartsController"
124   - })
125   -
126   -
127 127 .state("app.error", {
128 128 url: "/error",
129 129 templateUrl: "partials/error/error.html",
... ... @@ -204,18 +204,19 @@
204 204 controller: "DispatchFuelController"
205 205 })
206 206  
207   - .state("app.searchDispatchFuel", {
  207 + .state("app.searchDispatchFuel", {
208 208 url: "/searchDispatchFuel",
209 209 templateUrl: "partials/searchDispatchFuel/searchDispatchFuel.html",
210 210 controller: "searchDispatchFuelController"
211 211 })
212 212  
213   - .state("app.Accept", {
  213 + .state("app.Accept", {
214 214 url: "/Accept",
215 215 templateUrl: "partials/Accept/Accept.html",
216 216 controller: "AcceptController"
217 217 })
218   - .state("app.delselected", {
  218 +
  219 + .state("app.delselected", {
219 220 url: "/delselected",
220 221 templateUrl: "partials/delselected/delselected.html",
221 222 controller: "delselectedController"
... ... @@ -227,7 +228,7 @@
227 228 controller: "pricingcontactController"
228 229 })
229 230  
230   - .state("app.viewContact", {
  231 + .state("app.viewContact", {
231 232 url: "/viewContact/:id",
232 233 templateUrl: "partials/viewcontact/viewcontact.html",
233 234 controller: "viewcontactController"
... ...
app/partials/FuelVendors/FuelVendors.controller.js
... ... @@ -3,9 +3,9 @@
3 3 //Load controller
4 4 angular.module('acufuel')
5 5  
6   - .controller('FuelVendorsController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'FuelVendorsService', 'CustomersService', FuelVendorsController]);
  6 + .controller('FuelVendorsController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'FuelVendorsService', 'CustomersService', 'ViewFuelVendorService', FuelVendorsController]);
7 7  
8   - function FuelVendorsController($scope, $rootScope, $uibModal, $filter, $http, FuelVendorsService, CustomersService) {
  8 + function FuelVendorsController($scope, $rootScope, $uibModal, $filter, $http, FuelVendorsService, CustomersService, ViewFuelVendorService) {
9 9  
10 10 $(document).ready(function() {
11 11 $('#example').DataTable();
... ... @@ -20,6 +20,9 @@
20 20 FuelVendorsService.getAllVendor().then(function(result) {
21 21 console.log(result)
22 22 $scope.vendorList = result;
  23 + for(var i=0; i<$scope.vendorList.length; i++){
  24 + $scope.vendorList[i].masterMargin = $scope.vendorList[i].margin.id;
  25 + }
23 26 })
24 27 }
25 28  
... ... @@ -32,13 +35,40 @@
32 35 })
33 36 })
34 37  
  38 + $scope.editMargin = function(vendor){
  39 + console.log(vendor.masterMargin)
  40 +
  41 + var companyMargin = "vendorName=" + vendor.vendorName + "&masterMargin=" + vendor.masterMargin
  42 + + "&addressOne=" + vendor.addressOne + "&addressTwo=" + vendor.addressTwo + "&city=" + vendor.city + "&state="
  43 + + vendor.state + "&country=" + vendor.country + "&zipcode=" + vendor.zipcode + "&internalNote="
  44 + + vendor.internalNote + "&certificateType=" + vendor.certificateType + "&baseTenant=" + vendor.baseTenant
  45 + + "&fuelerlinxvendor=" + vendor.fuelerlinxvendor + "&contractFuelVendor=" + vendor.contractFuelVendor
  46 + + "&activate=" + vendor.activate + "&baseIcao=" + vendor.baseIcao + "&vendorId=" + vendor.id;
  47 +
  48 + ViewFuelVendorService.updateContact(companyMargin).then(function(result) {
  49 + if(result != null && result.success){
  50 + toastr.success(''+result.success+'', {
  51 + closeButton: true
  52 + })
  53 + }else{
  54 + toastr.error(''+result.statusText+'', {
  55 + closeButton: true
  56 + })
  57 + }
  58 + })
  59 + }
  60 +
35 61 getData();
36 62 function getData(){
37 63 CustomersService.getAircraftMake().then(function(result) {
38 64 $scope.aircraftMakeList = result;
39 65 })
40 66 }
41   -
  67 +
  68 + CustomersService.getMargin().then(function(result) {
  69 + $scope.marginList = result;
  70 + })
  71 +
42 72 $scope.addFirstData = function(sel, step){
43 73 // console.log($scope.data)
44 74  
... ... @@ -62,7 +92,8 @@
62 92 'tail':'',
63 93 'make': '',
64 94 'model': '',
65   - 'sizeId' : ''
  95 + 'sizeId' : '',
  96 + 'marginId': $scope.data.masterMargin
66 97 }];
67 98  
68 99 $scope.addNew = function(){
... ... @@ -70,7 +101,8 @@
70 101 'tail':'',
71 102 'make': '',
72 103 'model': '',
73   - 'sizeId' : ''
  104 + 'sizeId' : '',
  105 + 'marginId': ''
74 106 });
75 107 console.log($scope.aircraftDetails)
76 108 };
... ... @@ -101,7 +133,8 @@
101 133 'tail': $scope.aircraftDetails[i].tail,
102 134 'make': $scope.aircraftDetails[i].make,
103 135 'model': $scope.aircraftDetails[i].model,
104   - 'sizeId' : $scope.aircraftDetails[i].sizeId
  136 + 'sizeId' : $scope.aircraftDetails[i].sizeId,
  137 + 'marginId': $scope.aircraftDetails[i].marginId
105 138 });
106 139 }
107 140 $scope.aircraftListData.aircraftList = $scope.addData;
... ...
app/partials/FuelVendors/FuelVendors.html
... ... @@ -147,10 +147,12 @@
147 147 </td>
148 148 <td class="font-company">{{vendor.source}}</td>
149 149 <td class="font-company">
150   - <select class="form-control" style="height:31px;">
  150 + <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>
  151 +
  152 + <!-- <select class="form-control" style="height:31px;">
151 153 <option>Margin1</option>
152 154 <option>Margin2</option>
153   - </select>
  155 + </select> -->
154 156 </td>
155 157 <td class="font-company">{{vendor.allIn}}</td>
156 158 </tr>
... ... @@ -353,13 +355,14 @@
353 355 <b>Master Margin</b>
354 356 </div>
355 357 <div class="pull-left">
356   - <select required class="form-control" style="max-width: 250px;" ng-model="data.masterMargin">
  358 + <!-- <select required class="form-control" style="max-width: 250px;" ng-model="data.masterMargin">
357 359 <option value="" disabled selected hidden>Select </option>
358 360 <option value="margin1">Margin1</option>
359 361 <option value="margin2">Margin2</option>
360 362 <option value="vendorsonly">Vendors Only</option>
361 363 <option value="margintenants">Margin Tenants</option>
362   - </select>
  364 + </select> -->
  365 + <select class="form-control" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList"></select>
363 366 </div>
364 367 <div class="clearfix"></div>
365 368 </div>
... ... @@ -544,6 +547,7 @@
544 547 <th>Make</th>
545 548 <th>Model</th>
546 549 <th>Size</th>
  550 + <th>Margin</th>
547 551 </tr>
548 552 </thead>
549 553 <tbody>
... ... @@ -570,6 +574,9 @@
570 574 <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option>
571 575 </select> -->
572 576 </td>
  577 + <td>
  578 + <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in marginList"></select>
  579 + </td>
573 580 </tr>
574 581 </tbody>
575 582 </table>
... ...
app/partials/accountSetting/accountSetting.Controller.js
... ... @@ -0,0 +1,15 @@
  1 +
  2 +(function() {
  3 + 'use strict'
  4 +
  5 + angular.module('acufuel')
  6 + .controller('AccountSettingController', [ '$scope', '$filter', '$rootScope', '$state', 'AccountSettingService', AccountSettingController]);
  7 +
  8 + function AccountSettingController($scope, $filter, $rootScope, $state, AccountSettingService) {
  9 +
  10 + AccountSettingService.getProducts().then(function(result) {
  11 +
  12 + })
  13 + }
  14 +})();
  15 +
... ...
app/partials/accountSetting/accountSetting.Service.js
... ... @@ -0,0 +1,27 @@
  1 +(function(){
  2 + 'use strict';
  3 + angular.module('acufuel')
  4 + .service('AccountSettingService', ['$rootScope', '$q', '$http', '$state', 'BASE_URL', AccountSettingService]);
  5 +
  6 + function AccountSettingService($rootScope, $q, $http, $state, BASE_URL) {
  7 +
  8 + this.getProducts = function(data) {
  9 +
  10 + var deferred = $q.defer();
  11 + $http({
  12 + method : 'GET',
  13 + url : BASE_URL.url +'/user/products',
  14 + headers : {'Content-Type': 'application/json'},
  15 + })
  16 + .then(function (result){
  17 + deferred.resolve(result.data);
  18 + },function (result){
  19 + //console.log(result.data)
  20 + deferred.resolve(result.data);
  21 + })
  22 + return deferred.promise;
  23 + }
  24 +
  25 + }
  26 +
  27 +})();
0 28 \ No newline at end of file
... ...
app/partials/accountSetting/accountSetting.html
... ... @@ -0,0 +1,95 @@
  1 +<div class="col-xs-12 col-md-11">
  2 + <div class="row" style="margin-left:0px">
  3 + <div class="col-md-5">
  4 + <div class="widget">
  5 + <div class="widget-header">
  6 + <i class="fa fa-user" aria-hidden="true"></i>
  7 + <h3>Account Sertting</h3>
  8 + </div>
  9 + <!-- /widget-header -->
  10 + <div class="widget-content">
  11 + <h3 style="color: #666;margin-left: 10px;">Castle & Cooke FBO</h3></br>
  12 + <form role="form">
  13 + <div class="col-sm-6">
  14 + <div class="form-group"><label>Username</label> <input type="email" placeholder="Username" ng-model="user.email" class="form-control"></div>
  15 + <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="user.firstName" class="form-control"></div>
  16 + <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="user.lastName" class="form-control"></div>
  17 + </div>
  18 +
  19 + <div class="col-sm-6">
  20 + <div class="form-group"><label>Password</label> <input type="password" ng-model="user.password" placeholder="Password" class="form-control"></div>
  21 + <div class="form-group"><label>Phone</label> <input type="number" ng-model="user.phone" placeholder="Phone" class="form-control"></div>
  22 + <div class="form-group"><label>Mobile</label> <input type="number" ng-model="user.mobile" placeholder="Mobile" class="form-control"></div>
  23 + </div>
  24 + <div class="col-xs-12">
  25 + <div class="col-xs-12">
  26 + <div class="form-group">
  27 + <div class="row">
  28 + <div class="col-md-5">
  29 + <label class="new-input-label"><b>Fuel Types Offered&nbsp;</b></label>
  30 + </div>
  31 + <div class="col-md-7">
  32 + <input type="checkbox" ng-model="data.baseTenant" name="vehicle" value="Bike"> Jet-A: Full Service<br>
  33 + <input type="checkbox" ng-model="data.fuelerlinxCustomer" name="vehicle" value="Car" checked> Jet-A: w/Additive<br>
  34 + <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> Jet-A: Self Service <br>
  35 + <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> 100LL: Full Service <br>
  36 + <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> 100LL: Self Service
  37 + </div>
  38 + </div>
  39 + </div>
  40 + </div>
  41 + </div>
  42 + </form>
  43 + </div>
  44 + <!-- /widget-content -->
  45 + </div>
  46 + <!-- /widget -->
  47 + </div>
  48 + <div class="col-md-7">
  49 + <div class="widget">
  50 + <div class="widget-header">
  51 + <i class="fa fa-tasks" aria-hidden="true"></i>
  52 + <h3>Additional User Accounts</h3>
  53 + <div class="pull-right">
  54 + <button type="submit" style="margin-top: 4px;margin-right: 9px;" data-toggle="modal" data-target="#vendor-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Contact</button>
  55 + </div>
  56 + <div class="clearfix"></div>
  57 + </div>
  58 + <!-- /widget-header -->
  59 + <div class="widget-content">
  60 + <div class="table-responsive">
  61 + <table class="table table-bordered table-hover table-striped">
  62 + <thead>
  63 + <tr>
  64 + <th></th>
  65 + <th>First Name</th>
  66 + <th>Last Name</th>
  67 + <th>Email Username</th>
  68 + <th>Password</th>
  69 + <th>Control</th>
  70 + </tr>
  71 + </thead>
  72 + <tbody>
  73 + <tr>
  74 + <td rowspan="2">1</td>
  75 + <td>Mark</td>
  76 + <td>Otto</td>
  77 + <td>otto@email.com</td>
  78 + <td>@otto</td>
  79 + <td><input id="toggle-one2" checked type="checkbox" data-size="mini" data-width="55" data-toggle="toggle" data-on="Active" data-off="Deactive"></td>
  80 + </tr>
  81 + </tbody>
  82 + </table>
  83 + </div>
  84 + </div>
  85 + <!-- /widget-content -->
  86 + </div>
  87 + <!-- /widget -->
  88 + </div>
  89 + <!-- /span6 -->
  90 + </div>
  91 + <!-- /widget -->
  92 +</div>
  93 +<!-- /container -->
  94 +<div class="clearfix"></div>
  95 +
... ...
app/partials/charts/charts.controller.js
... ... @@ -1,79 +0,0 @@
1   -
2   -'use strict';
3   -
4   - //Load controller
5   - angular.module('acufuel')
6   -
7   - .controller('chartsController', ['$scope',function($scope) {
8   -
9   - $scope.test = "Testing...";
10   -
11   - }]);
12   -
13   - $(function () {
14   -
15   - $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=us-population-density.json&callback=?', function (data) {
16   -
17   - // Make codes uppercase to match the map data
18   - $.each(data, function () {
19   - this.code = this.code.toUpperCase();
20   - });
21   -
22   - // Instanciate the map
23   - Highcharts.mapChart('containerNew', {
24   -
25   - chart: {
26   - borderWidth: 1
27   - },
28   -
29   - title: {
30   - text: 'US population density (/kmยฒ)'
31   - },
32   -
33   - legend: {
34   - layout: 'horizontal',
35   - borderWidth: 0,
36   - backgroundColor: 'rgba(255,255,255,0.85)',
37   - floating: true,
38   - verticalAlign: 'top',
39   - y: 25
40   - },
41   -
42   - mapNavigation: {
43   - enabled: true
44   - },
45   -
46   - colorAxis: {
47   - min: 1,
48   - type: 'logarithmic',
49   - minColor: '#EEEEFF',
50   - maxColor: '#000022',
51   - stops: [
52   - [0, '#EFEFFF'],
53   - [0.67, '#4444FF'],
54   - [1, '#000022']
55   - ]
56   - },
57   -
58   - series: [{
59   - animation: {
60   - duration: 1000
61   - },
62   - data: data,
63   - mapData: Highcharts.maps['countries/us/us-all'],
64   - joinBy: ['postal-code', 'code'],
65   - dataLabels: {
66   - enabled: true,
67   - color: '#FFFFFF',
68   - format: '{point.code}'
69   - },
70   - name: 'Population density',
71   - tooltip: {
72   - pointFormat: '{point.code}: {point.value}/kmยฒ'
73   - }
74   - }]
75   - });
76   - });
77   - });
78   -
79   -
app/partials/charts/charts.html
... ... @@ -1,130 +0,0 @@
1   -<style>
2   - .chart-holder {
3   - height: 325px;
4   - }
5   - .cirque-stats {
6   - text-align: center;
7   - }
8   - .cirque-stats .cirque-container {
9   - margin-top: 1.5em;
10   - margin-bottom: 1.5em;
11   - margin-right: 2em;
12   - margin-left: 2em;
13   - }
14   -</style>
15   -<div class="main">
16   - <div class="container">
17   - <div class="row">
18   - <div class="col-md-6">
19   - <div class="widget stacked">
20   - <div class="widget-header">
21   - <i class="icon-bar-chart"></i>
22   - <h3>Bar Chart</h3>
23   - </div>
24   - <!-- /widget-header -->
25   - <div class="widget-content">
26   - <div id="bar-chart" class="chart-holder"></div>
27   - <!-- /bar-chart -->
28   - </div>
29   - <!-- /widget-content -->
30   - </div>
31   - <!-- /widget -->
32   - </div>
33   - <!-- /.span6 -->
34   - <div class="col-md-6">
35   - <div class="widget stacked">
36   - <div class="widget-header">
37   - <i class="icon-bar-chart"></i>
38   - <h3>Cirque Stats</h3>
39   - </div>
40   - <!-- /widget-header -->
41   - <div class="widget-content">
42   - <div class="cirque-stats">
43   - <div class="ui-cirque" data-value="2875" data-total="3245" data-arc-color="#FF9900" data-label="ratio"></div>
44   - <div class="ui-cirque" data-value="13" data-arc-color="#222222"></div>
45   - <div class="ui-cirque" data-value="63" data-total="225" data-arc-color="#888888" data-label="ratio"></div>
46   - <div class="ui-cirque" data-value="40" data-arc-color="#222222"></div>
47   - <div class="ui-cirque" data-value="72" data-arc-color="#888888" data-label="ratio"></div>
48   - <div class="ui-cirque" data-value="57" data-arc-color="#FF9900"></div>
49   - </div>
50   - <!-- /.cirque-stats -->
51   - </div>
52   - <!-- /widget-content -->
53   - </div>
54   - <!-- /widget -->
55   - </div>
56   - <!-- /.span6 -->
57   - </div>
58   - <!-- /.row -->
59   - <div class="row">
60   - <div class="col-md-6">
61   - <div class="widget stacked">
62   - <div class="widget-header">
63   - <i class="icon-bar-chart"></i>
64   - <h3>Area Chart</h3>
65   - </div>
66   - <!-- /widget-header -->
67   - <div class="widget-content">
68   - <div id="containerNew" style="height: 500px; min-width: 310px; max-width: 600px; margin: 0 auto"></div>
69   - </div>
70   - <!-- /widget-content -->
71   - </div>
72   - <!-- /widget -->
73   - </div>
74   - <!-- /.span6 -->
75   - <div class="col-md-6">
76   - <div class="widget stacked">
77   - <div class="widget-header">
78   - <i class="icon-bar-chart"></i>
79   - <h3>Pie Chart</h3>
80   - </div>
81   - <!-- /widget-header -->
82   - <div class="widget-content">
83   - <div id="pie-chart" class="chart-holder"></div>
84   - <!-- /pie-chart -->
85   - </div>
86   - <!-- /widget-content -->
87   - </div>
88   - <!-- /widget -->
89   - </div>
90   - <!-- /span6 -->
91   - </div>
92   - <!-- /.row -->
93   - <div class="row">
94   - <div class="col-md-6">
95   - <div class="widget stacked">
96   - <div class="widget-header">
97   - <i class="icon-bar-chart"></i>
98   - <h3>Donut Chart</h3>
99   - </div>
100   - <!-- /widget-header -->
101   - <div class="widget-content">
102   - <div id="donut-chart" class="chart-holder"></div>
103   - <!-- /bar-chart -->
104   - </div>
105   - <!-- /widget-content -->
106   - </div>
107   - <!-- /widget -->
108   - </div>
109   - <!-- /span6 -->
110   - <div class="col-md-6">
111   - <div class="widget stacked">
112   - <div class="widget-header">
113   - <i class="icon-bar-chart"></i>
114   - <h3>Line Chart</h3>
115   - </div>
116   - <!-- /widget-header -->
117   - <div class="widget-content">
118   - <div id="line-chart" class="chart-holder"></div>
119   - <!-- /line-chart -->
120   - </div>
121   - <!-- /widget-content -->
122   - </div>
123   - <!-- /widget -->
124   - </div>
125   - <!-- /span6 -->
126   - </div>
127   - <!-- /row -->
128   - </div>
129   - <!-- /container -->
130   -</div>
131 0 \ No newline at end of file
app/partials/charts/charts.service.js
... ... @@ -1,13 +0,0 @@
1   -(function(){
2   - 'use strict';
3   - angular.module('acufuel')
4   - .service('chartsService', ['$q', '$http', 'BE', chartsService]);
5   -
6   - function chartsService($q, $http, BE) {
7   - var temp = {};
8   -
9   -
10   -
11   - }
12   -
13   -})();
14 0 \ No newline at end of file
app/partials/customers/customers.controller.js
... ... @@ -2,9 +2,9 @@
2 2  
3 3 //Load controller
4 4 angular.module('acufuel')
5   - .controller('customersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'CustomersService', customersController]);
  5 + .controller('customersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'CustomersService', 'ViewCompanyService', customersController]);
6 6  
7   - function customersController($scope, $rootScope, $uibModal, $filter, $http, CustomersService) {
  7 + function customersController($scope, $rootScope, $uibModal, $filter, $http, CustomersService, ViewCompanyService) {
8 8 $(document).ready(function() {
9 9 $('#example').DataTable();
10 10 });
... ... @@ -18,6 +18,9 @@
18 18 CustomersService.getAllCompanies().then(function(result) {
19 19 console.log(result)
20 20 $scope.companyList = result;
  21 + for(var i=0; i<$scope.companyList.length; i++){
  22 + $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id;
  23 + }
21 24 })
22 25 }
23 26  
... ... @@ -29,6 +32,29 @@
29 32 })
30 33 })
31 34  
  35 + $scope.editMargin = function(customer){
  36 + console.log(customer.masterMargin)
  37 +
  38 + var companyMargin = "companyName=" + customer.companyName + "&masterMargin=" + customer.masterMargin
  39 + + "&addressOne=" + customer.addressOne + "&addressTwo=" + customer.addressTwo + "&city=" + customer.city + "&state="
  40 + + customer.state + "&country=" + customer.country + "&zipcode=" + customer.zipcode + "&internalNote="
  41 + + customer.internalNote + "&certificateType=" + customer.certificateType + "&baseTenant=" + customer.baseTenant
  42 + + "&fuelerlinxCustomer=" + customer.fuelerlinxCustomer + "&contractFuelVendor=" + customer.contractFuelVendor
  43 + + "&activate=" + customer.activate + "&baseIcao=" + customer.baseIcao + "&companyId=" + customer.id;
  44 +
  45 + ViewCompanyService.updateContact(companyMargin).then(function(result) {
  46 + if(result != null && result.success){
  47 + toastr.success(''+result.success+'', {
  48 + closeButton: true
  49 + })
  50 + }else{
  51 + toastr.error(''+result.statusText+'', {
  52 + closeButton: true
  53 + })
  54 + }
  55 + })
  56 + }
  57 +
32 58  
33 59  
34 60 getData();
... ... @@ -37,31 +63,45 @@
37 63 $scope.aircraftMakeList = result;
38 64 })
39 65 }
40   -
  66 +
  67 + CustomersService.getMargin().then(function(result) {
  68 + $scope.marginList = result;
  69 + })
  70 +
41 71 $scope.addFirstData = function(sel, step){
42 72 // console.log($scope.data)
43   -
44   - var companyData = "companyName=" + $scope.data.companyName + "&masterMargin=" + $scope.data.masterMargin
45   - + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state="
46   - + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote="
47   - + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant
48   - + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor
49   - + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao;
50   -
51   - CustomersService.addCompany(companyData).then(function(result) {
52   - console.log(result)
53   - $scope.accountId = result;
54   - $scope.aircraft.accountId = $scope.accountId;
55   - })
56   - $(sel).trigger('next.m.' + step);
57   - getData();
  73 + if($scope.data.companyName == undefined){
  74 + toastr.error('Please enter Company Name', {
  75 + closeButton: true
  76 + })
  77 + }else if($scope.data.masterMargin == undefined){
  78 + toastr.error('Please select Master Margin', {
  79 + closeButton: true
  80 + })
  81 + }else{
  82 + var companyData = "companyName=" + $scope.data.companyName + "&masterMargin=" + $scope.data.masterMargin
  83 + + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state="
  84 + + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote="
  85 + + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant
  86 + + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor
  87 + + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao;
  88 +
  89 + CustomersService.addCompany(companyData).then(function(result) {
  90 + console.log(result)
  91 + $scope.accountId = result;
  92 + $scope.aircraft.accountId = $scope.accountId;
  93 + })
  94 + $(sel).trigger('next.m.' + step);
  95 + getData();
  96 + }
58 97 }
59 98  
60 99 $scope.aircraftDetails = [{
61 100 'tail':'',
62 101 'make': '',
63 102 'model': '',
64   - 'sizeId' : ''
  103 + 'sizeId' : '',
  104 + 'marginId': $scope.data.masterMargin
65 105 }];
66 106  
67 107 $scope.addNew = function(){
... ... @@ -69,7 +109,8 @@
69 109 'tail':'',
70 110 'make': '',
71 111 'model': '',
72   - 'sizeId' : ''
  112 + 'sizeId' : '',
  113 + 'marginId': ''
73 114 });
74 115 console.log($scope.aircraftDetails)
75 116 };
... ... @@ -99,7 +140,8 @@
99 140 'tail': $scope.aircraftDetails[i].tail,
100 141 'make': $scope.aircraftDetails[i].make,
101 142 'model': $scope.aircraftDetails[i].model,
102   - 'sizeId' : $scope.aircraftDetails[i].sizeId
  143 + 'sizeId' : $scope.aircraftDetails[i].sizeId,
  144 + 'marginId': $scope.aircraftDetails[i].marginId
103 145 });
104 146 }
105 147 $scope.aircraftListData.aircraftList = $scope.addData;
... ...
app/partials/customers/customers.html
... ... @@ -2,7 +2,74 @@
2 2 .subnavbar .mainnav > li:nth-child(3) > a{
3 3 color: #ff9900;
4 4 }
  5 +
  6 + .button1 {
  7 + display: inline-block;
  8 + height: 35px;
  9 + line-height: 35px;
  10 + padding-right: 15px;
  11 + padding-left: 50px;
  12 + position: relative;
  13 + background-color:rgb(41,127,184);
  14 + color:rgb(255,255,255);
  15 + text-decoration: none;
  16 + text-transform: uppercase;
  17 + letter-spacing: 1px;
  18 + margin-bottom: 15px;
  19 + border: 0;
  20 +
  21 +
  22 + border-radius: 5px;
  23 + -moz-border-radius: 5px;
  24 + -webkit-border-radius: 5px;
  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;
  27 + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true);
  28 +
  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);
  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)";
  33 + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true);
  34 + }
  35 +
  36 + .button1 span {
  37 + position: absolute;
  38 + left: 0;
  39 + top: 0;
  40 + width: 35px;
  41 + background-color:rgba(0,0,0,0.5);
  42 +
  43 + -webkit-border-top-left-radius: 5px;
  44 + -webkit-border-bottom-left-radius: 5px;
  45 + -moz-border-radius-topleft: 5px;
  46 + -moz-border-radius-bottomleft: 5px;
  47 + border-top-left-radius: 5px;
  48 + border-bottom-left-radius: 5px;
  49 + border-right: 1px solid rgba(0,0,0,0.15);
  50 + }
  51 +
  52 + .button1:hover span, .button1.active span {
  53 + background-color:rgb(0,102,26);
  54 + border-right: 1px solid rgba(0,0,0,0.3);
  55 + }
  56 +
  57 + .button1:active {
  58 + margin-top: 2px;
  59 + margin-bottom: 13px;
  60 +
  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);
  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)";
  65 + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true);
  66 + }
  67 +
  68 + .button1.turquoise {
  69 + background: #449d44;
  70 + }
5 71 </style>
  72 +
6 73 <div class="main">
7 74 <div class="container">
8 75 <div class="row">
... ... @@ -79,7 +146,7 @@
79 146 <td class="font-company">
80 147 <a style="color: #333; text-decoration: none;" href="#!/viewCompany/{{customer.id}}">{{customer.companyName}}</a>
81 148 </td>
82   - <td class="font-company">{{customer.Fleet}}</td>
  149 + <td class="font-company">{{customer.companyAircraftSize}}</td>
83 150 <td class="font-company">{{customer.phone}}</td>
84 151 <td class="font-company">{{customer.contact}}</td>
85 152 <td class="font-company">{{customer.baseIcao}}</td>
... ... @@ -88,10 +155,11 @@
88 155 <button type="button" ng-if="customer.activate == false" class="btn btn-warning btn-xs">InActive</button>
89 156 </td>
90 157 <td class="font-company">
91   - <select class="form-control" style="height:31px;">
  158 + <select class="form-control" ng-blur="editMargin(customer)" style="height:31px;" ng-model="customer.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList" required></select>
  159 + <!-- <select class="form-control" style="height:31px;">
92 160 <option>Margin1</option>
93 161 <option>Margin2</option>
94   - </select>
  162 + </select> -->
95 163 </td>
96 164 <td class="font-company">{{customer.allIn}}</td>
97 165 <td>
... ... @@ -170,7 +238,7 @@
170 238 <label class="new-input-label"><b>Company Name</b></label>
171 239 </div>
172 240 <div class="pull-left" style="margin-left: 15px;">
173   - <input type="text" ng-model="data.companyName" class="form-control" id="Address" placeholder="">
  241 + <input type="text" ng-model="data.companyName" class="form-control" id="Address" placeholder="" required>
174 242 </div>
175 243 <div class="clearfix"></div>
176 244 </div>
... ... @@ -207,13 +275,15 @@
207 275 <b>Master Margin</b>
208 276 </div>
209 277 <div class="pull-left">
210   - <select required class="form-control" style="max-width: 250px;" ng-model="data.masterMargin">
  278 + <select class="form-control" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList" required></select>
  279 +
  280 + <!-- <select required class="form-control" style="max-width: 250px;" ng-model="data.masterMargin">
211 281 <option value="" disabled selected hidden>Select </option>
212 282 <option value="margin1">Margin1</option>
213 283 <option value="margin2">Margin2</option>
214 284 <option value="vendorsonly">Vendors Only</option>
215 285 <option value="margintenants">Margin Tenants</option>
216   - </select>
  286 + </select> -->
217 287 </div>
218 288 <div class="clearfix"></div>
219 289 </div>
... ... @@ -398,6 +468,7 @@
398 468 <th>Make</th>
399 469 <th>Model</th>
400 470 <th>Size</th>
  471 + <th>Margin</th>
401 472 </tr>
402 473 </thead>
403 474 <tbody>
... ... @@ -424,6 +495,9 @@
424 495 <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option>
425 496 </select> -->
426 497 </td>
  498 + <td>
  499 + <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in marginList"></select>
  500 + </td>
427 501 </tr>
428 502 </tbody>
429 503 </table>
... ...
app/partials/customers/customers.service.js
... ... @@ -21,6 +21,22 @@
21 21 return deferred.promise;
22 22 }
23 23  
  24 + this.getMargin = function() {
  25 +
  26 + var deferred = $q.defer();
  27 + $http({
  28 + method : 'GET',
  29 + url : BASE_URL.url +'/user/margins',
  30 + headers : {'Content-Type': 'application/json'},
  31 + })
  32 + .then(function (result){
  33 + deferred.resolve(result.data);
  34 + },function (result){
  35 + deferred.resolve(result.data);
  36 + })
  37 + return deferred.promise;
  38 + }
  39 +
24 40 this.addCompany = function(data) {
25 41  
26 42 var deferred = $q.defer();
... ...
app/partials/main/main.html
... ... @@ -19,7 +19,7 @@
19 19 </a>
20 20 <ul class="dropdown-menu">
21 21 <li><a href="javascript:;">FBO Profile</a></li>
22   - <li><a href="javascript:;">Account Settings</a></li>
  22 + <li><a ui-sref="app.accountSetting">Account Settings</a></li>
23 23 <li class="divider"></li>
24 24 <li><a href="#" ng-click="logout();">Logout</a></li>
25 25 </ul>
... ...
app/partials/viewCompany/viewCompany.controller.js
... ... @@ -8,6 +8,7 @@
8 8 $scope.data = {};
9 9 $scope.data.priceEmail = true;
10 10 $scope.aircraft = {};
  11 + $scope.primayData = {};
11 12  
12 13 $(function() {
13 14 $('#company-one2').bootstrapToggle();
... ... @@ -34,10 +35,20 @@
34 35 })
35 36 })
36 37  
  38 +
  39 +
  40 + CustomersService.getMargin().then(function(result) {
  41 + $scope.marginList = result;
  42 + })
  43 +
37 44 var value = "";
38 45 var companyId = $stateParams.id;
39 46 ViewCompanyService.getCompany(companyId).then(function(result) {
40 47 $scope.companyData = result;
  48 + if(result.margin != null){
  49 + $scope.companyData.masterMargin = result.margin.id;
  50 + }
  51 +
41 52 if($scope.companyData.activate == true){
42 53 value = 'on';
43 54 }else{
... ... @@ -46,6 +57,20 @@
46 57 $('#company-one2').bootstrapToggle(value)
47 58 })
48 59  
  60 + $(function() {
  61 + $('#company-one2').bootstrapToggle();
  62 + $('#company-one2').change(function() {
  63 + $('#console-event').html('Toggle: ' + $(this).prop('checked'));
  64 + $scope.companyData.activate = $(this).prop('checked');
  65 + console.log($scope.companyData.activate)
  66 + var statusData = "status=" + $scope.companyData.activate;
  67 + ViewCompanyService.changeStatus(companyId, statusData).then(function(result) {
  68 +
  69 + })
  70 + })
  71 + })
  72 +
  73 +
49 74 getContactList();
50 75 function getContactList(){
51 76 ViewCompanyService.getContact(companyId).then(function(result) {
... ... @@ -78,11 +103,14 @@
78 103 $scope.data.companyId = companyId;
79 104 $scope.contactData.contactList.push($scope.data);
80 105 ViewCompanyService.addContact($scope.contactData).then(function(result) {
81   - if(result.success){
82   - toastr.success(''+result.success+'', {
83   - closeButton: true
84   - })
  106 + console.log(result)
  107 + if(result.status == 200){
  108 + // toastr.success(''+result.success+'', {
  109 + // closeButton: true
  110 + // })
85 111 $('#contact-modal-3').modal('hide');
  112 + $scope.primayData.id = result.data;
  113 + $scope.sendPrimaryContact();
86 114 getContactList();
87 115 }else{
88 116 toastr.error(''+result.statusText+'', {
... ... @@ -103,7 +131,8 @@
103 131 'tail':'',
104 132 'make': '',
105 133 'model': '',
106   - 'sizeId' : ''
  134 + 'sizeId' : '',
  135 + 'marginId': ''
107 136 }];
108 137  
109 138 $scope.addNew = function(){
... ... @@ -111,7 +140,8 @@
111 140 'tail':'',
112 141 'make': '',
113 142 'model': '',
114   - 'sizeId' : ''
  143 + 'sizeId' : '',
  144 + 'marginId': ''
115 145 });
116 146 console.log($scope.aircraftDetails)
117 147 };
... ... @@ -140,7 +170,8 @@
140 170 'tail': $scope.aircraftDetails[i].tail,
141 171 'make': $scope.aircraftDetails[i].make,
142 172 'model': $scope.aircraftDetails[i].model,
143   - 'sizeId' : $scope.aircraftDetails[i].sizeId
  173 + 'sizeId' : $scope.aircraftDetails[i].sizeId,
  174 + 'marginId': $scope.aircraftDetails[i].marginId
144 175 });
145 176 }
146 177 console.log($scope.addData)
... ... @@ -214,6 +245,7 @@
214 245 toastr.success(''+result.success+'', {
215 246 closeButton: true
216 247 })
  248 + $('#confirm1').css('display', 'none');
217 249 }else{
218 250 toastr.error(''+result.statusText+'', {
219 251 closeButton: true
... ... @@ -222,4 +254,68 @@
222 254 })
223 255 }
224 256  
  257 + $scope.openConfirmMail = function(){
  258 + $('#confirm1').css('display', 'block');
  259 + }
  260 +
  261 +
  262 + $scope.cancelAndCloseConfirm = function(){
  263 + $('#confirm1').css('display', 'none');
  264 + }
  265 +
  266 + $scope.cancelPrimaryContact = function(){
  267 + $('#primaryContact').css('display', 'none');
  268 + }
  269 +
  270 + $scope.checkPrimaryContact = function(){
  271 + if($scope.primaryContact == true){
  272 + ViewCompanyService.checkPrimaryContact(companyId).then(function(result) {
  273 + console.log(result)
  274 + if(result.status == 422){
  275 + $('#primaryContact').css('display', 'block');
  276 + }
  277 + })
  278 + }
  279 + }
  280 +
  281 + $scope.sendPrimaryContact = function(){
  282 + $scope.primaryContact = true;
  283 + $('#primaryContact').css('display', 'none');
  284 + if($scope.primayData.id != null || $scope.primayData.id != undefined){
  285 + var priamryContactData = "companyContactId=" + $scope.primayData.id + "&primary=" + $scope.primaryContact;
  286 +
  287 + ViewCompanyService.addPrimaryContact(priamryContactData).then(function(result) {
  288 + console.log(result)
  289 + })
  290 + }
  291 +
  292 + }
  293 +
  294 + var contactName = '';
  295 + $scope.addCustom = function(value){
  296 + console.log(value)
  297 + if(value != null){
  298 + contactName = value;
  299 + $('#customField').css('display', 'block');
  300 + }
  301 +
  302 + }
  303 + $scope.acceptCustomField = function(){
  304 + console.log(contactName)
  305 + if(contactName == 'phone'){
  306 + var customData = "companyId=" + companyId + "&contactNumber=" + $scope.custom.content
  307 + + "&title=" + $scope.custom.title;
  308 + }else{
  309 + var customData = "companyId=" + companyId + "&email=" + $scope.custom.content
  310 + + "&title=" + $scope.custom.title;
  311 + }
  312 + ViewCompanyService.addCustomField(customData).then(function(result) {
  313 + console.log(result)
  314 + if(result != null && result.success){
  315 + $('#customField').css('display', 'none');
  316 + }
  317 + })
  318 +
  319 + }
  320 +
225 321 }]);
226 322 \ No newline at end of file
... ...
app/partials/viewCompany/viewCompany.html
... ... @@ -164,11 +164,9 @@
164 164 <div>
165 165 <p class="new-label">
166 166 <span>Master Margin Setting </span>
  167 + <!-- <select class="form-control" ng-model="companyData.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList"></select> -->
167 168 <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-model="companyData.masterMargin" ng-click="editData()">
168   - <option value="margin1">Margin1</option>
169   - <option value="margin2">Margin2</option>
170   - <option value="vendorsonly">Vendors Only</option>
171   - <option value="margintenants">Margin Tenants</option>
  169 + <option ng-repeat="margin in marginList" value="{{margin.id}}">{{margin.marginName}}</option>
172 170 </select>
173 171 <span>&nbsp;See Aircrart List</span>
174 172 <div class="clearfix"></div>
... ... @@ -196,14 +194,14 @@
196 194 <input type="tel" ng-hide="showAddress" ng-model="companyData.addressTwo" class="form-control" ng-blur="editData('showAddress')"/>
197 195 </div>
198 196  
199   - <p><i class="fa fa-phone"></i> (310) 2342-3433 &nbsp;<i class="fa fa-pencil-square-o" aria-hidden="true"></i></p>
200   - <p><i class="fa fa-envelope"></i> freed@gmail.com &nbsp;<i class="fa fa-pencil-square-o" aria-hidden="true"></i></p>
  197 + <p ng-repeat="data in companyData.companyCustomContacts" ng-if="data.contactNumber != null"><i class="fa fa-phone"></i> {{data.contactNumber}} &nbsp;<i class="fa fa-pencil-square-o" aria-hidden="true"></i></p>
  198 + <p ng-repeat="data in companyData.companyCustomContacts" ng-if="data.email != null"><i class="fa fa-envelope"></i> {{data.email}} &nbsp;<i class="fa fa-pencil-square-o" aria-hidden="true"></i></p>
201 199 </div>
202 200 <div class="new-add-select">
203   - <select class="form-control" style="background: #ebebeb;padding: 4px 8px;width: 115px;">
  201 + <select class="form-control" ng-model="value" ng-click="addCustom(value)" style="background: #ebebeb;padding: 4px 8px;width: 115px;">
204 202 <option disabled selected>Add Field</option>
205   - <option class="optionclass">Add Phone</option>
206   - <option class="optionclass">Add Email</option>
  203 + <option value="phone" class="optionclass">Add Phone</option>
  204 + <option value="email" class="optionclass">Add Email</option>
207 205 </select>
208 206 </div>
209 207 <div>
... ... @@ -212,7 +210,7 @@
212 210 <textarea name="message" ng-hide="showNoteData" style="margin-bottom: 6px;" class="form-control" ng-model="companyData.internalNote" ng-blur="editData('showNoteData')" rows="4" cols="34"></textarea>
213 211 </div>
214 212 <div class="dis">
215   - <button type="button" data-toggle="modal" data-target="#distribute-modal-3" class="btn btn-primary">Distribute Price to Company Contacts</button>
  213 + <button type="button" ng-click="openConfirmMail()" class="btn btn-primary">Distribute Price to Company Contacts</button>
216 214 </div>
217 215 <div><button type="button" class="btn btn-info">Setup Fuel</button></div>
218 216 </div>
... ... @@ -506,7 +504,7 @@
506 504 <div class="col-md-3">
507 505 <div class="pull-left my-toggle-switch">
508 506 <div style="color: #ff9a01;">Primary Contact &nbsp &nbsp
509   - <input type="checkbox" ng-model="data.primaryContact">
  507 + <input type="checkbox" ng-click="checkPrimaryContact()" ng-model="primaryContact">
510 508 </div>
511 509 </div>
512 510 <div class="clearfix"></div>
... ... @@ -568,6 +566,7 @@
568 566 <th>Make</th>
569 567 <th>Model</th>
570 568 <th>Size</th>
  569 + <th>Margin</th>
571 570 </tr>
572 571 </thead>
573 572 <tbody>
... ... @@ -594,6 +593,9 @@
594 593 <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option>
595 594 </select> -->
596 595 </td>
  596 + <td>
  597 + <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in marginList"></select>
  598 + </td>
597 599 </tr>
598 600 </tbody>
599 601 </table>
... ... @@ -620,23 +622,69 @@
620 622 </div>
621 623 </form>
622 624  
623   -<form class="modal multi-step" id="distribute-modal-3" name="aircraftForm">
624   - <div class="modal-dialog">
625   - <div class="modal-content">
626   - <div class="modal-body step-2" data-step="2" style="padding: 0;">
627   - <div>
628   - <div class="row" style="margin: 0;">
629   - <p>Are you sure that you want to email pricing to everyone in your contact list</p>
630   - </div>
631   - </div>
632   - </div>
633   - <div class="modal-footer" style="border-top: 0;">
634   - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
635   - <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="sendMail()">Save</button>
  625 +<div class="customConfirmPopBackdrop" id="confirm1">
  626 + <div class="customModalInner" style="max-width: 400px;">
  627 + <div class="customModelBody" style="border-radius: 5px 5px 0 0;">
  628 + <table>
  629 + <tr>
  630 + <td>
  631 + <img src="img/info.png" style="width: 50px;">
  632 + </td>
  633 + <td>
  634 + <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure that you want to email pricing to everyone in your contact list?</p>
  635 + </td>
  636 + </tr>
  637 + </table>
  638 + </div>
  639 + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;">
  640 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendMail()">Yes</button>
  641 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAndCloseConfirm()">Cancel</button>
  642 + </div>
  643 + </div>
  644 +</div>
  645 +
  646 +<div class="customConfirmPopBackdrop" id="primaryContact">
  647 + <div class="customModalInner" style="max-width: 400px;">
  648 + <div class="customModelBody" style="border-radius: 5px 5px 0 0;">
  649 + <table>
  650 + <tr>
  651 + <td>
  652 + <img src="img/info.png" style="width: 50px;">
  653 + </td>
  654 + <td>
  655 + <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure you want to set this person as your primary contact?</p>
  656 + </td>
  657 + </tr>
  658 + </table>
  659 + </div>
  660 + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;">
  661 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendPrimaryContact()">Yes</button>
  662 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelPrimaryContact()">Cancel</button>
  663 + </div>
  664 + </div>
  665 +</div>
  666 +
  667 +<div class="customConfirmPopBackdrop" id="customField">
  668 + <div class="customModalInner" style="max-width: 400px;">
  669 + <div class="customModelBody" style="border-radius: 5px 5px 0 0;">
  670 + <div class="col-md-2"><img class="src-image" src="img/images.jpg"></div>
  671 + <div class="col-md-10">
  672 + <form>
  673 + Title:<br>
  674 + <input type="text" name="firstname" ng-model="custom.title"><br>
  675 + Content:<br>
  676 + <input type="text" name="lastname" ng-model="custom.content">
  677 + </form>
636 678 </div>
637   - </div>
638   - </div>
639   -</form>
  679 + <div class="clearfix"></div>
  680 + </div>
  681 + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;">
  682 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="acceptCustomField()">Accept</button>
  683 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelPrimaryContact()">Cancel</button>
  684 + </div>
  685 + </div>
  686 +</div>
  687 +
640 688 <!-- Le javascript
641 689 ================================================== -->
642 690 <!-- Placed at the end of the document so the pages load faster -->
... ...
app/partials/viewCompany/viewCompany.service.js
... ... @@ -42,7 +42,39 @@
42 42 var deferred = $q.defer();
43 43 $http({
44 44 method : 'POST',
45   - url : BASE_URL.url +'/company/add/contact',
  45 + url : BASE_URL.url +'/company/contact',
  46 + data : data,
  47 + headers : {'Content-Type': 'application/json'},
  48 + })
  49 + .then(function (result){
  50 + deferred.resolve(result);
  51 + },function (result){
  52 + deferred.resolve(result);
  53 + })
  54 + return deferred.promise;
  55 + }
  56 +
  57 + this.addCustomField = function(data){
  58 + var deferred = $q.defer();
  59 + $http({
  60 + method : 'POST',
  61 + url : BASE_URL.url +'/company/custom/contacts',
  62 + data : data,
  63 + headers : {'Content-Type': 'application/json'},
  64 + })
  65 + .then(function (result){
  66 + deferred.resolve(result.data);
  67 + },function (result){
  68 + deferred.resolve(result.data);
  69 + })
  70 + return deferred.promise;
  71 + }
  72 +
  73 + this.addPrimaryContact = function(data){
  74 + var deferred = $q.defer();
  75 + $http({
  76 + method : 'POST',
  77 + url : BASE_URL.url +'/company/contact/createPrimaryContact',
46 78 data : data,
47 79 headers : {'Content-Type': 'application/json'},
48 80 })
... ... @@ -70,6 +102,22 @@
70 102 return deferred.promise;
71 103 }
72 104  
  105 + this.changeStatus = function(companyId, data){
  106 + var deferred = $q.defer();
  107 + $http({
  108 + method : 'PUT',
  109 + url : BASE_URL.url +'/company/status/'+companyId,
  110 + data : data,
  111 + headers : {'Content-Type': 'application/json'},
  112 + })
  113 + .then(function (result){
  114 + deferred.resolve(result.data);
  115 + },function (result){
  116 + deferred.resolve(result.data);
  117 + })
  118 + return deferred.promise;
  119 + }
  120 +
73 121 this.updateContact = function(data) {
74 122  
75 123 var deferred = $q.defer();
... ... @@ -102,6 +150,21 @@
102 150 })
103 151 return deferred.promise;
104 152 }
  153 +
  154 + this.checkPrimaryContact = function(id){
  155 + var deferred = $q.defer();
  156 + $http({
  157 + method : 'GET',
  158 + url : BASE_URL.url +'/company/contact/check/primaryContact/'+id,
  159 + headers : {'Content-Type': 'application/json'},
  160 + })
  161 + .then(function (result){
  162 + deferred.resolve(result);
  163 + },function (result){
  164 + deferred.resolve(result);
  165 + })
  166 + return deferred.promise;
  167 + }
105 168  
106 169 }
107 170  
... ...
app/partials/viewFuelVendor/viewFuelVendor.controller.js
... ... @@ -222,4 +222,14 @@
222 222 })
223 223 }
224 224  
  225 +
  226 + $scope.openConfirmMail = function(){
  227 + $('#confirm2').css('display', 'block');
  228 + }
  229 +
  230 +
  231 + $scope.cancelAndCloseConfirm = function(){
  232 + $('#confirm2').css('display', 'none');
  233 + }
  234 +
225 235 }]);
226 236 \ No newline at end of file
... ...
app/partials/viewFuelVendor/viewFuelVendor.html
... ... @@ -212,7 +212,7 @@
212 212 <textarea name="message" ng-hide="showNoteData" style="margin-bottom: 6px;" class="form-control" ng-model="vendorData.internalNote" ng-blur="editData('showNoteData')" rows="4" cols="34"></textarea>
213 213 </div>
214 214 <div class="dis">
215   - <button type="button" data-toggle="modal" data-target="#distribute-modal-3" class="btn btn-primary">Distribute Price to Company Contacts</button>
  215 + <button type="button" ng-click="openConfirmMail()" class="btn btn-primary">Distribute Price to Company Contacts</button>
216 216 </div>
217 217 <div><button type="button" class="btn btn-info">Setup Fuel</button></div>
218 218 </div>
... ... @@ -620,23 +620,26 @@
620 620 </div>
621 621 </form>
622 622  
623   -<form class="modal multi-step" id="distribute-modal-3" name="aircraftForm">
624   - <div class="modal-dialog">
625   - <div class="modal-content">
626   - <div class="modal-body step-2" data-step="2" style="padding: 0;">
627   - <div>
628   - <div class="row" style="margin: 0;">
629   - <p>Are you sure that you want to email pricing to everyone in your contact list</p>
630   - </div>
631   - </div>
632   - </div>
633   - <div class="modal-footer" style="border-top: 0;">
634   - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
635   - <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="sendMail()">Save</button>
636   - </div>
637   - </div>
638   - </div>
639   -</form>
  623 +<div class="customConfirmPopBackdrop" id="confirm2">
  624 + <div class="customModalInner" style="max-width: 400px;">
  625 + <div class="customModelBody" style="border-radius: 5px 5px 0 0;">
  626 + <table>
  627 + <tr>
  628 + <td>
  629 + <img src="img/info.png" style="width: 50px;">
  630 + </td>
  631 + <td>
  632 + <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure that you want to email pricing to everyone in your contact list?</p>
  633 + </td>
  634 + </tr>
  635 + </table>
  636 + </div>
  637 + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;">
  638 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="sendMail()">Yes</button>
  639 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAndCloseConfirm()">Cancel</button>
  640 + </div>
  641 + </div>
  642 +</div>
640 643 <!-- Le javascript
641 644 ================================================== -->
642 645 <!-- Placed at the end of the document so the pages load faster -->
... ...