diff --git a/app/Http/Controllers/SRP/SRPAdminController.php b/app/Http/Controllers/SRP/SRPAdminController.php index b85671bea..900a0b297 100644 --- a/app/Http/Controllers/SRP/SRPAdminController.php +++ b/app/Http/Controllers/SRP/SRPAdminController.php @@ -70,8 +70,6 @@ class SRPAdminController extends Controller } } - - return view('srp.admin.process')->with('requests', $requests); } @@ -85,7 +83,7 @@ class SRPAdminController extends Controller ]); if($request->notes != null) { - $srp = SRPShip::where(['id' => $id])->update([ + $srp = SRPShip::where(['id' => $request->id])->update([ 'approved' => $request->approved, 'paid_value' => $request->paid_value, 'paid_by_id' => auth()->user()->character_id, @@ -93,7 +91,7 @@ class SRPAdminController extends Controller 'notes' => $request->notes, ]); } else { - $srp = SRPShip::where(['id' => $id])->update([ + $srp = SRPShip::where(['id' => $request->id])->update([ 'approved' => $request->approved, 'paid_value' => $request->paid_value, 'paid_by_id' => auth()->user()->character_id, @@ -101,9 +99,7 @@ class SRPAdminController extends Controller ]); } - - - if($request->approved == 'Yes') { + if($request->approved == 'Approved') { return redirect('/srp/admin/display')->with('success', 'SRP Marked as Paid'); } else { return redirect('/srp/admin/display')->with('error', 'SRP Request Denied.'); diff --git a/resources/views/srp/admin/process.blade.php b/resources/views/srp/admin/process.blade.php index 928ef229d..5bb88bb49 100644 --- a/resources/views/srp/admin/process.blade.php +++ b/resources/views/srp/admin/process.blade.php @@ -14,39 +14,53 @@ Fleet Type Actual SRP Notes + Approve + Deny + Process @foreach($requests as $row) {!! Form::open(['action' => 'SRP\SRPAdminController@processSRPRequest', 'method' => 'POST']) !!} - {{ $row['created_at'] }} - {{ $row['character_name'] }} - {{ $row['fleet_commander_name'] }} - zKill Link - {{ $row['loss_value'] }} - {{ $row['ship_type'] }} - {{ $row['fleet_type'] }} + + {{ Form::hidden('id', $row['id'], ['class' => 'form-control']) }} + {{ $row['created_at'] }} + + + {{ $row['character_name'] }} + + + {{ $row['fleet_commander_name'] }} + + + zKill Link + + + {{ $row['loss_value'] }} + + + {{ $row['ship_type'] }} + + + {{ $row['fleet_type'] }} + {{ $row['actual_srp'] }} {{ Form::hidden('paid_value', $row['actual_srp'], ['class' => 'form-control']) }} - {{ Form::textarea('notes', null, ['class' => 'form-control', 'id' => 'notes', 'rows' => 2, 'cols' => 15, 'style' => 'resize:none']) }} + + {{ Form::textarea('notes', null, ['class' => 'form-control', 'id' => 'notes', 'rows' => 2, 'cols' => 15, 'style' => 'resize:none']) }} + + + {{ Form::radio('approved', 'Approved', false, ['class' => 'form-control']) }} + + + {{ Form::radio('approved', 'Denied', false, ['class' => 'form-control']) }} + + + {{ Form::submit('Pay Out', ['class' => 'btn btn-primary']) }} + - -
- {{ Form::hidden('pay_out', $row['id'], ['class' => 'form-control']) }} - - {{ Form::label('approved', 'Approve') }} - {{ Form::radio('approved', 'Approved', false, ['class' => 'form-control']) }} - - - {{ Form::label('approved', 'Deny') }} - {{ Form::radio('approved', 'Denied', false, ['class' => 'form-control']) }} - - - {{ Form::submit('Pay Out', ['class' => 'btn btn-primary']) }} - -
{!! Form::close() !!} @endforeach