@extends('layouts.dashboard')

@section('content')

<!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
      <div class="container-full">
        <!-- Content Header (Page header) -->
        <div class="content-header">
            <div class="d-flex align-items-center">
                <div class="me-auto">
                    <h3 class="page-title">Home Work</h3>
                    <div class="d-inline-block align-items-center">
                        <nav>
                            <ol class="breadcrumb">
                                <li class="breadcrumb-item"><a href="{{ route('admin.index') }}"><i class="mdi mdi-home-outline"></i></a></li>
                                <li class="breadcrumb-item" aria-current="page">Home Work</li>
                                <li class="breadcrumb-item active" aria-current="page">View</li>
                            </ol>
                        </nav>
                    </div>
                </div>
                
            </div>
        </div>

        <!-- Main content -->
        <section class="content">
          <div class="row">

            <div class="col-12">

             <div class="box">
                @include('layouts.flash-message')
                <!-- /.box-header -->
                <div class="box-body">
                    <form action="{{ route('teacher.student.mark.bulk.upload') }}" method="post" enctype="multipart/form-data">
                    @csrf
                    <div class="row">
                        <div class="col-md-3">
                           
                        </div>
                        <div class="col-md-2">
                            
                        </div>
                        <div class="col-md-4"></div>
                        <div class="col-md-3">
                            <a href="{{ route('admin.homework.report.download') }}" class="btn btn-primary btn-sm add_button" style="float: right;">Download Report</a>
                        </div>
                    </div>
                    </form>
                    <style type="text/css">
                        .add_button
                        {
                            margin-bottom: 10px;
                        }
                    </style>
                     <div class="table-responsive">
                      <table id="example1" class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>S No</th>
                                <th>Student Name</th>
                                <th>Title</th>
                                <th>Last Date</th>
                                <th>Description</th>
                                <th>Status</th>
                            </tr>
                        </thead>
                        <tbody>
                            @if(count($home_work) > 0)
                            @foreach($home_work as $key => $value)
                            <tr>
                                <td>{{ $key + 1}}</td>
                                <td>{{ $value->student_details->name }}</td>
                                <td>{{ $value->homework_title }}</td>
                                <td>{{ date('d-m-Y', strtotime($value->homework_last_date)) }}</td>
                                <td>{{ $value->homework_description }}</td>
                                <td>
                                    @if($value->status == 0)
                                        <span> Pending</span>
                                    @elseif($value->status == 1)
                                        <span> Student Completed</span>
                                    @elseif($value->status == 2)
                                        <span>Homework Completed</span>
                                    @endif
                                </td>
                            </tr>
                            @endforeach
                            @endif
                        </tbody>
                      </table>
                    </div>
                </div>
                <!-- /.box-body -->
              </div>
              <!-- /.box -->

            </div>
            <!-- /.col -->
          </div>
          <!-- /.row -->
        </section>
        <!-- /.content -->
      
      </div>
  </div>
  <!-- /.content-wrapper -->

@endsection