@extends('layouts.admin', ['heading' => 'Matrix Tree View', 'subheading' => 'Fixed width matrix network structure']) @section('content')
@if($member)
Root: {{ $member->member_code }} - {{ $member->name }}
Plan {{ strtoupper($plan) }} | Width {{ $width }} | Levels {{ $maxDepth }}
@for($depth = 1; $depth <= $maxDepth; $depth++) @php $nodes = $levels[$depth] ?? collect(); $slots = min($width ** $depth, 200); @endphp
Level {{ $depth }} ({{ $nodes->count() }}/{{ $slots }} filled)
@for($slot = 1; $slot <= $slots; $slot++) @php $node = $nodes->get($slot - 1); @endphp
@if($node)
{{ $node->member_code }}
{{ $node->name }}
{{ ucfirst($node->status) }}
@else
Empty #{{ $slot }}
@endif
@endfor
@endfor
@else
Search a member to view matrix structure.
@endif @endsection