@extends('layouts.admin')    
@section('content')

            <div class="card-header">
                    <h4>Manage Board Pattern </h4>
                    <a class="btn  btn-primary  float-right" href="{{ route('admin.addstudentspattern') }}"> Add Board Pattern  </a>
                  </div>
                  <div class="card-body"> 
                    @include('admin.partials.flash-messages')
                    <div class="table-responsive"> 
                     <div class="table-responsive">
                      <table class="table table-striped table-hover" id="tableExport" style="width:100%;">
                        <thead>
                          <tr>
                            <th>Board Pattern Name</th>       
                            <th>Short Name</th>                                                                     
                            <th>Action</th> 
                          </tr>
                        </thead>
                        <tbody>
                          @forelse($boardpattern as $pattern)
                            <tr>
                              <td>{{ $pattern->boardname }}</td>     
                              <td>{{ $pattern->showname }}</td>                            
                              <td>
                                <a class="btn btn-success btn-sm"  data-toggle="tooltip" data-placement="top"  title="Edit Board Pattern" href="{{ route('admin.editstudentspattern', ['id' => $pattern->id]) }}"> <i class='fas fa-pencil-alt'></i> </a>
                                &nbsp;  &nbsp;  
                                <form action="{{ route('admin.deletestudentspattern', ['id' => $pattern->id]) }}" method="post" class="d-inline-block">
                                  @csrf
                                  <button type="submit" class="btn btn-danger deletedata" data-toggle="tooltip" data-placement="top" title="Delete Board Pattern" data-confirm-message="Are you sure you want to delete this board pattern?"><i class='fas fa-trash'></i></button>
                                </form>
                              </td>
                            </tr>
                          @empty
                            <tr>
                              <td colspan="3" class="text-center text-muted font-weight-bold">No board patterns have been added yet.</td>
                            </tr>
                          @endforelse
                          
                        </tbody>
                      </table>
                    </div>
            </div>
@endsection
