after action reports

This commit is contained in:
2021-03-15 00:52:39 +09:00
parent 0af6824866
commit b23d7195c5
4 changed files with 62 additions and 8 deletions

View File

@@ -48,7 +48,7 @@ class AfterActionReportsController extends Controller
$report->summary = $request->summary;
$report->improvements = $request->improvements;
$report->worked_well = $request->well;
$report->additon_comments = $request->comments;
$report->additonal_comments = $request->comments;
$report->save();
return redirect('/reports/display/all')->with('success', 'Added report to the database.');
@@ -71,9 +71,6 @@ class AfterActionReportsController extends Controller
}
public function DisplayAllReports() {
//Declare variables
$comments = array();
//Grab all the reports
$reports = AfterActionReports::where('created_at', '>=', Carbon::now()->subDays(30))->toArray();

View File

@@ -36,7 +36,8 @@ class AfterActionReport extends Model
];
public function comments() {
return $this->hasMany(App\Models\AfterActionReports\AfterActionReportComment::class, 'report_id', 'id');
return $this->hasMany(App\Models\AfterActionReports\AfterActionReportComment::class, 'report_id', 'id');
}
}

View File

@@ -4,10 +4,56 @@
<div class="container">
<div class="card">
<div class="card-header">
<h2>After Action Report Form</h2>
</div>
<div class="card-body">
{!! Form::open([
'action' => 'AfterActionReports\AfterActionReportsController@StoreReport',
'method' => 'POST',
])
!!}
<div class="form-group">
{{ Form::label('location', 'Location') }}
{{ Form::text('location', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('time', 'Time') }}
{{ Form::dateTime('time', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('comms', 'Comms') }}
{{ Form::text('comms', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('doctrine', 'Doctrine') }}
{{ Form::text('doctrine', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('objective', 'Objective') }}
{{ Form::text('objective', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('result', 'Result') }}
{{ Form::select('result', ['Win', 'Loss', 'Neither'], ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('summary', 'Summary') }}
{{ Form::textarea('summary', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('improvements', 'Improvements') }}
{{ Form::textarea('improvements', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('well', 'What Worked Well?') }}
{{ Form::textarea('well', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('comments', 'Additional Comments') }}
{{ Form::textarea('comments', '', ['class' => 'form-control']) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>

View File

@@ -1,4 +1,14 @@
@extends('layouts.user.dashb4')
@section('content')
<br>
@foreach($reports as $report)
<div class="card">
<div class="card-header">
</div>
<div class="card-body">
</div>
</div>
@endforeach
@endsection