@extends('layouts.app') @section('title', 'Agent Management') @section('content')
Manage external sales agents and their hierarchy
| Agent | Matrix ID | Program | Upline | Team | Orders | Status | Actions |
|---|---|---|---|---|---|---|---|
|
{{ $agent->name }}
{{ $agent->email }}
|
{{ $agent->coupon_code }} |
@if($agent->commissionProgram)
@php
$programColors = [
'legacy' => 'bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200',
'progressive' => 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200',
'performance' => 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200',
];
$programColor = $programColors[$agent->commissionProgram->type] ?? 'bg-gray-100 text-gray-800';
@endphp
{{ $agent->commissionProgram->type === 'legacy' ? 'Legacy' : ($agent->commissionProgram->type === 'progressive' ? 'Prog' : 'Perf') }}
@if($agent->commissionProgram->type === 'legacy')
{{ number_format($agent->legacy_commission_rate ?? 0, 0) }}%
@elseif($agent->performanceTier)
{{ number_format($agent->performanceTier->commission_rate, 0) }}%
@else
10%
@endif
@else
-
@endif
|
@if($agent->upline) {{ $agent->upline->name }} @else - @endif | {{ $agent->downlines_count }} | {{ $agent->orders_count }} | {{ $agent->status_display }} |