@extends('admin.layouts.container')
@section('css')
    <link rel="stylesheet" href="{{ asset('assets/web/css/lib/toastr.css') }}" />
@endsection
@section('content')
    <div class="side-title">
        <h3>{{$head ?? '' }}</h3>
    </div>

    <div class="border-item">
        <form class="form-row">

        @if($coupon)
            <div class="form-group col-lg-6">
                <label>{{  __('marketerCoupons.user_id') }}</label>
                <input readonly class="form-control bg-white"  value='{{ $marketerCommission->name}}'/>
            </div>
            <div class="form-group col-lg-3">
                <label>{{  __('marketerCoupons.code') }}</label>
                <input readonly class="form-control bg-white"  value='{{ $coupon->code}}'/>
            </div>

            <div class="form-group col-lg-3">
                <label>{{  __('marketerCommissions.coupon_request_count') }}</label>
                <input readonly class="form-control bg-white"  value='{{ $requestsCount}}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('marketerCommissions.total') }}</label>
                <input readonly class="form-control bg-white"  value='{{ $total}}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('marketerCommissions.marketer_percentage') }}</label>
                <input readonly class="form-control bg-white"  value='{{ $marketerPercentage}}'/>
            </div>

            <div class="col-md-12">
                <table class="table table-hover table-striped table-bordered text-center">
                    <thead class="bg-secondary text-white">
                    <tr>
{{--                        <th>#</th>--}}
                        <th>{{__('marketerCommissions.service_no')}}</th>
                        <th>{{__('marketerCommissions.service_name')}}</th>
                        <th>{{__('marketerCommissions.service_price')}}</th>
                    </tr>
                    </thead>
                </table>
            </div>
            @if(count($docRequests) || count($consRequests))
                    <div class="col-md-12" style="height: 600px; overflow-y: scroll">
                        <table class="table table-hover table-striped table-bordered text-center">
                            <tbody>
                            @if(count($docRequests))
                                @foreach($docRequests as $docRequest)
                                    <tr>
{{--                                        <td>{{$loop->iteration}}</td>--}}
                                        <td>{{$docRequest->id}}</td>
                                        <td>{{__('marketerCommissions.documentation_requests')}}</td>
                                        <td>{{$docRequest->documentation_price}}</td>
                                    </tr>
                                @endforeach
                            @endif
                            @if(count($consRequests))
                                @foreach($consRequests as $consRequest)
                                    <tr>
{{--                                        <td>{{$loop->iteration}}</td>--}}
                                        <td>{{$consRequest->id}}</td>
                                        <td>{{__('marketerCommissions.consulting_requests')}}</td>
                                        <td>{{$consRequest->consulting_price}}</td>
                                    </tr>
                                @endforeach
                            @endif
                            </tbody>
                        </table>
                    </div>
                    <div class="col-md-12">
                        <table class="table table-hover table-striped table-bordered text-center">
                            <tfoot class="bg-secondary text-white">
                            <tr>
                                <td>{{$requestsCount}}</td>
                                <td>{{__('marketerCommissions.all_total')}}</td>
                                <td>{{$total}}</td>
                            </tr>
                            </tfoot>
                        </table>
                    </div>
                @else
                    <div class="text-center col-md-12"><p class="text-danger">{{__('marketerCommissions.no_commission')}}</p></div>
                @endif
            @else
            <div class="alert alert-secondary text-danger text-center col-md-12">{{__('marketerCommissions.no_commission')}}</div>
        @endif

            <div class="text-center mt-5 col-12">
                <a href="{{ route('marketerCommissions.index') }}" class="butn add_coupon_button"><span>{{__('marketerCommissions.head')}}</span></a>
            </div>
        </form>
    </div>

@endsection

@section('inner_js')

@endsection



