@extends('Admin.master_page')


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

<a href="{{ route('StatusCategory.create') }}" style="float: right;"><i class="fas fa-plus-circle"></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>Name</th>
 	    <th>Status</th>
 	    <th>Action</th>
 	       </tr>
 	        </thead> 
 	        <tbody>
 	        @foreach($status as $st)		
 	         <tr>
 	          <td>{{ $st->id }}</td>
 	           <td>{{ $st->name }}</td>
 	           <td>{{ GetStatusName($st->status) }}</td>
 	            
 	             <td>
			
				  <form action="{{route('StatusCategory.destroy' , $st->id)}}" method="post" id="form-{{$st->id}}">
                        {{csrf_field()}}
                        {{method_field("DELETE")}}
                    </form>

                    <a href="{{ route('StatusCategory.edit' , $st->id) }}" ><i class="fas fa-edit"></i></a>

                    &nbsp;
                                   <a href=""
                       onclick="if(confirm('Are you sure to delete?')) {
                               event.preventDefault();
                               document.getElementById('form-{{$st->id}}').submit();
                               }else{ event.preventDefault(); }"
                       ><i class="fas fa-trash-alt"></i></a>
   
 	             </td> 
 	            
 	         </tr>
 	         @endforeach


 	                 </tbody> 
 	             </table> 

 	             

 	         </div> 



@endsection