bunch of updates
This commit is contained in:
@@ -68,6 +68,7 @@ class CorpJournal extends Command
|
|||||||
foreach($structures as $structure) {
|
foreach($structures as $structure) {
|
||||||
foreach($finishedCorps as $finished) {
|
foreach($finishedCorps as $finished) {
|
||||||
if($finished == $structure->corporation_id) {
|
if($finished == $structure->corporation_id) {
|
||||||
|
$this->line('Finished Journal for ' . $structure->corporation_name . '\n');
|
||||||
$corpCompleted = true;
|
$corpCompleted = true;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@@ -79,6 +80,7 @@ class CorpJournal extends Command
|
|||||||
}
|
}
|
||||||
//If we didn't find the corporation was already done, then complete it.
|
//If we didn't find the corporation was already done, then complete it.
|
||||||
if($corpCompleted === false) {
|
if($corpCompleted === false) {
|
||||||
|
$this->line('Getting Journal for ' . $structure->corporation_name . '\n');
|
||||||
$this->GetJournal($structure->character_id);
|
$this->GetJournal($structure->character_id);
|
||||||
$finishedCorps[sizeof($finishedCorps)] = $structure->corporation_id;
|
$finishedCorps[sizeof($finishedCorps)] = $structure->corporation_id;
|
||||||
//After the corporation has been done set the variable back to false
|
//After the corporation has been done set the variable back to false
|
||||||
|
|||||||
10
app/Http/Controllers/JumpBridgeController.php
Normal file
10
app/Http/Controllers/JumpBridgeController.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class JumpBridgeController extends Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
154
app/Http/Controllers/MoonsAdminController.php
Normal file
154
app/Http/Controllers/MoonsAdminController.php
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use Auth;
|
||||||
|
use DB;
|
||||||
|
|
||||||
|
use App\Models\Moon\Moon;
|
||||||
|
|
||||||
|
use Seat\Eseye\Cache\NullCache;
|
||||||
|
use Seat\Eseye\Configuration;
|
||||||
|
use Seat\Eseye\Containers\EsiAuthentication;
|
||||||
|
use Seat\Eseye\Eseye;
|
||||||
|
|
||||||
|
use App\Library\MoonCalc;
|
||||||
|
|
||||||
|
class MoonsAdminController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct() {
|
||||||
|
$this->middleware('auth');
|
||||||
|
$this->middleware('role:Admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateMoon() {
|
||||||
|
return view('moons.updatemoon');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function storeUpdateMoon(Request $request) {
|
||||||
|
$this->validate($request, [
|
||||||
|
'system' => 'required',
|
||||||
|
'planet' => 'required',
|
||||||
|
'moon' => 'required',
|
||||||
|
'renter' => 'required',
|
||||||
|
'date' => 'required'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$date = strtotime($request->date . '00:00:01');
|
||||||
|
//Update the database entry
|
||||||
|
DB::table('Moons')
|
||||||
|
->where([
|
||||||
|
['System', '=', $request->system],
|
||||||
|
['Planet', '=', $request->planet],
|
||||||
|
['Moon', '=', $request->moon]
|
||||||
|
])
|
||||||
|
->update([
|
||||||
|
'RentalCorp' => $request->renter,
|
||||||
|
'RentalEnd' => $date,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return redirect('/moons/display')->with('success', 'Moon Updated');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addMoon() {
|
||||||
|
return view('moons.addmoon');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new moon into the database
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Reponse
|
||||||
|
*/
|
||||||
|
public function storeMoon(Request $request) {
|
||||||
|
$this->validate($request, [
|
||||||
|
'region' => 'required',
|
||||||
|
'system' => 'required',
|
||||||
|
'structure' => 'required',
|
||||||
|
]);
|
||||||
|
|
||||||
|
if($request->input('firstquan') < 1.00) {
|
||||||
|
$firstQuan = $request->input('firstquan') * 100.00;
|
||||||
|
} else {
|
||||||
|
$firstQuan = $request->input('firstquan');
|
||||||
|
}
|
||||||
|
|
||||||
|
if($request->input('secondquan') < 1.00) {
|
||||||
|
$firstQuan = $request->input('secondquan') * 100.00;
|
||||||
|
} else {
|
||||||
|
$firstQuan = $request->input('secondquan');
|
||||||
|
}
|
||||||
|
|
||||||
|
if($request->input('thirdquan') < 1.00) {
|
||||||
|
$firstQuan = $request->input('thirdquan') * 100.00;
|
||||||
|
} else {
|
||||||
|
$firstQuan = $request->input('thirdquan');
|
||||||
|
}
|
||||||
|
|
||||||
|
if($request->input('fourthquan') < 1.00) {
|
||||||
|
$firstQuan = $request->input('fourthquan') * 100.00;
|
||||||
|
} else {
|
||||||
|
$firstQuan = $request->input('fourthquan');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add new moon
|
||||||
|
$moon = new Moon;
|
||||||
|
$moon->Region = $request->input('region');
|
||||||
|
$moon->System = $request->input('system');
|
||||||
|
$moon->Planet = $request->input('planet');
|
||||||
|
$moon->Moon = $request->input('moon');
|
||||||
|
$moon->StructureName = $request->input('structure');
|
||||||
|
$moon->FirstOre = $request->input('firstore');
|
||||||
|
$moon->FirstQuantity = $request->input('firstquan');
|
||||||
|
$moon->SecondOre = $request->input('secondore');
|
||||||
|
$moon->SecondQuantity = $request->input('secondquan');
|
||||||
|
$moon->ThirdOre = $request->input('thirdore');
|
||||||
|
$moon->ThirdQuantity = $request->input('thirdquan');
|
||||||
|
$moon->FourthOre = $request->input('fourthore');
|
||||||
|
$moon->FourthQuantity = $request->input('fourthquan');
|
||||||
|
$moon->save();
|
||||||
|
|
||||||
|
return redirect('/dashboard')->with('success', 'Moon Added');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to display the moons to admins
|
||||||
|
*/
|
||||||
|
public function displayMoonsAdmin() {
|
||||||
|
//Setup calls to the MoonCalc class
|
||||||
|
$moonCalc = new MoonCalc();
|
||||||
|
//Update the prices for the moon
|
||||||
|
$moonCalc->FetchNewPrices();
|
||||||
|
//get all of the moons from the database
|
||||||
|
$moons = DB::table('Moons')->orderBy('System', 'asc')->get();
|
||||||
|
//declare the html variable and set it to null
|
||||||
|
$html = '';
|
||||||
|
foreach($moons as $moon) {
|
||||||
|
//Setup formats as needed
|
||||||
|
$spm = $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon;
|
||||||
|
$rentalEnd = date('m/d/Y', $moon->RentalEnd);
|
||||||
|
$price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
||||||
|
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
||||||
|
//Add the data to the html string to be passed to the view
|
||||||
|
$html .= '<tr>';
|
||||||
|
$html .= '<td>' . $spm . '</td>';
|
||||||
|
$html .= '<td>' . $moon->StructureName . '</td>';
|
||||||
|
$html .= '<td>' . $moon->FirstOre . '</td>';
|
||||||
|
$html .= '<td>' . $moon->FirstQuantity . '</td>';
|
||||||
|
$html .= '<td>' . $moon->SecondOre . '</td>';
|
||||||
|
$html .= '<td>' . $moon->SecondQuantity . '</td>';
|
||||||
|
$html .= '<td>' . $moon->ThirdOre . '</td>';
|
||||||
|
$html .= '<td>' . $moon->ThirdQuantity . '</td>';
|
||||||
|
$html .= '<td>' . $moon->FourthOre . '</td>';
|
||||||
|
$html .= '<td>' . $moon->FourthQuantity . '</td>';
|
||||||
|
$html .= '<td>' . $price['alliance'] . '</td>';
|
||||||
|
$html .= '<td>' . $price['outofalliance'] . '</td>';
|
||||||
|
$html .= '<td>' . $moon->RentalCorp . '</td>';
|
||||||
|
$html .= '<td>' . $rentalEnd . '</td>';
|
||||||
|
$html .= '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('moons.adminmoon')->with('html', $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,46 +22,6 @@ class MoonsController extends Controller
|
|||||||
$this->middleware('role:User');
|
$this->middleware('role:User');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to display the moons to admins
|
|
||||||
*/
|
|
||||||
public function displayMoonsAdmin() {
|
|
||||||
//Setup calls to the MoonCalc class
|
|
||||||
$moonCalc = new MoonCalc();
|
|
||||||
//Update the prices for the moon
|
|
||||||
$moonCalc->FetchNewPrices();
|
|
||||||
//get all of the moons from the database
|
|
||||||
$moons = DB::table('Moons')->orderBy('System', 'asc')->get();
|
|
||||||
//declare the html variable and set it to null
|
|
||||||
$html = '';
|
|
||||||
foreach($moons as $moon) {
|
|
||||||
//Setup formats as needed
|
|
||||||
$spm = $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon;
|
|
||||||
$rentalEnd = date('m/d/Y', $moon->RentalEnd);
|
|
||||||
$price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
|
||||||
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
|
||||||
//Add the data to the html string to be passed to the view
|
|
||||||
$html .= '<tr>';
|
|
||||||
$html .= '<td>' . $spm . '</td>';
|
|
||||||
$html .= '<td>' . $moon->StructureName . '</td>';
|
|
||||||
$html .= '<td>' . $moon->FirstOre . '</td>';
|
|
||||||
$html .= '<td>' . $moon->FirstQuantity . '</td>';
|
|
||||||
$html .= '<td>' . $moon->SecondOre . '</td>';
|
|
||||||
$html .= '<td>' . $moon->SecondQuantity . '</td>';
|
|
||||||
$html .= '<td>' . $moon->ThirdOre . '</td>';
|
|
||||||
$html .= '<td>' . $moon->ThirdQuantity . '</td>';
|
|
||||||
$html .= '<td>' . $moon->FourthOre . '</td>';
|
|
||||||
$html .= '<td>' . $moon->FourthQuantity . '</td>';
|
|
||||||
$html .= '<td>' . $price['alliance'] . '</td>';
|
|
||||||
$html .= '<td>' . $price['outofalliance'] . '</td>';
|
|
||||||
$html .= '<td>' . $moon->RentalCorp . '</td>';
|
|
||||||
$html .= '<td>' . $rentalEnd . '</td>';
|
|
||||||
$html .= '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
return view('moons.adminmoon')->with('html', $html);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to display the moons and pass data to the blade template
|
* Function to display the moons and pass data to the blade template
|
||||||
*/
|
*/
|
||||||
@@ -109,99 +69,6 @@ class MoonsController extends Controller
|
|||||||
return view('moons.moon')->with('html', $html);
|
return view('moons.moon')->with('html', $html);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addMoon() {
|
|
||||||
$this->middleware('role:SuperUser');
|
|
||||||
return view('moons.addmoon');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a new moon into the database
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Reponse
|
|
||||||
*/
|
|
||||||
public function storeMoon(Request $request) {
|
|
||||||
$this->middleware('role:SuperUser');
|
|
||||||
$this->validate($request, [
|
|
||||||
'region' => 'required',
|
|
||||||
'system' => 'required',
|
|
||||||
'structure' => 'required',
|
|
||||||
]);
|
|
||||||
|
|
||||||
if($request->input('firstquan') < 1.00) {
|
|
||||||
$firstQuan = $request->input('firstquan') * 100.00;
|
|
||||||
} else {
|
|
||||||
$firstQuan = $request->input('firstquan');
|
|
||||||
}
|
|
||||||
|
|
||||||
if($request->input('secondquan') < 1.00) {
|
|
||||||
$firstQuan = $request->input('secondquan') * 100.00;
|
|
||||||
} else {
|
|
||||||
$firstQuan = $request->input('secondquan');
|
|
||||||
}
|
|
||||||
|
|
||||||
if($request->input('thirdquan') < 1.00) {
|
|
||||||
$firstQuan = $request->input('thirdquan') * 100.00;
|
|
||||||
} else {
|
|
||||||
$firstQuan = $request->input('thirdquan');
|
|
||||||
}
|
|
||||||
|
|
||||||
if($request->input('fourthquan') < 1.00) {
|
|
||||||
$firstQuan = $request->input('fourthquan') * 100.00;
|
|
||||||
} else {
|
|
||||||
$firstQuan = $request->input('fourthquan');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add new moon
|
|
||||||
$moon = new Moon;
|
|
||||||
$moon->Region = $request->input('region');
|
|
||||||
$moon->System = $request->input('system');
|
|
||||||
$moon->Planet = $request->input('planet');
|
|
||||||
$moon->Moon = $request->input('moon');
|
|
||||||
$moon->StructureName = $request->input('structure');
|
|
||||||
$moon->FirstOre = $request->input('firstore');
|
|
||||||
$moon->FirstQuantity = $request->input('firstquan');
|
|
||||||
$moon->SecondOre = $request->input('secondore');
|
|
||||||
$moon->SecondQuantity = $request->input('secondquan');
|
|
||||||
$moon->ThirdOre = $request->input('thirdore');
|
|
||||||
$moon->ThirdQuantity = $request->input('thirdquan');
|
|
||||||
$moon->FourthOre = $request->input('fourthore');
|
|
||||||
$moon->FourthQuantity = $request->input('fourthquan');
|
|
||||||
$moon->save();
|
|
||||||
|
|
||||||
return redirect('/dashboard')->with('success', 'Moon Added');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function updateMoon() {
|
|
||||||
$this->middleware('role:Admin');
|
|
||||||
return view('moons.updatemoon');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function storeUpdateMoon(Request $request) {
|
|
||||||
$this->middleware('role:Admin');
|
|
||||||
$this->validate($request, [
|
|
||||||
'system' => 'required',
|
|
||||||
'planet' => 'required',
|
|
||||||
'moon' => 'required',
|
|
||||||
'renter' => 'required',
|
|
||||||
'date' => 'required'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$date = strtotime($request->date . '00:00:01');
|
|
||||||
//Update the database entry
|
|
||||||
DB::table('Moons')
|
|
||||||
->where([
|
|
||||||
['System', '=', $request->system],
|
|
||||||
['Planet', '=', $request->planet],
|
|
||||||
['Moon', '=', $request->moon]
|
|
||||||
])
|
|
||||||
->update([
|
|
||||||
'RentalCorp' => $request->renter,
|
|
||||||
'RentalEnd' => $date,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return redirect('/moons/display')->with('success', 'Moon Updated');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function displayTotalWorthForm() {
|
public function displayTotalWorthForm() {
|
||||||
return view('moons.formTotalWorth');
|
return view('moons.formTotalWorth');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,9 @@ class StructureController extends Controller
|
|||||||
//Calculate the tax ratio to later be divided against the tax to find the
|
//Calculate the tax ratio to later be divided against the tax to find the
|
||||||
//actual tax owed to the alliance. Revenue will be a separate function
|
//actual tax owed to the alliance. Revenue will be a separate function
|
||||||
$ratio = $this->CalculateTaxRatio($tax, $refType, $start, $end);
|
$ratio = $this->CalculateTaxRatio($tax, $refType, $start, $end);
|
||||||
|
if($ratio == 0 || $ratio == null) {
|
||||||
|
$ratio = 1.0;
|
||||||
|
}
|
||||||
//Get the total taxes produced by the structure(s) over a given set of dates
|
//Get the total taxes produced by the structure(s) over a given set of dates
|
||||||
$revenue = $this->GetRevenue($corpId, $refType, $start, $end);
|
$revenue = $this->GetRevenue($corpId, $refType, $start, $end);
|
||||||
|
|
||||||
@@ -76,6 +78,7 @@ class StructureController extends Controller
|
|||||||
if($taxOwed < 0.00){
|
if($taxOwed < 0.00){
|
||||||
$taxOwed = 0.00;
|
$taxOwed = 0.00;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Return the amount
|
//Return the amount
|
||||||
return $taxOwed;
|
return $taxOwed;
|
||||||
}
|
}
|
||||||
@@ -94,7 +97,6 @@ class StructureController extends Controller
|
|||||||
$revenue = 0.00;
|
$revenue = 0.00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $revenue;
|
return $revenue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,14 +25,15 @@ Route::get('/dashboard', 'DashboardController@index');
|
|||||||
|
|
||||||
//Moon Controller display pages
|
//Moon Controller display pages
|
||||||
Route::get('/moons/display', 'MoonsController@displayMoons');
|
Route::get('/moons/display', 'MoonsController@displayMoons');
|
||||||
Route::get('/moons/addmoon', 'MoonsController@addMoon');
|
|
||||||
Route::get('/moons/updatemoon', 'MoonsController@updateMoon');
|
|
||||||
Route::get('/moons/display/worth', 'MoonsController@displayTotalWorthForm');
|
Route::get('/moons/display/worth', 'MoonsController@displayTotalWorthForm');
|
||||||
Route::get('/moons/admin/display', 'MoonsController@displayMoonsAdmin');
|
|
||||||
//Moon Controller POST requests
|
|
||||||
Route::post('storeMoon', 'MoonsController@storeMoon');
|
|
||||||
Route::post('storeUpdateMoon', 'MoonsController@storeUpdateMoon');
|
|
||||||
Route::post('displayTotalWorth', 'MoonsController@displayTotalWorth');
|
Route::post('displayTotalWorth', 'MoonsController@displayTotalWorth');
|
||||||
|
//Moon Admin Controller display pages
|
||||||
|
Route::get('/moons/addmoon', 'MoonsAdminController@addMoon');
|
||||||
|
Route::post('storeMoon', 'MoonsAdminController@storeMoon');
|
||||||
|
Route::get('/moons/admin/display', 'MoonsAdminController@displayMoonsAdmin');
|
||||||
|
Route::post('storeUpdateMoon', 'MoonsAdminController@storeUpdateMoon');
|
||||||
|
Route::get('/moons/updatemoon', 'MoonsAdminController@updateMoon');
|
||||||
|
|
||||||
|
|
||||||
//Wiki Controller display pages
|
//Wiki Controller display pages
|
||||||
Route::get('/wiki/register', 'WikiController@displayRegister');
|
Route::get('/wiki/register', 'WikiController@displayRegister');
|
||||||
|
|||||||
Reference in New Issue
Block a user