
@extends('admin.layouts.app')

@section('header-script')
    @include('admin.layouts.datatable-header')
@endsection


@section('content')
   <!-- Page-Title -->
                <div class="row">
                    <div class="col-sm-12">
                       <div class="btn-group pull-right m-t-25">
                            <a  href="{{URL::to('admin/sliders')}}"  class="btn btn-custom  waves-effect waves-light"  >New Slider  <span class="m-l-5"><i class="fa fa-plus-square" aria-hidden="true"></i></span></a>
                             
                        </div>
                        <h4 class="page-title">Slider List</h4>
                        
                         
                        @foreach (['danger', 'warning', 'success', 'info'] as $key)
                            @if(Session::has($key))
                                 <p class="alert alert-{{ $key }}"><i class="fa fa-info-circle" style="color: #fe6271;"></i> {{ Session::get($key) }}</p>
                            @endif
                        @endforeach
                        
                        
                    </div>
                </div>
 <div class="row">
                    <div class="col-sm-12">
                        <div class="card-box">
                             

                           
                             <div class="row">
                             <table id="datatable" class="table table-striped dt-responsive nowrap">
                                <thead>
                                    <tr>
                                        <th>Caption Title</th>
                                        <th>Caption Description </th>
                                        <th>Photo</th>
                                        <th>Publish Date</th>
									 
                                        <th  style="width: 60px;">Action</th>
                                         
                                    </tr>
                                </thead>

                                <tbody>
                                @if(!$sliders->isEmpty())
                                @foreach($sliders as $slider)
                                    <tr>
                                        <td>{{$slider->caption_title}}</td>
                                        <td>{{$slider->caption_description}}</td>
                                         <td><img src="../sliderphoto/{{$slider->image}}"  width="150px"/></td>
                                        
                                        <td>{{$slider->created_at->format('d M Y')}}</td> 
                                         <td style="width: 60px;"> 
										
                                          <a href="{{url('admin/edit_slider/'.$slider->id)}}" class="btn btn-sm  btn-warning"><i class="fa fa-edit"></i></a>
                                          
                                           <a href="{{url('admin/delete_slider/'.$slider->id)}}" class="btn btn-sm  btn-danger"><i class="fa fa-trash"></i></a></td> 
                                    </tr>
                                @endforeach   
                                     @else
                                 Nothing Found
                            @endif  
                                     
                                     
                                     
                                     
                                      
                                </tbody>
                            </table>
                             </div>
                        </div>
                    </div><!-- end col -->
                </div>
                
                  
                 
                <!-- end row -->
 @endsection

 @section('footer-script')
     @include('admin.layouts.datatable-footer-script')
 @endsection