added controller layouts for display pages
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\MiningTaxes;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class MiningTaxesAdminController extends Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\MiningTaxes;
|
||||||
|
|
||||||
|
//Internal Library
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Log;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Khill\Lavacharts\Lavacharts;
|
||||||
|
use Auth;
|
||||||
|
|
||||||
|
//Library Helpers
|
||||||
|
use App\Library\Lookups\LookupHelper;
|
||||||
|
use App\Library\Structures\StructureHelper;
|
||||||
|
|
||||||
|
//Models
|
||||||
|
use App\Models\Moon\ItemComposition;
|
||||||
|
use App\Models\Moon\MineralPrice;
|
||||||
|
use App\Models\MiningTax\Ledger;
|
||||||
|
use App\Models\MiningTax\Observer;
|
||||||
|
use App\Models\MiningTax\Invoice;
|
||||||
|
|
||||||
|
class MiningTaxesController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct() {
|
||||||
|
$this->middleware('auth');
|
||||||
|
$this->middleware('role:User');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function DisplayUpcomingExtractions() {
|
||||||
|
|
||||||
|
//Declare variables
|
||||||
|
$structures = array();
|
||||||
|
$sHelper = new StructureHelper;
|
||||||
|
|
||||||
|
//Get all the current observers from the database
|
||||||
|
$observers = Observer::all();
|
||||||
|
|
||||||
|
foreach($observers as $obs) {
|
||||||
|
$extraction = $sHelper->GetExtractions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function DisplayMiningMoons() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function DisplayAccruedTaxes() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function DisplayLedgers() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,20 +34,22 @@ class StructureHelper {
|
|||||||
public function __construct($char, $corp, $esi = null) {
|
public function __construct($char, $corp, $esi = null) {
|
||||||
$this->charId = $char;
|
$this->charId = $char;
|
||||||
$this->corpId = $corp;
|
$this->corpId = $corp;
|
||||||
$this->esi = $esi;
|
if($esi == null) {
|
||||||
|
$esiHelper = new Esi;
|
||||||
|
$token = $esiHelper->GetRefreshToken($char);
|
||||||
|
$this->esi = $esiHelper->SetupEsiAuthentication($token);
|
||||||
|
} else {
|
||||||
|
$this->esi = $esi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetExtractions() {
|
||||||
|
//Declare some variables
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetStructuresByPage($page) {
|
public function GetStructuresByPage($page) {
|
||||||
//Declare some variables
|
|
||||||
$esiHelper = new Esi;
|
|
||||||
|
|
||||||
if($this->esi == null) {
|
|
||||||
//Get the refresh token from the database
|
|
||||||
$token = $esiHelper->GetRefreshToken($this->charId);
|
|
||||||
//Create the esi authentication container
|
|
||||||
$this->esi = $esiHelper->SetupEsiAuthentication($token);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Try to get the ESI data
|
//Try to get the ESI data
|
||||||
try {
|
try {
|
||||||
$structures = $this->esi->page($page)
|
$structures = $this->esi->page($page)
|
||||||
@@ -63,14 +65,7 @@ class StructureHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function ProcessStructure($structure) {
|
public function ProcessStructure($structure) {
|
||||||
//Declare some variables
|
|
||||||
$esiHelper = new Esi;
|
|
||||||
|
|
||||||
//Get the refresh token from the database
|
|
||||||
$token = $esiHelper->GetRefreshToken($this->charId);
|
|
||||||
//Setup the esi authentication container
|
|
||||||
$this->esi = $esiHelper->SetupEsiAuthentication($token);
|
|
||||||
|
|
||||||
//Get the structure information
|
//Get the structure information
|
||||||
$info = $this->GetStructureInfo($structure->structure_id);
|
$info = $this->GetStructureInfo($structure->structure_id);
|
||||||
|
|
||||||
@@ -88,13 +83,6 @@ class StructureHelper {
|
|||||||
$esiHelper = new Esi;
|
$esiHelper = new Esi;
|
||||||
$lookup = new LookupHelper;
|
$lookup = new LookupHelper;
|
||||||
|
|
||||||
if($this->esi == null) {
|
|
||||||
//Get the refresh token
|
|
||||||
$token = $esiHelper->GetRefreshToken($this->charId);
|
|
||||||
//Setup the esi authentication container
|
|
||||||
$this->esi = $esiHelper->SetupEsiAuthentication($token);
|
|
||||||
}
|
|
||||||
|
|
||||||
$solar = $lookup->SystemIdToName($systemId);
|
$solar = $lookup->SystemIdToName($systemId);
|
||||||
|
|
||||||
if($solar != null) {
|
if($solar != null) {
|
||||||
@@ -108,13 +96,6 @@ class StructureHelper {
|
|||||||
//Declare some variables
|
//Declare some variables
|
||||||
$esiHelper = new Esi;
|
$esiHelper = new Esi;
|
||||||
|
|
||||||
if($this->esi == null) {
|
|
||||||
//Get the refresh token
|
|
||||||
$token = $esiHelper->GetRefreshToken($this->charId);
|
|
||||||
//Setup the esi authentication container
|
|
||||||
$this->esi = $esiHelper->SetupEsiAuthentication($token);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$info = $this->esi->invoke('get', '/universe/structures/{structure_id}/', [
|
$info = $this->esi->invoke('get', '/universe/structures/{structure_id}/', [
|
||||||
'structure_id' => $structureId,
|
'structure_id' => $structureId,
|
||||||
|
|||||||
Reference in New Issue
Block a user