@extends('layouts.app') @section('htmlheader_title') Systems @endsection @section('content')

{{ $o->name }}

@if($o->phone) @endif @if($o->addresses->count()) @endif
System Name {{ $o->name }} @can('update',$o)Edit@endcan
Sysop {{ $o->sysop }}
Location {{ $o->location }}
Address {{ $o->access_method }}
Mailer {{ $o->access_mailer }}
Phone {{ $o->phone }}
Last Seen {{ $o->logs_recent->count() ? $o->logs_recent->last()->created_at : '-' }}
FTN Addresses @foreach($o->addresses->sortBy('zone.domain.name')->groupBy('zone.domain.name') as $name => $children) @endforeach
Domain Addresses
{{ $name }} {{ $children->pluck('ftn3d')->join(', ') }}
Echoarea Activity @foreach($o->addresses->sortBy('zone.domain.name')->groupBy('zone.domain_id') as $did => $domain_addresses) @foreach(\App\Models\Echoarea::select([DB::raw('count(echomails.*) as count'),DB::raw('max(echomails.datetime) as most_recent')]) ->join('echomails',['echomails.echoarea_id'=>'echoareas.id']) ->join('echomail_seenby',function($join) use ($domain_addresses) { return $join->on('echomail_seenby.echomail_id','echomails.id') ->whereIn('echomail_seenby.address_id',$domain_addresses->pluck('id')); }) ->get() as $o) @if($o->count) @else @endif @endforeach @endforeach
Domain # Last
{{ $domain_addresses->first()->zone->domain->name }}{{ $o->count }} {{ $o->most_recent }}No Echoarea Activity
@endsection