@extends('Admin.master_page')



@section('title') <h5 class="m-0 font-weight-bold text-primary" style="float: left;">Incident History</h5> 

<a href="{{ route('Incident.index') }}" style="float: right;"><i class="fas fa-chevron-circle-left"></i></a>
@endsection

@section('content')

@if(Session::has('success_message'))
<div class="alert alert-success">{{ Session::get('success_message') }}</div>
@endif

<div class="table-responsive"> 

 	<br>
 	<table class="table">
 	 <thead>
 	  <tr>
 	   <th>#</th>
 	    <th>Date</th>
 	    <th>Name</th>
         <th>Impact</th>
 	    <th>Components</th>
 	    <th>Message</th>
 	    <th>Status</th>
 	    <th>Action</th>
 	       </tr>
 	        </thead> 
 	        <tbody>
 	        @foreach($ins as $in)
 	         <tr>
 	          <td>{{ $in->id }}</td>
 	          <td>{{ $in->date }}</td>
               <td>{{ $in->incident->name }}</td>
 	           <td>{{ $in->incident->impact }}</td>
 	           <td>
 	               @foreach($in->incident->components as $com)
 	               <?php $sub = App\Models\StatusCategory::find($com); ?>
 	               {{ $sub->name }},
 	               @endforeach
 	           </td> 

               <td>{!! html_entity_decode($in->message) !!}</td>
               <td>{{ $in->status }}</td>
               <td><a href="/history/{{ $in->id }}" class="btn btn-sm btn-danger">Delete</a></td>

 	         </tr>
 	         @endforeach


 	                 </tbody> 
 	             </table> 

 	             

 	         </div> 



@endsection