@extends('layouts.app') @section('content')

{{ $user->name }}


{{ __('Profile') }}

{{ __('Status: ') }} {{ $user->status === 1 ? 'Active' : 'Inactive' }}

{{ __('Company: ' . $user->profile->company) }}

{{ __('Email: ' . $user->email) }}

{{ __('Phone: ' . $user->profile->phone) }}

{{ __('Address: ' . $user->profile->address) }}

{{ __('Zip code: ' . $user->profile->zip) }}

{{ __('Country: ' . $user->profile->country) }}

@if($user->roles->first()->name === 'user')

{{ __('Mikrotik settings') }}

{{ __('Username: ' . $user->profile->mikrotik_username) }}

{{ __('Password: ' . $user->profile->mikrotik_password) }}

{{ __('Package information') }}

{{ __('Name: ' . $user->package->packageDetail->title) }}

{{ __('Type: ') }}{{ $user->package->packageDetail->package->type === 1 ? 'PPoE' : 'HotSpot' }}

{{ __('Price: ' . auth()->user()->currency . $user->package->packageDetail->amount) }}

{{ __('Billing') }}

{{ __('Total bill: ' . auth()->user()->currency . $user->bills->sum('amount')) }}

{{ __('Total payment: ' . auth()->user()->currency . $user->payments->sum('amount')) }}

@if($user->bills->sum('amount') >= $user->payments->sum('amount')) {{ __('Due: ' . auth()->user()->currency . ($user->bills->sum('amount') - $user->payments->sum('amount'))) }}{{ __('(due)') }} @else {{ __('Due: ' . auth()->user()->currency . ($user->payments->sum('amount') - $user->bills->sum('amount'))) }}{{ __('(advanced)') }} @endif

@endif @if($user->roles->first()->name === 'accountant' || $user->roles->first()->name === 'support')

{{ __('Professional profile') }}

{{ __('Salary: ' . auth()->user()->currency . $user->profile->salary) }}

{{ __('role: ' . $user->roles->first()->name) }}

@endif
@if($user->roles->first()->name === 'user')
@csrf @method('PATCH') @if($user->status === 1) @else @endif
@csrf
@csrf
{{ __('Billing history') }}

@foreach($user->bills as $bill) @endforeach
{{ __('Amount') }} {{ __('From') }} {{ __('To') }} {{ __('Package') }} {{ __('Package type') }} {{ __('Edit') }}
{{ auth()->user()->currency . $bill->amount }} {{ $bill->start }} {{ $bill->end }} {{ $bill->package }} {{ $bill->package_type }} {{ __('Edit') }}
{{ __('Payment history') }}

@foreach($user->payments as $pay) @endforeach
{{ __('Amount') }} {{ __('Note') }} {{ __('Payment method') }} {{ __('Created on') }} {{ __('Edit') }}
{{ $pay->amount }} {{ $pay->note }} {{ $pay->payment_method }} {{ date('Y-m-d', strtotime($pay->created_at->tz(auth()->user()->timezone) )) }} {{ __('Edit') }}
@endif @if($user->roles->first()->name === 'accountant' || $user->roles->first()->name === 'support')
{{ __('Salary history') }}

@foreach($user->salaries as $salary) @endforeach
{{ __('Amount') }} {{ __('From') }} {{ __('To') }}
{{ auth()->user()->currency . $salary->amount }} {{ $salary->start }} {{ $salary->end }}
@endif
@endsection @section('scripts') @endsection