@extends('layout.main')
@section('title') @if( ! empty($title)) {{ $title }} | @endif @parent @endsection

@section('main')
    <div class="">

        <div id="wrapper">
            @include('admin.sidebar_menu')
            <div id="page-wrapper">
                @if( ! empty($title))
                    <div class="row">
                        <div class="col-lg-12">
                            <h1 class="page-header"> {{ $title }}  </h1>
                        </div> <!-- /.col-lg-12 -->
                    </div> <!-- /.row -->
                @endif

                @include('admin.flash_msg')

                <div class="row">
                    <div class="col-xs-12">
                        @if(count($providers) > 0)
                            <table class="table table-bordered table-striped table-responsive">

                                @foreach($providers as $provider)
                                    <tr>
                                        <td width="100">
                                            <img src="/uploads/images/serviceproviders/{{ $provider->logo}}" class="thumb-listing-table" alt="">
                                        </td>
                                        <td>
                                            <h5><a href="{{route("providers_modify", $provider->id)}}" >{{ $provider->name}}</a> </h5>
                                            <p class="text-muted">
                                                <i class="fa fa-folder-open" aria-hidden="true"></i> {{$provider->type}}<br />
                                                <i class="fa fa-link" aria-hidden="true"></i>@if($provider->status == 0)<span style='color:green'> ACTIVE</span> @else <span style='color:red'>INACTIVE</span>@endif
                                                <br />  <a href="{{route("providers_modify", $provider->id)}} "><i class="fas fa-pencil-alt"></i> Edit Provider</a>
                                            </p>
                                            
                                        </td>

                                    </tr>
                                @endforeach
                            </table>
                        @endif
                        
                    </div>
                </div>
            </div>   <!-- /#page-wrapper -->

        </div>   <!-- /#wrapper -->

    </div> <!-- /#container -->
@endsection

@section('page-js')

    <script>
        @if(session('success'))
            toastr.success('{{ session('success') }}', '{{ trans('app.success') }}', toastr_options);
        @endif
        @if(session('error'))
            toastr.error('{{ session('error') }}', '{{ trans('app.success') }}', toastr_options);
        @endif
    </script>

@endsection