structure request form
This commit is contained in:
@@ -49,7 +49,6 @@ class StructureRequestController extends Controller
|
||||
'requested_drop_time' => $request->requested_drop_time,
|
||||
'requester_id' => $requesterId,
|
||||
'requester' => $request->requester,
|
||||
'completed' => 'No',
|
||||
]);
|
||||
|
||||
return redirect('/structures/display/requests');
|
||||
@@ -61,26 +60,6 @@ class StructureRequestController extends Controller
|
||||
return view('structurerequest.display.structurerequest')->with('reqs', $reqs);
|
||||
}
|
||||
|
||||
public function assignFC() {
|
||||
$this->validate($request, [
|
||||
'id' => 'required',
|
||||
'assigned_fc' => 'required',
|
||||
]);
|
||||
|
||||
$lookup = new NewLookupHelper;
|
||||
|
||||
$fcId = $lookup->CharacterNameToId($request->assigned_fc);
|
||||
|
||||
AnchorStructure::where([
|
||||
'id' => $request->id,
|
||||
])->update([
|
||||
'assigned_fc_id' => $fcId,
|
||||
'assigned_fc' => $request->assigned_fc,
|
||||
]);
|
||||
|
||||
return redirect('/structures/display/requests');
|
||||
}
|
||||
|
||||
public function deleteRequest($request) {
|
||||
$this->validate($request, [
|
||||
'id' => 'required',
|
||||
|
||||
@@ -24,10 +24,7 @@ class AnchorStructure extends Model
|
||||
'structure_size',
|
||||
'structure_type',
|
||||
'requested_drop_time',
|
||||
'assigned_fc_id',
|
||||
'assigned_fc',
|
||||
'requester_id',
|
||||
'requester',
|
||||
'completed',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -31,14 +31,8 @@ class CreateAllianceAnchorStructureTable extends Migration
|
||||
'Refinery',
|
||||
]);
|
||||
$table->dateTime('requested_drop_time');
|
||||
$table->unsignedInteger('assigned_fc_id')->nullable();
|
||||
$table->string('assigned_fc')->nullable();
|
||||
$table->unsignedInteger('requester_id');
|
||||
$table->string('requester');
|
||||
$table->enum('completed', [
|
||||
'Yes',
|
||||
'No',
|
||||
]);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,10 +13,9 @@
|
||||
<th>Structure Size</th>
|
||||
<th>Structure Type</th>
|
||||
<th>Drop Time</th>
|
||||
<th>FC</th>
|
||||
<th>Requester</th>
|
||||
<th>Completed</th>
|
||||
<th>Delete</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($reqs as $req)
|
||||
@@ -26,10 +25,16 @@
|
||||
<td>{{ $req->structure_size }}</td>
|
||||
<td>{{ $req->structure_type }}</td>
|
||||
<td>{{ $req->requested_drop_time }}</td>
|
||||
<td>{{ $req->assigned_fc }}</td>
|
||||
<td>{{ $req->requester }}</td>
|
||||
<td>{{ $req->completed }}</td>
|
||||
<!-- Create Form -->
|
||||
{!! Form::open(['action' => 'Logistics\StructureRequestController@deleteRequest', 'method' => 'POST']) !!}
|
||||
<td>
|
||||
{{ Form::hidden('id', $req->id, ['class' => 'form-control']) }}
|
||||
{{ Form::radio('delete', 'Delete', false, ['class' => 'form-conotrol']) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::submit('Delete', ['class' => 'btn btn-danger']) }}
|
||||
</td>
|
||||
{!! Form::close() !!}
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
@extends('layouts.b4')
|
||||
@section('content')
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Structure Request Form</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{!! Form::open(['action' => 'Logistics\StructureRequestController@storeForm', 'method' => 'POST']) !!}
|
||||
<div class="form-group">
|
||||
{{ Form::label('corporation_name', 'Corporation Name') }}
|
||||
{{ Form::text('corporation_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('structure_size', 'Structure Size') }}
|
||||
{{ Form::select('structure_size', ['M', 'L', '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']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('requested_drop_time', 'Requested Drop Time') }}
|
||||
{{ Form::dateTime('requested_drop_time', \Carbon\Carbon::now(), ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('requester', 'Requester') }}
|
||||
{{ Form::text('requester', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -140,7 +140,6 @@ Route::group(['middleware' => ['auth']], function(){
|
||||
* Anchor Structure Controller display pages
|
||||
*/
|
||||
Route::get('/structures/display/requests', 'Logistics\StructureRequestController@displayRequests');
|
||||
Route::post('/structures/display/requests/assignfc', 'Logistics\StructureRequestController@assignFC');
|
||||
Route::post('/structures/display/requests/delete', 'Logistics\StructureRequestController@deleteRequest');
|
||||
Route::get('/structures/display/form', 'Logistics\StructureRequestController@displayForm');
|
||||
Route::post('/structures/display/form', 'Logistics\StructureRequestController@storeForm');
|
||||
|
||||
Reference in New Issue
Block a user