flex structure registry framework
This commit is contained in:
66
app/Http/Controllers/Flex/FlexAdminController.php
Normal file
66
app/Http/Controllers/Flex/FlexAdminController.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Flex;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Auth;
|
||||
use DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Models
|
||||
use App\Models\Flex\FlexStructure;
|
||||
|
||||
//Library
|
||||
use App\Library\Lookups\NewLookupHelper;
|
||||
use App\Library\Esi\Esi;
|
||||
|
||||
class FlexAdminController extends Controller
|
||||
{
|
||||
//Constructor
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role:Admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to display all active flex structures and
|
||||
* the information regarding the flex structure
|
||||
*/
|
||||
public function displayFlexStructure() {
|
||||
|
||||
//Get the structures from the database
|
||||
$structures = FlexStructure::all();
|
||||
|
||||
return view('flex.view')->with('structures', $structures);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to display form for adding new flex structure
|
||||
*/
|
||||
public function displayAddFlexStructure() {
|
||||
return view('flex.add');
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to add new flex structure to the database
|
||||
*/
|
||||
public function addFlexStructure(Request $request) {
|
||||
$this->validate($request, [
|
||||
|
||||
]);
|
||||
|
||||
return redirect('/flex/display')->with('success', 'Flex Structure Added.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Funciton to remove flex structure from the database
|
||||
*/
|
||||
public function removeFlexStructure(Request $request) {
|
||||
$this->validate($request, [
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
34
app/Models/Flex/FlexStructure.php
Normal file
34
app/Models/Flex/FlexStructure.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Flex;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FlexStructure extends Model
|
||||
{
|
||||
/**
|
||||
* Table Name
|
||||
*/
|
||||
public $table = 'alliance_flex_structures';
|
||||
|
||||
/**
|
||||
* Timestamps
|
||||
*/
|
||||
public $timestamps = true;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'requestor_id',
|
||||
'requestor_name',
|
||||
'requestor_corp_id',
|
||||
'requestor_corp_name',
|
||||
'system_id',
|
||||
'system',
|
||||
'structure_type',
|
||||
'structure_cost',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateFlexStructuresTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('alliance_flex_structures')) {
|
||||
Schema::create('alliance_flex_structures', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->bigUnsignedInteger('requestor_id');
|
||||
$table->string('request_name');
|
||||
$table->bigUnsignedInteger('requestor_corp_id');
|
||||
$table->string('request_corp_name');
|
||||
$table->bigUnsignedInteger('system_id');
|
||||
$table->string('system');
|
||||
$table->enum('structure_type', [
|
||||
'Cyno Jammer',
|
||||
'Cyno Beacon',
|
||||
'Jump Bridge',
|
||||
'Super Construction Facilities',
|
||||
]);
|
||||
$table->double('structure_cost', 20, 2);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('flex_structures');
|
||||
}
|
||||
}
|
||||
35
resources/views/flex/add.blade.php
Normal file
35
resources/views/flex/add.blade.php
Normal file
@@ -0,0 +1,35 @@
|
||||
@extends('layouts.b4')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>New Flex Structure Registration</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ Form::open(['action' => 'Flex\FlexAdminController@addFlexStructure', 'method' => 'POST']) }}
|
||||
<div class="form-group">
|
||||
{{ Form::label('requestor_name', 'Character Name') }}
|
||||
{{ Form::text('requestor_name', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('requestor_corp_name', 'Corporation Name') }}
|
||||
{{ Form::text('requestor_corp_name', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('system', 'System') }}
|
||||
{{ Form::text('system', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('structure_type', 'Structure Type') }}
|
||||
{{ Form::text('structure_type', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('structure_cost', 'Structure Cost') }}
|
||||
{{ Form::text('structure_cost', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
37
resources/views/flex/list.blade.php
Normal file
37
resources/views/flex/list.blade.php
Normal file
@@ -0,0 +1,37 @@
|
||||
@extends('layouts.b4')
|
||||
@section('content')
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Flex Structures</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($structures != null)
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<th>Requestor</th>
|
||||
<th>Corp</th>
|
||||
<th>System</th>
|
||||
<th>Structure Type</th>
|
||||
<th>Cost</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($structures as $structure)
|
||||
<tr>
|
||||
<td>{{ $structure->requestor_name }}</td>
|
||||
<td>{{ $structure->requestor_corp_name }}</td>
|
||||
<td>{{ $structure->system }}</td>
|
||||
<td>{{ $structure->structure_type }}</td>
|
||||
<td>{{ number_format($structure->structure_cost, "2", ".", ",") }}
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<h3>No Flex Structures Registered</h3>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -93,6 +93,14 @@ Route::group(['middleware' => ['auth']], function(){
|
||||
Route::post('/dashboard/alt/delete', 'Dashboard\DashboardController@removeAlt');
|
||||
Route::get('/profile', 'Dashboard\DashboardController@profile');
|
||||
|
||||
/**
|
||||
* Flex Admin Controller display pages
|
||||
*/
|
||||
Route::get('/flex/display', 'Flex\FlexAdminController@displayFlexStructures');
|
||||
Route::get('/flex/display/add', 'Flex\FlexAdminController@displayAddFlexStructure');
|
||||
Route::post('/flex/display/add', 'Flex\FlexAdminController@addFlexStructure');
|
||||
Route::post('/flex/display/remove', 'Flex\FlexAdminController@removeFlexStructure');
|
||||
|
||||
/**
|
||||
* Fuel Controller display pages
|
||||
*/
|
||||
|
||||
4
vendor/composer/autoload_classmap.php
vendored
4
vendor/composer/autoload_classmap.php
vendored
@@ -30,6 +30,7 @@ return array(
|
||||
'App\\Http\\Controllers\\Controller' => $baseDir . '/app/Http/Controllers/Controller.php',
|
||||
'App\\Http\\Controllers\\Dashboard\\AdminController' => $baseDir . '/app/Http/Controllers/Dashboard/AdminController.php',
|
||||
'App\\Http\\Controllers\\Dashboard\\DashboardController' => $baseDir . '/app/Http/Controllers/Dashboard/DashboardController.php',
|
||||
'App\\Http\\Controllers\\Flex\\FlexAdminController' => $baseDir . '/app/Http/Controllers/Flex/FlexAdminController.php',
|
||||
'App\\Http\\Controllers\\Fuel\\FuelController' => $baseDir . '/app/Http/Controllers/Logistics/FuelController.php',
|
||||
'App\\Http\\Controllers\\Logistics\\StructureRequestController' => $baseDir . '/app/Http/Controllers/Logistics/StructureRequestController.php',
|
||||
'App\\Http\\Controllers\\Market\\MarketController' => $baseDir . '/app/Http/Controllers/Market/MarketController.php',
|
||||
@@ -79,7 +80,7 @@ return array(
|
||||
'App\\Library\\Structures\\StructureHelper' => $baseDir . '/app/Library/Structures/StructureHelper.php',
|
||||
'App\\Library\\Taxes\\TaxesHelper' => $baseDir . '/app/Library/Taxes/TaxesHelper.php',
|
||||
'App\\Models\\Admin\\AllowedLogin' => $baseDir . '/app/Models/Admin/AllowedLogin.php',
|
||||
'App\\Models\\Character\\BlacklistUser' => $baseDir . '/app/Models/Charcter/BlacklistUser.php',
|
||||
'App\\Models\\Blacklist\\BlacklistUser' => $baseDir . '/app/Models/Blacklist/BlacklistUser.php',
|
||||
'App\\Models\\Config' => $baseDir . '/app/Models/Moon/Config.php',
|
||||
'App\\Models\\Contracts\\AcceptedBid' => $baseDir . '/app/Models/Contracts/AcceptedBid.php',
|
||||
'App\\Models\\Contracts\\Bid' => $baseDir . '/app/Models/Contracts/Bid.php',
|
||||
@@ -101,6 +102,7 @@ return array(
|
||||
'App\\Models\\Finances\\PlayerDonationJournal' => $baseDir . '/app/Models/Finances/PlayerDonationJournal.php',
|
||||
'App\\Models\\Finances\\ReprocessingTaxJournal' => $baseDir . '/app/Models/Finances/ReprocessingTaxJournal.php',
|
||||
'App\\Models\\Finances\\StructureIndustryTaxJournal' => $baseDir . '/app/Models/Finances/StructureIndustryTaxJournal.php',
|
||||
'App\\Models\\Flex\\FlexStructure' => $baseDir . '/app/Models/Flex/FlexStructure.php',
|
||||
'App\\Models\\Jobs\\JobProcessAsset' => $baseDir . '/app/Models/Jobs/JobProcessAsset.php',
|
||||
'App\\Models\\Jobs\\JobProcessStructure' => $baseDir . '/app/Models/Jobs/JobProcessStructure.php',
|
||||
'App\\Models\\Jobs\\JobProcessWalletJournal' => $baseDir . '/app/Models/Jobs/JobProcessWalletJournal.php',
|
||||
|
||||
4
vendor/composer/autoload_static.php
vendored
4
vendor/composer/autoload_static.php
vendored
@@ -494,6 +494,7 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
|
||||
'App\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/app/Http/Controllers/Controller.php',
|
||||
'App\\Http\\Controllers\\Dashboard\\AdminController' => __DIR__ . '/../..' . '/app/Http/Controllers/Dashboard/AdminController.php',
|
||||
'App\\Http\\Controllers\\Dashboard\\DashboardController' => __DIR__ . '/../..' . '/app/Http/Controllers/Dashboard/DashboardController.php',
|
||||
'App\\Http\\Controllers\\Flex\\FlexAdminController' => __DIR__ . '/../..' . '/app/Http/Controllers/Flex/FlexAdminController.php',
|
||||
'App\\Http\\Controllers\\Fuel\\FuelController' => __DIR__ . '/../..' . '/app/Http/Controllers/Logistics/FuelController.php',
|
||||
'App\\Http\\Controllers\\Logistics\\StructureRequestController' => __DIR__ . '/../..' . '/app/Http/Controllers/Logistics/StructureRequestController.php',
|
||||
'App\\Http\\Controllers\\Market\\MarketController' => __DIR__ . '/../..' . '/app/Http/Controllers/Market/MarketController.php',
|
||||
@@ -543,7 +544,7 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
|
||||
'App\\Library\\Structures\\StructureHelper' => __DIR__ . '/../..' . '/app/Library/Structures/StructureHelper.php',
|
||||
'App\\Library\\Taxes\\TaxesHelper' => __DIR__ . '/../..' . '/app/Library/Taxes/TaxesHelper.php',
|
||||
'App\\Models\\Admin\\AllowedLogin' => __DIR__ . '/../..' . '/app/Models/Admin/AllowedLogin.php',
|
||||
'App\\Models\\Character\\BlacklistUser' => __DIR__ . '/../..' . '/app/Models/Charcter/BlacklistUser.php',
|
||||
'App\\Models\\Blacklist\\BlacklistUser' => __DIR__ . '/../..' . '/app/Models/Blacklist/BlacklistUser.php',
|
||||
'App\\Models\\Config' => __DIR__ . '/../..' . '/app/Models/Moon/Config.php',
|
||||
'App\\Models\\Contracts\\AcceptedBid' => __DIR__ . '/../..' . '/app/Models/Contracts/AcceptedBid.php',
|
||||
'App\\Models\\Contracts\\Bid' => __DIR__ . '/../..' . '/app/Models/Contracts/Bid.php',
|
||||
@@ -565,6 +566,7 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
|
||||
'App\\Models\\Finances\\PlayerDonationJournal' => __DIR__ . '/../..' . '/app/Models/Finances/PlayerDonationJournal.php',
|
||||
'App\\Models\\Finances\\ReprocessingTaxJournal' => __DIR__ . '/../..' . '/app/Models/Finances/ReprocessingTaxJournal.php',
|
||||
'App\\Models\\Finances\\StructureIndustryTaxJournal' => __DIR__ . '/../..' . '/app/Models/Finances/StructureIndustryTaxJournal.php',
|
||||
'App\\Models\\Flex\\FlexStructure' => __DIR__ . '/../..' . '/app/Models/Flex/FlexStructure.php',
|
||||
'App\\Models\\Jobs\\JobProcessAsset' => __DIR__ . '/../..' . '/app/Models/Jobs/JobProcessAsset.php',
|
||||
'App\\Models\\Jobs\\JobProcessStructure' => __DIR__ . '/../..' . '/app/Models/Jobs/JobProcessStructure.php',
|
||||
'App\\Models\\Jobs\\JobProcessWalletJournal' => __DIR__ . '/../..' . '/app/Models/Jobs/JobProcessWalletJournal.php',
|
||||
|
||||
Reference in New Issue
Block a user