@extends('layouts.layout-2')

@section('content')

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


    <h4 class="font-weight-bold mb-4">
        Content Tools: Links
    </h4>


    <div class="card mb-4">

        <div class="card-body">
            <!-- Controls -->
            {!! Form::open(['url' => url()->current(), 'class' => '']) !!}
            <div class="form-group mb-1">
                <label class="form-label" for="description">Description</label>
                {{ Form::textarea('text', $text,  array('class'=>'form-control', 'rows'=>20)) }}
            </div>
            <button type="submit" class="btn btn-primary"><i class="ion"></i> action</button>

            {!! Form::close() !!}
        </div>

        @if(count($values)>0)        
            <div class="card-body">

                <div class="card-datatable table-responsive">
                    <table class="datatables-style table table-striped table-bordered">
                        <thead>
                        <tr>
                            <th style="max-width: 60px;">ID</th>
                            <th style="max-width: 60px;">User-ID</th>
                            <th>{{__('Name')}}</th>
                            <th>{{__('seit')}}</th>
                            <th>Datum</th>
                            <th>Erreichbar</th>
                            <th>{{__('Status')}}</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($values as $value)
                        <tr>
                            <td>{{ $value->id }}</td>
                            <td>{{ $value->user_id }}</td>
                            <td>{{ $value->name }}.mivita.care</td>
                            <td>{{ $value->getActiveDateFormatSmall() }}</td>
                            <td>
                                @if($value->user && $value->user->payment_shop)
                                    @if($value->user->isActiveShop())
                                        <span class="badge badge-pill badge-success"><i class="fa fa-check"></i> {{ $value->user->getPaymentShopDateFormat() }}</span>
                                    @else
                                        <span class="badge badge-pill badge-warning"><i class="fa fa-ban"></i>{{ $value->user->getPaymentShopDateFormat() }}</span></a>
                                    @endif
                                @else
                                    <span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>
                                @endif
              
                            </td>
                            <td>
                                @if($value->getSubdomainAvailable())
                                    <span class="badge badge-pill badge-success"><i class="fa fa-check"> {{ __('available') }} </i>
                                    @if($value->getSubdomainSslSin()) HTTPS @else HTTP @endif
                                    </span>
                                @else
                                    <span class="badge badge-pill badge-danger"><i class="fa fa-times"> {{ __('not available') }} </i> HTTP </span>
                                @endif
                            </td>
                            <td>{!! get_active_badge($value->active) !!}</td>
                        </tr>
                         @endforeach
                          
                        </tbody>
                    </table>
                  
                </div>

            </div>
        @endif
    </div>

@endsection

