Commit 6275a96f0a42263b8eeaaa57cfdc80760359cd62

Authored by Jaideep Singh
1 parent 8670c59059
Exists in master

s

app/partials/dashboard/dashboard.controller.js
1 1
2 (function() { 2 (function() {
3 'use strict' 3 'use strict'
4 4
5 angular.module('acufuel') 5 angular.module('acufuel')
6 .controller('dashboardController', [ '$scope', '$filter', '$rootScope', '$state', 'dashboardService', dashboardController]); 6 .controller('dashboardController', [ '$scope', '$filter', '$rootScope', '$state', 'dashboardService', dashboardController]);
7 7
8 function dashboardController($scope, $filter, $rootScope, $state, dashboardService) { 8 function dashboardController($scope, $filter, $rootScope, $state, dashboardService) {
9 9
10 $scope.logout = function () { 10 $scope.logout = function () {
11 localStorage.removeItem("loginStatus"); 11 localStorage.removeItem("loginStatus");
12 $rootScope.path = false; 12 $rootScope.path = false;
13 $state.reload(); 13 $state.reload();
14 } 14 }
15 15
16 $scope.marginList = {}
17 dashboardService.getMargin().then(function(result) {
18 $scope.marginList = result;
19 console.log("Margin result", result)
20 })
21
16 $scope.newFuelPricing = {}; 22 $scope.newFuelPricing = {};
17 dashboardService.getFuelPricingNew().then(function(result) { 23 dashboardService.getFuelPricingNew().then(function(result) {
18 $scope.newFuelPricing = result; 24 $scope.newFuelPricing = result;
25 console.log("Fuel Pricing result", result)
19 for (var i = 0; i<$scope.newFuelPricing.length; i++) { 26 for (var i = 0; i<$scope.newFuelPricing.length; i++) {
20 if ($scope.newFuelPricing[i].fuelPricing != null) { 27 if ($scope.newFuelPricing[i].fuelPricing != null) {
21 if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { 28 if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') {
22 var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); 29 var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate);
23 var month = newTime.getUTCMonth() + 1; //months from 1-12 30 var month = newTime.getUTCMonth() + 1; //months from 1-12
24 var day = newTime.getUTCDate(); 31 var day = newTime.getUTCDate();
25 var year = newTime.getUTCFullYear(); 32 var year = newTime.getUTCFullYear();
26 $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; 33 $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year;
27 } 34 }
28 } 35 }
29 if ($scope.newFuelPricing[i].futureFuelPricing != null) { 36 if ($scope.newFuelPricing[i].futureFuelPricing != null) {
30 if ($scope.newFuelPricing[i].futureFuelPricing != null) { 37 if ($scope.newFuelPricing[i].futureFuelPricing != null) {
31 if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { 38 if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') {
32 var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); 39 var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration);
33 var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 40 var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12
34 var nextDay = newTime.getUTCDate(); 41 var nextDay = newTime.getUTCDate();
35 var nextYear = newTime.getUTCFullYear(); 42 var nextYear = newTime.getUTCFullYear();
36 $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; 43 $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear;
37 } 44 }
38 } 45 }
39 if ($scope.newFuelPricing[i].futureFuelPricing != null) { 46 if ($scope.newFuelPricing[i].futureFuelPricing != null) {
40 if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { 47 if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') {
41 var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); 48 var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate);
42 var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 49 var dmonth = newTime.getUTCMonth() + 1; //months from 1-12
43 var dday = newTime.getUTCDate(); 50 var dday = newTime.getUTCDate();
44 var dyear = newTime.getUTCFullYear(); 51 var dyear = newTime.getUTCFullYear();
45 $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; 52 $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear;
46 } 53 }
47 } 54 }
48 } 55 }
49 } 56 }
50 $scope.showLoader = false; 57 $scope.showLoader = false;
51 }) 58 })
59
52 60
53 $scope.updateFuelPricing = {}; 61 $scope.updateFuelPricing = {};
54 $scope.updateFuelPricing.fuelPricingList = []; 62 $scope.updateFuelPricing.fuelPricingList = [];
55 $scope.updateFuelPricing.userProfileId = $scope.userProfileId; 63 $scope.updateFuelPricing.userProfileId = $scope.userProfileId;
56 $scope.updateFuelPricingClick = function(){ 64 $scope.updateFuelPricingClick = function(){
57 $scope.showLoader = true; 65 $scope.showLoader = true;
58 66
59 for (var i = 0; i<$scope.newFuelPricing.length; i++) { 67 for (var i = 0; i<$scope.newFuelPricing.length; i++) {
60 if ($scope.newFuelPricing[i].fuelPricing != null) { 68 if ($scope.newFuelPricing[i].fuelPricing != null) {
61 $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); 69 $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin);
62 if ($scope.newFuelPricing[i].fuelPricing.cost == null) { 70 if ($scope.newFuelPricing[i].fuelPricing.cost == null) {
63 $scope.newFuelPricing[i].fuelPricing.cost = ''; 71 $scope.newFuelPricing[i].fuelPricing.cost = '';
64 } 72 }
65 if ($scope.newFuelPricing[i].fuelPricing.papMargin == null) { 73 if ($scope.newFuelPricing[i].fuelPricing.papMargin == null) {
66 $scope.newFuelPricing[i].fuelPricing.papMargin = ''; 74 $scope.newFuelPricing[i].fuelPricing.papMargin = '';
67 } 75 }
68 if ($scope.newFuelPricing[i].fuelPricing.papTotal == null) { 76 if ($scope.newFuelPricing[i].fuelPricing.papTotal == null) {
69 $scope.newFuelPricing[i].fuelPricing.papTotal = ''; 77 $scope.newFuelPricing[i].fuelPricing.papTotal = '';
70 } 78 }
71 if ($scope.newFuelPricing[i].fuelPricing.expirationDate == null) { 79 if ($scope.newFuelPricing[i].fuelPricing.expirationDate == null) {
72 $scope.newFuelPricing[i].fuelPricing.expirationDate = ''; 80 $scope.newFuelPricing[i].fuelPricing.expirationDate = '';
73 }else{ 81 }else{
74 $scope.newFuelPricing[i].fuelPricing.expirationDate = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); 82 $scope.newFuelPricing[i].fuelPricing.expirationDate = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate);
75 console.log('$scope.newFuelPricing[i].fuelPricing.expirationDate', $scope.newFuelPricing[i].fuelPricing.expirationDate); 83 console.log('$scope.newFuelPricing[i].fuelPricing.expirationDate', $scope.newFuelPricing[i].fuelPricing.expirationDate);
76 $scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate.getTime(); 84 $scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate.getTime();
77 } 85 }
78 86
79 $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); 87 $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin);
80 $scope.updateFuelPricing.fuelPricingList.push({ 88 $scope.updateFuelPricing.fuelPricingList.push({
81 'cost': $scope.newFuelPricing[i].fuelPricing.cost, 89 'cost': $scope.newFuelPricing[i].fuelPricing.cost,
82 'papMargin': $scope.newFuelPricing[i].fuelPricing.papMargin, 90 'papMargin': $scope.newFuelPricing[i].fuelPricing.papMargin,
83 'papTotal': $scope.newFuelPricing[i].fuelPricing.papTotal, 91 'papTotal': $scope.newFuelPricing[i].fuelPricing.papTotal,
84 'expirationDate': $scope.newFuelPricing[i].fuelPricing.expirationDate, 92 'expirationDate': $scope.newFuelPricing[i].fuelPricing.expirationDate,
85 'productId': $scope.newFuelPricing[i].id, 93 'productId': $scope.newFuelPricing[i].id,
86 'id': $scope.newFuelPricing[i].fuelPricing.id, 94 'id': $scope.newFuelPricing[i].fuelPricing.id,
87 }) 95 })
88 96
89 }else{ 97 }else{
90 /*$scope.newFuelPricing[i].fuelPricing.cost = ''; 98 /*$scope.newFuelPricing[i].fuelPricing.cost = '';
91 $scope.newFuelPricing[i].fuelPricing.papMargin = ''; 99 $scope.newFuelPricing[i].fuelPricing.papMargin = '';
92 $scope.newFuelPricing[i].fuelPricing.papTotal = ''; 100 $scope.newFuelPricing[i].fuelPricing.papTotal = '';
93 $scope.newFuelPricing[i].fuelPricing.expirationDate = '';*/ 101 $scope.newFuelPricing[i].fuelPricing.expirationDate = '';*/
94 } 102 }
95 103
96 } 104 }
105
106
107
108
109 console.log('result',$scope.marginList)
97 dashboardService.updateFuelPricing($scope.updateFuelPricing).then(function(result) { 110 dashboardService.updateFuelPricing($scope.updateFuelPricing).then(function(result) {
98 toastr.success('Successfully Updated', { 111 toastr.success('Successfully Updated', {
99 closeButton: true 112 closeButton: true
100 }) 113 })
101 dashboardService.getFuelPricingNew().then(function(result) { 114 dashboardService.getFuelPricingNew().then(function(result) {
102 $scope.newFuelPricing = result; 115 $scope.newFuelPricing = result;
103 for (var i = 0; i<$scope.newFuelPricing.length; i++) { 116 for (var i = 0; i<$scope.newFuelPricing.length; i++) {
104 if ($scope.newFuelPricing[i].fuelPricing != null) { 117 if ($scope.newFuelPricing[i].fuelPricing != null) {
105 if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { 118 if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') {
106 var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); 119 var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate);
107 var month = newTime.getUTCMonth() + 1; //months from 1-12 120 var month = newTime.getUTCMonth() + 1; //months from 1-12
108 var day = newTime.getUTCDate(); 121 var day = newTime.getUTCDate();
109 var year = newTime.getUTCFullYear(); 122 var year = newTime.getUTCFullYear();
110 $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; 123 $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year;
111 } 124 }
112 } 125 }
113 if ($scope.newFuelPricing[i].futureFuelPricing != null) { 126 if ($scope.newFuelPricing[i].futureFuelPricing != null) {
114 if ($scope.newFuelPricing[i].futureFuelPricing != null) { 127 if ($scope.newFuelPricing[i].futureFuelPricing != null) {
115 if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { 128 if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') {
116 var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); 129 var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration);
117 var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 130 var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12
118 var nextDay = newTime.getUTCDate(); 131 var nextDay = newTime.getUTCDate();
119 var nextYear = newTime.getUTCFullYear(); 132 var nextYear = newTime.getUTCFullYear();
120 $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; 133 $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear;
121 } 134 }
122 } 135 }
123 if ($scope.newFuelPricing[i].futureFuelPricing != null) { 136 if ($scope.newFuelPricing[i].futureFuelPricing != null) {
124 if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { 137 if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') {
125 var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); 138 var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate);
126 var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 139 var dmonth = newTime.getUTCMonth() + 1; //months from 1-12
127 var dday = newTime.getUTCDate(); 140 var dday = newTime.getUTCDate();
128 var dyear = newTime.getUTCFullYear(); 141 var dyear = newTime.getUTCFullYear();
129 $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; 142 $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear;
130 } 143 }
131 } 144 }
132 } 145 }
133 } 146 }
134 $scope.showLoader = false; 147 $scope.showLoader = false;
135 }) 148 })
136 }) 149 })
137 150
138 } 151 }
139 152
140 153
141 154
142 // $scope.submitLogin = function() { 155 // $scope.submitLogin = function() {
143 // LoginService.setAuth(true); 156 // LoginService.setAuth(true);
144 // toastr.info("Login successfully"); 157 // toastr.info("Login successfully");
145 // $state.go('app.dashboard'); 158 // $state.go('app.dashboard');
146 // /*LoginService.login($scope.username, $scope.password).then(function(result){ 159 // /*LoginService.login($scope.username, $scope.password).then(function(result){
147 // if(typeof result == 'object') { 160 // if(typeof result == 'object') {
148 // LoginService.setAuth(true); 161 // LoginService.setAuth(true);
149 // $rootScope.path = true; 162 // $rootScope.path = true;
150 // var reqPwdChng = localStorage.getItem("requiredChangePwd"); 163 // var reqPwdChng = localStorage.getItem("requiredChangePwd");
151 // if (reqPwdChng && reqPwdChng == "Y") { 164 // if (reqPwdChng && reqPwdChng == "Y") {
152 // $state.go('resetPassword'); 165 // $state.go('resetPassword');
153 // } else { 166 // } else {
154 // $state.go('app.upload'); 167 // $state.go('app.upload');
155 // } 168 // }
156 // } else { 169 // } else {
157 // toastr.info("Error in login. Please check login name and password"); 170 // toastr.info("Error in login. Please check login name and password");
158 // } 171 // }
159 // })*/ 172 // })*/
160 // } 173 // }
161 } 174 }
162 })(); 175 })();
163 176
app/partials/dashboard/dashboard.html
1 <style> 1 <style>
2 .subnavbar .mainnav > li:first-child > a{ 2 .subnavbar .mainnav > li:first-child > a{
3 color: #ff9900; 3 color: #ff9900;
4 } 4 }
5 </style> 5 </style>
6 6
7 7
8 <div class="main"> 8 <div class="main">
9 <div class="container"> 9 <div class="container">
10 <div class="row"> 10 <div class="row">
11 <div class="col-md-7"> 11 <div class="col-md-7">
12 <div class="widget stacked"> 12 <div class="widget stacked">
13 <div class="row"> 13 <div class="row">
14 <div class="col-md-3"> 14 <div class="col-md-3">
15 <div class="widget-header"> 15 <div class="widget-header">
16 <i class="fa fa-tint"></i> &nbsp; Fuel Orders 16 <i class="fa fa-tint"></i> &nbsp; Fuel Orders
17 </div> 17 </div>
18 <div class="custom-widget-content"> 18 <div class="custom-widget-content">
19 <div> 19 <div>
20 <div class="col-xs-12"> 20 <div class="col-xs-12">
21 <span class="pull-left">Completed</span> 21 <span class="pull-left">Completed</span>
22 <button class="btn btn-success btn-xs pull-right"> 22 <button class="btn btn-success btn-xs pull-right">
23 <span style="font-size:9px;">Monthly</span> 23 <span style="font-size:9px;">Monthly</span>
24 </button> 24 </button>
25 <div class="clearfix"></div> 25 <div class="clearfix"></div>
26 </div> 26 </div>
27 <div class="clearfix"></div> 27 <div class="clearfix"></div>
28 </div> 28 </div>
29 <hr class="hr"> 29 <hr class="hr">
30 <div class="col-xs-12"> 30 <div class="col-xs-12">
31 <h2 style="margin-bottom: 0px;">280</h2> 31 <h2 style="margin-bottom: 0px;">280</h2>
32 <span>Fuel Orders</span> 32 <span>Fuel Orders</span>
33 </div> 33 </div>
34 <div class="clearfix"></div> 34 <div class="clearfix"></div>
35 </div> 35 </div>
36 </div> 36 </div>
37 <div class="col-md-3"> 37 <div class="col-md-3">
38 <div class="widget-header"> 38 <div class="widget-header">
39 <i class="fa fa-tint"></i> &nbsp; Fuel Orders 39 <i class="fa fa-tint"></i> &nbsp; Fuel Orders
40 </div> 40 </div>
41 <div class="custom-widget-content"> 41 <div class="custom-widget-content">
42 <div> 42 <div>
43 <div class="col-xs-12"> 43 <div class="col-xs-12">
44 <span class="pull-left">Pending</span> 44 <span class="pull-left">Pending</span>
45 <button class="btn btn-success btn-xs pull-right pull-right-color "> 45 <button class="btn btn-success btn-xs pull-right pull-right-color ">
46 <span style="font-size:9px;">Monthly</span> 46 <span style="font-size:9px;">Monthly</span>
47 </button> 47 </button>
48 <div class="clearfix"></div> 48 <div class="clearfix"></div>
49 </div> 49 </div>
50 <div class="clearfix"></div> 50 <div class="clearfix"></div>
51 </div> 51 </div>
52 <hr class="hr"> 52 <hr class="hr">
53 <div class="col-xs-12"> 53 <div class="col-xs-12">
54 <h2 style="margin-bottom: 0px;">280</h2> 54 <h2 style="margin-bottom: 0px;">280</h2>
55 <span>Fuel Orders</span> 55 <span>Fuel Orders</span>
56 </div> 56 </div>
57 <div class="clearfix"></div> 57 <div class="clearfix"></div>
58 </div> 58 </div>
59 </div> 59 </div>
60 <div class="col-md-6"> 60 <div class="col-md-6">
61 <div class="widget-header"> 61 <div class="widget-header">
62 <i class="fa fa-list-alt "></i> 62 <i class="fa fa-list-alt "></i>
63 <h3>Fuel Order</h3> 63 <h3>Fuel Order</h3>
64 </div> 64 </div>
65 <div class="custom-widget-content"> 65 <div class="custom-widget-content">
66 <div> 66 <div>
67 <div class="col-xs-12"> 67 <div class="col-xs-12">
68 <span class="pull-left">Activity: Airport Operations</span> 68 <span class="pull-left">Activity: Airport Operations</span>
69 <button class="btn btn-primary btn-xs pull-right"> 69 <button class="btn btn-primary btn-xs pull-right">
70 <span style="font-size:9px;">Monthly</span> 70 <span style="font-size:9px;">Monthly</span>
71 </button> 71 </button>
72 <div class="clearfix"></div> 72 <div class="clearfix"></div>
73 </div> 73 </div>
74 <div class="clearfix"></div> 74 <div class="clearfix"></div>
75 </div> 75 </div>
76 <hr class="hr"> 76 <hr class="hr">
77 <div class="col-xs-6"> 77 <div class="col-xs-6">
78 <h2 style="margin-bottom:0px;">280</h2> 78 <h2 style="margin-bottom:0px;">280</h2>
79 <span>Based-Aircraft</span> 79 <span>Based-Aircraft</span>
80 </div> 80 </div>
81 <div class="col-xs-6"> 81 <div class="col-xs-6">
82 <h2 style="margin-bottom: 0px;">280</h2> 82 <h2 style="margin-bottom: 0px;">280</h2>
83 <span>Take-offs & Landings</span> 83 <span>Take-offs & Landings</span>
84 </div> 84 </div>
85 <div class="clearfix"></div> 85 <div class="clearfix"></div>
86 </div> 86 </div>
87 </div> 87 </div>
88 </div> 88 </div>
89 </br> 89 </br>
90 <div class="row"> 90 <div class="row">
91 <div class="col-md-12"> 91 <div class="col-md-12">
92 <div class="widget-header"> 92 <div class="widget-header">
93 <i class="fa fa-signal" aria-hidden="true"></i> 93 <i class="fa fa-signal" aria-hidden="true"></i>
94 <h3>Chart</h3> 94 <h3>Chart</h3>
95 </div> 95 </div>
96 <!-- /widget-header --> 96 <!-- /widget-header -->
97 <div class="widget-content"> 97 <div class="widget-content">
98 <div class="stats"> 98 <div class="stats">
99 <div class="stat"> 99 <div class="stat">
100 <span class="stat-value">12,386</span> 100 <span class="stat-value">12,386</span>
101 Site Visits 101 Site Visits
102 </div> 102 </div>
103 <!-- /stat --> 103 <!-- /stat -->
104 <div class="stat"> 104 <div class="stat">
105 <span class="stat-value">9,249</span> 105 <span class="stat-value">9,249</span>
106 Unique Visits 106 Unique Visits
107 </div> 107 </div>
108 <!-- /stat --> 108 <!-- /stat -->
109 <div class="stat"> 109 <div class="stat">
110 <span class="stat-value">70%</span> 110 <span class="stat-value">70%</span>
111 New Visits 111 New Visits
112 </div> 112 </div>
113 <!-- /stat --> 113 <!-- /stat -->
114 </div> 114 </div>
115 <!-- /stats --> 115 <!-- /stats -->
116 <div id="chart-stats" class="stats"> 116 <div id="chart-stats" class="stats">
117 <div class="stat stat-chart"> 117 <div class="stat stat-chart">
118 <!-- <div id="donut-chart" class="chart-holder"></div> --> <!-- #donut --> 118 <!-- <div id="donut-chart" class="chart-holder"></div> --> <!-- #donut -->
119 <div id="area-chart" class="chart-holder" style="height: 250px;"></div> 119 <div id="area-chart" class="chart-holder" style="height: 250px;"></div>
120 <!-- /area-chart --> 120 <!-- /area-chart -->
121 </div> 121 </div>
122 <!-- /substat --> 122 <!-- /substat -->
123 <div class="stat stat-time"> 123 <div class="stat stat-time">
124 <span class="stat-value">00:28:13</span> 124 <span class="stat-value">00:28:13</span>
125 Average Time on Site 125 Average Time on Site
126 </div> 126 </div>
127 <!-- /substat --> 127 <!-- /substat -->
128 </div> 128 </div>
129 <!-- /substats --> 129 <!-- /substats -->
130 </div> 130 </div>
131 <!-- /widget-content --> 131 <!-- /widget-content -->
132 </div> 132 </div>
133 <!-- /widget --> 133 <!-- /widget -->
134 </div> 134 </div>
135 </div> 135 </div>
136 </div> 136 </div>
137 <!-- /span6 --> 137 <!-- /span6 -->
138 <div class="col-md-5"> 138 <div class="col-md-5">
139 <div class="widget stacked"> 139 <div class="widget stacked">
140 <div class="widget-header"> 140 <div class="widget-header">
141 <i class="fa fa-pencil"></i> 141 <i class="fa fa-pencil"></i>
142 <h3>Price Manager</h3> 142 <h3>Price Manager</h3>
143 <!-- <select style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="form-control" ng-model="sendEmail.pricing" ng-change="confirmMail()"> 143 <select style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="form-control" ng-model="sendEmail.pricing" ng-change="confirmMail()">
144 <option value="" disabled selected="selected">Send Pricing Email</option> 144 <option value="" disabled selected="selected">Send Pricing Email</option>
145 <option ng-repeat="margins in marginList" value="{{margins.id}}">{{margins.marginName}}</option> 145 <option ng-repeat="margins in marginList" value="{{margins.id}}">{{margins.marginName}}</option>
146 <option disabled>_______________</option> 146 <option disabled>_______________</option>
147 <option value="all">Distribute All</option> 147 <option value="all">Distribute All</option>
148 </select> --> 148 </select>
149 </div> 149 </div>
150 <!-- /widget-header --> 150 <!-- /widget-header -->
151 <div class="widget-content"> 151 <div class="widget-content">
152 <h4>Update Fuel Price Here</h4> 152 <h4>Update Fuel Price Here</h4>
153 <table class="table"> 153 <table class="table">
154 <thead> 154 <thead>
155 <tr> 155 <tr>
156 <th> Product</th> 156 <th> Product</th>
157 <th> Cost</th> 157 <th> Cost</th>
158 <th> Margin</th> 158 <th> Margin</th>
159 <th> PAP(Total)</th> 159 <th> PAP(Total)</th>
160 <th style="color: #F90;"> Expires</th> 160 <th style="color: #F90;"> Expires</th>
161 </tr> 161 </tr>
162 </thead> 162 </thead>
163 <tbody> 163 <tbody>
164 <tr ng-repeat="fuelPricing in newFuelPricing"> 164 <tr ng-repeat="fuelPricing in newFuelPricing">
165 <td> 165 <td>
166 <span>{{fuelPricing.name}}</span> 166 <span>{{fuelPricing.name}}</span>
167 </td> 167 </td>
168 <td> 168 <td>
169 <input type="text" class="form-control" ng-model="fuelPricing.fuelPricing.cost" style="height:31px; width: 50px; padding: 6px 6px"> 169 <input type="text" class="form-control" ng-model="fuelPricing.fuelPricing.cost" style="height:31px; width: 50px; padding: 6px 6px">
170 </td> 170 </td>
171 <td> 171 <td>
172 <input type="text" class="form-control" ng-model="fuelPricing.fuelPricing.papMargin" style="height:31px; width: 50px; padding: 6px 6px;"> 172 <input type="text" class="form-control" ng-model="fuelPricing.fuelPricing.papMargin" style="height:31px; width: 50px; padding: 6px 6px;">
173 </td> 173 </td>
174 <td> 174 <td>
175 <span style="line-height: 31px; color: #1ab394;">$ {{fuelPricing.fuelPricing.cost -- fuelPricing.fuelPricing.papMargin}}</span> 175 <span style="line-height: 31px; color: #1ab394;">$ {{fuelPricing.fuelPricing.cost -- fuelPricing.fuelPricing.papMargin}}</span>
176 </td> 176 </td>
177 <td> 177 <td>
178 <input type="text" class="form-control" datepicker ng-model="fuelPricing.fuelPricing.expirationDate" style="height:31px; width: 100px; padding: 6px 6px;"> 178 <input type="text" class="form-control" datepicker ng-model="fuelPricing.fuelPricing.expirationDate" style="height:31px; width: 100px; padding: 6px 6px;">
179 </td> 179 </td>
180 </tr> 180 </tr>
181 </tbody> 181 </tbody>
182 </table> 182 </table>
183 <div class="row" style="margin-left: 0px;"> 183 <div class="row" style="margin-left: 0px;">
184 <div class="col-md-12" style= "text-align: right;"> 184 <div class="col-md-12" style= "text-align: right;">
185 <button type="button" class="btn btn-success btn-xs" ng-click="updateFuelPricingClick()">Save</button> 185 <button type="button" class="btn btn-success btn-xs" ng-click="updateFuelPricingClick()">Save</button>
186 </div> 186 </div>
187 </div> 187 </div>
188 </div> 188 </div>
189 <!-- /widget-content --> 189 <!-- /widget-content -->
190 </div> 190 </div>
191 <!-- /widget --> 191 <!-- /widget -->
192 <div class="widget widget-nopad stacked"> 192 <div class="widget widget-nopad stacked">
193 <div class="widget-header"> 193 <div class="widget-header">
194 <i class="fa fa-comment" aria-hidden="true"></i> 194 <i class="fa fa-comment" aria-hidden="true"></i>
195 <h3>Messages</h3> 195 <h3>Messages</h3>
196 </div> 196 </div>
197 <!-- /widget-header --> 197 <!-- /widget-header -->
198 <div class="widget-content"> 198 <div class="widget-content">
199 <h4 style="padding:10px">Messages</h4> 199 <h4 style="padding:10px">Messages</h4>
200 <hr class="hr"> 200 <hr class="hr">
201 <ul class="news-items"> 201 <ul class="news-items">
202 <li> 202 <li>
203 <div class="news-item-detail"> 203 <div class="news-item-detail">
204 <a href="javascript:;" class="news-item-title">Duis aute irure dolor in reprehenderit</a> 204 <a href="javascript:;" class="news-item-title">Duis aute irure dolor in reprehenderit</a>
205 <p class="news-item-preview">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore.</p> 205 <p class="news-item-preview">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore.</p>
206 </div> 206 </div>
207 <div class="news-item-date"> 207 <div class="news-item-date">
208 <span class="news-item-day">08</span> 208 <span class="news-item-day">08</span>
209 <span class="news-item-month">Mar</span> 209 <span class="news-item-month">Mar</span>
210 </div> 210 </div>
211 </li> 211 </li>
212 <li> 212 <li>
213 <div class="news-item-detail"> 213 <div class="news-item-detail">
214 <a href="javascript:;" class="news-item-title">Duis aute irure dolor in reprehenderit</a> 214 <a href="javascript:;" class="news-item-title">Duis aute irure dolor in reprehenderit</a>
215 <p class="news-item-preview">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore.</p> 215 <p class="news-item-preview">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore.</p>
216 </div> 216 </div>
217 <div class="news-item-date"> 217 <div class="news-item-date">
218 <span class="news-item-day">08</span> 218 <span class="news-item-day">08</span>
219 <span class="news-item-month">Mar</span> 219 <span class="news-item-month">Mar</span>
220 </div> 220 </div>
221 </li> 221 </li>
222 </ul> 222 </ul>
223 </div> 223 </div>
224 <!-- /widget-content --> 224 <!-- /widget-content -->
225 </div> 225 </div>
226 <!-- /widget --> 226 <!-- /widget -->
227 </div> 227 </div>
228 <!-- /span6 --> 228 <!-- /span6 -->
229 </div> 229 </div>
230 <!-- /row --> 230 <!-- /row -->
231 </div> 231 </div>
232 <!-- /container --> 232 <!-- /container -->
233 </div> 233 </div>
234 <!-- /main --> 234 <!-- /main -->
app/partials/dashboard/dashboard.service.js
1 (function(){ 1 (function(){
2 'use strict'; 2 'use strict';
3 angular.module('acufuel') 3 angular.module('acufuel')
4 .service('dashboardService', ['$q', '$http', 'BASE_URL', dashboardService]); 4 .service('dashboardService', ['$q', '$http', 'BASE_URL', dashboardService]);
5 5
6 function dashboardService($q, $http, BASE_URL) { 6 function dashboardService($q, $http, BASE_URL) {
7 var temp = {}; 7 var temp = {};
8 8
9 this.getFuelPricingNew = function() { 9 this.getFuelPricingNew = 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/products', 14 url : BASE_URL.url +'/user/products',
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.getMargin = function() {
26
27 var deferred = $q.defer();
28 $http({
29 method : 'GET',
30 url : BASE_URL.url +'/user/margins',
31 headers : {'Content-Type': 'application/json'},
32 })
33 .then(function (result){
34 deferred.resolve(result.data);
35 },function (result){
36 deferred.resolve(result.data);
37 })
38 return deferred.promise;
39 }
40
25 this.getFuelPricingNew = function() { 41 this.getFuelPricingNew = function() {
26 42
27 var deferred = $q.defer(); 43 var deferred = $q.defer();
28 $http({ 44 $http({
29 method : 'GET', 45 method : 'GET',
30 url : BASE_URL.url +'/user/products', 46 url : BASE_URL.url +'/user/products',
31 headers : {'Content-Type': 'application/json'}, 47 headers : {'Content-Type': 'application/json'},
32 }) 48 })
33 .then(function (result){ 49 .then(function (result){
34 deferred.resolve(result.data); 50 deferred.resolve(result.data);
35 },function (result){ 51 },function (result){
36 deferred.resolve(result.data); 52 deferred.resolve(result.data);
37 }) 53 })
38 return deferred.promise; 54 return deferred.promise;
39 } 55 }
40 56
41 } 57 }
42 58
43 })(); 59 })();