updated srp statistics
This commit is contained in:
@@ -11,14 +11,14 @@ class CorpMarketMail extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'command:name';
|
protected $signature = 'services:MarketMail';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $description = 'Command description';
|
protected $description = 'Send a mail about a market.';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new command instance.
|
* Create a new command instance.
|
||||||
@@ -37,6 +37,13 @@ class CorpMarketMail extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
//
|
//Create the command helper container
|
||||||
|
$task = new CommandHelper('CorpMarketMail');
|
||||||
|
|
||||||
|
//Add entry into the table saying the job is starting
|
||||||
|
$task->SetStartStatus();
|
||||||
|
|
||||||
|
//Mark the job as finished
|
||||||
|
$task->SetStopStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ class SRPAdminController extends Controller
|
|||||||
//Create the array
|
//Create the array
|
||||||
$requests = array();
|
$requests = array();
|
||||||
|
|
||||||
|
//Declare variables for use later.
|
||||||
|
$sum_actual = 0.00;
|
||||||
|
$sum_loss = 0.00;
|
||||||
|
|
||||||
//Get the ship types from the database
|
//Get the ship types from the database
|
||||||
$shipTypes = SrpShipType::all();
|
$shipTypes = SrpShipType::all();
|
||||||
|
|
||||||
@@ -58,6 +62,7 @@ class SRPAdminController extends Controller
|
|||||||
$temp['fleet_commander_name'] = $r['fleet_commander_name'];
|
$temp['fleet_commander_name'] = $r['fleet_commander_name'];
|
||||||
$temp['zkillboard'] = $r['zkillboard'];
|
$temp['zkillboard'] = $r['zkillboard'];
|
||||||
$temp['loss_value'] = $r['loss_value'];
|
$temp['loss_value'] = $r['loss_value'];
|
||||||
|
$sum_loss += $temp['loss_value'];
|
||||||
//Get the ship type
|
//Get the ship type
|
||||||
foreach($shipTypes as $s) {
|
foreach($shipTypes as $s) {
|
||||||
if($r['ship_type'] == $s->code) {
|
if($r['ship_type'] == $s->code) {
|
||||||
@@ -75,6 +80,7 @@ class SRPAdminController extends Controller
|
|||||||
if($r['ship_type'] == $p->code) {
|
if($r['ship_type'] == $p->code) {
|
||||||
$temp['actual_srp'] = $r['loss_value'] * ($p->payout / 100.00 );
|
$temp['actual_srp'] = $r['loss_value'] * ($p->payout / 100.00 );
|
||||||
$temp['cost_code'] = $p->payout;
|
$temp['cost_code'] = $p->payout;
|
||||||
|
$sum_actual += $temp['actual_srp'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +90,9 @@ class SRPAdminController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Return the view with the variables
|
//Return the view with the variables
|
||||||
return view('srp.admin.process')->with('requests', $requests);
|
return view('srp.admin.process')->with('requests', $requests)
|
||||||
|
->with('sum_actual', $sum_actual)
|
||||||
|
->with('sum_loss', $sum_loss);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processSRPRequest(Request $request) {
|
public function processSRPRequest(Request $request) {
|
||||||
|
|||||||
@@ -71,6 +71,16 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<br>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h2>Totals</h2>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
Total Loss Values: {{ $sum_loss }}<br>
|
||||||
|
Total Actual Value: {{ $sum_actual }}<br>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
|
|||||||
Reference in New Issue
Block a user