structure fuel
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers\Fuel;
|
||||||
|
|
||||||
//Internal Library
|
//Internal Library
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -32,7 +32,55 @@ class FuelController extends Controller
|
|||||||
public function displayStructureFuel() {
|
public function displayStructureFuel() {
|
||||||
$aHelper = new AssetHelper;
|
$aHelper = new AssetHelper;
|
||||||
$sHelper = new StructureHelper;
|
$sHelper = new StructureHelper;
|
||||||
|
$lava = new Lavacharts;
|
||||||
|
$gates = array();
|
||||||
|
$i = 1;
|
||||||
|
|
||||||
|
$jumpGates = $sHelper->GetStructuresByType('Ansiblex Jump Gate');
|
||||||
|
$cynoBeacons = $sHelper->GetStructuresByTypes('Pharolux Cyno Beacon');
|
||||||
|
$cynoJammers = $sHelper->GetSTructureByTypes('Tenebrex Cyno Jammer');
|
||||||
|
|
||||||
|
foreach($jumpGates as $jump) {
|
||||||
|
//Liquid Ozone's item id is 16273
|
||||||
|
$lo = $aHelper->GetAssetByType(16273, $jump->structure_id);
|
||||||
|
|
||||||
|
$temp = [
|
||||||
|
'id' => $i,
|
||||||
|
'structure_id' => $jump->structure_id,
|
||||||
|
'structure_name' => $jump->structure_name,
|
||||||
|
'solar_system_name' => $jump->solar_system_name,
|
||||||
|
'fuel_expires' => $jump->fuel_expires,
|
||||||
|
'liquid_ozone' => $lo,
|
||||||
|
'row' => 'Liquid Ozone ' . $i,
|
||||||
|
'div' => 'Liquid-Ozone-' . $i . '-div',
|
||||||
|
];
|
||||||
|
|
||||||
|
array_push($gates, $temp);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($gates as $gate) {
|
||||||
|
$gateChart = $lava->DataTable();
|
||||||
|
$gateChart->addStringColumn($gate->structure_name)
|
||||||
|
->addNumberColumn('Liquid Ozone')
|
||||||
|
->addRow([$gate->row, $gate->lo]);
|
||||||
|
|
||||||
|
$lava->GaugeChart($gate->row, $gateChart, [
|
||||||
|
'width' => 300,
|
||||||
|
'redFrom' => 0,
|
||||||
|
'redTo' => 50000,
|
||||||
|
'yellowFrom' => 50000,
|
||||||
|
'yellowTo' => 150000,
|
||||||
|
'greenFrom' => 150000,
|
||||||
|
'greenTo' => 1000000,
|
||||||
|
'majorTicks' => [
|
||||||
|
'Critical',
|
||||||
|
'Ok',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('logistics.display.fuel')->with('lava', $lava)
|
||||||
|
->with('gates', $gates);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,6 +106,19 @@ class AssetHelper {
|
|||||||
Asset::where('updated_at', '<', $date)->delete();
|
Asset::where('updated_at', '<', $date)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the liquid ozone asset
|
||||||
|
*/
|
||||||
|
public function GetAssetByType($type, $structureId) {
|
||||||
|
$asset = Asset::where([
|
||||||
|
'structure_id' => $structureId,
|
||||||
|
'type' => $type,
|
||||||
|
'location_flag' => 'StructureFuel',
|
||||||
|
])->first();
|
||||||
|
|
||||||
|
return $asset->quantity;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an existing asset based off the esi pull
|
* Update an existing asset based off the esi pull
|
||||||
*/
|
*/
|
||||||
|
|||||||
8
resources/views/logistics/display/fuel.blade.php
Normal file
8
resources/views/logistics/display/fuel.blade.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
@extends('layouts.b4')
|
||||||
|
@section('content')
|
||||||
|
@foreach($gates as $gate)
|
||||||
|
<div id="{{ $gate->div }}"></div>
|
||||||
|
{!! $lava->render('Gauge Chart', $gate->row, $gate->div) !!}
|
||||||
|
<br>
|
||||||
|
@endforeach
|
||||||
|
@endsection
|
||||||
@@ -117,6 +117,7 @@ Route::group(['middleware' => ['auth']], function(){
|
|||||||
Route::get('/logistics/courier/form', 'Logistics\LogisticsController@displayContractForm');
|
Route::get('/logistics/courier/form', 'Logistics\LogisticsController@displayContractForm');
|
||||||
Route::post('/logistics/courier/form', 'Logistics\LogisticsController@displayContractDetails');
|
Route::post('/logistics/courier/form', 'Logistics\LogisticsController@displayContractDetails');
|
||||||
Route::get('/logistics/contracts/display', 'Logistics\LogisticsController@displayLogisticsContracts');
|
Route::get('/logistics/contracts/display', 'Logistics\LogisticsController@displayLogisticsContracts');
|
||||||
|
Route::get('/logistics/fuel/display', 'Fuel\FuelController@displayStructureFuel');
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user