@extends('layouts.main') @section('title', 'Email Management') @section('css') @php $dashboardCssPath = public_path('assets/css/dashboard.css'); $dashboardCssVersion = file_exists($dashboardCssPath) ? filemtime($dashboardCssPath) : time(); @endphp @endsection @section('navbarTitle', 'Email Management') @section('content') @include('layouts.breadcrumb', [ 'title' => 'Email Management', 'current' => 'Accounts & Takeovers', 'homeRoute' => 'dashboard', ]) @include('partials.swal-alert', ['type' => 'success', 'message' => session('status')]) @include('partials.swal-alert', ['type' => 'error', 'message' => session('error')]) @if ($errors->any())
Data belum valid.
@endif @php $showTakeoverAccess = false; @endphp

Mail Access Accounts

@forelse ($accounts as $account) @php $ownerName = $account->employee?->profile?->name ?? $account->employee?->profile?->nickname ?? $account->employee?->user?->email ?? '-'; $accountStatusClass = $account->is_active ? 'badge-success' : 'badge-danger'; $isConfigManagedAccount = $protectedMailAccountEmails->contains(mb_strtolower((string) $account->email)); @endphp @empty @endforelse
Email Type Company Owner Staff Status Action
{{ $account->email }} {{ $mailTypeLabels[$account->type] ?? ucfirst((string) $account->type) }} {{ $account->company?->name ?? '-' }} {{ $ownerName }} {{ $account->is_active ? 'Active' : 'Inactive' }}
@if ($isConfigManagedAccount) @else @endif
No email account data available.
@include('settings.partials.pagination', ['items' => $accounts])
@if ($showTakeoverAccess)

Takeover Access

Akses baca email staff lama untuk staff pengganti.

@forelse ($takeovers as $takeover) @php $isReadable = $takeover->can_read && $takeover->revoked_at === null; $sourceName = $takeover->sourceEmployee?->profile?->name ?? $takeover->sourceEmployee?->profile?->nickname ?? ''; $sourceEmail = $takeover->mailAccessAccount?->email ?? $takeover->sourceEmployee?->user?->email ?? $takeover->sourceEmployee?->user?->username ?? ''; $sourceLabel = trim((string) $sourceName) !== '' && trim((string) $sourceEmail) !== '' ? "{$sourceName} - {$sourceEmail}" : ($sourceName ?: ($sourceEmail ?: '-')); $targetName = $takeover->targetEmployee?->profile?->name ?? $takeover->targetEmployee?->profile?->nickname ?? ''; $targetEmail = $takeover->targetEmployee?->user?->email ?? $takeover->targetEmployee?->user?->username ?? ''; $targetLabel = trim((string) $targetName) !== '' && trim((string) $targetEmail) !== '' ? "{$targetName} - {$targetEmail}" : ($targetName ?: ($targetEmail ?: '-')); @endphp @empty @endforelse
Staff Lama Staff Pengganti Status Action
{{ $sourceLabel }} {{ $targetLabel }} @if ($isReadable) Readable @else Closed @endif
No takeover data available.
@include('settings.partials.pagination', ['items' => $takeovers])
@endif @if ($showTakeoverAccess) @endif @foreach ($accounts as $account) @php $isConfigManagedAccount = $protectedMailAccountEmails->contains(mb_strtolower((string) $account->email)); @endphp @if (! $isConfigManagedAccount) @endif @endforeach @if ($showTakeoverAccess) @foreach ($takeovers as $takeover) @endforeach @endif @endsection @section('script') @php $dashboardJsPath = public_path('assets/js/dashboard.js'); $dashboardJsVersion = file_exists($dashboardJsPath) ? filemtime($dashboardJsPath) : time(); @endphp @endsection