@extends('adminlte::page')
@section('content_header')
    <h1> Search Items</h1>
@stop
<script src="//code.jquery.com/jquery.js"></script>
@section('content')

    @if ($errors->any())
            <div class="alert alert-danger">
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
    @endif

    @if (session('status'))
            <div class="alert alert-success">
                {{ session('status') }}
            </div>
    @endif
  

   
<div class="row">
            <!--row starts-->

         <div class="col-md-12">
               @if($tapaldata!="")
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                           {{request()->session()->get('session_tname')}}s
                        </h3>
                    </div>

                  <div class="panel-body">
                        
                            <!-- CSRF Token -->
                              <input type="hidden" name="_token" value="{{csrf_token()}}">

                                <table id="example" class="display" style="width:100%">
                                    <thead>
                                        <tr>
                                            <th>Number</th>
                                            <th>Date</th>
                                            <th>Keywords</th>
                                            <th>Subject</th>
                                            <th>Actions</th>
                                        </tr>
                                    </thead>

                                    <tbody>
                                        @foreach($tapaldata as $tapaldetails)

                                        <tr>
                                            <td>{{$tapaldetails->tapal_no}}</td>
                                            <td>{{$tapaldetails->created_at->format("d-m-Y")}}</td>
                                            <td>{{$tapaldetails->keywords}}</td>
                                            <td>{{$tapaldetails->subject->subject}}</td>
                                            <td><a href=tapal_view/{{$tapaldetails->id}} class='btn btn-xs btn-primary'><i class='glyphicon glyphicon-edit'></i>Show</a> </td>

                                           
                                        </tr>

                                        @endforeach
                                    </tbody>
                                </table>
                  </div>
                               
                </div>
       
        @endif

                @if($filedata!="")
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                           {{request()->session()->get('session_fname')}}s
                        </h3>
                    </div>

                  <div class="panel-body">
                        
                            <!-- CSRF Token -->
                              <input type="hidden" name="_token" value="{{csrf_token()}}">

                                <table id="example1" class="display" style="width:100%">
                                    <thead>
                                        <tr>
                                            <th>Number</th>
                                            <th>Date</th>
                                            <th>Title</th>
                                            <th>{{request()->session()->get('session_fname')}} Group</th>
                                            <th>Actions</th>
                                        </tr>
                                    </thead>

                                    <tbody>
                                        @foreach($filedata as $filedetails)

                                        <tr>
                                            <td>{{$filedetails->file_no}}</td>
                                            <td>{{$filedetails->created_at->format("d-m-Y")}}</td>
                                            <td>{{$filedetails->title}}</td>
                                            <td>{{$filedetails->file_groupobj->file_group}}</td>
                                            <td><a href=file_view/{{$filedetails->id}} class='btn btn-xs btn-primary'><i class='glyphicon glyphicon-edit'></i>Show</a> </td>
                                           
                                        </tr>

                                        @endforeach
                                    </tbody>
</table>
                  </div>
                               
                
        </div>
        @endif

 </div>
 </div>   
<script>
        $(document).ready(function() {
    $('#example').DataTable();
} );

</script>

<script>
        $(document).ready(function() {
    $('#example1').DataTable();
} );

</script>

@stop
