@extends('layouts.admin') @section('title',__('adminstaticwords.Reports')) @section('content')

{{__('adminstaticwords.AllReports')}}

@if (isset($all_reports) && count($all_reports->data) > 0)
{{__('Stripe Report')}}

@php $sell = null; @endphp @foreach ($all_reports->data as $key => $report) @php \Stripe\Stripe::setApiKey(env('STRIPE_SECRET')); $customer_id = \Stripe\Customer::retrieve($report->customer); $user = Illuminate\Support\Facades\DB::table('users')->where('email', '=', $customer_id->email)->first(); $sell = $sell + (($report->plan->amount/100)); @endphp @endforeach
# {{__('adminstaticwords.Date')}} {{__('adminstaticwords.SubscribedPackage')}} {{__('adminstaticwords.PaidAmount')}} {{__('adminstaticwords.Method')}} {{__('adminstaticwords.User')}}
{{$key+1}} {{date('d/m/Y',$report->items->data[0]->created)}} {{$report->items->data[0]->plan->id}} {{$report->plan->amount/100}} Stripe @if (isset($user)) {{$user->name ? $user->name : ''}} @else {{__('adminstaticwords.UserRemoved')}} @endif


{{__('adminstaticwords.TotalSells')}} {{isset($sell) ? $sell : ''}}
@endif
@if (isset($paypal_subscriptions) && count($paypal_subscriptions) > 0)
{{__('Paypal Report')}}

@foreach ($paypal_subscriptions as $key => $item) @php $sell = 0; $date = $item->created_at->toDateString(); $sell = $sell + $item->price; @endphp @endforeach
# {{__('adminstaticwords.Date')}} {{__('adminstaticwords.SubscribedPackage')}} {{__('adminstaticwords.PaidAmount')}} {{__('adminstaticwords.Method')}} {{__('adminstaticwords.User')}}
{{$key+1}} {{$date}} {{$item->plan ? $item->plan->name : 'N/A'}} {{$item->price}} Paypal {{$item->user ? $item->user->name : 'N/A'}}


{{__('adminstaticwords.TotalSells')}} {{isset($sell) ? $sell : ''}}
@endif
@endsection