srp stuff

This commit is contained in:
2019-06-30 22:57:49 -05:00
parent 95dad78a7f
commit c3eeadece5
2 changed files with 40 additions and 30 deletions

View File

@@ -70,8 +70,6 @@ class SRPAdminController extends Controller
} }
} }
return view('srp.admin.process')->with('requests', $requests); return view('srp.admin.process')->with('requests', $requests);
} }
@@ -85,7 +83,7 @@ class SRPAdminController extends Controller
]); ]);
if($request->notes != null) { if($request->notes != null) {
$srp = SRPShip::where(['id' => $id])->update([ $srp = SRPShip::where(['id' => $request->id])->update([
'approved' => $request->approved, 'approved' => $request->approved,
'paid_value' => $request->paid_value, 'paid_value' => $request->paid_value,
'paid_by_id' => auth()->user()->character_id, 'paid_by_id' => auth()->user()->character_id,
@@ -93,7 +91,7 @@ class SRPAdminController extends Controller
'notes' => $request->notes, 'notes' => $request->notes,
]); ]);
} else { } else {
$srp = SRPShip::where(['id' => $id])->update([ $srp = SRPShip::where(['id' => $request->id])->update([
'approved' => $request->approved, 'approved' => $request->approved,
'paid_value' => $request->paid_value, 'paid_value' => $request->paid_value,
'paid_by_id' => auth()->user()->character_id, 'paid_by_id' => auth()->user()->character_id,
@@ -101,9 +99,7 @@ class SRPAdminController extends Controller
]); ]);
} }
if($request->approved == 'Approved') {
if($request->approved == 'Yes') {
return redirect('/srp/admin/display')->with('success', 'SRP Marked as Paid'); return redirect('/srp/admin/display')->with('success', 'SRP Marked as Paid');
} else { } else {
return redirect('/srp/admin/display')->with('error', 'SRP Request Denied.'); return redirect('/srp/admin/display')->with('error', 'SRP Request Denied.');

View File

@@ -14,39 +14,53 @@
<th>Fleet Type</th> <th>Fleet Type</th>
<th>Actual SRP</th> <th>Actual SRP</th>
<th>Notes</th> <th>Notes</th>
<th>Approve</th>
<th>Deny</th>
<th>Process</th>
</thead> </thead>
<tbody> <tbody>
@foreach($requests as $row) @foreach($requests as $row)
<tr> <tr>
{!! Form::open(['action' => 'SRP\SRPAdminController@processSRPRequest', 'method' => 'POST']) !!} {!! Form::open(['action' => 'SRP\SRPAdminController@processSRPRequest', 'method' => 'POST']) !!}
<td>{{ $row['created_at'] }}</td> <td>
<td>{{ $row['character_name'] }}</td> {{ Form::hidden('id', $row['id'], ['class' => 'form-control']) }}
<td>{{ $row['fleet_commander_name'] }}</td> {{ $row['created_at'] }}
<td><a href="{{ $row['zkillboard'] }}" target="_blank">zKill Link</a></td> </td>
<td>{{ $row['loss_value'] }}</td> <td>
<td>{{ $row['ship_type'] }}</td> {{ $row['character_name'] }}
<td>{{ $row['fleet_type'] }}</td> </td>
<td>
{{ $row['fleet_commander_name'] }}
</td>
<td>
<a href="{{ $row['zkillboard'] }}" target="_blank">zKill Link</a>
</td>
<td>
{{ $row['loss_value'] }}
</td>
<td>
{{ $row['ship_type'] }}
</td>
<td>
{{ $row['fleet_type'] }}
</td>
<td> <td>
{{ $row['actual_srp'] }} {{ $row['actual_srp'] }}
{{ Form::hidden('paid_value', $row['actual_srp'], ['class' => 'form-control']) }} {{ Form::hidden('paid_value', $row['actual_srp'], ['class' => 'form-control']) }}
</td> </td>
<td>{{ Form::textarea('notes', null, ['class' => 'form-control', 'id' => 'notes', 'rows' => 2, 'cols' => 15, 'style' => 'resize:none']) }} <td>
{{ Form::textarea('notes', null, ['class' => 'form-control', 'id' => 'notes', 'rows' => 2, 'cols' => 15, 'style' => 'resize:none']) }}
</td>
<td>
{{ Form::radio('approved', 'Approved', false, ['class' => 'form-control']) }}
</td>
<td>
{{ Form::radio('approved', 'Denied', false, ['class' => 'form-control']) }}
</td>
<td>
{{ Form::submit('Pay Out', ['class' => 'btn btn-primary']) }}
</td>
</tr> </tr>
<tr>
<div class="form-group">
<td>{{ Form::hidden('pay_out', $row['id'], ['class' => 'form-control']) }}</td>
<td>
{{ Form::label('approved', 'Approve') }}
{{ Form::radio('approved', 'Approved', false, ['class' => 'form-control']) }}
</td>
<td>
{{ Form::label('approved', 'Deny') }}
{{ Form::radio('approved', 'Denied', false, ['class' => 'form-control']) }}
</td>
<td>
{{ Form::submit('Pay Out', ['class' => 'btn btn-primary']) }}
</td>
</div>
{!! Form::close() !!} {!! Form::close() !!}
</tr> </tr>
@endforeach @endforeach