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

            <div class="card-header">
                    <h4>Manage Student Subjects </h4>
                    <a class="btn  btn-primary  float-right" href="{{ route('admin.addclasssubject') }}"> Add Student Subject  </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>Students Subject Title</th>                                                                     
                            <th>Action</th> 
                          </tr>
                        </thead>
                        <tbody>
                          @forelse($studentsgroup as $subject)
                            <tr>
                              <td>{{ $subject->subjectname }}</td>                            
                              <td>
                                <a class="btn btn-success btn-sm"  data-toggle="tooltip" data-placement="top"  title="Edit Student Subject" href="{{ route('admin.editclasssubject', ['id' => $subject->id]) }}"> <i class='fas fa-pencil-alt'></i> </a>
                                &nbsp;  &nbsp;  
                                <form action="{{ route('admin.deleteclasssubject', ['id' => $subject->id]) }}" method="post" class="d-inline-block">
                                  @csrf
                                  <button type="submit" class="btn btn-danger deletedata" data-toggle="tooltip" data-placement="top" title="Delete Student Subject" data-confirm-message="Are you sure you want to delete this student subject?"><i class='fas fa-trash'></i></button>
                                </form>
                              </td>
                            </tr>
                          @empty
                            <tr>
                              <td colspan="2" class="text-center text-muted font-weight-bold">No student subjects have been added yet.</td>
                            </tr>
                          @endforelse
                          
                        </tbody>
                      </table>
                    </div>
            </div>
@endsection
