 @extends('admin.layouts.main-layout')
 @section('content')
<div class="card">
        <div class="card-header">
            <h3 class="card-title">Game List</h3>
        </div>
        <div align="left">
            <a href="{{ url('admin/games/create') }}" class="btn btn-info">Add New </a>
        </div>
        <!-- /.card-header -->
        <div class="card-body">
            @if(session()->has('message'))
                <div class="alert alert-success">
                    {{ session()->get('message') }}
                </div>
            @endif
            <div id="example1_wrapper" class=" dt-bootstrap4">
                <div class="row">
                    <div class="col-sm-12">
                          <div class='tablescroll'>
                            <div class="table-responsive">
                        <table id="example1" class="table table-bordered table-striped dataTable" role="grid"
                               aria-describedby="example1_info">
                            <thead>
                            <tr role="row">
                                <th class="sorting_asc" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-sort="ascending"
                                    aria-label="Rendering engine: activate to sort column descending"
                                    style="width: 60px;">#
                                </th>
                                <!-- <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="Browser: activate to sort column ascending" style="width: 207px;">
                                    Game Group Name
                                </th> -->
                                 <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="Browser: activate to sort column ascending" style="width: 207px;">
                                   Game Name
                                </th>
                                <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="Platform(s): activate to sort column ascending" style="width: 183px;">
                                    Status
                                </th>
                               <!--  <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="CSS grade: activate to sort column ascending" style="width: 200px;">
                                    Action
                                </th> -->
                                
                            </tr>
                            </thead>
                            <tbody>
                              @php 
                    $page=1;
                    if(Request::input('page'))
                    $page=Request::input('page');
                    $sort = $lists->perPage();
                  @endphp
                  @forelse($lists as $key => $list)
                
                        <tr>
                          <td>{{ $sort*($page-1)+($key+1) }}</td>
                         <!--  <td>
                            <a>{{$list->gameGroup->name}}</a>
                           
                          </td> -->
                           <td>
                            <a>{{$list->name}}</a>
                           
                          </td>
                         
                         <td>
                             <!-- <a href="{{url('/admin/game-group/changestatus/'.$list->id)}}" class="btn btn-xs btn-{{($list->status == 'Active') ? 'success' : 'danger'}} button_flow"  data-toggle="tooltip" data-placement="top" title=""  onclick="return confirm('Are you sure you want to make  {{($list->status == 'Active') ? 'Inactive' : 'Active'}} this Game Name ?')"> <i class="fa {{($list->status == 'Active') ? 'fa-toggle-on' : 'fa-toggle-off'}}"></i></a> -->

                            <button type="button" class="btn btn-{{($list->status == 'Active') ? 'success' : 'danger'}} btn-xs">Success</button>
                          </td>
                            <!--  <td>

                                  <a href="{{url('admin/games/'.$list->id.'/edit')}}"
                                     class="btn btn-primary">Edit</a>
                                     <a href="javascript:void(0);" class="btn btn-danger" onclick="$(this).find('form').submit();" >
                                      <form action="{{ url('admin/games/delete/'.$list->id) }}" method="post">
                                        {!! csrf_field() !!}
      {{ method_field('DELETE') }}
                                          
                                      </form>
                                      Delete
                                  </a>
                                  

                              </td> -->
                        </tr>
                         @empty
                  <tr>
                    <td colspan="5">Record not found </td>
                  </tr>
                  @endforelse
                            </tbody>
                   </table>
                   </div>
                   </div>
                    <div class="row">
              <div class="col-md-6 text-left" style="margin: 20px 0px;">
                Showing  {{$lists->firstItem()}} to {{$lists->lastItem()}} of {{$lists->total()}}
              </div>
              <div class="col-md-6 text-right">
                {!! $lists->appends(request()->input())->links() !!}
              </div>
            </div>
                  </div>
                </div>
              </div>
            </div>
          </div>


 @endsection
@section('js-content')
@endsection