Compare commits

...

184 Commits

Author SHA1 Message Date
516105c492 composer updates 2020-12-21 11:07:01 +00:00
e7b3093986 composer update 2020-12-21 11:01:29 +00:00
064cd2244b laravel rollback 2020-12-21 19:35:33 +09:00
b0bf2a107b composer update 2020-12-21 19:24:33 +09:00
09413522bb composer update 2020-12-06 10:28:55 +00:00
69d92960d9 blacklist updates 2020-12-04 06:57:20 -06:00
3f5ce7dbf4 blacklist modifications and moon admin new stuff 2020-12-04 06:55:48 -06:00
76658b85f1 list updated for flex structures 2020-11-30 11:25:28 -06:00
cbf2c3f9e4 flex structure removal 2020-11-09 04:23:50 -06:00
120c0808bb flex structure removal 2020-11-09 04:22:26 -06:00
e6ac3e9056 modified remove flex structure 2020-11-09 04:20:53 -06:00
52be26a099 modified remove flex structure 2020-11-09 04:17:34 -06:00
c75107e34a flex structure deletion 2020-11-09 04:09:50 -06:00
05c613bf61 flex structure deletion issue 2020-11-09 03:33:18 -06:00
5528a0e024 item prices update 2020-10-03 04:33:07 -05:00
98e69fcc25 item prices update 2020-10-03 04:32:28 -05:00
d3f33979e4 blacklist fix 2020-09-29 00:01:28 -05:00
46ee5cf3b1 moon calc library 2020-09-14 00:18:47 -05:00
7c72944d7d moon stuff 2020-09-13 23:59:59 -05:00
f665050d66 moon update pricing 2020-09-13 23:30:34 -05:00
393a412784 gas moon price stuff 2020-09-13 23:18:41 -05:00
30e859b552 moon calc 2020-09-13 22:47:11 -05:00
a70c0bf4e9 moon calc library 2020-09-13 22:43:00 -05:00
e745502542 update moon rental pricing 2020-09-13 21:48:46 -05:00
55acc5e487 added log info for updating rental prices 2020-09-13 21:38:58 -05:00
c0d2348fc3 added log info for updating rental prices 2020-09-13 21:33:44 -05:00
e5a225a687 moon calc changes 2020-09-13 21:01:07 -05:00
257a6e3eb6 moon price update stuff 2020-09-13 20:54:34 -05:00
7b5268f0a3 pricing for moons where moon goo is priced at half the value 2020-09-12 17:06:56 -05:00
b6fcbd1b4a updated srp form stuff 2020-09-07 05:14:30 -05:00
c19b417a5d rental updates 2020-09-03 01:55:41 -05:00
94307d105d rental admin controller 2020-09-03 01:54:06 -05:00
16e5a9808b rental admin controller 2020-09-03 01:53:06 -05:00
2239ec16a8 rental admin controller 2020-09-03 01:51:51 -05:00
0e6109c09a blacklist update to add removal notes 2020-08-30 07:52:11 -05:00
a242bffb28 moon blade for sidebar to allow others to see rental moons 2020-08-26 22:41:49 -05:00
6717cbad48 updated structure request redirect 2020-08-18 19:32:22 -05:00
b7762cc18d fixed structure request form hopefully. 2020-08-14 22:48:36 -05:00
6ee0d8fef1 structure request controller was missing a namespace it needed. 2020-08-14 22:40:17 -05:00
58ef54e859 created a new job 2020-08-12 03:58:14 -05:00
076079f981 created a new job 2020-08-12 03:50:04 -05:00
22d0171e13 created a new job 2020-08-12 03:48:58 -05:00
12b6f8b98c created a new job 2020-08-12 03:43:50 -05:00
978a028553 adjusted the moon calc database functions 2020-08-12 03:35:12 -05:00
685dabede3 item updates weren't working for whatever reason 2020-08-12 03:33:00 -05:00
b7bfe880f4 item updates weren't working for whatever reason 2020-08-12 03:32:06 -05:00
72502ae53f add form for system rentals 2020-08-12 03:02:04 -05:00
5688f6ebb8 add form for system rentals 2020-08-12 02:57:39 -05:00
b916d0364c add form for system rentals 2020-08-12 02:56:47 -05:00
15ec617fec add form for system rentals 2020-08-12 02:46:32 -05:00
cd7428e3c3 add form for system rentals 2020-08-12 02:44:34 -05:00
6023f9801f add form for system rentals 2020-08-12 02:44:10 -05:00
5dad7a0427 add form for system rentals 2020-08-12 02:29:25 -05:00
d156c69992 add form for system rentals 2020-08-12 02:28:25 -05:00
82c755409d add form for system rentals 2020-08-12 02:27:25 -05:00
2f7aee4aad add form for system rentals 2020-08-12 02:25:48 -05:00
1824deecae add form for system rentals 2020-08-12 02:23:46 -05:00
2d5a1194bf blade fix for system rentals 2020-08-12 02:17:14 -05:00
e936fc721e namespace fix 2020-08-12 02:15:58 -05:00
4ba1dd8a11 namespace fix 2020-08-12 02:15:00 -05:00
716371200b namespace issue 2020-08-12 02:13:46 -05:00
ed7e2c9bb4 system rentals pages 2020-08-12 02:12:49 -05:00
57fbc092c8 rental system web routes 2020-08-12 02:11:21 -05:00
5fd183f95c created form for rental costs similar to flex structures 2020-08-10 02:17:21 -05:00
8dd1377090 changed journal entries to 2 months rather than 1 month. 2020-08-09 23:41:11 -05:00
bb63f9697e supply chain controller 2020-08-07 14:23:48 -05:00
99f63627b2 supply chain controller 2020-08-07 14:21:40 -05:00
a50182b1e5 supply chain controller 2020-08-07 14:19:51 -05:00
d5c57aca1c supply chain controller 2020-08-07 14:18:39 -05:00
273cb2b775 supply chain controller 2020-08-07 14:16:56 -05:00
ec315dc63f supply chain controller 2020-08-07 14:14:58 -05:00
4c0126bf4b supply chain controller 2020-08-07 14:12:45 -05:00
40135f5861 supply chain controller 2020-08-07 14:11:20 -05:00
76cbe6a073 supply chain controller 2020-08-07 13:57:27 -05:00
a08959980a supply chain controller 2020-08-07 13:55:16 -05:00
4e1a454d4e supply chain controller 2020-08-07 13:54:46 -05:00
eef0d65d44 supply chain controller 2020-08-07 13:50:52 -05:00
bb84b15f3b supply chain controller 2020-08-07 13:50:16 -05:00
0f108a709c supply chain controller 2020-08-07 13:40:24 -05:00
eb6c1c7c3b supply chain controller 2020-08-07 13:33:13 -05:00
bb026d2cd9 updated supply chain contract controller 2020-08-07 13:31:00 -05:00
955e494e05 closed supply chain contract labeling on the dashboard 2020-08-07 12:35:37 -05:00
7d07bde52c removed debugging line in blade 2020-08-07 12:34:25 -05:00
8a7e84ebb8 delete supply chain contract 2020-08-07 12:32:52 -05:00
075ec5f6bf redirect after storing bid. 2020-08-07 12:31:21 -05:00
aa0d510b05 open contracts blade file 2020-08-07 12:28:43 -05:00
0962ffb372 open contracts 2020-08-07 12:26:21 -05:00
ea75ac6d25 open contracts 2020-08-07 12:23:36 -05:00
d0c16d60cd open contracts 2020-08-07 12:19:56 -05:00
fdebf19a26 changed form to button only and updated web routes 2020-08-07 12:18:33 -05:00
6367b1593d changed form to button only and updated web routes 2020-08-07 12:18:01 -05:00
7c9e5e8491 troubleshooting supply chain contracts 2020-08-07 12:12:16 -05:00
9e90e785a3 fixed includes for supply chain contract blades 2020-08-07 12:07:58 -05:00
0474936bfc stuff 2020-08-07 12:05:13 -05:00
430432a18b supply chain contract controller 2020-08-07 12:01:22 -05:00
9d45b67c73 new supply chain contract mail 2020-08-07 11:59:58 -05:00
3bd7b9c2fd fixed new contract blade 2020-08-07 11:56:46 -05:00
3b5952cd44 fixed new contract blade 2020-08-07 11:55:22 -05:00
910e32809f added migration to drop wormhole tables 2020-08-07 11:19:37 -05:00
c888741aef removed several things including wormholes which weren't being utilized at all 2020-08-07 10:38:47 -05:00
8f74542371 updated rental moon mail 2020-08-04 02:44:41 -05:00
e86e7f62d3 updated request moon blade to show dy-p 2020-08-02 14:06:16 -05:00
9054c47777 updated request moon blade to show dy-p 2020-08-02 14:05:07 -05:00
735ca514bc adjusted the structure request mail delay 2020-08-02 13:41:36 -05:00
f008087b71 removed contract stuff from admin dashboard 2020-08-02 13:32:16 -05:00
3f510e40e7 moons controller 2020-08-02 13:29:50 -05:00
03f00518c3 issue with modify user page 2020-08-01 06:09:02 -05:00
c512629637 issue with modify user page 2020-08-01 06:06:36 -05:00
c38ffd3643 modified people to be able to see rental moon stuff with a permission 2020-08-01 06:02:21 -05:00
4f8c08011a added mail to be sent to Minerva and Rock about moon requests being entered into the system. 2020-08-01 05:05:42 -05:00
d476978cde create command to replace item compositions from sde file 2020-07-29 02:25:33 -05:00
b32812217b removed wiki from the navbar 2020-07-26 01:16:01 -05:00
8cf4c98633 commands and job 2020-07-26 01:14:22 -05:00
cf98e875ee modified add allowed login. 2020-07-23 22:25:32 -05:00
427759a98e modified open and closed contract blades 2020-07-22 01:45:02 -05:00
b537aa6ea1 modified open and closed contract blades 2020-07-22 01:39:34 -05:00
c079ae3c60 added buttons to dashboard for supply chain contracts 2020-07-22 01:31:27 -05:00
4043037d87 added buttons to dashboard for supply chain contracts 2020-07-22 01:22:37 -05:00
9a9b71f479 added buttons to dashboard for supply chain contracts 2020-07-22 01:21:56 -05:00
77429e2013 added buttons to dashboard for supply chain contracts 2020-07-22 01:13:18 -05:00
7e8ae3ab68 added buttons to dashboard for supply chain contracts 2020-07-22 01:12:25 -05:00
838aa1612a added buttons to dashboard for supply chain contracts 2020-07-22 01:10:09 -05:00
204a6c10dc added buttons to dashboard for supply chain contracts 2020-07-22 01:09:26 -05:00
936a8831fa added buttons to dashboard for supply chain contracts 2020-07-22 01:07:25 -05:00
7c86d0d9df added buttons to dashboard for supply chain contracts 2020-07-22 01:06:01 -05:00
60814f7c1c added buttons to dashboard for supply chain contracts 2020-07-22 01:03:25 -05:00
f4a193ec91 created supply chain contract end command and job 2020-07-21 23:38:16 -05:00
686ff34a11 modified nav bar for supply chain contracts 2020-07-21 23:36:09 -05:00
00ac338981 updated routes and browser links 2020-07-21 01:43:10 -05:00
b9af1cb074 updated routes and browser links 2020-07-21 01:42:28 -05:00
8c885636de updated routes and browser links 2020-07-21 01:23:46 -05:00
b114a16bed updated routes and browser links 2020-07-21 01:23:29 -05:00
a096edb88f updated routes and browser links 2020-07-21 01:21:30 -05:00
890c805f37 updated routes and browser links 2020-07-21 01:20:14 -05:00
9fe794543e fixed typo 2020-07-20 22:50:01 -05:00
bda6d5bdee added ability to add B, M, b, or m for bids text box on the form. 2020-07-20 22:49:11 -05:00
997d29c88a supply chain stuff 2020-07-20 06:46:54 -05:00
2d2395a97d supply chain coding 2020-07-10 03:44:33 -05:00
cc04244df8 supply chain stuff 2020-07-09 02:14:55 -05:00
fd21d72887 supply chain contracts views 2020-07-08 03:19:16 -05:00
52ae227085 past contract stuff 2020-06-29 00:33:36 -05:00
e264f23237 past contract stuff 2020-06-29 00:33:07 -05:00
854438a2ee past contract stuff 2020-06-29 00:32:39 -05:00
9fc304040a past contracts for nav bar on admin dashboard menu 2020-06-29 00:32:04 -05:00
bf5748d58e past contracts for nav bar on admin dashboard menu 2020-06-29 00:27:16 -05:00
e9ed06dbf3 past contracts for nav bar on admin dashboard menu 2020-06-29 00:26:14 -05:00
510fe5257a past contracts for nav bar on admin dashboard menu 2020-06-29 00:25:14 -05:00
9b4e2fabfa past contracts for nav bar on admin dashboard menu 2020-06-29 00:24:51 -05:00
0dae280d9f past contracts for nav bar on admin dashboard menu 2020-06-29 00:24:17 -05:00
75e20fb5d9 past contracts for nav bar on admin dashboard menu 2020-06-29 00:22:51 -05:00
0c1174d113 past contracts for nav bar on admin dashboard menu 2020-06-29 00:22:12 -05:00
50ddedb652 past contracts for nav bar on admin dashboard menu 2020-06-29 00:01:47 -05:00
4a39921355 past contracts 2020-06-29 00:00:29 -05:00
5fb5503d3e past contracts 2020-06-28 23:59:27 -05:00
c50bbe8c25 contract re-work 2020-06-28 15:06:50 -05:00
dd82f8cb8b contract re-work 2020-06-28 15:06:25 -05:00
d2570cec55 mailing list change for contracts 2020-06-28 02:22:35 -05:00
01435c6cea mail formatting issue 2020-06-27 20:02:33 -05:00
ddf7ec0c27 modify user role 2020-06-27 12:17:00 -05:00
400b777484 modify user role 2020-06-27 12:16:30 -05:00
fbbd4409d0 black list update 2020-06-27 11:41:36 -05:00
37865e134c moons admin controller coloring for moon rentals 2020-06-23 22:58:50 -05:00
e010cf1327 new moon stuff 2020-06-23 11:00:09 -05:00
da5d642505 moon testing 2020-06-23 00:13:52 -05:00
1f1c001fde moon testing 2020-06-22 23:51:06 -05:00
fc5261a645 moon testing 2020-06-22 22:43:32 -05:00
4c3da5c4b1 moon testing 2020-06-22 22:28:15 -05:00
163c57c600 moon testing 2020-06-22 22:27:21 -05:00
545a691387 color issues 2020-06-22 21:05:42 -05:00
f8a77b7c29 color issues 2020-06-22 20:48:33 -05:00
f2c3507355 color issues 2020-06-22 20:46:39 -05:00
6cbe808b89 color issues 2020-06-22 20:46:01 -05:00
bed71908ae alliance moon testing 2020-06-22 20:39:27 -05:00
5a48e6af32 alliance moon testing 2020-06-22 20:36:31 -05:00
4c8e9d58fd alliance moon testing 2020-06-22 20:35:35 -05:00
31d79bcc32 alliance moon testing 2020-06-22 20:33:23 -05:00
db91d9410c alliance moon testing 2020-06-22 20:30:53 -05:00
405a785b65 alliance moon testing 2020-06-22 20:25:20 -05:00
6994cb1e94 alliance moon testing 2020-06-22 20:22:50 -05:00
49e1ec3638 update for troubleshooting 2020-06-22 20:18:31 -05:00
60d47747ba navbar fix 2020-06-17 21:58:45 -05:00
375b121eb8 request rental moon page 2020-06-09 23:41:53 -05:00
27939b153f navigation issue 2020-06-07 22:18:15 -05:00
18d1eee592 added market to flex structures to keep track of. 2020-06-07 00:05:53 -05:00
1977 changed files with 63945 additions and 64348 deletions

View File

@@ -2,30 +2,31 @@
namespace App\Console\Commands\Eve;
//Internal Library
use Illuminate\Console\Command;
use Log;
//Library
use Commands\Library\CommandHelper;
use App\Library\Moons\MoonCalc;
//Job
use App\Jobs\Commands\Eve\GetEveRegionsJob;
use App\Jobs\Commands\Eve\ItemPricesUpdateJob;
class GetEveRegionsCommand extends Command
class ItemPricesUpdateCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'eve:getRegions';
protected $signature = 'services:ItemPriceUpdate';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Gets all of the information for regions from the eve esi';
protected $description = 'Update mineral and ore prices';
/**
* Create a new command instance.
@@ -44,6 +45,14 @@ class GetEveRegionsCommand extends Command
*/
public function handle()
{
GetEveRegionsJob::dispatch();
$task = new CommandHelper('ItemPriceUpdate');
$task->SetStartStatus();
$moonHelper = new MoonCalc;
$moonHelper->FetchNewPrices();
//ItemPricesUpdateJob::dispatch()->onQueue('default');
$task->SetStopStatus();
}
}

View File

@@ -0,0 +1,98 @@
<?php
namespace App\Console\Commands\Files;
//Internal Stuff
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
class UpdateItemCompositionFromSDECommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'sde:update:ItemCompositions';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Updates item compositions from sql file.';
/**
* The SDE storage path
*
* @var
*/
protected $storage_path;
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Query the sql file for the related database information
*
* @return mixed
*/
public function handle()
{
//Start by warning the user about the command which will be run
$this->comment('Warning! This Laravel command uses exec() to execute a ');
$this->comment('mysql shell command to import an extracted dump. Due');
$this->comment('to the way the command is constructed, should someone ');
$this->comment('view the current running processes of your server, they ');
$this->comment('will be able to see your SeAT database users password.');
$this->line('');
$this->line('Ensure that you understand this before continuing.');
//Test we have valid database parameters
DB::connection()->getDatabaseName();
//Warn the user about the operation to begin
if (! $this->confirm('Are you sure you want to update to the latest EVE SDE?', true)) {
$this->warn('Exiting');
return;
}
$fileName = $this->getSde();
$this->importSde($fileName);
}
/**
* Download the EVE Sde from Fuzzwork and save it
* in the storage_path/sde folder
*/
public function getSde() {
return $fileName;
}
/**
* Extract the SDE file downloaded and run the MySQL command to import the table into the database
*/
public function importSde($fileName) {
$import_command = 'mysql -u username -p password database < ' . $file;
//run the command
exec($import_command, $output, $exit_code);
if($exit_code !== 0) {
$this->error('Warning: Import failed with exit code ' .
$exit_code . ' and command outut: ' . implode('\n', $output));
}
}
}

View File

@@ -1,70 +0,0 @@
<?php
namespace App\Console\Commands;
//Internal Library
use Illuminate\Console\Command;
use Log;
//Library
use Commands\Library\CommandHelper;
//Jobs
use App\Jobs\Commands\Market\GetMarketRegionOrderJob;
class GetMarketDataCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:MarketData';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Get the market data for regions';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$task = new CommandHelper('GetMarketData');
$task->SetStartStatus();
$regions = [
'Immensea' => 10000025,
'Catch' => 10000014,
'Tenerifis' => 10000061,
'The Forge' => 10000002,
'Impass' => 10000031,
'Esoteria' => 10000039,
'Detorid' => 10000005,
'Omist' => 10000062,
'Feythabolis' => 10000056,
'Insmother' => 10000009,
];
foreach($regions as $key => $value) {
GetMarketRegionOrderJob::dispatch($value);
}
$task->SetStopStatus();
}
}

View File

@@ -1,50 +0,0 @@
<?php
namespace App\Console\Commands;
//Internal Library
use Illuminate\Console\Command;
use Log;
//Library
use Commands\Library\CommandHelper;
//Jobs
use App\Jobs\Commands\Market\PurgeMarketRegionOrderJob;
class PurgeMarketDataCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:PurgeMarketData';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Purges old market data from the database';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
PurgeMarketDataJob::dispatch();
}
}

View File

@@ -1,70 +0,0 @@
<?php
namespace App\Console\Commands;
//Internal Library
use Illuminate\Console\Command;
use Log;
//Library
use Commands\Library\CommandHelper;
//Jobs
use App\Jobs\Commands\PublicContracts\GetPublicContractsJob;
class PublicContractsCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:PublicContracts';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Get the public contracts in a region';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$task = new CommandHelper('PublicContracts');
$task->SetStartStatus();
$regions = [
'Immensea' => 10000025,
'Catch' => 10000014,
'Tenerifis' => 10000061,
'The Forge' => 10000002,
'Impass' => 10000031,
'Esoteria' => 10000039,
'Detorid' => 10000005,
'Omist' => 10000062,
'Feythabolis' => 10000056,
'Insmother' => 10000009,
];
foreach($regions as $key => $value) {
GetPublicContractsJob::dispatch($value);
}
$task->SetStopStatus();
}
}

View File

@@ -0,0 +1,61 @@
<?php
namespace App\Console\Commands\SupplyChain;
//Internal Library
use Illuminate\Console\Command;
use Log;
use Carbon\Carbon;
//Models
use App\Models\Contracts\SupplyChainContract;
//Job
use App\Jobs\Commands\SupplyChain\EndSupplyChainContractJob;
class EndSupplyChainContractCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:supplychain';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Checks and ends any supply chain contracts needs to be closed.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$today = Carbon::now();
//Get the supply chain contracts which are open, but need to be closed.
$contracts = SupplyChainContract::where([
'state' => 'open',
])->where('end_date', '>', $today)->get();
//Create jobs to complete each contract
foreach($contracts as $contract) {
EndSupplyChainContractJob::dispatch($contract)->onQueue('default');
}
}
}

View File

@@ -0,0 +1,133 @@
<?php
namespace App\Console\Commands\SystemRental;
//Internal Library
use Illuminate\Console\Command;
use Carbon\Carbon;
//Jobs
use App\Jobs\ProcessSendEveMailJob;
//Library
use Command\Library\CommandHelper;
//Models
use App\Models\Rentals\RentalSystem;
use App\Models\Mail\SentMail;
class SystemRentalCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:SystemRentals';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Mail out bill for system rentals.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//Create the new command helper container
$task = new CommandHelper('SystemRentalMailer');
//Add the entry into the jobs table saying the job has started
$task->SetStartStatus();
//Create other variables
$body = null;
$delay = 30;
//Get today's date
$today = Carbon::now();
$today->second = 2;
$today->minute = 0;
$today->hour = 0;
//Get the esi configuration
$config = config('esi');
//Get all of the contacts for the system rentals
$contacts = RentalSystem::select('contact_id')->orderBy('contact_id')->get();
//For each of the contacts send a reminder mail about the total of the systems they are paying for
foreach($contacts as $contact) {
//Get all of the systems
$systems = RentalSystem::where([
'contact_id' => $contact->contact_id,
])->get();
//Totalize the total cost of all of the systems
$totalCost = $this->TotalizeCost($systems);
//Build the body of the mail
$body = "System Rental Cost is due for the following systems:<br>";
foreach($systems as $system) {
$body .= $system->system_name . "<br>";
}
//Create the rest of the email body
$body .= "Total Cost: " . number_format($totalCost, 2, ".", ",");
$body .= "Please remite payment to White Wolves Holding.<br>";
$body .= "Sincerely,<br>";
$body .= "Warped Intentions Leadership<br>";
//Fill in the subject
$subject = "Warped Intentions System Rental Bill Due";
//Dispatch the mail job
ProcessSendEveMailJob::dispatch($body, (int)$contact->contact_id, 'character', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds($delay));
//Increase the delay for the next mail job
$delay += 60;
//After the mail is dispatched, save the sent mail record
$this->SaveSentRecord($config['primary'], $subject, $body, (int)$contact->contact_id, 'character');
}
//Mark the job as finished
$task->SetStopStatus();
}
private function TotalizeCost($systems) {
//Declare the starting total cost
$totalCost = 0.00;
foreach($systems as $system) {
$totalCost += $system->rental_cost;
}
return $totalCost;
}
private function SaveSentRecord($sender, $subject, $body, $recipient, $recipientType) {
$sentmail = new SentMail;
$sentmail->sender = $sender;
$sentmail->subject = $subject;
$sentmail->body = $body;
$sentmail->recipient = $recipient;
$sentmail->recipient_type = $recipientType;
$sentmail->save();
}
}

View File

@@ -1,50 +0,0 @@
<?php
namespace App\Console\Commands\Wormholes;
//Internal Library
use Illuminate\Console\Command;
use Carbon\Carbon;
//Models
use App\Models\Wormholes\AllianceWormhole;
class PurgeWormholes extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:PurgeWormholeData';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Purge stale wormhole data automatically';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//Time of now
$currentTime = Carbon::now();
AllianceWormhole::where('created_at', '<', $currentTime->subHours(48))->delete();
}
}

View File

@@ -24,11 +24,11 @@ class Kernel extends ConsoleKernel
Commands\Users\PurgeUsers::class,
Commands\Flex\FlexStructureCommand::class,
Commands\Data\EmptyJumpBridges::class,
Commands\Wormholes\PurgeWormholes::class,
Commands\Finances\SovBillsCommand::class,
Commands\Data\CleanStaleDataCommand::class,
Commands\Moons\MoonsUpdateCommand::class,
Commands\Data\PurgeCorpMoonLedgers::class,
Commands\Eve\ItemPricesUpdateCommand::class,
/**
* Rental Moon Commands
*/
@@ -62,9 +62,6 @@ class Kernel extends ConsoleKernel
$schedule->command('services:HoldingJournal')
->hourlyAt('45')
->withoutOverlapping();
//$schedule->command('services:GetFinances')
// ->hourlyAt('35')
// ->withoutOverlapping();
/**
* Get Information Schedule
@@ -79,14 +76,19 @@ class Kernel extends ConsoleKernel
/**
* Purge Data Schedule
*/
$schedule->command('services:PurgeWormholeData')
->hourlyAt(20);
$schedule->command('services:CleanData')
->weekly(7, '11:00');
$schedule->command('data:PurgeCorpLedgers')
->monthly();
$schedule->command('services:PurgeUsers')
->dailyAt('23:00');
/**
* Item Update Schedule
*/
$schedule->command('services:ItemPriceUpdate')
->hourlyAt('30')
->withoutOverlapping();
}
/**

View File

@@ -1,11 +0,0 @@
<?php
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class ApiController extends Controller
{
//
}

View File

@@ -38,7 +38,7 @@ class BlacklistController extends Controller
public function AddToBlacklist(Request $request) {
//Middleware needed for the function
$this->middleware('permission:alliance.recruiter');
$this->middleware('permission:blacklist.admin');
//Validate the user input
$this->validate($request, [
@@ -84,15 +84,16 @@ class BlacklistController extends Controller
}
//Store the entity in the table
BlacklistEntity::insert([
'entity_id' => $entityId,
'entity_name' => $request->name,
'entity_type' => $request->type,
'reason' => $request->reason,
'alts' => $request->alts,
'lister_id' => auth()->user()->getId(),
'lister_name' => auth()->user()->getName(),
]);
$blacklist = new BlacklistEntity;
$blacklist->entity_id = $entityId;
$blacklist->entity_name = $request->name;
$blacklist->entity_type = $request->type;
$blacklist->reason = $request->reason;
$blacklist->alts = $request->alts;
$blacklist->lister_id = auth()->user()->getId();
$blacklist->lister_name = auth()->user()->getName();
$blacklist->validity = 'Valid';
$blacklist->save();
//Return to the view
return redirect('/blacklist/display/add')->with('success', $request->name . ' added to the blacklist.');
@@ -108,17 +109,22 @@ class BlacklistController extends Controller
public function RemoveFromBlacklist(Request $request) {
//Middleware needed
$this->middleware('permission:alliance.recruiter');
$this->middleware('permission:blacklist.admin');
//Validate the input request
$this->validate($request, [
'name' => 'required',
]);
//Delete the blacklist character
//Set the character on the blacklist to removed
BlacklistEntity::where([
'entity_name' => $request->name,
])->delete();
])->update([
'validity' => 'Invalid',
'removed_by_id' => auth()->user()->getId(),
'removed_by_name' => auth()->user()->getName(),
'removed_notes' => $request->notes,
]);
//Return the view
return redirect('/blacklist/display')->with('success', 'Character removed from the blacklist.');
@@ -127,7 +133,9 @@ class BlacklistController extends Controller
public function DisplayBlacklist() {
//Get the entire blacklist
$blacklist = BlacklistEntity::orderBy('entity_name', 'asc')->paginate(50);
$blacklist = BlacklistEntity::where([
'validity' => 'Valid',
])->orderBy('entity_name', 'asc')->paginate(50);
//Return the view with the data
return view('blacklist.list')->with('blacklist', $blacklist);
@@ -141,9 +149,9 @@ class BlacklistController extends Controller
]);
$blacklist = DB::table('alliance_blacklist')->where('entity_name', 'like', $request->parameter . "%")
->orWhere('entity_type', 'like', $request->parameter . "%")
->orWhere('alts', 'like', $request->parameter . "%")
->orWhere('reason', 'like', $request->parameter . "%")
->orWhere('entity_type', 'like', "%" . $request->parameter . "%")
->orWhere('alts', 'like', "%" . $request->parameter . "%")
->orWhere('reason', 'like', "%" . $request->parameter . "%")
->orderBy('entity_name', 'asc')
->paginate(50);

View File

@@ -1,186 +0,0 @@
<?php
namespace App\Http\Controllers\Contracts;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Carbon\Carbon;
//Libraries
use App\Library\Esi\Mail;
//Jobs
use App\Jobs\ProcessSendEveMailJob;
//Models
use App\Models\User\User;
use App\Models\User\UserPermission;
use App\Models\Contracts\Contract;
use App\Models\Contracts\Bid;
use App\Models\Contracts\AcceptedBid;
class ContractAdminController extends Controller
{
public function __construct() {
$this->middleware('auth');
$this->middleware('role:User');
$this->middleware('permission:contract.admin');
}
/**
* Contract display functions
*/
public function displayContractDashboard() {
$contracts = Contract::where(['finished' => false])->get();
return view('contracts.admin.contractpanel')->with('contracts', $contracts);
}
public function displayPastContracts() {
$contracts = Contract::where(['finished' => true])->get();
return view('contracs.admin.past')->with('contracts', $contracts);
}
/**
* New contract functionality
*/
public function displayNewContract() {
return view('contracts.admin.newcontract');
}
public function storeNewContract(Request $request) {
$this->validate($request, [
'name' => 'required',
'date' => 'required',
'body' => 'required',
'type' => 'required',
]);
$date = new Carbon($request->date);
$body = nl2br($request->body);
//Store the contract in the database
$contract = new Contract;
$contract->title = $request->name;
$contract->end_date = $request->date;
$contract->body = $body;
$contract->type = $request->type;
$contract->save();
//Send a mail out to all of the people who can bid on a contract
$this->NewContractMail();
return redirect('/contracts/admin/display')->with('success', 'Contract written.');
}
/**
* Used to store a finished contract in the database
*/
public function storeAcceptContract(Request $request) {
$this->validate($request, [
'contract_id' => 'required',
'bid_id' => 'required',
'character_id' => 'required',
'bid_amount' => 'required',
]);
//Update the contract
Contract::where([
'contract_id' => $request->contract_id,
])->update([
'finished' => true,
'final_cost' => $request->bid_amount,
]);
//Save the accepted bid in the database
$accepted = new AcceptedBid;
$accepted->contract_id = $request->contract_id;
$accepted->bid_id = $request->bid_id;
$accepted->bid_amount = $request->bid_amount;
$accepted->save();
return redirect('/contracts/admin/display')->with('success', 'Contract accepted and closed.');
}
/**
* Delete a contract from every user
*/
public function deleteContract($id) {
Contract::where(['contract_id' => $id])->delete();
Bid::where(['contract_id' => $id])->delete();
return redirect('/contracts/admin/display')->with('success', 'Contract has been deleted.');
}
/**
* End Contract Functionality
*/
public function displayEndContract($id) {
//Gather the information for the contract, and all bids on the contract
$contract = Contract::where(['contract_id' => $id])->first()->toArray();
$bids = Bid::where(['contract_id' => $id])->get()->toArray();
return view('contracts.admin.displayend')->with('contract', $contract)
->with('bids', $bids);
}
public function storeEndContract(Request $request) {
$this->validate($request, [
'contract_id' => 'required',
'accept' => 'required',
]);
//Declare class variables
$tries = 1;
//Get the esi config
$config = config('esi');
$contract = Contract::where(['contract_id' => $request->contract_id])->first()->toArray();
$bid = Bid::where(['id' => $request->accept, 'contract_id' => $request->contract_id])->first()->toArray();
//Send mail out to winner of the contract
$subject = 'Contract Won';
$body = 'You have been accepted to perform the following contract:<br>';
$body .= $contract['contract_id'] . ' : ' . $contract['title'] . '<br>';
$body .= 'Notes:<br>';
$body .= $contract['body'] . '<br>';
$body .= 'Please remit contract when the items are ready to Spatial Forces. Description should be the contract identification number. Request ISK should be the bid amount.';
$body .= 'Sincerely,<br>Spatial Forces Contracting Department';
//Dispatch the mail job
ProcessSendEveMailJob::dispatch($body, $bid['character_id'], 'character', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds(5));
//Tidy up the contract by doing a few things.
$this->TidyContract($contract, $bid);
//Redirect back to the contract admin dashboard.
return redirect('/contracts/admin/display')->with('success', 'Contract finalized. Mail has been sent to the queue for processing.');
}
private function TidyContract($contract, $bid) {
Contract::where(['contract_id' => $contract['contract_id']])->update([
'finished' => true,
]);
//Create the accepted contract entry into the table
$accepted = new AcceptedBid;
$accepted->contract_id = $contract['contract_id'];
$accepted->bid_id = $bid['id'];
$accepted->bid_amount = $bid['bid_amount'];
$accepted->notes = $bid['notes'];
$accepted->save();
}
private function NewContractMail() {
//Get the esi config
$config = config('esi');
$subject = 'New Alliance Production Contract Available';
$body = "A new contract is available for the alliance contracting system. Please check out <a href='https://services.w4rp.space'>Services Site</a> if you want to bid on the production contract.<br><br>Sincerely,<br>Warped Intentions Leadership";
ProcessSendEveMailJob::dispatch($body, $config['alliance'], 'alliance', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds(5));
}
}

View File

@@ -1,322 +0,0 @@
<?php
namespace App\Http\Controllers\Contracts;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Carbon\Carbon;
//Libraries
use App\Library\Lookups\LookupHelper;
//Models
use App\Models\User\User;
use App\Models\User\UserPermission;
use App\Models\Contracts\Contract;
use App\Models\Contracts\Bid;
class ContractController extends Controller
{
public function __construct() {
$this->middleware('auth');
$this->middleware('role:User');
}
/**
* Controller function to display the bids placed on contracts
*/
public function displayBids($id) {
$bids = Bids::where(['contract_id' => $id, 'character_name' => auth()->user()->getName()])->get();
return view('contracts.bids')->with('bids', $bids);
}
/**
*
* Controller function to display all current open contracts
*
*/
public function displayContracts() {
//Calculate today's date to know which contracts to display
$today = Carbon::now();
//Declare our array variables
$bids = array();
$contracts = array();
$i = 0;
//Fetch all of the current contracts from the database
$contractsTemp = Contract::where('end_date', '>=', $today)
->where(['finished' => false])->get()->toArray();
//Count the number of bids, and add them to the arrays
for($i = 0; $i < sizeof($contractsTemp); $i++) {
$tempCount = Bid::where(['contract_id' => $contractsTemp[$i]['contract_id']])->count('contract_id');
$bids = Bid::where(['contract_id' => $contractsTemp[$i]['contract_id']])->get()->toArray();
//Assemble the finaly array
$contracts[$i] = $contractsTemp[$i];
$contracts[$i]['bid_count'] = $tempCount;
$contracts[$i]['bids'] = $bids;
}
//Call for the view to be displayed
return view('contracts.allcontracts')->with('contracts', $contracts);
}
/**
* Controller function to display all current public contracts
*/
public function displayPublicContracts() {
//Calculate today's date to know which contracts to display
$today = Carbon::now();
//Declare our array variables
$bids = array();
$contracts = array();
$i = 0;
$lowestBid = null;
$lowestCorp = null;
$lowestChar = null;
//Fetch all of the current contracts from the database
$contractsTemp = Contract::where('end_date', '>=', $today)
->where(['type' => 'Public', 'finished' => false])->get()->toArray();
//Count the number of bids, and add them to the arrays
for($i = 0; $i < sizeof($contractsTemp); $i++) {
$tempCount = Bid::where(['contract_id' => $contractsTemp[$i]['contract_id']])->count('contract_id');
$bids = Bid::where(['contract_id' => $contractsTemp[$i]['contract_id']])->get()->toArray();
foreach($bids as $bid) {
if($lowestBid == null) {
$lowestBid = $bid['bid_amount'];
$lowestCorp = $bid['corporation_name'];
$lowestChar = $bid['character_name'];
} else {
if($bid['bid_amount'] < $lowestBid) {
$lowestBid = $bid['bid_amount'];
$lowestCorp = $bid['corporation_name'];
$lowestChar = $bid['character_name'];
}
}
}
if($lowestBid == null) {
$lowestBid = 'No Bids Placed.';
$lowestCorp = 'No Corporation has placed a bid.';
}
//Assemble the finaly array
$contracts[$i] = $contractsTemp[$i];
$contracts[$i]['bid_count'] = $tempCount;
$contracts[$i]['bids'] = $bids;
$contracts[$i]['lowestbid'] = $lowestBid;
$contracts[$i]['lowestcorp'] = $lowestCorp;
$contracts[$i]['lowestchar'] = $lowestChar;
//Reset the lowestBid back to null
$lowestBid = null;
}
//Call for the view to be displayed
return view('contracts.publiccontracts')->with('contracts', $contracts);
}
/**
* Controller function to display current private contracts
*/
public function displayPrivateContracts() {
//Declare our array variables
$bids = array();
$contracts = array();
$lowestBid = null;
//Calucate today's date to know which contracts to display
$today = Carbon::now();
//Fetch all of the current contracts from the database
$contractsTemp = Contract::where('end_date', '>=', $today)
->where(['type' => 'Private', 'finished' => false])->get();
//Count the number of bids, and add them to the arrays
for($i = 0; $i < sizeof($contractsTemp); $i++) {
$tempCount = Bid::where(['contract_id' => $contractsTemp[$i]['contract_id']])->count('contract_id');
$bids = Bid::where(['contract_id' => $contractsTemp[$i]['contract_id']])->get()->toArray();
foreach($bids as $bid) {
if($lowestBid == null) {
$lowestBid = $bid['bid_amount'];
} else {
if($bid['bid_amount'] < $lowestBid) {
$lowestBid = $bid['bid_amount'];
}
}
}
if($lowestBid == null) {
$lowestBid = 'No Bids Placed.';
}
//Assemble the finaly array
$contracts[$i] = $contractsTemp[$i];
$contracts[$i]['bid_count'] = $tempCount;
$contracts[$i]['bids'] = $bids;
$contracts[$i]['lowestbid'] = $lowestBid;
}
return view ('contracts.privatecontracts')->with('contracts', $contracts);
}
/**
* Controller function to display expired contracts
*
*/
public function displayExpiredContracts() {
//Calculate today's date to know which contracts to display
$today = Carbon::now();
//Retrieve the contracts from the database
$contracts = Contract::where('end_date', '<', $today)->get();
return view('contracts.expiredcontracts')->with('contracts', $contracts);
}
/**
* Controller function to display a page to allow a bid
*
*/
public function displayNewBid($id) {
$contractId = $id;
return view('contracts.enterbid')->with('contractId', $contractId);
}
/**
* Controller function to store a new bid
*/
public function storeBid(Request $request) {
//Valid the request from the enter bid page
$this->validate($request, [
'contract_id' => 'required',
'bid' => 'required',
]);
//Delcare some class variables we will need
$lookup = new LookupHelper;
$amount = 0.00;
//Convert the amount to a whole number from abbreviations
if($request->suffix == 'B') {
$amount = $request->bid * 1000000000.00;
} else if($request->suffix == 'M') {
$amount = $request->bid * 1000000.00;
} else {
$amount = $request->bid * 1.00;
}
if(isset($request->notes)) {
$notes = nl2br($request->notes);
} else {
$notes = null;
}
//Get the character id and character name from the auth of the user calling
//this function
$characterId = auth()->user()->getId();
$characterName = auth()->user()->getName();
//Use the lookup helper in order to find the user's corporation id and name
$char = $lookup->GetCharacterInfo($characterId);
$corporationId = $char->corporation_id;
//use the lookup helper in order to find the corporation's name from it's id.
$corp = $lookup->GetCorporationInfo($corporationId);
$corporationName = $corp->name;
//Before saving a bid let's check to see if the user already placed a bid on the contract
$found = Bid::where([
'contract_id' => $request->contract_id,
'character_id' => $characterId,
])->first();
if(isset($found->contract_id)) {
return redirect('/contracts/display/all')->with('error', 'You have already placed a bid for this contract. Please modify the existing bid.');
} else {
//Create the model object to save data to
$bid = new Bid;
$bid->contract_id = $request->contract_id;
$bid->bid_amount = $amount;
$bid->character_id = $characterId;
$bid->character_name = $characterName;
$bid->corporation_id = $corporationId;
$bid->corporation_name = $corporationName;
$bid->notes = $notes;
$bid->save();
//Redirect to the correct page
return redirect('/contracts/display/all')->with('success', 'Bid accepted.');
}
}
/**
* Controller function to delete a bid
*/
public function deleteBid($id) {
//Delete the bid entry from the database
Bid::where([
'id' => $id,
])->delete();
return redirect('/contracts/display/public')->with('success', 'Bid deleted.');
}
/**
* Controller function to display modify bid page
*/
public function displayModifyBid($id) {
//With the bid id number, look up the bid in the database to get the contract information
$bid = Bid::where(['id' => $id])->first();
//Retrieve the contract from the database
$contract = Contract::where(['contract_id' => $bid->contract_id])->first()->toArray();
return view('contracts.modifybid')->with('contract', $contract)
->with('bid', $bid);
}
/**
* Controller function to modify a bid
*/
public function modifyBid(Request $request) {
$this->validate($request, [
'bid' => 'required',
]);
$amount = $request->bid;
$type = $request->type;
$contractId = $request->contract_id;
if($request->suffix == 'B') {
$amount = $amount * 1000000000.00;
} else if($request->suffix == 'M') {
$amount = $amount * 1000000.00;
} else {
$amount = $amount * 1.00;
}
Bid::where([
'character_id' => auth()->user()->getId(),
'contract_id' => $contractId,
])->update([
'bid_amount' => $amount,
]);
if($type == 'public') {
return redirect('/contracts/display/public')->with('success', 'Bid modified.');
} else {
return redirect('/contracts/display/private')->with('success', 'Bid modified');
}
}
}

View File

@@ -1,60 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
//Models
use App\Models\Market\MarketRegionOrder;
use App\Models\PublicContracts\PublicContract;
use App\Models\PublicContracts\PublicContractItem;
class PublicContractController extends Controller
{
/**
* Private variables
*/
private $regions = [
'Immensea' => 10000025,
'Catch' => 10000014,
'Tenerifis' => 10000061,
'The Forge' => 10000002,
'Impass' => 10000031,
'Esoteria' => 10000039,
'Detorid' => 10000005,
'Omist' => 10000062,
'Feythabolis' => 10000056,
'Insmother' => 10000009,
];
/**
* Contracts construct
*/
public function __construct() {
$this->middleware('auth');
$this->middleware('role:User');
}
/**
* Display the contracts in a region
*/
public function displayRegionalContracts() {
//Declare variables
$arrContracts = array();
//Get the contracts by region
foreach($region as $key => $value) {
$contracts = PublicContract::where([
'region_id' => $value,
])->get()->toArray();
//Compile the array
foreach($contracts as $contract) {
array_push($arrContracts, $contract);
}
}
return view('contracts.regional.user.displaycontracts');
}
}

View File

@@ -0,0 +1,501 @@
<?php
namespace App\Http\Controllers\Contracts;
//Internal Libraries
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Carbon\Carbon;
//Libraries
use App\Library\Lookups\LookupHelper;
//Models
use App\Models\User\User;
use App\Models\Contracts\SupplyChainBid;
use App\Models\Contracts\SupplyChainContract;
//Jobs
use App\Jobs\ProcessSendEveMailJob;
class SupplyChainController extends Controller
{
/**
* Constructor
*/
public function __construct() {
$this->middleware('auth');
$this->middleware('role:Renter');
}
/**
* Display the supply chain dashboard
* Should contain a section for open contracts, closed contracts, and expired contracts.
*/
public function displaySupplyChainDashboard() {
$openContracts = SupplyChainContract::where([
'state' => 'open',
])->get();
$closedContracts = SupplyChainContract::where([
'state' => 'closed',
])->get();
$completedContracts = SupplyChainContract::where([
'state' => 'completed',
])->get();
return view('supplychain.dashboard.main')->with('openContracts', $openContracts)
->with('closedContracts', $closedContracts)
->with('completedContracts', $completedContracts);
}
/**
* Display my supply chain contracts dashboard
* Should contain a section for open contracts, closed contracts, and expired contracts
*/
public function displayMySupplyChainDashboard() {
$openContracts = SupplyChainContract::where([
'issuer_id' => auth()->user()->getId(),
'state' => 'open',
])->get();
$closedContracts = SupplyChainContract::where([
'issuer_id' => auth()->user()->getId(),
'state' => 'closed',
])->get();
$completedContracts = SupplyChainContract::where([
'issuer_id' => auth()->user()->getId(),
'state' => 'completed',
])->get();
return view('supplychain.dashboard.main')->with('openContracts', $openContracts)
->with('closedContracts', $closedContracts)
->with('completedContracts', $completedContracts);
}
/**
* Display new contract page
*/
public function displayNewSupplyChainContract() {
return view('supplychain.forms.newcontract');
}
/**
* Store new contract page
*/
public function storeNewSupplyChainContract(Request $request) {
$this->validate($request, [
'name' => 'required',
'date' => 'required',
'delivery' => 'required',
'body' => 'required',
]);
$contract = new SupplyChainContract;
$contract->issuer_id = auth()->user()->getId();
$contract->issuer_name = auth()->user()->getName();
$contract->title = $request->name;
$contract->end_date = $request->date;
$contract->delivery_by = $request->delivery;
$contract->body = $request->body;
$contract->state = 'open';
$contract->bids = 0;
$contract->save();
$this->NewSupplyChainContractMail($contract);
return redirect('/supplychain/dashboard')->with('success', 'New Contract created.');
}
/**
* Display the delete contract page
*/
public function displayDeleteSupplyChainContract() {
$contracts = SupplyChainContract::where([
'issuer_id' => auth()->user()->getId(),
'state' => 'open',
])->get();
return view('supplychain.forms.delete')->with('contracts', $contracts);
}
/**
* Delete a supply chain contract
*/
public function deleteSupplyChainContract(Request $request) {
$this->validate($request, [
'contractId' => 'required',
]);
$contractId = $request->contractId;
/**
* Remove the supply chain contract if it's yours.
*/
$count = SupplyChainContract::where([
'issuer_id' => auth()->user()->getId(),
'contract_id' => $contractId,
])->count();
if($count > 0) {
//Remove the supply chain contract
SupplyChainContract::where([
'issuer_id' => auth()->user()->getId(),
'contract_id' => $contractId,
])->delete();
//Remove all bids associated with the supply chain contract
SupplyChainBid::where([
'contract_id' => $contractId,
])->delete();
return redirect('/supplychain/dashboard')->with('success', 'Supply Chain Contract deleted successfully.');
} else {
return redirect('/supplychain/dashboard')->with('error', 'Unable to delete supply chain contract.');
}
}
/**
* Display the end supply chain contrage page
*/
public function displayEndSupplyChainContract() {
return view('supplychain.forms.end');
}
/**
* Process the end supply chain contract page
*/
public function storeEndSupplyChainContract(Request $request) {
$this->validate($request, [
'accept' => 'required',
'contractId' => 'required',
]);
//Check to make sure the user owns the contract
$count = SupplyChainContract::where([
'issuer_name' => auth()->user()->getName(),
'contract_id' => $request->contractId,
])->count();
//If the count is greater than 0, the user owns the contract.
//Proceed with ending the contract
if($count > 0) {
SupplyChainContract::where([
])->update([
]);
SupplyChainBid::where([
])->update([
]);
return redirect('/supplychain/dashboard')->with('success', 'Contract ended, and mails sent to the winning bidder.');
} else {
//If the count is zero, then redirect with error messsage
return redirect('/supplychain/dashboard')->with('error', 'Contract was not yours to end.');
}
}
/**
* Display supply chain contract bids page
*/
public function displaySupplyChainBids() {
//Display bids for the user on a page
$bids = array();
$bidsCount = SupplyChainBid::where([
'entity_id' => auth()->user()->getId(),
'bid_type' => 'pending',
])->count();
$myBids = SupplyChainBid::where([
'entity_id' => auth()->user()->getId(),
'bid_type' => 'pending',
])->get();
foreach($myBids as $bid) {
//Declare the temporary array
$temp = array();
//Get the contract information for the bid
$contract = SupplyChainContract::where([
'contract_id' => $bid->contract_id,
])->first();
$temp['bid_id'] = $bid->bid_id;
$temp['contract_id'] = $bid->contract_id;
$temp['issuer_name'] = $contract->issuer_name;
$temp['title'] = $contract->title;
$temp['end_date'] = $contract->end_date;
$temp['body'] = $contract->body;
$temp['bid_amount'] = $bid->bid_amount;
array_push($bids, $temp);
}
return view('supplychain.dashboard.bids')->with('bids', $bids)
->with('bidsCount', $bidsCount);
}
/**
* Display expired supply chain contracts page
*/
public function displayExpiredSupplyChainContracts() {
return view('supplychain.dashboard.expired');
}
/**
* Display the new bid on a supply chain contract page
*/
public function displaySupplyChainContractBid($contract) {
$contractId = $contract;
return view('supplychain.forms.enterbid')->with('contractId', $contractId);
}
/**
* Enter a new bid on a supply chain contract
*/
public function storeSupplyChainContractBid(Request $request) {
$this->validate($request, [
'bid' => 'required',
'contract_id' => 'required',
]);
//Declare some needed variables
$bidAmount = 0.00;
//See if a bid has been placed by the user for this contract
$count = SupplyChainBid::where([
'entity_id' => auth()->user()->getId(),
'entity_name' => auth()->user()->getName(),
'contract_id' => $request->contract_id,
])->count();
//If the person already has a bid in, then deny them the option to place another bid on the same contract.
//Otherwise, enter the bid into the database
if($count > 0) {
return redirect('/supplychain/dashboard')->with('error', 'Unable to insert bid as one is already present for the supply chain contract.');
} else {
//Sanitize the bid amount
if(preg_match('(m|M|b|B)', $request->bid) === 1) {
if(preg_match('(m|M)', $request->bid) === 1) {
$cStringSize = strlen($request->bid);
$tempCol = str_split($request->bid, $cStringSize - 1);
$bidAmount = $tempCol[0];
$bidAmount = $bidAmount * 1000000.00;
} else if(preg_match('(b|B)', $request->bid) === 1) {
$cStringSize = strlen($request->bid);
$tempCol = str_split($request->bid, $cStringSize - 1);
$bidAmount = $tempCol[0];
$bidAmount = $bidAmount * 1000000000.00;
}
} else {
$bidAmount = $request->bid;
}
//Create the database entry
$bid = new SupplyChainBid;
$bid->contract_id = $request->contract_id;
$bid->bid_amount = $bidAmount;
$bid->entity_id = auth()->user()->getId();
$bid->entity_name = auth()->user()->getName();
$bid->entity_type = 'character';
if(isset($request->notes)) {
$bid->bid_note = $request->notes;
}
$bid->bid_type = 'pending';
$bid->save();
//Update the database entry for the supply chain contract bid number
$num = SupplyChainContract::where([
'contract_id' => $request->contract_id,
])->select('bids')->first();
//Increment the number of bids
$numBids = $num->bids + 1;
//Update the database
SupplyChainContract::where([
'contract_id' => $request->contract_id,
])->update([
'bids' => $numBids,
]);
return redirect('/supplychain/dashboard')->with('success', 'Bid succesfully entered into the contract.');
}
}
/**
* Delete a bid on a supply chain contract
*
* @var contractId
* @var bidId
*/
public function deleteSupplyChainContractBid($contractId, $bidId) {
//See if the user has put in a bid. If not, then redirect to failure.
$count = SupplyChainBid::where([
'contract_id' => $contractId,
'entity_id' => auth()->user()->getId(),
'bid_id' => $bidId,
])->count();
if($count > 0) {
SupplyChainBid::where([
'contract_id' => $contractId,
'entity_id' => auth()->user()->getId(),
'bid_id' => $bidId,
])->delete();
//Update the database entry for the supply chain contract bid number
$num = SupplyChainContract::where([
'contract_id' => $contractId,
])->select('bids')->first();
//Decrement the number of bids
$numBids = $num->bids - 1;
//Update the database
SupplyChainContract::where([
'contract_id' => $contractId,
])->update([
'bids' => $numBids,
]);
return redirect('/supplychain/dashboard')->with('success', 'Deleted supply chain contract bid.');
} else {
return redirect('/supplychain/dashboard')->with('error', 'No bid found to delete.');
}
}
/**
* Display the modify a bid on supply chain contract page
*/
public function displayModifySupplyChainContractBid(Request $request) {
$this->validate($request, [
'contract_id' => 'required',
]);
//Get the contract id
$contractId = $request->contract_id;
//Get the bid id to be modified later
$bid = SupplyChainBid::where([
'contract_id' => $contractId,
'entity_id' => auth()->user()->getId(),
])->first();
$bidId = $bid->id;
return view('supplychain.forms.modifybid')->with('contractId', $contractId)
->with('bidId', $bidId);
}
/**
* Modify a bid on a supply chain contract
*/
public function modifySupplyChainContractBid(Request $request) {
$this->validate($request, [
'bid_id' => 'required',
'contract_id' => 'required',
'bid_amount' => 'required',
]);
//Check for the owner of the bid
$count = SupplyChainBid::where([
'bid_id' => $request->bid_id,
'contract_id' => $request->contract_id,
'entity_id' => auth()->user()->getId(),
])->count();
if($count > 0) {
if(isset($request->bid_note)) {
SupplyChainBid::where([
'bid_id' => $request->bid_id,
'contract_id' => $request->contract_id,
'entity_id' => auth()->user()->getId(),
])->update([
'bid_amount' => $request->bid_amount,
'bid_note' => $request->bid_note,
]);
} else {
SupplyChainBid::where([
'bid_id' => $request->bid_id,
'contract_id' => $request->contract_id,
'entity_id' => auth()->user()->getId(),
])->update([
'bid_amount' => $request->bid_amount,
]);
}
return redirect('/supplychain/dashboard')->with('success', 'Modified supply chain contract bid.');
} else {
return redirect('/supplychain/dashboard')->with('error', 'Not able to modify supply chain contract bid.');
}
}
/**
* Send out a new supply chain contract mail
*/
private function NewSupplyChainContractMail(SupplyChainContract $contract) {
//Get the config for the esi
$config = config('esi');
$todayDate = Carbon::now()->toFormattedDateString();
$subject = 'New Supply Chain Contract ' . $todayDate;
$body = "A supply chain contract is available.<br>";
$body .= "Contract: " . $contract->title . "<br>";
$body .= "Notes: " . $contract->body . "<br>";
$body .= "Delivery Date: " . $contract->delivery_date . "<br>";
$body .= "<br>Sincerely on behalf of,<br>" . $contract->issuer_name . "<br>";
ProcessSendEveMailJob::dispatch($body, 145223267, 'mailing_list', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds(30));
}
/**
* Send out a mail when the supply chain contract has been deleted
*/
private function DeleteSupplyChainContractMail($contract) {
//Get the esi config
$config = config('esi');
$subject = 'Production Contract Removal';
$body = "A production contract has been deleted.<br>";
$body .= "Contract: " . $contract->title . "<br>";
$body .= "Notes: " . $contract->note . "<br>";
$body .= "<br>Sincerely on behalf of,<br>" . $contract->issuer_name;
ProcessSendEveMailJob::dispatch($body, 145223267, 'mailing_list', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds(30));
}
/**
* Tidy up datatables from a completed supply chain contract
*/
private function TidySupplyChainContract($contract, $bid) {
//Set the contract as finished
SupplyChainContract::where([
'contract_id' => $contract->contract_id,
])->update([
'state' => 'finished',
]);
//Set all of the bids as not_accepted as default
SupplyChainBid::where([
'contract_id' => $contract->contract_id,
])->update([
'bid_type' => 'not_accepted',
]);
//Set the correct bid as accepted
SupplyChainBid::where([
'contract_id' => $contract->contract_id,
'bid_id' => $bid->bid_id,
])->update([
'bid_type' => 'accepted',
]);
}
}

View File

@@ -18,6 +18,7 @@ use App\Models\User\User;
use App\Models\User\UserRole;
use App\Models\User\UserPermission;
use App\Models\User\AvailableUserPermission;
use App\Models\User\AvailableUserRole;
use App\Models\Admin\AllowedLogin;
use App\Models\Doku\DokuGroupNames;
use App\Models\Doku\DokuMember;
@@ -38,7 +39,7 @@ class AdminController extends Controller
$dateInit = Carbon::now();
$date = $dateInit->subDays(30);
$journal = DB::select('SELECT amount,reason,description,date FROM `player_donation_journal` WHERE corporation_id=98287666 AND date >= DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 MONTH) ORDER BY date DESC');
$journal = DB::select('SELECT amount,reason,description,date FROM `player_donation_journal` WHERE corporation_id=98287666 AND date >= DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 2 MONTH) ORDER BY date DESC');
return view('admin.dashboards.walletjournal')->with('journal', $journal);
}
@@ -220,37 +221,41 @@ class AdminController extends Controller
$permissions[$p->permission] = $p->permission;
}
$roles = AvailableUserRole::all();
$role = $user->getRole();
//Pass the user information to the page for hidden text entries
return view('admin.user.modify')->with('user', $user)
->with('permissions', $permissions);
->with('permissions', $permissions)
->with('role', $role)
->with('roles', $roles);
}
public function modifyUser(Request $request) {
$type = $request->type;
if(isset($request->permission)) {
$permission = $request->permission;
}
if(isset($request->user)) {
$user = $request->user;
}
public function modifyRole(Request $request) {
$this->validate($request, [
'user' => 'required',
'role' => 'required|role!=None',
]);
return redirect('/admin/dashboard/users')->with('error', 'Not Implemented Yet.');
UserRole::where(['character_id' => $user])->update([
'role' => $request->role,
]);
return redirect('/admin/dashboard/users')->with('success', "User: " . $user . " has been modified to a new role: " . $request->role . ".");
}
public function addPermission(Request $request) {
//Get the user and permission from the form
$user = $request->user;
$character = $request->user;
$permission = $request->permission;
//Get the character id from the username using the user table
$character = User::where(['name' => $user])->get(['character_id']);
//Check to see if the character already has the permission
$check = UserPermission::where(['character_id' => $character[0]->character_id, 'permission' => $permission])->get(['permission']);
$check = UserPermission::where(['character_id' => $character, 'permission' => $permission])->get(['permission']);
if(!isset($check[0]->permission)) {
$perm = new UserPermission;
$perm->character_id = $character[0]->character_id;
$perm->character_id = $character;
$perm->permission = $permission;
$perm->save();

View File

@@ -42,18 +42,55 @@ class AdminDashboardController extends Controller
}
//Declare variables we will need
$tHelper = new TaxesHelper();
$srpHelper = new SRPHelper();
$days = 30;
$sovBills = array();
$pi = array();
$industry = array();
$reprocessing = array();
$office = array();
$sprActual = array();
$srpLoss = array();
$months = 1;
$lava = new Lavacharts;
//Get the dates for the information being requested
$dates = $tHelper->GetTimeFrameInMonths($months);
//Get the data for the sov expenses for a graph
//Setup the charts
//Setup the chart to be able the show the categories for income
/*
$iChart = $lava->DataTable();
$iChart->addStringColumn('Categories')
->addNumberColumn('ISK')
->addRow(['pi', $pi])
->addRow(['industry', $industry])
->addRow(['reprocessing', $reprocessing])
->addRow(['offices', $office])
->addRow(['industry', $industry])
->addRow(['market', $market])
->addRow(['gate', $gate])
->addRow(['iBuyback', $iBuyback])
->addRow(['renters', $renters])
->addRow(['ops', $ops]);
*/
//Setup the chart to be able to show the categories for expenses
/*
$eChart = $lava->DataTable();
$eCjart->addStringColumn('Categories')
->addNumberColumn('ISK')
->addRow(['sov', $sovBills])
->addRow(['srp', $srpActual])
->addRow(['maintenance', $maintenance])
->addRow(['wardecs', $wardecs])
->addRow(['fcs', $fcs])
->addRow(['keepstar_fuel', $keepstarFuel])
->addRow(['fortizar_fuel', $fortizarFuel])
->addRow(['astrahus_fuel', $astrahusFuel])
->addRow(['sotiyo_fuel', $sotiyoFuel])
->addRow(['azbel_fuel', $azbelFuel])
->addRow(['raitaru_fuel', $raitaruFuel])
->addRow(['beacon_fuel', $beaconFuel])
->addRow(['bridge_fuel', $bridgeFuel])
->addRow(['jammer_fuel', $jammerFuel]);
*/
return view('admin.dashboards.dashboard');
}
}

View File

@@ -120,14 +120,29 @@ class FlexAdminController extends Controller
'structure_type' => 'required',
]);
FlexStructure::where([
$count = FlexStructure::where([
'requestor_id' => $request->requestor_id,
'requestor_corp_id' => $request->requestor_corp_id,
'system' => $request->system_id,
'system_id' => $request->system_id,
'structure_type' => $request->structure_type,
])->delete();
])->count();
return redirect('/flex/display')->with('success', 'Flex Structure Entry Removed.');
if($count > 0) {
FlexStructure::where([
'requestor_id' => $request->requestor_id,
'requestor_corp_id' => $request->requestor_corp_id,
'system_id' => $request->system_id,
'structure_type' => $request->structure_type,
])->delete();
return redirect('/flex/display')->with('success', 'Flex Structure Entry Removed.');
} else {
return redirect('/flex/display')->with('error', 'Could not find flex structure to delete.');
}
}
}

View File

@@ -6,6 +6,7 @@ namespace App\Http\Controllers\Logistics;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Log;
use Carbon\Carbon;
//Jobs
use App\Jobs\ProcessSendEveMailJob;
@@ -62,7 +63,7 @@ class StructureRequestController extends Controller
])->get();
//Set the mail delay
$delay = 5;
$delay = 30;
foreach($fcTeam as $fc) {
$body = "Structure Anchor Request has been entered.<br>";
@@ -74,9 +75,9 @@ class StructureRequestController extends Controller
$subject = "New Structure Anchor Request";
ProcessSendEveMailJob::dispatch($body, (int)$fc->character_id, 'character', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds($delay));
$delay += 15;
$delay += 30;
}
return redirect('/structures/display/requests');
return redirect('/dashboard')->with('success', 'Structure request successfully submitted.');
}
}

View File

@@ -29,6 +29,25 @@ use App\Jobs\ProcessSendEveMailJob;
class MoonsAdminController extends Controller
{
/**
* Variable for the class
*/
private $romans = [
'M' => 1000,
'CM' => 900,
'D' => 500,
'CD' => 400,
'C' => 100,
'XC' => 90,
'L' => 50,
'XL' => 40,
'X' => 10,
'IX' => 9,
'V' => 5,
'IV' => 4,
'I' => 1,
];
/**
* Constructor for the class
*/
@@ -130,7 +149,7 @@ class MoonsAdminController extends Controller
}
//Setup the mail model
ProcessSendEveMailJob::dispatch($body, (int)$moon->requestor_id, 'character', 'Warped Intentions Moon Request', $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds(5));
ProcessSendEveMailJob::dispatch($body, (int)$moon->requestor_id, 'character', 'Warped Intentions Moon Request', $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds(30));
return redirect('/moons/admin/display/request')->with('success', 'Moon has been processed, and mail has been sent out.');
}
@@ -242,7 +261,6 @@ class MoonsAdminController extends Controller
//Check if a current rental for the moon is on going
if(($moon->rental_type == 'In Alliance' || $moon->rental_type == 'Out of Alliance')) {
$paid = $moon->paid;
$paidUntil = new Carbon($moon->paid_until);
$paidUntil = $paidUntil->format('m-d');
@@ -251,17 +269,28 @@ class MoonsAdminController extends Controller
$rentalTemp = new Carbon($moon->rental_until);
$rentalEnd = $rentalTemp->format('m-d');
//Set the correct color for the table
if($rentalTemp->diffInDays(Carbon::now()) < 3 && $today->lessThan($rentalTemp)) {
$color = 'table-warning';
} else if($today->lessThan($rentalTemp)) {
$color = 'table-danger';
} else {
$color = 'table-primary';
}
//Set the contact name based on the contact type
if($moon->rental_contact_type == 'Alliance') {
$allianceInfo = $lookupHelper->GetAllianceInfo($moon->rental_contact_id);
//Set the contact name and ticker
$contact = $allianceInfo->name;
$ticker = $allianceInfo->ticker;
} else if($moon->rental_contact_type == 'Corporation') {
$corporationInfo = $lookupHelper->GetCorporationInfo($moon->rental_contact_id);
//Set the contact name and ticker
$contact = $corporationInfo->name;
$ticker = $corporationInfo->ticker;
} else if($moon->rental_contact_type == 'Character') {
$characterInfo = $lookupHelper->GetCharacterInfo($moon->rental_contact_id);
//Set the contact name
@@ -269,21 +298,12 @@ class MoonsAdminController extends Controller
//Get the ticker for the character from the corporation he belongs to
$corpInfo = $lookupHelper->GetCorporationInfo($characterInfo->corporation_id);
$ticker = $corpInfo->ticker;
} else {
$contact = 'N/A';
$ticker = 'N/A';
$type = 'N/A';
}
//Set up the moon rental type
if($moon->rental_type == 'In Alliance') {
$type = 'IA';
} else if($moon->rental_type == 'Out of Alliance') {
$type = 'OOA';
} else if($moon->rental_type == 'Alliance') {
$type = 'W4RP';
} else {
$type = 'N/A';
$color = 'table-primary';
}
//Check if the moon is currently being utilized by the alliance
@@ -292,8 +312,10 @@ class MoonsAdminController extends Controller
$paid = 'No';
//Setup the rental end time as the end of the month
$rentalTemp = $today->endOfMonth();
$rentalTemp = Carbon::now()->endOfMonth();
$rentalEnd = $rentalTemp->format('m-d');
//Set the color of the table
$color = 'table-info';
//Setup the paid time as the same as the rental end
$paidUntiltemp = $rentalTemp;
@@ -323,19 +345,40 @@ class MoonsAdminController extends Controller
$renter = 'None';
$ticker = 'N/A';
$type = 'N/A';
//Set the color of the table
$color = 'table-primary';
}
//Set the color for the table
if($moon->rental_type != 'Alliance') {
if($rentalTemp->diffInDays($today) < 3) {
//Set up the moon rental type
if($moon->rental_type == 'In Alliance') {
$type = 'IA';
//Setup the row color
if($rentalTemp->diffInDays(Carbon::now()) < 3 && $today->lessThan($rentalTemp)) {
$color = 'table-warning';
} else if($today > $rentalTemp) {
$color = 'table-success';
} else {
} else if($today->lessThan($rentalTemp)) {
$color = 'table-danger';
} else {
$color = 'table-primary';
}
} else {
} else if($moon->rental_type == 'Out of Alliance') {
$type = 'OOA';
//Setup the row color
if($rentalTemp->diffInDays(Carbon::now()) < 3 && $today->lessThan($rentalTemp)) {
$color = 'table-warning';
} else if($today->lessThan($rentalTemp)) {
$color = 'table-danger';
} else {
$color = 'table-primary';
}
} else if($moon->rental_type == 'Alliance') {
$type = 'W4RP';
//Set the row color
$color = 'table-info';
} else {
$type = 'N/A';
//Set the row color
$color = 'table-primary';
}
//Add the data to the html string to be passed to the view
@@ -475,4 +518,78 @@ class MoonsAdminController extends Controller
//Redirect to the previous screen.
return redirect('/moons/admin/updatemoon')->with('success', 'Moon Rental updated.');
}
public function ImportMoonSurveyData(Request $request) {
//Declare variables
$added = 0;
$updated = 0;
$moon = null;
$newMoon = false;
$num = 0;
$planet = null;
$moonNumber = null;
foreach(explode("\n", $request->input('data')) as $row) {
$cols = explode("\t", $row);
dd($cols);
}
return redirect('/admin/dashboard')->with('success', 'Import done: ' . $added . ' moons added ' . $updated . ' moons updated.');
}
private function romanNumberToInteger($roman) {
$result = 0;
foreach($this->romans as $key => $value) {
while(strpos($roman, $key) === 0) {
$result += $value;
$roman = substr($roman, strlen($key));
}
}
return $result;
}
private function integerToRomanNumber($number) {
$returnValue = '';
while($number > 0) {
foreach($this->romans as $roman => $int) {
if($number >= $int) {
$number -= $int;
$returnValue .= $roman;
break;
}
}
}
return $returnValue;
}
private function arrayToCsv(array $rows) {
//Declare needed variable as text null
$result = '';
//Open the temp file
$fp = fopen('php://temp', 'w');
//Process the file
foreach($rows as $fields) {
fputcsv($fp, $fields, ';', '"');
}
//Go back to the beginning of the file
rewind($fp);
//Continue through the buffer until the end
while(($buffer = fgets($fp, 4096)) !== false) {
$result .= $buffer;
}
//Close the temp file
fclose($fp);
//Return the result
return $result;
}
}

View File

@@ -12,7 +12,6 @@ use Carbon\Carbon;
//Models
use App\Models\Moon\Config;
use App\Models\Moon\ItemComposition;
use App\Models\Moon\RentalMoon;
use App\Models\Moon\OrePrice;
use App\Models\Moon\Price;
use App\Models\Moon\AllianceMoon;
@@ -23,6 +22,9 @@ use App\Models\Moon\AllianceMoonRequest;
use App\Library\Moons\MoonCalc;
use App\Library\Lookups\LookupHelper;
//Jobs
use App\Jobs\ProcessSendEveMailJob;
class MoonsController extends Controller
{
public function __construct() {
@@ -30,6 +32,10 @@ class MoonsController extends Controller
$this->middleware('role:Renter');
}
public function displayRentalMoonPage() {
return view('moons.user.requestrental');
}
/**
* Function to display all alliance moons and pass data to the blade template
*/
@@ -150,6 +156,7 @@ class MoonsController extends Controller
'Z-H2MA',
'B-KDOZ',
'E8-YS9',
'DY-P7Q',
];
//Declare lookup variables
@@ -212,6 +219,16 @@ class MoonsController extends Controller
'Availability' => 'Request Pending',
]);
//Send a mail over to the site admins to approve the moon request
$config = config('esi');
$body = 'A new moon request has been entered into the services site. Please approve or deny the request within 3 business days.<br><br>';
$body .= 'Sincerely,<br>';
$body .= 'W4RP Services Site';
$subject = 'New Moon Request Available';
ProcessSendEveMailJob::dispatch($body, 92947432, 'character', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds(30));
ProcessSendEveMailJob::dispatch($body, 92626011, 'character', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds(60));
return redirect('/moons/display/request')->with('success', 'Moon request submitted.');
}
@@ -221,7 +238,6 @@ class MoonsController extends Controller
*/
public function displayRentalMoons() {
//Declare variables
$rentalEnd = null;
$lastMonth = Carbon::now()->subMonth();
$today = Carbon::now();
$table = array();
@@ -237,17 +253,32 @@ class MoonsController extends Controller
//For each of the moons let's format the data for the display table
foreach($moons as $moon) {
$color = null;
$rentalTemp = null;
$rentalEnd = null;
//Check if someone is currently renting the moon
if(($moon->rental_type == 'In Alliance' || $moon->rental_type == 'Out of Alliance') && ($moon->paid == 'Yes')) {
if($moon->rental_type == 'In Alliance' || $moon->rental_type == 'Out of Alliance') {
$rentalTemp = new Carbon($moon->rental_until);
$rentalEnd = $rentalTemp->format('m-d');
//Setup the correct color for the table
if($rentalTemp->diffInDays(Carbon::now()) < 3 && $today->lessThan($rentalTemp)) {
$color = 'table-warning';
} else if($today->lessThan($rentalTemp)) {
$color = 'table-danger';
} else {
$color = 'table-primary';
}
} else if($moon->rental_type == 'Alliance') {
$rentalTemp = $today->endOfMonth();
$rentalTemp = Carbon::now()->endOfMonth();
$rentalEnd = $rentalTemp->format('m-d');
$color = 'table-info';
} else {
//Set the rental date for if someone is not renting the moon
$rentalTemp = $lastMonth;
$rentalEnd = $rentalTemp->format('m-d');
$color = 'table-primary';
}
//Get the price of the moon from the database based on if the person is in Warped Intentions
@@ -258,21 +289,6 @@ class MoonsController extends Controller
$moonprice = $moon->out_of_alliance_rental_price;
}
//Get the color correct for the table
if($moon->rental_type == 'In Alliance' || $moon->rental_type == 'Out of Alliance') {
if($rentalTemp->diffInDays($today) < 3 && $today < $rentalTemp ) {
$color = 'table-danger';
} else if($today > $rentalTemp) {
$color = 'table-primary';
} else if($today < $rentalTemp) {
$color = 'table-danger';
}
} else if($moon->rental_type == 'Alliance') {
$color = 'table-info';
} else {
$color = 'table-primary';
}
//Add the data to the html array to be passed to the view
array_push($table, [
'SPM' => $moon->system . " - " . $moon->planet . " - " . $moon->moon,

View File

@@ -0,0 +1,62 @@
<?php
namespace App\Http\Controllers\Moons;
//Internal Library
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Auth;
use Log;
use Carbon\Carbon;
//Models
use App\Models\Moon\AllianceRentalMoon;
class RentalMoonsAdminController extends Controller
{
/**
* Construct
*/
public function __construct() {
$this->middleware('auth');
$this->middelware('role:user');
$this->middleware('permission:mining.director');
}
/**
* Function to display rental moons being used for the alliance
*/
public function displayAllianceUsageRentalMoons() {
}
/**
* Display the form for requesting new rental moon for the alliance
*/
public function displayRentalMoonForAllianceForm() {
}
/**
* Function to store when a new rental moon is requested
*/
public function storeRentalMoonForAlliance(Request $request) {
}
/**
* Function to display the form for figuring out item composition
*/
public function displayItemCompositionForm() {
}
/**
* Function to display the results of the form for figuring out item composition
*/
public function displayItemCompositionResults(Request $request) {
}
}

View File

@@ -85,8 +85,13 @@ class SRPAdminController extends Controller
//Calculate the recommended srp amount
foreach($payouts as $p) {
if($r['ship_type'] == $p->code) {
$temp['actual_srp'] = $r['loss_value'] * ($p->payout / 100.00 );
$temp['payout_percentage'] = $p->payout;
$payout = $p->payout;
if($temp['character_name'] == $temp['fleet_commander_name']) {
$payout = 100.00;
}
$temp['actual_srp'] = $r['loss_value'] * ($payout / 100.00 );
$temp['payout_percentage'] = $payout;
$sum_actual += $temp['actual_srp'];
}
}

View File

@@ -0,0 +1,156 @@
<?php
namespace App\Http\Controllers\SystemRentals;
//Internal Library
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Auth;
use DB;
use Carbon\Carbon;
//Models
use App\Models\SystemRentals\RentalSystem;
//Library
use App\Library\Lookups\LookupHelper;
use App\Library\Esi\Esi;
class RentalAdminController extends Controller
{
//Constructor
public function __construct() {
$this->middleware('auth');
$this->middleware('role:Admin');
}
/**
* Function to display all active rental systems and
* the information regarding the rental systems
*/
public function displayRentalSystems() {
//Get the rental systems from the database
$rentals = RentalSystem::all();
foreach($rentals as $rental) {
//Format the rental cost
if($rental->rental_cost > 1000000000.00) {
$rental->rental_cost = $rental->rental_cost / 1000000000.00;
$rental->rental_cost = $rental->rental_cost . "B";
} else if($rental->rental_cost > 1000000.00 && $rental->rental_cost < 999999999.99) {
$rental->rental_cost = $rental->rental_cost / 1000000.00;
$rental->rental_cost = $rental->rental_cost . "M";
}
//Format the date
$rental->paid_until = Carbon::parse($rental->paid_until)->format('Y-m-d');
}
//Return the view with the data
return view('rental.list')->with('rentals', $rentals);
}
/**
* Function to display form for adding new rental system
*/
public function displayAddRentalSystem() {
return view('rental.add');
}
/**
* Function to add new rental system to the database
*/
public function addRentalSystem(Request $request) {
$this->validate($request, [
'contact_name' => 'required',
'contact_corp_name' => 'required',
'system' => 'required',
'rental_cost' => 'required',
'paid_until' => 'required',
]);
//Declare the variables and classes needed
$lookup = new LookupHelper;
//From the character name find the character id
$charId = $lookup->CharacterNameToId($request->contact_name);
//From the corporation name find the corporation id
$corpId = $lookup->CorporationNameToId($request->contact_corp_name);
//From the system name find the system id
$systemId = $lookup->SystemNameToId($request->system);
//Sanitize the bid amount
if(preg_match('(m|M|b|B)', $request->rental_cost) === 1) {
if(preg_match('(m|M)', $request->rental_cost) === 1) {
$cStringSize = strlen($request->rental_cost);
$tempCol = str_split($request->rental_cost, $cStringSize - 1);
$rentalCost = $tempCol[0];
$rentalCost = $rentalCost * 1000000.00;
} else if(preg_match('(b|B)', $request->rental_cost) === 1) {
$cStringSize = strlen($request->rental_cost);
$tempCol = str_split($request->rental_cost, $cStringSize - 1);
$rentalCost = $tempCol[0];
$rentalCost = $rentalCost * 1000000000.00;
}
} else {
$rentalCost = $request->rental_cost;
}
//Create the database model
$rental = new RentalSystem;
$rental->contact_id = $charId;
$rental->contact_name = $request->contact_name;
$rental->corporation_id = $corpId;
$rental->corporation_name = $request->contact_corp_name;
$rental->system_id = $systemId;
$rental->system_name = $request->system;
$rental->rental_cost = $rentalCost;
$rental->paid_until = $request->paid_until;
$rental->save();
return redirect('/system/rental/dashboard')->with('success', 'Rental System Added.');
}
/**
* Function to update paid until section of the rental system in the database
*/
public function updateRentalSystem(Request $request) {
$this->validate($request, [
'paid_until' => 'required',
'contact_id' => 'required',
'corporation_id' => 'required',
'system_id' => 'required',
]);
RentalSystem::where([
'contact_id' => $request->contact_id,
'corporation_id' => $request->corporation_id,
'system_id' => $request->system_id,
])->update([
'paid_until' => $request->paid_until,
]);
return redirect('/system/rental/dashboard')->with('success', 'Rental System updated.');
}
/**
* Function to remove rental system from the database
*/
public function removeRentalSystem(Request $request) {
$this->validate($request, [
'contact_id' => 'required',
'corporation_id' => 'required',
'system_id' => 'required',
]);
RentalSystem::where([
'contact_id' => $request->contact_id,
'corporation_id' => $request->corporation_id,
'system_id' => $request->system_id,
])->delete();
return redirect('/system/rental/dashboard')->with('success', 'Removed renter from database.');
}
}

View File

@@ -1,148 +0,0 @@
<?php
namespace App\Http\Controllers\Wormholes;
//Laravel Libraries
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Auth;
use Carbon\Carbon;
//User Libraries
//Models
use App\Models\Wormholes\AllianceWormhole;
use App\Models\Wormholes\WormholeType;
class WormholeController extends Controller
{
public function __construct() {
$this->middleware('auth');
$this->middleware('role:User');
}
public function displayWormholeForm() {
//Declare a few array variables
$duration = array();
$class = array();
$stability = array();
$size = array();
//Get the duration from the table
$duration = [
'This wormhole has not yet begun its natural cycle of decay and should last at least another day.',
'This wormhole is beginning to decay, but will not last another day.',
'This wormhole is reaching the end of its natural lifetime',
];
//Get the wh classes from the table
$class = [
'C1',
'C2',
'C3',
'C4',
'C5',
'C6',
'C7',
'C8',
'C9',
'C13',
'Drifter',
'Thera',
'Exit WH',
];
//Get the wh types from the table
$type = WormholeType::groupBy('type')->pluck('type');
//Get the wh sizes from the table
$size = [
'XS',
'S',
'M',
'L',
'XL',
];
//Get the wh stabilities from the table
$stability = [
'Stable',
'Non-Critical',
'Critical',
];
//Return all the variables to the view
return view('wormholes.form')->with('class', $class)
->with('type', $type)
->with('size', $size)
->with('stability', $stability)
->with('duration', $duration);
}
public function storeWormhole() {
$this->validate($request, [
'sig' => 'required',
'duration' => 'required',
'dateTiume' => 'required',
'class' => 'required',
'size' => 'required',
'stability' => 'required',
'system' => 'required',
]);
//Declare some variables
$duration = null;
//Create the stable time for the database
if($request->duration == 'This wormhole has not yet begun its natural cycle of decay and should last at least another day.') {
$duration = '>24 hours';
} else if ($request->duration == 'This wormhole is beginning to decay, but will not last another day.') {
$duration = '>4 hours <24 hours';
} else if($request->duration == 'This wormhole is reaching the end of its natural lifetime') {
'<4 hours';
}
//Get the wormhole type from the database so we can enter other details
$wormholeType = WormholeType::where([
'type' => $request->type,
])->first();
$found = AllianceWormhole::where([
'system' => $request->system,
'sig_ig' => $request->sig,
])->count();
if($found == 0) {
AllianceWormhole::insert([
'system' => $request->system,
'sig_id' => $request->sig_id,
'duration_left' => $duration,
'dateTime' => $request->dateTime,
'class' => $request->class,
'type' => $request->class,
'hole_size' => $request->size,
'stability' => $request->stability,
'details' => $request->details,
'link' => $request->link,
'mass_allowed' => $wormholeType->mass_allowed,
'individual_mass' => $wormholeType->individual_mass,
'regeneration' => $wormholeType->regeneration,
'max_stable_time' => $wormholeType->max_stable_time,
]);
return redirect('/wormholes/display')->with('success', 'Wormhole Info Added.');
} else {
return redirect('/wormholes/display')->with('error', 'Wormhole already in database.');
}
}
public function displayWormholes() {
//Create the date and time
$dateTime = Carbon::now()->subDays(2);
//Get all of the wormholes from the last 48 hours from the database to display
$wormholes = AllianceWormhole::where('created_at', '>=', $dateTime)->get();
return view('wormholes.display')->with('wormholes', $wormholes);
}
}

View File

@@ -1,56 +0,0 @@
<?php
namespace App\Jobs\Commands\Eve;
//Internal Library
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Log;
//Library
use Seat\Eseye\Exceptions\RequestFailedException;
use App\Library\Esi\Esi;
//Models
use App\Models\Eve\EveRegion;
class GetEveRegionsJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$esi = new Esi();
$regions = $esi->invoke('get', '/universe/regions/');
$responses = $esi->setBody($regions)->invoke('post', '/universe/names/');
foreach($responses as $resp) {
if($resp->category == 'region') {
EveRegion::insertOrIgnore([
'region_id' => $resp->id,
'region_name' => $resp->name,
]);
}
}
}
}

View File

@@ -1,14 +1,18 @@
<?php
namespace App\Jobs;
namespace App\Jobs\Commands\Eve;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Log;
class PurgeMarketRegionOrderJob implements ShouldQueue
//Library
use App\Library\Moons\MoonCalc;
class ItemPricesUpdateJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
@@ -29,6 +33,8 @@ class PurgeMarketRegionOrderJob implements ShouldQueue
*/
public function handle()
{
//
$moonHelper = new MoonCalc;
$moonHelper->FetchNewPrices();
}
}

View File

@@ -1,104 +0,0 @@
<?php
namespace App\Jobs\Commands\Market;
//Internal Library
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Carbon\Carbon;
use Log;
//App Library
use Seat\Eseye\Exceptions\RequestFailedException;
use App\Library\Esi\Esi;
use App\Library\Lookups\LookupHelper;
class GetMarketRegionOrderJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Private variables
*/
private $esi;
private $region;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($region, $esi = null)
{
//Setup the region variable
$this->region = $region;
//Setup the esi variable
if($esi == null) {
$this->esi = new Esi();
} else {
$this->esi = $esi;
}
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
//Get the market orders for a region
$orders = $this->esi->invoke('get', '/markets/{region_id}/orders/', [
'region_id' => $this->region,
]);
foreach($orders as $order) {
$count = MarketRegionOrder::where([
'order_id',
])->count();
if($count == 0) {
$newOrder = new MarketRegionOrder;
$newOrder->region_id = $this->region;
$newOrder->duration = $order->duration;
$newOrder->is_buy_order = $order->is_buy_order;
$newOrder->issued = $order->issued;
$newOrder->location_id = $order->location_id;
$newOrder->min_volume = $order->min_volume;
$newOrder->order_id = $order->order_id;
$newOrder->price = $order->price;
$newOrder->range = $order->range;
$newOrder->system_id = $order->system_id;
$newOrder->type_id = $order->type_id;
$newOrder->volume_remain = $order->volume_remain;
$newOrder->volume_total = $order->volume_total;
$newOrder->save();
} else if ($order->volume_remain == 0) {
MarketRegionOrder::where([
'order_id' => $order->order_id,
])->delete();
} else {
MarketRegionOrder::where([
'order_id' => $order->order_id,
])->update([
'region_id' => $this->region,
'duration' => $order->duration,
'is_buy_order' => $order->is_buy_order,
'issued' => $order->issued,
'location_id' => $order->location_id,
'min_volume' => $order->min_volume,
'order_id' => $order->order_id,
'price' => $order->price,
'range' => $order->range,
'system_id' => $order->system_id,
'type_id' => $order->type_id,
'volume_remain' => $order->volume_remain,
'volume_total' => $order->volume_total,
]);
}
}
}
}

View File

@@ -98,7 +98,7 @@ class SendMoonRentalPaymentReminderJob implements ShouldQueue
}
//Put the price for the moons
$body .= "The price for next month's rent is " . number_format($cost, 0, ".", ",") . "<br>";
$body .= "Rental Payment is due on the 1st of the month should you continue to want to rent the moons.<br>";
$body .= "Rental Payment is due on the 1st of the month. If the rental payment is not remitted to Spatial Forces by the 3rd of the month, the rental claim shall be forfeited.<br>";
$body .= "Rental Payment should be transferred to Spatial Forces.<br>";
$body .= "In the description of the payment please put the following transaction identification: " . $transId . "<br>";
$body .= "<br>";

View File

@@ -94,6 +94,11 @@ class UpdateMoonRentalPrice implements ShouldQueue
'alliance_rental_price' => $rentalPrice['alliance'],
'out_of_alliance_rental_price' => $rentalPrice['outofalliance'],
]);
Log::info('Alliance Rental Moon: ' . $rental->region . ' : ' . $rental->system . ' : ' . $rental->planet . ' : ' . $rental->moon . ' : ' . $rental->structure_name);
Log::info('Total Worth: ' . $totalWorth);
Log::info('Alliance Rental Price: ' . $rentalPrice['alliance']);
Log::info('Out of Alliance Rental Price: ' . $rentalPrice['outofalliance']);
}
}
}

View File

@@ -0,0 +1,113 @@
<?php
namespace App\Jobs\Commands\SupplyChain;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Carbon\Carbon;
use Log;
//Library
use App\Library\Lookups\LookupHelper;
//Models
use App\Models\Contracts\SupplyChainBid;
use App\Models\Contracts\SupplyChainContract;
//Jobs
use App\Jobs\ProcessSendEveMailJob;
class EndSupplyChainContractJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Timeout in seconds
*
* @var int
*/
public $timeout = 1200;
/**
* Retries
*
* @var int
*/
public $retries = 3;
/**
* Private Variables
*/
private $contractId;
private $issuerId;
private $issuerName;
private $title;
private $endDate;
private $deliveryBy;
private $body;
private $state;
private $finalCost;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct(SupplyChainContract $contract)
{
//Set the queue connection up
$this->connection = 'redis';
//Set the variables
$contractId = $contract->contract_id;
$issuerId = $contract->issuer_id;
$issuerName = $contract->issuer_name;
$title = $contract->title;
$endDate = $contract->end_date;
$deliveryBy = $contract->delivery_by;
$body = $contract->body;
$state = $contract->state;
$finalCost = $contract->final_cost;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
//Declare variables
$bidId = null;
$bidAmount = null;
//Get all of the bids from the contract
$bids = SupplyChainBids::where([
'contract_id' => $contractId,
])->get();
//Loop through the bids and find the lowest bid
foreach($bids as $bid) {
if($bidId == null) {
$bidId = $bid->id;
$bidAmount = $bid->bid_amount;
} else {
if($bid->bid_amount < $bidAmount) {
$bidId = $bid->id;
$bidAmount = $bid->bid_amount;
}
}
}
//Clean up the bids and update the contract with the winning bid
SupplyChainContract::where([
'contract_id' => $this->contractId,
])->update([
'final_cost' => $bidAmount,
'winning_bid_id' => $bidId,
]);
}
}

View File

@@ -12,6 +12,7 @@ use DB;
use Carbon\Carbon;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
use Log;
//Models
use App\Models\Moon\Config;
@@ -20,8 +21,14 @@ use App\Models\Moon\RentalMoon;
use App\Models\Moon\OrePrice;
use App\Models\Moon\MineralPrice;
/**
* MoonCalc Library
*/
class MoonCalc {
/**
* Get the ore composition of an ore
*/
public function GetOreComposition($ore) {
$composition = ItemComposition::where([
'Name' => $ore,
@@ -30,10 +37,12 @@ class MoonCalc {
return $composition;
}
/**
* Calculate the total worth of a moon
*/
public function SpatialMoonsTotalWorth($firstOre, $firstQuan, $secondOre, $secondQuan, $thirdOre, $thirdQuan, $fourthOre, $fourthQuan) {
//Get the total moon pull in m3
$totalPull = $this->CalculateTotalMoonPull();
//Declare variables
$totalPriceMined = 0.00;
//Get the configuration for pricing calculations
$config = DB::table('Config')->get();
@@ -42,21 +51,29 @@ class MoonCalc {
$this->ConvertPercentages($firstPerc, $firstQuan, $secondPerc, $secondQuan, $thirdPerc, $thirdQuan, $fourthPerc, $fourthQuan);
//Calculate the prices from the ores
$this->CalculateTotalPrice($firstOre, $firstPerc, $firstTotal);
$this->CalculateTotalPrice($secondOre, $secondPerc, $secondTotal);
$this->CalculateTotalPrice($thirdOre, $thirdPerc, $thirdTotal);
$this->CalculateTotalPrice($fourthOre, $fourthPerc, $fourthTotal);
if($firstOre != 'None') {
$totalPriceMined += $this->CalcMoonPrice($firstOre, $firstPerc);
}
if($secondOre != 'None') {
$totalPriceMined += $this->CalcMoonPrice($secondOre, $secondPerc);
}
if($thirdOre != 'None') {
$totalPriceMined += $this->CalcMoonPrice($thirdOre, $thirdPerc);
}
if($fourthOre != 'None') {
$totalPriceMined += $this->CalcMoonPrice($fourthOre, $fourthPerc);
}
//Calculate the total to price to be mined in one month
$totalPriceMined = $firstTotal + $secondTotal + $thirdTotal + $fourthTotal;
//Return the rental price to the caller
return $totalPriceMined;
}
/**
* Calculate the rental price
*/
public function SpatialMoons($firstOre, $firstQuan, $secondOre, $secondQuan, $thirdOre, $thirdQuan, $fourthOre, $fourthQuan) {
//Get the total moon pull in m3
$totalPull = $this->CalculateTotalMoonPull();
//Declare variables
$totalPrice = 0.00;
//Get the configuration for pricing calculations
$config = DB::table('Config')->get();
@@ -65,22 +82,30 @@ class MoonCalc {
$this->ConvertPercentages($firstPerc, $firstQuan, $secondPerc, $secondQuan, $thirdPerc, $thirdQuan, $fourthPerc, $fourthQuan);
//Calculate the prices from the ores
$this->CalculateTotalPrice($firstOre, $firstPerc, $firstTotal);
$this->CalculateTotalPrice($secondOre, $secondPerc, $secondTotal);
$this->CalculateTotalPrice($thirdOre, $thirdPerc, $thirdTotal);
$this->CalculateTotalPrice($fourthOre, $fourthPerc, $fourthTotal);
if($firstOre != 'None') {
$totalPrice += $this->CalcRentalPrice($firstOre, $firstPerc);
}
if($secondOre != 'None') {
$totalPrice += $this->CalcRentalPrice($secondOre, $secondPerc);
}
if($thirdOre != 'None') {
$totalPrice += $this->CalcRentalPrice($thirdOre, $thirdPerc);
}
if($fourthOre != 'None') {
$totalPrice += $this->CalcRentalPrice($fourthOre, $fourthPerc);
}
//Calculate the total to price to be mined in one month
$totalPriceMined = $firstTotal + $secondTotal + $thirdTotal + $fourthTotal;
//Calculate the rental price. Refined rate is already included in the price from rental composition
$rentalPrice['alliance'] = $totalPriceMined * ($config[0]->RentalTax / 100.00);
$rentalPrice['outofalliance'] = $totalPriceMined * ($config[0]->AllyRentalTax / 100.00);
$rentalPrice['alliance'] = $totalPrice * ($config[0]->RentalTax / 100.00);
$rentalPrice['outofalliance'] = $totalPrice * ($config[0]->AllyRentalTax / 100.00);
//Return the rental price to the caller
return $rentalPrice;
}
/**
* Fetch new prices for items from the market
*/
public function FetchNewPrices() {
//Create the item id array which we will pull data for from Fuzzwork market api
$ItemIDs = array(
@@ -153,6 +178,9 @@ class MoonCalc {
$this->UpdateItemPricing();
}
/**
* Calculate the ore units
*/
public function CalcOreUnits($ore, $percentage) {
//Specify the total pull amount
$totalPull = 5.55 * (3600.00 * 24.00 *30.00);
@@ -175,6 +203,9 @@ class MoonCalc {
return $units;
}
/**
* Update item pricing after new prices were pulled
*/
private function UpdateItemPricing() {
//Get the configuration from the config table
$config = DB::table('Config')->first();
@@ -188,42 +219,42 @@ class MoonCalc {
$pastTime = Carbon::now()->subDays(30);
//Get the price of the basic minerals
$tritaniumPrice = MineralPrice::where(['ItemId' => 34])->whereDate('Time', '>', $pastTime)->avg('Price');
$pyeritePrice = MineralPrice::where(['ItemId' => 35])->whereDate('Time', '>', $pastTime)->avg('Price');
$mexallonPrice = MineralPrice::where(['ItemId' => 36])->whereDate('Time', '>', $pastTime)->avg('Price');
$isogenPrice = MineralPrice::where(['ItemId' => 37])->whereDate('Time', '>', $pastTime)->avg('Price');
$nocxiumPrice = MineralPrice::where(['ItemId' => 38])->whereDate('Time', '>', $pastTime)->avg('Price');
$zydrinePrice = MineralPrice::where(['ItemId' => 39])->whereDate('Time', '>', $pastTime)->avg('Price');
$megacytePrice = MineralPrice::where(['ItemId' => 40])->whereDate('Time', '>', $pastTime)->avg('Price');
$morphitePrice = MineralPrice::where(['ItemId' => 11399])->whereDate('Time', '>', $pastTime)->avg('Price');
$heliumIsotopesPrice = MineralPrice::where(['ItemId' => 16274])->whereDate('Time', '>', $pastTime)->avg('Price');
$nitrogenIsotopesPrice = MineralPrice::where(['ItemId' => 17888])->whereDate('Time', '>', $pastTime)->avg('Price');
$oxygenIsotopesPrice = MineralPrice::where(['ItemId' => 17887])->whereDate('Time', '>', $pastTime)->avg('Price');
$hydrogenIsotopesPrice = MineralPrice::where(['ItemId' => 17889])->whereDate('Time', '>', $pastTime)->avg('Price');
$liquidOzonePrice = MineralPrice::where(['ItemId' => 16273])->whereDate('Time', '>', $pastTime)->avg('Price');
$heavyWaterPrice = MineralPrice::where(['ItemId' => 16272])->whereDate('Time', '>', $pastTime)->avg('Price');
$strontiumClathratesPrice = MineralPrice::where(['ItemId' => 16275])->whereDate('Time', '>', $pastTime)->avg('Price');
$tritaniumPrice = MineralPrice::where(['ItemId' => 34])->where('Time', '>', $pastTime)->avg('Price');
$pyeritePrice = MineralPrice::where(['ItemId' => 35])->where('Time', '>', $pastTime)->avg('Price');
$mexallonPrice = MineralPrice::where(['ItemId' => 36])->where('Time', '>', $pastTime)->avg('Price');
$isogenPrice = MineralPrice::where(['ItemId' => 37])->where('Time', '>', $pastTime)->avg('Price');
$nocxiumPrice = MineralPrice::where(['ItemId' => 38])->where('Time', '>', $pastTime)->avg('Price');
$zydrinePrice = MineralPrice::where(['ItemId' => 39])->where('Time', '>', $pastTime)->avg('Price');
$megacytePrice = MineralPrice::where(['ItemId' => 40])->where('Time', '>', $pastTime)->avg('Price');
$morphitePrice = MineralPrice::where(['ItemId' => 11399])->where('Time', '>', $pastTime)->avg('Price');
$heliumIsotopesPrice = MineralPrice::where(['ItemId' => 16274])->where('Time', '>', $pastTime)->avg('Price');
$nitrogenIsotopesPrice = MineralPrice::where(['ItemId' => 17888])->where('Time', '>', $pastTime)->avg('Price');
$oxygenIsotopesPrice = MineralPrice::where(['ItemId' => 17887])->where('Time', '>', $pastTime)->avg('Price');
$hydrogenIsotopesPrice = MineralPrice::where(['ItemId' => 17889])->where('Time', '>', $pastTime)->avg('Price');
$liquidOzonePrice = MineralPrice::where(['ItemId' => 16273])->where('Time', '>', $pastTime)->avg('Price');
$heavyWaterPrice = MineralPrice::where(['ItemId' => 16272])->where('Time', '>', $pastTime)->avg('Price');
$strontiumClathratesPrice = MineralPrice::where(['ItemId' => 16275])->where('Time', '>', $pastTime)->avg('Price');
//Get the price of the moongoo
$atmosphericGasesPrice = MineralPrice::where(['ItemId' => 16634])->whereDate('Time', '>', $pastTime)->avg('Price');
$evaporiteDepositsPirce = MineralPrice::where(['ItemId' => 16635])->whereDate('Time', '>', $pastTime)->avg('Price');
$hydrocarbonsPrice = MineralPrice::where(['ItemId' => 16633])->whereDate('Time', '>', $pastTime)->avg('Price');
$silicatesPrice = MineralPrice::where(['ItemId' => 16636])->whereDate('Time', '>', $pastTime)->avg('Price');
$cobaltPrice = MineralPrice::where(['ItemId' => 16640])->whereDate('Time', '>', $pastTime)->avg('Price');
$scandiumPrice = MineralPrice::where(['ItemId' => 16639])->whereDate('Time', '>', $pastTime)->avg('Price');
$titaniumPrice = MineralPrice::where(['ItemId' => 16638])->whereDate('Time', '>', $pastTime)->avg('Price');
$tungstenPrice = MineralPrice::where(['ItemId' => 16637])->whereDate('Time', '>', $pastTime)->avg('Price');
$cadmiumPrice = MineralPrice::where(['ItemId' => 16643])->whereDate('Time', '>', $pastTime)->avg('Price');
$platinumPrice = MineralPrice::where(['ItemId' => 16644])->whereDate('Time', '>', $pastTime)->avg('Price');
$vanadiumPrice = MineralPrice::where(['ItemId' => 16642])->whereDate('Time', '>', $pastTime)->avg('Price');
$chromiumPrice = MineralPrice::where(['ItemId' => 16641])->whereDate('Time', '>', $pastTime)->avg('Price');
$technetiumPrice = MineralPrice::where(['ItemId' => 16649])->whereDate('Time', '>', $pastTime)->avg('Price');
$hafniumPrice = MineralPrice::where(['ItemId' => 16648])->whereDate('Time', '>', $pastTime)->avg('Price');
$caesiumPrice = MineralPrice::where(['ItemId' => 16647])->whereDate('Time', '>', $pastTime)->avg('Price');
$mercuryPrice = MineralPrice::where(['ItemId' => 16646])->whereDate('Time', '>', $pastTime)->avg('Price');
$dysprosiumPrice = MineralPrice::where(['ItemId' => 16650])->whereDate('Time', '>', $pastTime)->avg('Price');
$neodymiumPrice = MineralPrice::where(['ItemId' => 16651])->whereDate('Time', '>', $pastTime)->avg('Price');
$promethiumPrice = MineralPrice::where(['ItemId' => 16652])->whereDate('Time', '>', $pastTime)->avg('Price');
$thuliumPrice = MineralPrice::where(['ItemId' => 16653])->whereDate('Time', '>', $pastTime)->avg('Price');
$atmosphericGasesPrice = MineralPrice::where(['ItemId' => 16634])->where('Time', '>', $pastTime)->avg('Price');
$evaporiteDepositsPirce = MineralPrice::where(['ItemId' => 16635])->where('Time', '>', $pastTime)->avg('Price');
$hydrocarbonsPrice = MineralPrice::where(['ItemId' => 16633])->where('Time', '>', $pastTime)->avg('Price');
$silicatesPrice = MineralPrice::where(['ItemId' => 16636])->where('Time', '>', $pastTime)->avg('Price');
$cobaltPrice = MineralPrice::where(['ItemId' => 16640])->where('Time', '>', $pastTime)->avg('Price');
$scandiumPrice = MineralPrice::where(['ItemId' => 16639])->where('Time', '>', $pastTime)->avg('Price');
$titaniumPrice = MineralPrice::where(['ItemId' => 16638])->where('Time', '>', $pastTime)->avg('Price');
$tungstenPrice = MineralPrice::where(['ItemId' => 16637])->where('Time', '>', $pastTime)->avg('Price');
$cadmiumPrice = MineralPrice::where(['ItemId' => 16643])->where('Time', '>', $pastTime)->avg('Price');
$platinumPrice = MineralPrice::where(['ItemId' => 16644])->where('Time', '>', $pastTime)->avg('Price');
$vanadiumPrice = MineralPrice::where(['ItemId' => 16642])->where('Time', '>', $pastTime)->avg('Price');
$chromiumPrice = MineralPrice::where(['ItemId' => 16641])->where('Time', '>', $pastTime)->avg('Price');
$technetiumPrice = MineralPrice::where(['ItemId' => 16649])->where('Time', '>', $pastTime)->avg('Price');
$hafniumPrice = MineralPrice::where(['ItemId' => 16648])->where('Time', '>', $pastTime)->avg('Price');
$caesiumPrice = MineralPrice::where(['ItemId' => 16647])->where('Time', '>', $pastTime)->avg('Price');
$mercuryPrice = MineralPrice::where(['ItemId' => 16646])->where('Time', '>', $pastTime)->avg('Price');
$dysprosiumPrice = MineralPrice::where(['ItemId' => 16650])->where('Time', '>', $pastTime)->avg('Price');
$neodymiumPrice = MineralPrice::where(['ItemId' => 16651])->where('Time', '>', $pastTime)->avg('Price');
$promethiumPrice = MineralPrice::where(['ItemId' => 16652])->where('Time', '>', $pastTime)->avg('Price');
$thuliumPrice = MineralPrice::where(['ItemId' => 16653])->where('Time', '>', $pastTime)->avg('Price');
//Get the item compositions
$items = DB::select('SELECT Name,ItemId FROM ItemComposition');
@@ -302,21 +333,34 @@ class MoonCalc {
}
}
/**
* Calculate the total amount pulled from a moon
*/
private function CalculateTotalMoonPull() {
//Always assume a 1 month pull which equates to 5.55m3 per second or 2,592,000 seconds
//Total pull size is 14,385,600 m3
$totalPull = 5.55 * (3600.00 * 24.00 *30.00);
$totalPull = 5.55 * 3600.00 * 24.00 *30.00;
//Return the total pull
return $totalPull;
}
private function CalcPrice($ore, $percentage) {
/**
* Calculate the rental price of a moon ore from the moon
*/
private function CalcRentalPrice($ore, $percentage) {
//Specify the total pull amount
$totalPull = $this->CalculateTotalMoonPull();
//Setup the total value at 0.00
$totalPrice = 0.00;
//Check to see what type of moon goo the moon is
$gasMoonOre = $this->IsGasMoonGoo($ore);
//Find the size of the asteroid from the database
$m3Size = DB::table('ItemComposition')->where('Name', $ore)->value('m3Size');
//Calculate the actual m3 from the total pull amount in m3 using the percentage of the ingredient
$actualm3 = floor($percentage * $totalPull);
@@ -325,19 +369,79 @@ class MoonCalc {
//Look up the unit price from the database
$unitPrice = DB::table('ore_prices')->where('Name', $ore)->value('UnitPrice');
//Calculate the total amount from the units and unit price
$total = $units * $unitPrice;
//Return the value
return $total;
//If the ore is a gas ore, then take only 50% of the price.
if($gasMoonOre == true) {
$totalPrice = $units * ($unitPrice / 2.00);
Log::warning('Found gas ore: ' . $totalPrice);
} else {
$totalPrice = $units * $unitPrice;
}
//Return the total
return $totalPrice;
}
/**
* Calculate the moon's total price
*/
private function CalcMoonPrice($ore, $percentage) {
//Specify the total pull amount
$totalPull = $this->CalculateTotalMoonPull();
//Setup the total value at 0.00
$totalPrice = 0.00;
//Find the size of the asteroid from the database
$m3Size = DB::table('ItemComposition')->where('Name', $ore)->value('m3Size');
//Calculate the actual m3 from the total pull amount in m3 using the percentage of the ingredient
$actualm3 = floor($percentage * $totalPull);
//Calculate the units once we have the size and actual m3 value
$units = floor($actualm3 / $m3Size);
//Look up the unit price from the database
$unitPrice = DB::table('ore_prices')->where('Name', $ore)->value('UnitPrice');
//Calculate the total amount from the units and the unit price.
$totalPrice = $units * $unitPrice;
//Return the value
return $totalPrice;
}
/**
* Convert a number to a percentage
*/
private function ConvertToPercentage($quantity) {
//Perform the calculation and return the data
return $quantity / 100.00;
}
/**
* Return if a type of ore is a gas moon goo
*/
private function IsGasMoonGoo($ore) {
$ores = [
'Zeolites' => 'Gas',
'Sylvite' => 'Gas',
'Bitumens' => 'Gas',
'Coesite' => 'Gas',
];
foreach($ores as $key => $value) {
if(strtolower($key) == strtolower($ore)) {
return $value;
}
}
return false;
}
/**
* Return the type of ore a particular moon ore is.
*/
private function IsRMoonGoo($ore) {
$ores = [
'Zeolites' => 'Gas',
@@ -363,21 +467,21 @@ class MoonCalc {
];
foreach($ores as $key => $value) {
if(strtolower($key) == strtolower($ore)) {
return true;
return $value;
}
}
//Return false if the ore is not found in an array
return false;
}
private function IsRMoon($ore) {
/**
* Return true if a moon ore is a moon ore, and false
* if the ore is not a moon ore.
*/
private function IsRMoonOre($ore) {
$ores = [
'Prime Arkonor' => 'Null',
'Cubic Bistot' => 'Null',
'Pellucid Crokite' => 'Null',
'Jet Ochre' => 'Null',
'Zeolites' => 'Gas',
'Sylvite' => 'Gas',
'Bitumens' => 'Gas',
@@ -410,6 +514,9 @@ class MoonCalc {
return false;
}
/**
* Convert percentages from quantities into a normalized percentage
*/
private function ConvertPercentages(&$firstPerc, $firstQuan, &$secondPerc, $secondQuan, &$thirdPerc, $thirdQuan, &$fourthPerc, $fourthQuan) {
//Set the base percentages for the if statements
$firstPerc = 0.00;
@@ -469,16 +576,4 @@ class MoonCalc {
}
}
}
/**
* Calculate the total price, then pass it by reference to the calling function
*/
private function CalculateTotalPrice($ore, $perc, &$total) {
//Calculate the prices from the ores
if($ore != 'None') {
$total = $this->CalcPrice($ore, $perc);
} else {
$total = 0.00;
}
}
}

View File

@@ -1,30 +0,0 @@
<?php
namespace App\Models\Contracts;
use Illuminate\Database\Eloquent\Model;
class AcceptedBid extends Model
{
// Table Name
public $table = 'accepted_bids';
//Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'contract_id',
'bid_id',
'bid_amount',
'notes',
];
public function Contract() {
return $this->belongsTo(Contract::class);
}
}

View File

@@ -1,39 +0,0 @@
<?php
namespace App\Models\Contracts;
use Illuminate\Database\Eloquent\Model;
class Bid extends Model
{
// Table Name
public $table = 'contract_bids';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'contract_id',
'bid_amount',
'character_name',
'character_id',
'corporation_name',
'corporation_id',
'notes',
];
protected $guarded = [];
public function ContractId() {
return $this->hasOne('App\Models\Contracts\Contract', 'id', 'contract_id');
}
public function Contract() {
return $this->belongsTo(Contract::class);
}
}

View File

@@ -1,38 +0,0 @@
<?php
namespace App\Models\Contracts;
use Illuminate\Database\Eloquent\Model;
class Contract extends Model
{
// Table Name
public $table = 'contracts';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'title',
'type',
'end_date',
'body',
'final_cost',
'finished',
];
//One-to-Many relationship for the bids on a contract
public function Bids() {
return $this->hasMany('App\Models\Contracts\Bid', 'contract_id', 'id');
}
//One-to-One relationship for the accepted bid.
public function AcceptedBid() {
return $this->hasOne('App\Models\Contracts\AcceptedBid', 'contract_id', 'id');
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Models\Contracts;
use Illuminate\Database\Eloquent\Model;
class SupplyChainBid extends Model
{
//Table Name
public $table = 'supply_chain_bids';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'contract_id',
'bid_amount',
'entity_id',
'entity_name',
'entity_type',
'bid_type',
'bid_note',
];
//Relationships
public function ContractId() {
return $this->hasOne('App\Models\Contracts\SupplyChainContract', 'contract_id', 'contract_id');
}
public function Contract() {
return $this->belongsTo(SupplyChainContract::class);
}
//Model functions
public function getContractId() {
return $this->contract_id;
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Models\Contracts;
use Illuminate\Database\Eloquent\Model;
class SupplyChainContract extends Model
{
//Table Name
public $table = 'supply_chain_contracts';
//Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'issuer_id',
'issuer_name',
'title',
'end_date',
'delivery_by',
'body',
'state',
'final_cost',
];
//Relationship
public function Bids() {
return $this->hasMany('App\Models\Contracts\SupplyChainBid', 'contract_id', 'id');
}
}

View File

@@ -1,43 +0,0 @@
<?php
namespace App\Models\PublicContracts;
use Illuminate\Database\Eloquent\Model;
class PublicContract extends Model
{
//Table Name
protected $table = 'public_contracts';
//Timestamps
public $timestamps = false;
/**
* Items which are mass assignable
*
* @var array
*/
protected $fillable = [
'region_id',
'buyout',
'collateral',
'contract_id',
'date_expired',
'date_issued',
'days_to_complete',
'end_location_id',
'for_corporation',
'issuer_corporation_id',
'issuer_id',
'price',
'reward',
'start_location_id',
'title',
'type',
'volume',
];
public function items() {
return $this->hasMany('App\Models\PublicContracts\PublicContractItem', 'contract_id', 'contract_id');
}
}

View File

@@ -1,36 +0,0 @@
<?php
namespace App\Models\PublicContracts;
use Illuminate\Database\Eloquent\Model;
class PublicContractItem extends Model
{
//Table Name
protected $table = 'public_contract_items';
//Timestamps
public $timestamps = true;
/**
* Items which are mass assignable
*
* @var array
*/
protected $fillable = [
'contract_id',
'is_blueprint_copy',
'is_included',
'item_id',
'material_efficency',
'quantity',
'record_id',
'runs',
'time_efficiency',
'type_id',
];
public function contract() {
return $this->hasOne('App\Models\PublicContracts\PublicContract', 'contract_id', 'contract_id');
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Models\SystemRentals;
use Illuminate\Database\Eloquent\Model;
class RentalSystem extends Model
{
/**
* Table Name
*/
public $table = 'alliance_rental_systems';
/**
* Timestamps
*/
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'contact_id',
'contact_name',
'corporation_id',
'corporation_name',
'system_id',
'system_name',
'rental_cost',
'paid_until',
];
}

View File

@@ -10,8 +10,8 @@
"eveseat/eseye": "^1.1",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"khill/lavacharts": "3.1.*",
"laravel/framework": "5.8.*",
"khill/lavacharts": "^3.1.14",
"laravel/framework": "^5.8",
"laravel/horizon": "^3.1",
"laravel/socialite": "^3.1",
"laravel/tinker": "^1.0",

1472
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -27,6 +27,7 @@ class CreateFlexStructuresTable extends Migration
'Cyno Beacon',
'Jump Bridge',
'Super Construction Facilities',
'Market',
]);
$table->double('structure_cost', 20, 2);
$table->dateTime('paid_until');

View File

@@ -0,0 +1,82 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNewContractsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//Remove this group of tables
Schema::dropIfExists('eve_regions');
Schema::dropIfExists('public_contracts');
Schema::dropIfExists('public_contract_items');
Schema::dropIfExists('market_region_orders');
Schema::dropIfExists('market_groups');
Schema::dropIfExists('market_prices');
Schema::dropIfExists('contracts');
Schema::dropIfExists('contract_bids');
Schema::dropIfExists('accepted_bids');
//Add these new tables for the contracts
if(!Schema::hasTable('supply_chain_contracts')) {
Schema::create('supply_chain_contracts', function(Blueprint $table) {
$table->increments('contract_id')->unique();
$table->unsignedBigInteger('issuer_id');
$table->string('issuer_name');
$table->string('title');
$table->dateTime('end_date');
$table->dateTime('delivery_by');
$table->text('body')->nullable();
$table->enum('state', [
'open',
'closed',
'completed',
]);
$table->unsignedInteger('bids')->default(0);
$table->decimal('final_cost', 20, 2)->default(0.00);
$table->unsignedInteger('winning_bid_id')->default(0);
$table->timestamps();
});
}
if(!Schema::hasTable('supply_chain_bids')) {
Schema::create('supply_chain_bids', function(Blueprint $table) {
$table->increments('bid_id')->unique();
$table->unsignedBigInteger('contract_id');
$table->decimal('bid_amount', 20, 2)->default(0.00);
$table->unsignedBigInteger('entity_id');
$table->string('entity_name')->nullable();
$table->enum('entity_type', [
'character',
'corporation',
'alliance',
]);
$table->enum('bid_type', [
'accepted',
'pending',
'not_accepted',
]);
$table->text('bid_note');
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('supply_chain_contract');
Schema::dropIfExists('supply_chain_bids');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateEveMailTemplateTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(!Schema::hasTable('eve_mail_template')) {
Schema::create('eve_mail_template', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('subject');
$table->text('body');
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('eve_mail_template');
}
}

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveWormholeTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('alliance_wormholes');
Schema::dropIfExists('wormhole_types');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRentalRecordsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(!Schema::hasTable('alliance_rental_systems')) {
Schema::create('alliance_rental_systems', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('contact_id');
$table->string('contact_name');
$table->unsignedBigInteger('corporation_id');
$table->string('corporation_name');
$table->unsignedBigInteger('system_id');
$table->string('system_name');
$table->double('rental_cost', 20, 2);
$table->dateTime('paid_until');
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('alliance_rental_systems');
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ModifyBlackListTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(Schema::hasTable('alliance_blacklist')) {
Schema::table('alliance_blacklist', function(Blueprint $table) {
$table->enum('validity', [
'Valid',
'Invalid',
])->default('Valid');
$table->string('removed_by_id')->nullable();
$table->string('removed_by_name')->nullable();
$table->string('removed_notes')->nullable();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('alliance_blacklist', function(Blueprint $table) {
$table->dropColumn([
'validity',
'removed_by_id',
'removed_by_name',
'removed_notes',
]);
});
}
}

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,7 @@
</div>
<div class="form-group">
{{ Form::label('allowedEntityType', 'Allowed Entity Type') }}
{{ Form::select('allowedEtntityType', ['Corporation' => 'Corporation', 'Alliance' => 'Alliance'], null, ['class' => 'form-control']) }}
{{ Form::select('allowedEntityType', ['Corporation' => 'Corporation', 'Alliance' => 'Alliance'], null, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('allowedEntityName', 'Allowed Entity Name') }}

View File

@@ -21,14 +21,13 @@
<div class="card-body">
{{ Form::open(['action' => 'Dashboard\AdminController@addPermission', 'method' => 'POST']) }}
<div class="form-group">
{{ Form::hidden('user', $user->name) }}
{{ Form::hidden('user', $user->character_id) }}
{{ Form::select('permission', $permissions, 'None', ['class' => 'form-control']) }}
{{ Form::hidden('type', 'addPermission') }}
</div>
<div class="form-group col-md-2">
{{ Form::submit('Add Permission', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@@ -38,7 +37,19 @@
<h2>Modify Role</h2>
</div>
<div class="card-body">
<div class="container">
<h2>Current Role: {{ $role }}</h2>
</div>
{{ Form::open(['action' => 'Dashboard\AdminController@modifyRole', 'method' => 'POST']) }}
<div class="form-group">
{{ Form::hidden('user', $user->character_id) }}
{{ Form::select('role', $roles, 'None', ['class' => 'form-control']) }}
{{ Form::hidden('type', 'modifyRole') }}
</div>
<div class="form-group col-md-2">
{{ Form::submit('Modify Role', ['class' => 'btn btn-primary']) }}
</div>
{!! Form::close() !!}
</div>
</div>
</div>

View File

@@ -6,6 +6,10 @@
{{ Form::label('name', 'Entity Name') }}
{{ Form::text('name', '', ['class' => 'form-control', 'placeholder' => 'CCP Antiquarian']) }}
</div>
<div class="form-group">
{{ Form::label('notes', 'Notes') }}
{{ Form::textarea('notes', '', ['class' => 'form-control']) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>

View File

@@ -1,67 +0,0 @@
@extends('layouts.admin.b4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>Contract Dashboard</h2>
</div>
</div>
<br>
<div class="container">
<div class="row justify-content-center">
<a href="/contracts/admin/new" class="btn btn-primary" role="button">Create New Contract</a>
</div>
</div>
<br>
@if(count($contracts))
@foreach($contracts as $contract)
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-sm" align="left">
{{ $contract['title'] }}
</div>
<div class="col-sm" align="center">
Type: {{ $contract['type'] }}
</div>
<div class="col-sm" align="right">
<a href="/contracts/admin/delete/{{ $contract['contract_id'] }}" class="btn btn-primary" role="button">Delete Contract</a>
<br><br>
<a href="/contracts/admin/end/{{ $contract['contract_id'] }}" class="btn btn-primary" role="button">End Contract</a>
</div>
</div>
</div>
<div class="card-body">
<div class="container">
End Date: {{ $contract['end_date'] }}
</div>
<span class="border-dark">
<div class="container">
{!! $contract['body'] !!}
</div>
</span>
</div>
</div>
</div>
</div>
</div>
<br>
@endforeach
@else
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
No Contracts Issued
</div>
<div class="card-body">
</div>
</div>
</div>
</div>
</div>
@endif
@endsection

View File

@@ -1,45 +0,0 @@
@extends('layouts.admin.b4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>Create New Contract</h2>
</div>
</div>
<br>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
New Contracts
</div>
<div class="card-body">
{!! Form::open(['action' => 'Contracts\ContractAdminController@storeNewContract', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('name', 'Contract Name') }}
{{ Form::text('name', '', ['class' => 'form-control', 'placeholder' => 'Some Name']) }}
</div>
<div class="form-group">
{{ Form::label('body', 'Description') }}
{{ Form::textarea('body', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('date', 'End Date') }}
{{ Form::date('date', \Carbon\Carbon::now()->addWeek(), ['class' => 'form-control', 'placeholder' => '4/24/2019']) }}
</div>
<div class="form-group">
{{ Form::label('type', 'Public Contract') }}
{{ Form::radio('type', 'Public', true) }}
</div>
<div class="form-group">
{{ Form::label('type', 'Private Contract') }}
{{ Form::radio('type', 'Private', false) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -1,72 +0,0 @@
@foreach($contracts as $contract)
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-sm" align="left">
{{ $contract['title'] }}
</div>
<div class="col-sm" align="center">
Type: {{ $contract['type'] }}
</div>
<div class="col-sm" align="right">
<a href="/contracts/display/newbid/{{ $contract['contract_id'] }}" class="btn btn-primary" role="button">Bid on Contract</a>
</div>
</div>
</div>
<div class="card-body">
<div class="container">
End Date: {{ $contract['end_date'] }}
</div>
<span class="border-dark">
<div class="container">
{!! $contract['body'] !!}
</div>
</span>
<hr>
<!-- Count the number of bids for the current contract -->
@if($contract['bid_count'] > 0)
<span class="border-dark">
@if($contract['type'] == 'Public')
<table class="table table-striped">
<thead>
<th>Corporation / Character</th>
<th>Amount</th>
<th></th>
</thead>
<tbody>
@foreach($contract['bids'] as $bid)
<tr>
<td>{{ $bid['corporation_name'] }} : {{ $bid['character_name'] }}</td>
<td>{{ number_format($bid['bid_amount'], 2, '.', ',') }}</td>
@if(auth()->user()->character_id == $bid['character_id'])
<td>
<a href="/contracts/modify/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Modify Bid</a>
<a href="/contracts/delete/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Delete Bid</a>
</td>
@else
<td></td>
@endif
</tr>
@endforeach
</tbody>
</table>
@else
@foreach($contract['bids'] as $bid)
@if(auth()->user()->character_id == $bid['character_id'])
<a href="/contracts/modify/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Modify Bid</a>
<a href="/contracts/delete/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Delete Bid</a>
@endif
@endforeach
@endif
</span>
@endif
</div>
</div>
</div>
</div>
</div>
<br>
@endforeach

View File

@@ -1,27 +0,0 @@
<table class="table table-striped">
<thead>
<th>Corporation</th>
<th>Amount</th>
</thead>
<tbody>
@foreach($data['bids'] as $bid)
<tr>
<td>{{ $bid['corporation_name'] }}</td>
<td>{{ $bid['bid_amount'] }}</td>
@if(auth()->user()->character_id == $bid['character_id'])
{{ Form::open(['action' => 'Contracts\ContractController@displayModifyBid', 'method' => 'POST']) }}
{{ Form::hidden('id', $bid['id']) }}
{{ Form::hidden('contract_id', $bid['contract_id']) }}
{{ Form::submit('Modify Bid', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
{{ Form::open(['action' => 'Contracts\ContractController@deleteBid', 'method' => 'POST']) }}
{{ Form::hidden('id', $bid['id']) }}
{{ Form::hidden('contract_id', $bid['contract_id']) }}
{{ Form::submit('Delete Bid', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
@endif
</tr>
@endforeach
</tbody>
</table>

View File

@@ -1,13 +0,0 @@
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
No Contracts Issued
</div>
<div class="card-body">
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,51 +0,0 @@
@foreach($contracts as $contract)
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-sm" align="left">
{{ $contract['title'] }}
</div>
<div class="col-sm" align="center">
Type: Private
</div>
<div class="col-sm" align="right">
<a href="/contracts/display/newbid/{{ $contract['contract_id'] }}" class="btn btn-primary" role="button">Bid on Contract</a>
</div>
</div>
</div>
<div class="card-body">
<div class="container">
End Date: {{ $contract['end_date'] }}
</div>
<hr>
<div class="container">
<pre>
{!! $contract['body'] !!}
</pre>
</div>
<hr>
<div class="container">
@if($contract['lowestbid'] == 'No Bids Placed.')
No Bids Placed.<br>
@else
Lowest Bid: {{ number_format($contract['lowestbid'], 2, '.', ',') }}<br>
@endif
</div>
<hr>
@foreach($contract['bids'] as $bid)
@if(auth()->user()->character_id == $bid['character_id'])
Your Bid: {{ number_format($bid['bid_amount'], 2, '.', ',') }}<br>
<a href="/contracts/modify/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Modify Bid</a>
<a href="/contracts/delete/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Delete Bid</a>
@endif
@endforeach
</div>
</div>
</div>
</div>
</div>
<br>
@endforeach

View File

@@ -1,72 +0,0 @@
@foreach($contracts as $contract)
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-sm" align="left">
{{ $contract['title'] }}
</div>
<hr>
<div class="col-sm" align="center">
Type: Public
</div>
<hr>
<div class="col-sm" align="right">
<a href="/contracts/display/newbid/{{ $contract['contract_id'] }}" class="btn btn-primary" role="button">Bid on Contract</a>
</div>
</div>
</div>
<div class="card-body">
<div class="container">
End Date: {{ $contract['end_date'] }}
</div>
<hr>
<div class="container">
{!! $contract['body'] !!}
</div>
<hr>
<div class="container">
@if($contract['lowestbid'] == 'No Bids Placed.')
No Bids Placed.<br>
No Corproation has placed a bid.<br>
@else
Lowest Bid: {{ number_format($contract['lowestbid'], 2, '.', ',') }}<br>
Lowest Bid Corp: {{ $contract['lowestcorp'] }}<br>
@endif
</div>
<hr>
<!-- Count the number of bids for the current contract -->
@if($contract['bid_count'] > 0)
<table class="table table-striped">
<thead>
<th>Corporation / Character</th>
<th>Amount</th>
<th></th>
</thead>
<tbody>
@foreach($contract['bids'] as $bid)
<tr>
<td>{{ $bid['corporation_name'] }} : {{ $bid['character_name'] }}</td>
<td>{{ number_format($bid['bid_amount'], 2, '.', ',') }}</td>
@if(auth()->user()->character_id == $bid['character_id'])
<td>
<a href="/contracts/modify/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Modify Bid</a>
<a href="/contracts/delete/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Delete Bid</a>
</td>
@else
<td></td>
@endif
</tr>
@endforeach
</tbody>
</table>
@endif
</div>
</div>
</div>
</div>
</div>
<br>
@endforeach

View File

@@ -1,39 +0,0 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>Modify Bid</h2>
</div>
</div>
<br>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
{{ $contract['title'] }}
</div>
<div class="card-body">
Type: {{ $contract['type'] }}<br>
End Date: {{ $contract['end_date'] }}<br>
Description: {{ $contract['body'] }}<br>
{!! Form::open(['action' => 'Contracts\ContractController@modifyBid', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('bid', 'Bid') }}
{{ Form::text('bid', '', ['class' => 'form-control', 'placeholder' => '1.0']) }}
{{ Form::label('suffix', 'M') }}
{{ Form::radio('suffix', 'M', false) }}
{{ Form::label('suffix', 'B') }}
{{ Form::radio('suffix', 'B', false) }}
{{ Form::hidden('type', $contract['type']) }}
{{ Form::hidden('contract_id', $contract['contract_id']) }}
</div>
{{ Form::submit('Modify Bid', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -1,14 +0,0 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>Private Contracts</h2>
</div>
</div>
<br>
@if(count($contracts))
@include('contracts.includes.private')
@else
@include('contracts.includes.nocontracts')
@endif
@endsection

View File

@@ -1,14 +0,0 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>Public Contracts</h2>
</div>
</div>
<br>
@if(count($contracts))
@include('contracts.includes.public')
@else
@include('contracts.includes.nocontracts')
@endif
@endsection

View File

@@ -26,6 +26,7 @@
'Cyno Beacon' => 'Cyno Beacon',
'Jump Bridge' => 'Jump Bridge',
'Super Construction Facilities' => 'Super Construction Facilities',
'Market' => 'Market',
], 'None', ['class' => 'form-control']) }}
</div>
<div class="form-group">

View File

@@ -17,7 +17,6 @@
<th>Paid Until</th>
<th>Update</th>
<th>Remove?</th>
<th> </th>
</thead>
<tbody>
@foreach($structures as $structure)
@@ -42,13 +41,10 @@
</td>
<td>
{!! Form::open(['action' => 'Flex\FlexAdminController@removeFlexStructure', 'method' => 'POST']) !!}
{{ Form::radio('remove', 'Yes', false, ['class' => 'form-control']) }}
{{ Form::hidden('structure_type', $structure->structure_type) }}
{{ Form::hidden('requestor_id', $structure->requestor_id) }}
{{ Form::hidden('requestor_corp_id', $structure->requestor_corp_id) }}
{{ Form::hidden('system_id', $structure->system_id) }}
</td>
<td>
{{ Form::submit('Remove', ['class' => 'btn btn-danger']) }}
{!! Form::close() !!}
</td>

View File

@@ -29,9 +29,9 @@
<!-- SRP Admin -->
@include('layouts.admin.sidebarmenu.srp')
<!-- End SRP Admin -->
<!-- Contract Admin -->
@include('layouts.admin.sidebarmenu.contract')
<!-- End Contract Admin -->
<!-- System Rental Admin -->
@include('layouts.admin.sidebarmenu.rentalsystem')
<!-- End System Rental Admin -->
</ul>
</nav>
<!-- /.sidebar-menu -->

View File

@@ -21,6 +21,12 @@
<p>New Contract</p>
</a>
</li>
<li class="nav-item">
<a href="/contracts/admin/past" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Past Contracts</p>
</a>
</li>
</ul>
</li>
@endif

View File

@@ -0,0 +1,27 @@
<!-- System Rentals -->
@if(auth()->user()->hasRole('Admin'))
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>
System Rental<br>
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="/system/rental/dashboard" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Display</p>
</a>
</li>
<li class="nav-item">
<a href="/system/rental/add" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Add</p>
</a>
</li>
</u>
</li>
@endif
<!-- End System Rentals -->

View File

@@ -205,7 +205,7 @@
</a>
</li>
@endif
@if(auth()->user()->isMoonRenter())
@if(auth()->user()->isMoonRenter() || auth()->user()->hasPermission('rentalmoon.viewer'))
<li class="nav-item">
<a href="/moons/ledger/display/rentals" class="nav-link">
<i class="far fa-circle nav-icon"></i>
@@ -319,7 +319,7 @@
<p>Search</p>
</a>
</li>
@if(auth()->user()->hasPermission('alliance.recruiter'))
@if(auth()->user()->hasPermission('blacklist.admin'))
<li class="nav-item">
<a href="/blacklist/display/add" class="nav-link">
<i class="far fa-circle nav-icon"></i>

View File

@@ -1,5 +1,7 @@
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Included Messages -->
@include('inc.messages')
<!-- Main content -->
<div class="content">
@yield('content')

View File

@@ -21,7 +21,7 @@
@if(auth()->user()->hasRole('User') || auth()->user()->hasRole('Admin'))
@include('layouts.user.sidebarmenu.general')
@endif
<!-- End General Items -->
<!-- End General Items -->
<!-- Moon Items -->
@include('layouts.user.sidebarmenu.moon')
<!-- End Moon Items -->

View File

@@ -18,7 +18,7 @@
<p>Search</p>
</a>
</li>
@if(auth()->user()->hasPermission('alliance.recruiter'))
@if(auth()->user()->hasPermission('blacklist.admin'))
<li class="nav-item">
<a href="/blacklist/display/add" class="nav-link">
<i class="far fa-circle nav-icon"></i>

View File

@@ -2,27 +2,27 @@
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-file-contract"></i>
<p>Contracts<br>
<p>Supply Chain<br>
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="/contracts/display/all" class="nav-link">
<a href="/supplychain/dashboard" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Display All Contracts</p>
<p>Dashboard</p>
</a>
</li>
<li class="nav-item">
<a href="/contracts/display/public" class="nav-link">
<a href="/supplychain/my/dashboard" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Display Public Contracts</p>
<p>My Dashboard</p>
</a>
</li>
<li class="nav-item">
<a href="/contracts/display/private" class="nav-link">
<a href="/supplychain/display/bids" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Display Private Contracts</p>
<p>Display Bids</p>
</a>
</li>
</ul>

View File

@@ -30,17 +30,5 @@
<p>Buyback Program</p>
</a>
</li>
<li class="nav-item">
<a href="/wormholes/display" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Wormholes</p>
</a>
</li>
<li class="nav-item">
<a href="/wormholes/form" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Wormhole Form</p>
</a>
</li>
</ul>
</li>

View File

@@ -20,6 +20,12 @@
<p>Display Rental Moons</p>
</a>
</li>
<li class="nav-item">
<a href="/moons/display/rental/request" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Request Rental Moon</p>
</a>
</li>
<li class="nav-item">
<a href="/moons/display/form/worth" class="nav-link">
<i class="far fa-circle nav-icon"></i>
@@ -42,7 +48,7 @@
</a>
</li>
@endif
@if(auth()->user()->isMoonRenter())
@if(auth()->user()->isMoonRenter() || auth()->user()->hasPermission('rentalmoon.viewer') || auth()->user()->hasRole('Admin'))
<li class="nav-item">
<a href="/moons/ledger/display/rentals" class="nav-link">
<i class="far fa-circle nav-icon"></i>

View File

@@ -52,7 +52,7 @@
<div class="card-body">
<table class="table table-striped">
<tbody>
<tr class="table-success">
<tr class="table-primary">
<td>Moon Available</td>
</tr>
<tr class="table-danger">

View File

@@ -0,0 +1,23 @@
@extends('layous.admin.b4')
@section('content')
<div class="container">
<div class="card">
<div class="card-header">
<h2>Set Rental Moons for Alliance</h2>
</div>
<div class="card-body">
{!! Form::open(['action' => 'Moons\MoonsAdminController@storeRentalMoonForAlliance', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('moon', 'Moon') }}
{{ Form::select('moon', $moons, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('until', 'End Date') }}
{{ Form::date('until', \Carbon\Carbon::now()->endOfMonth(), ['class' => 'form-control']) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
@endsection

View File

@@ -21,6 +21,7 @@
'B-S347' => 'B-S347',
'B9E-H6' => 'B9E-H6',
'CJNF-J' => 'CJNF-J',
'DY-P7Q' => 'DY-P7Q',
'E8-YS9' => 'E8-YS9',
'EA-HSA' => 'EA-HSA',
'FYI-49' => 'FYI-49',

View File

@@ -0,0 +1,13 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="card">
<div class="card-header">
<h2>Request Rental Moon</h2>
</div>
<div class="card-body">
Send an in game mail to Rock Onzo about requesting a rental moon.
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,35 @@
@extends('layouts.admin.b4')
@section('content')
<div class="container">
<div class="card">
<div class="card-header">
<h2>New Rental Contract</h2>
</div>
<div class="card-body">
{!! Form::open(['action' => 'SystemRentals\RentalAdminController@addRentalSystem', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('contact_name', 'Contact Name') }}
{{ Form::text('contact_name', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('contact_corp_name', 'Corporation Name') }}
{{ Form::text('contact_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('rental_cost', 'Rental Cost') }}
{{ Form::text('rental_cost', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('paid_until', 'Paid Until') }}
{{ Form::date('paid_until', \Carbon\Carbon::now()->addMonth(), ['class' => 'form-control']) }}
</div>
{{ Form::submit('Add Rental', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,56 @@
@extends('layouts.admin.b4')
@section('content')
<br>
<div class="container">
<div class="card">
<div class="card-header">
<h2>Rental Systems</h2>
</div>
<div class="card-body">
<table class="table table-bordered table-striped">
<thead>
<th>Contact</th>
<th>Corporation</th>
<th>System</th>
<th>Cost</th>
<th>Paid Until</th>
<th>Update</th>
<th>Remove?</th>
<th> </th>
</thead>
<tbody>
@foreach($rentals as $rental)
<tr>
<td>{{ $rental->contact_name }}</td>
<td>{{ $rental->corporation_name }}</td>
<td>{{ $rental->system_name }}</td>
<td>{{ $rental->rental_cost }}</td>
<td>{{ $rental->paid_until }}</td>
<td>
{!! Form::open(['action' => 'SystemRentals\RentalAdminController@updateRentalSystem', 'method' => 'POST']) !!}
{{ Form::date('paid_until', \Carbon\Carbon::now()->endOfMonth(), ['class' => 'form-control']) }}
{{ Form::hidden('contact_id', $rental->contact_id) }}
{{ Form::hidden('corporation_id', $rental->corporation_id) }}
{{ Form::hidden('system_id', $rental->system_id) }}
{{ Form::submit('Update', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</td>
<td>
{!! Form::open(['action' => 'SystemRentals\RentalAdminController@removeRentalSystem', 'method' => 'POST']) !!}
{{ Form::radio('remove', 'Yes', false, ['class' => 'form-control']) }}
{{ Form::hidden('contact_id', $rental->contact_id) }}
{{ Form::hidden('corporation_id', $rental->corporation_id) }}
{{ Form::hidden('system_id', $rental->system_id) }}
</td>
<td>
{{ Form::submit('Remove', ['class' => 'btn btn-danger']) }}
{!! Form::close() !!}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection

View File

@@ -18,11 +18,11 @@
</div>
<div class="form-group">
{{ Form::label('structure_size', 'Structure Size') }}
{{ Form::select('structure_size', ['M', 'L', 'XL'], null, ['class' => 'form-control']) }}
{{ Form::select('structure_size', ['M' => 'M', 'L' => 'L', 'XL' => 'XL'], null, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('structure_type', 'Structure Type') }}
{{ Form::select('structure_type', ['Flex', 'Citadel', 'Refinery', 'Engineering'], null, ['class' => 'form-control']) }}
{{ Form::select('structure_type', ['Citadel' => 'Citadel', 'Refinery' => 'Refinery', 'Engineering' => 'Engineering', 'Flex' => 'Flex'], null, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('requested_drop_time', 'Requested Drop Time') }}

View File

@@ -0,0 +1,43 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>Personal Bids on Contracts</h2>
</div>
</div>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
@if($bidsCount > 0)
@foreach($bids as $bid)
<div class="card">
<div class="card-header">
<div class="col-md" align="left">
Contract Id: {{ $bid['contract_id'] }}<br>
Contract Title: {{ $bid['title'] }}<br>
Issuer: {{ $bid['issuer_name'] }}<br>
</div>
<div class="col-md" align="right">
<a href="/supplychain/delete/bid/{{ $bid['contract_id'] }}/{{ $bid['bid_id'] }} "><button type="button" class="btn btn-danger">Delete Bid</button></a>
</div>
</div>
<div class="card-body">
Bid Id: {{ $bid['bid_id'] }}<br>
Bid Amount: {{ $bid['bid_amount'] }}<br>
</div>
</div>
@endforeach
@else
<div class="card">
<div class="card-header">
<h2>No Bids on Open Contracts</h2>
</div>
<div class="card-body">
<h3> </h3>
</div>
</div>
@endif
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,56 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>Supply Chain Contracts</h2>
</div>
<br>
<div class="row justify-content-center">
<div class="btn toolbar" role="toolbar" aria-label="Toolbar">
<div class="btn-group mr-2" role="group" aria-label="Create">
<a class="btn btn-primary" href="/supplychain/contracts/new" role="button">Create Contract</a>
</div>
<div class="btn-group mr-2" role="group" aria-label="Delete">
<a class="btn btn-danger" href="/supplychain/contracts/delete" role="button">Delete Contract</a>
</div>
</div>
</div>
</div>
<br>
@if(count($openContracts))
@include('supplychain.includes.opencontracts')
@else
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h2>No Open Supply Chain Contracts</h2>
</div>
<div class="card-body">
</div>
</div>
</div>
</div>
</div>
@endif
@if(count($closedContracts))
@include('supplychain.includes.closedcontracts')
@else
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h2>No Closed Supply Chain Contracts</h2>
</div>
<div class="card-body">
</div>
</div>
</div>
</div>
</div>
@endif
@endsection

View File

@@ -2,13 +2,13 @@
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>All Contracts</h2>
<h2>Past Supply Chain Contracts</h2>
</div>
</div>
<br>
@if(count($contracts))
@include('contracts.includes.all')
@include('supplychain.includes.contracts')
@else
@include('contracts.includes.nocontracts')
@include('supplychain.includes.nocontracts')
@endif
@endsection

View File

@@ -0,0 +1,35 @@
@extends('layouts.user.dashb4')
@section('content')
<!-- Delete a contract the user has created -->
<div class="container">
<div class="row justify-content-center">
@if(count($contracts) > 0)
@foreach($contracts as $contract)
<div class="card">
<div class="card-header">
<h2>{{ $contract['title'] }}</h2>
</div>
<div class="card-body">
{!! $contract['body'] !!}<br>
{!! Form::open(['action' => 'Contracts\SupplyChainController@deleteSupplyChainContract', 'method' => 'POST']) !!}
{{ Form::hidden('contractId', $contract['contract_id']) }}
{{ Form::submit('Delete', ['class' => 'btn btn-danger']) }}
{!! Form::close() !!}
</div>
</div>
@endforeach
@else
<div class="card">
<div class="card-header">
<h2>User currently has no supply chain contracts open.</h2>
</div>
<div class="card-body">
<div class="container">
</div>
</div>
</div>
@endif
</div>
</div>
@endsection

View File

@@ -0,0 +1,4 @@
@extends('layouts.user.dashb4')
@section('content')
@endsection

View File

@@ -1,56 +1,54 @@
@extends('layouts.admin.b4')
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<h2>Contract End</h2>
<h2>Supply Chain Contract Completion</h2>
</div>
<br>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="col-md-10">
<div class="card">
<!-- Card Header display Contract Information -->
<div class="card-header">
<table class="table table-striped">
<table class="table table-striped table-bordered">
<!-- Card Header display the supply chain contract information -->
<thead>
<th>Contract Id</th>
<th>Contract Type</th>
<th>Supply Chain Contract Id</th>
<th>Title</th>
<th>End Date</th>
<th>Delivery Date</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>{{ $contract['contract_id'] }}</td>
<td>{{ $contract['type'] }}</td>
<td>{{ $contract['title'] }}</td>
<td>{{ $contract['end_date'] }}</td>
<td>{{ $contract['delivery_by'] }}</td>
<td>{{ $contract['body'] }}</td>
</tr>
</tbody>
</table>
</div>
<!-- Card Body displays all of the bids and allows for selection of which bid to accept -->
<!-- Card Body display all of the bids and allows for selection of the bid for the supply chain contract -->
<div class="card-body">
<table class="table table-striped">
<table class="table table-striped table-bordered">
<thead>
<th>Bid Amount</th>
<th>Character Name</th>
<th>Corporation Name</th>
<th>Entity</th>
<th>Notes</th>
<th>Accept?</th>
</thead>
<tbody>
{!! Form::open(['action' => 'Contracts\ContractAdminController@storeEndContract', 'method' => 'POST']) !!}
{!! Form::open(['action' => 'Contracts\SupplyChainController@storeEndSupplyChainContract']) !!}
{{ Form::hidden('contract_id', $contract['contract_id']) }}
@foreach($bids as $bid)
@foreach($bids as $bid)
<tr>
<td>{{ $bid['bid_amount'] }}</td>
<td>{{ $bid['character_name'] }}</td>
<td>{{ $bid['corporation_name'] }}</td>
<td>{{ $bid['amount'] }}</td>
<td>{{ $bid['name'] }}</td>
<td><pre>{{ $bid['notes'] }}</pre></td>
<td>{{ Form::radio('accept', $bid['id'], false, ['class' => 'form-control']) }}</td>
<td>{{ Form::radio('accept', $bid['id'], false, ['class' => 'form-control']) }}
</tr>
@endforeach
@endforeach
</tbody>
</table>
{{ Form::submit('End Contract', ['class' => 'btn btn-primary']) }}
@@ -60,4 +58,5 @@
</div>
</div>
</div>
@endforeach
@endsection

View File

@@ -4,7 +4,7 @@
<div class="row justify-content-center">
<h2>Bid on Contract</h2>
</div>
</div>
</div>
<br>
<div class="container">
<div class="row justify-content-center">
@@ -14,15 +14,11 @@
Enter Bid
</div>
<div class="card-body">
{!! Form::open(['action' => 'Contracts\ContractController@storeBid', 'method' => 'POST']) !!}
{!! Form::open(['action' => 'Contracts\SupplyChainController@storeSupplyChainContractBid', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('bid', 'Bid') }}
{{ Form::text('bid', '', ['class' => 'form-control', 'placeholder' => '1.0']) }}
{{ Form::text('bid', '', ['class' => 'form-control', 'placeholder' => '0.00']) }}
{{ Form::hidden('contract_id', $contractId) }}
{{ Form::label('suffix', 'M') }}
{{ Form::radio('suffix', 'M', false) }}
{{ Form::label('suffix', 'B') }}
{{ Form::radio('suffix', 'B', false) }}
</div>
<div class="form-group">
{{ Form::label('notes', 'Notes') }}
@@ -35,5 +31,4 @@
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,25 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
Modify Bid
</div>
<div class="card-body">
{!! Form::open(['action' => 'Contracts\SupplyChainController@storeModifyBid', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::hidden('bid_id', $bidId) }}
{{ Form::hidden('contract_id', $contractId) }}
{{ Form::label('bid_amount', 'Bid Amount') }}
{{ Form::text('bid_amount', '', ['class' => 'form-control']) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,41 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<h2>Create New Supply Chain Contract</h2>
</div>
</div>
<br>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
Enter New Supply Chain Contract Information
</div>
<div class="card-body">
{!! Form::open(['action' => 'Contracts\SupplyChainController@storeNewSupplyChainContract', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('name', 'Contract Name') }}
{{ Form::text('name', '', ['class' => 'form-control', 'placeholder' => 'Supply Chain Contract Name']) }}
</div>
<div class="form-group">
{{ Form::label('body', 'Contract Items') }}
{{ Form::textarea('body', '', ['class' => 'form-control', 'placeholder' => 'Enter description.']) }}
</div>
<div class="form-group">
{{ Form::label('date', 'End Date') }}
{{ Form::date('date', \Carbon\Carbon::now()->addWeek(), ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('delivery', 'Delivery Date') }}
{{ Form::date('delivery', \Carbon\Carbon::now()->addWeeks(2), ['class' => 'form-control']) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,44 @@
@foreach($closedContracts as $contract)
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-sm" align="left">
{{ $contract['title'] }}
</div>
<div class="col-sm" align="right">
{!! Form::open(['action' => 'Contracts\SupplyChainController@displaySupplyChainContractBid', 'method' => 'POST']) !!}
{{ Form::hidden('contract_id', $contract['contract_id'], ['class' => 'form-control']) }}
{{ Form::submit('Bid', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
<div class="card-body">
<div class="container">
Delivery Date: {{ $contract['delivery_by'] }}<br>
End Date: {{ $contract['end_date'] }}<br>
</div>
<span class="border-dark">
<div class="container">
{!! $contract['body'] !!}
</div>
</span>
<hr>
<!-- If there is more than one bid display the lowest bid, and the number of bids -->
@if($contract['bid_count'] > 0)
<span class="border-dark">
<table class="table table-striped">
{{ $contract['lowest_bid']['name'] }}<br>
{{ $contract['lowest_bid']['amount'] }}<br>
</table>
</span>
@endif
</div>
</div>
</div>
</div>
</div>
@endforeach

View File

@@ -0,0 +1,41 @@
@foreach($openContracts as $contract)
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-sm" align="left">
{{ $contract['title'] }}
</div>
<div class="col-sm" align="right">
<a href="/supplychain/display/newbid/{{ $contract['contract_id'] }}"><button type="button" class="btn btn-primary">Bid</button></a>
</div>
</div>
</div>
<div class="card-body">
<div class="container">
Delivery Date: {{ $contract['delivery_by'] }}<br>
End Date: {{ $contract['end_date'] }}<br>
</div>
<span class="border-dark">
<div class="container">
{!! $contract['body'] !!}
</div>
</span>
<hr>
<!-- If there is more than one bid display the lowest bid, and the number of bids -->
@if($contract['bid_count'] > 0)
<span class="border-dark">
<table class="table table-striped">
{{ $contract['lowest_bid']['name'] }}<br>
{{ $contract['lowest_bid']['amount'] }}<br>
</table>
</span>
@endif
</div>
</div>
</div>
</div>
</div>
@endforeach

View File

@@ -1,41 +0,0 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<table class="table table-striped table-bordered">
<thead>
<th>System</th>
<th>Sig ID</th>
<th>Duration Left</th>
<th>Scan Time</th>
<th>WH Class</th>
<th>Hole Size</th>
<th>Stability</th>
<th>Mass Allowed</th>
<th>Individual Mass</th>
<th>Regeneration</th>
<th>Max Stable Time</th>
<th>Details</th>
<th>Link</th>
</thead>
<tbody>
@foreach($wormholes as $wormhole)
<tr>
<td>{{ $wormhole->system }}</td>
<td>{{ $wormhole->sig_id }}</td>
<td>{{ $wormhole->duration_left }}</td>
<td>{{ $wormhole->dateTime }}</td>
<td>{{ $wormhole->class }}</td>
<td>{{ $wormhole->hole_size }}</td>
<td>{{ $wormhole->stability }}</td>
<td>{{ $wormhole->mass_allowed }}</td>
<td>{{ $wormhole->individual_mass }}</td>
<td>{{ $wormhole->regeneration }}</td>
<td>{{ $wormhole->max_stable_time }}</td>
<td>{{ $wormhole->details }}</td>
<td>{{ $wormhole->link }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection

View File

@@ -1,53 +0,0 @@
@extends('layouts.user.dashb4')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="card">
<div class="card-header">
<h2>Enter Wormhole Info</h2>
</div>
<div class="card-body">
{!! Form::open(['action' => 'Wormholes\WormholeController@storeWormhole', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('system', 'System') }}
{{ Form::text('system', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sig', 'Sig ID') }}
{{ Form::text('sig', '', ['class' => 'form-control', 'placeholder' => 'XXX-XXX']) }}
</div>
<div class="form-group">
{{ Form::label('duration', 'Duration Left') }}
{{ Form::select('duration', $duration, null, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('dateTime', 'Date Scanned') }}
{{ Form::date('dateTime', \Carbon\Carbon::now(), ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('class', 'WH Class') }}
{{ Form::select('class', $class, null, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('size', 'WH Size') }}
{{ Form::select('size', $size, null, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('stability', 'Stability') }}
{{ Form::select('stability', $stability, null, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('points', 'Points of Interest') }}
{{ Form::textarea('points', null, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('link', 'WH Link') }}
{{ Form::text('link', null, ['class' => 'form-control']) }}
</div>
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
@endsection

View File

@@ -37,9 +37,9 @@ Route::group(['middleware' => ['auth']], function(){
Route::post('/admin/add/role', 'Dashboard\AdminController@addRole');
Route::post('/admin/remove/role', 'Dashboard\AdminController@removeRole');
Route::post('/admin/add/permission', 'Dashboard\AdminController@addPermission');
Route::post('/admin/modify/role', 'Dashboard\AdminController@modifyRole');
Route::post('/admin/remove/user', 'Dashboard\AdminController@removeUser');
Route::post('/admin/modify/user/display', 'Dashboard\AdminController@displayModifyUser');
Route::post('/admin/modify/user', 'Dashboard\AdminController@modifyUser');
Route::post('/admin/add/allowedlogin', 'Dashboard\AdminController@addAllowedLogin');
Route::post('/admin/rmoeve/allowedlogin', 'Dashboard\AdminController@removeAllowedLogin');
Route::get('/admin/dashboard/journal', 'Dashboard\AdminController@showJournalEntries');
@@ -64,19 +64,6 @@ Route::group(['middleware' => ['auth']], function(){
Route::post('/blacklist/remove', 'Blacklist\BlacklistController@RemoveFromBlacklist');
Route::post('/blacklist/search', 'Blacklist\BlacklistController@SearchInBlacklist');
/**
* Contract Controller display pages
*/
Route::get('/contracts/display/all', 'Contracts\ContractController@displayContracts');
Route::get('/contracts/display/public', 'Contracts\ContractController@displayPublicContracts');
Route::get('/contracts/display/private', 'Contracts\ContractController@displayPrivateContracts');
Route::get('/contracts/display/newbid/{id}', 'Contracts\ContractController@displayNewBid');
Route::get('/contracts/modify/bid/{id}', 'Contracts\ContractController@displayModifyBid');
Route::get('/contracts/display/bids/{id}', 'Contracts\ContractController@displayBids');
Route::get('/contracts/delete/bid/{id}', 'Contracts\ContractController@deleteBid');
Route::post('/contracts/modify/bid', 'Contracts\ContractController@modifyBid');
Route::post('/contracts/bids/store', 'Contracts\ContractController@storeBid');
/**
* Contract Admin Controller display pages
*/
@@ -119,6 +106,7 @@ Route::group(['middleware' => ['auth']], function(){
Route::get('/moons/display/all', 'Moons\MoonsController@displayMoons');
Route::get('/moons/display/request', 'Moons\MoonsController@displayRequestAllianceMoon');
Route::post('/moon/display/request', 'Moons\MoonsController@storeRequestAllianceMoon');
Route::get('/moons/display/rental/request', 'Moons\MoonsController@displayRentalMoonPage');
/**
* Moon Admin Controller display pages
@@ -137,6 +125,15 @@ Route::group(['middleware' => ['auth']], function(){
Route::get('/moons/ledger/display/rentals', 'Moons\MoonLedgerController@displayRentalMoonLedger');
Route::get('/moons/ledger/register', 'Moons\MoonLedgerController@registerStructures');
/**
* Moon Rental Controller display pages
*/
Route::get('/rentals/moons/alliance/display', 'Moons\RentalMoonsAdminController@displayAllianceUsageRentalMoons');
Route::get('/rentals/moons/alliance/request', 'Moons\RentalMoonsAdminController@displayRentalMoonForAllianceForm');
Route::post('/rentals/moons/alliance/request', 'Moons\RentalMoonsAdminController@storeREntalMoonForAlliance');
Route::get('/moons/composition/display', 'Moons\RentalMoonsAdminController@displayItemCompositionForm');
Route::post('/moons/composition/display', 'Moons\RentalMoonsAdminController@displayItemCompositionResults');
/**
* Scopes Controller display pages
*/
@@ -176,6 +173,33 @@ Route::group(['middleware' => ['auth']], function(){
Route::get('/structures/display/requests', 'Logistics\StructureRequestAdminController@displayRequests');
Route::post('/structures/display/requests/delete', 'Logistics\StructureRequestAdminController@deleteRequest');
/**
* Supply Chain Contracts Controller display pages
*/
Route::get('/supplychain/dashboard', 'Contracts\SupplyChainController@displaySupplyChainDashboard');
Route::get('/supplychain/my/dashboard', 'Contracts\SupplyChainController@displayMySupplyChainDashboard');
Route::get('/supplychain/contracts/new', 'Contracts\SupplyChainController@displayNewSupplyChainContract');
Route::post('/supplychain/contracts/new', 'Contracts\SupplyChainController@storeNewSupplyChainContract');
Route::get('/supplychain/contracts/delete', 'Contracts\SupplyChainController@displayDeleteSupplyChainContract');
Route::post('/supplychain/contracts/delete', 'Contracts\SupplyChainController@deleteSupplyChainContract');
Route::get('/supplychain/contracts/end', 'Contracts\SupplyChainController@displayEndSupplyChainContract');
Route::post('/supplychain/contracts/end', 'Contracts\SupplyChainController@storeEndSupplyChainContract');
Route::get('/supplychain/display/bids', 'Contracts\SupplyChainController@displaySupplyChainBids');
Route::get('/supplychain/display/newbid/{contract}', 'Contracts\SupplyChainController@displaySupplyChainContractBid');
Route::post('/supplychain/display/newbid', 'Contracts\SupplyChainController@storeSupplyChainContractBid');
Route::get('/supplychain/delete/bid/{contractId}/{bidId}', 'Contracts\SupplyChainController@deleteSupplyChainContractBid');
Route::get('/supplychain/modify/bid', 'Contracts\SupplyChainController@displayModifySupplyChainContractBid');
Route::post('/supplychain/modify/bid', 'Contracts\SupplyChainController@modifySupplyChainContractBid');
/**
* System Rentals Controller display pages
*/
Route::get('/system/rental/dashboard', 'SystemRentals\RentalAdminController@displayRentalSystems');
Route::get('/system/rental/add', 'SystemRentals\RentalAdminController@displayAddRentalSystem');
Route::post('/system/rental/add', 'SystemRentals\RentalAdminController@addRentalSystem');
Route::post('/system/rental/update', 'SystemRentals\RentalAdminController@updateRentalSystem');
Route::post('/system/rental/remove', 'SystemRentals\RentalAdminController@removeRentalSystem');
/**
* Test Controller display pages
*/

View File

@@ -1 +0,0 @@
vendor/

View File

@@ -24,8 +24,8 @@ Suppose you need to pass a callback to a JSON object.
];
?>
<scrtip>
let bar = <?php echo $json_encode($array); ?>
<script>
let bar = <?php echo json_encode($array); ?>;
bar.callback('hello'); //error
</script>
```
@@ -52,8 +52,8 @@ To get around this problem, use `Raw` objects provided by this package:
];
?>
<scrtip>
let bar = <?php echo Encoder::encode($array); ?>
<script>
let bar = <?php echo Encoder::encode($array); ?>;
bar.callback('hello'); //prints hello
</script>
```
@@ -100,3 +100,7 @@ Result:
## License
This package is licensed under GPLv3.
## Download statistics
[![statistics](https://packagist-statistics.dura.hu/balping/json-raw-encoder/10days.svg)](https://packagist-statistics.dura.hu/balping/json-raw-encoder/10days.svg)

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>

Some files were not shown because too many files have changed in this diff Show More