@extends('admin.layouts.app') @section('title', 'Duplikátum detektálás') @section('header', 'Duplikátum detektálás') @section('breadcrumb') / Kapcsolatok / Duplikátumok @endsection @section('header-actions') Vissza @endsection @section('content') @if($pairs->isEmpty())

Nincs duplikátum

Nem található egyező email, telefon vagy névvel rendelkező kapcsolat.

@else
{{ $pairs->count() }} potenciális duplikátum pár található
Ellenőrizd és vond össze az egyező kapcsolatokat.
@foreach($pairs as $i => $pair) @php $a = $pair['a']; $b = $pair['b']; $reasons = $pair['reasons']; $reasonLabels = ['email' => 'Email egyezés', 'phone' => 'Telefon egyezés', 'name' => 'Névegyezés']; $reasonColors = ['email' => '#405189', 'phone' => '#0ab39c', 'name' => '#f7b84b']; @endphp
{{-- Header --}}
#{{ $i + 1 }} @foreach($reasons as $r) {{ $reasonLabels[$r] ?? $r }} @endforeach
{{-- Side-by-side --}}
@foreach([$a, $b] as $ci => $c)
{{-- Avatar + name --}}
@if($c->photo) @else {{ strtoupper(substr($c->first_name,0,1)) }} @endif
{{ $c->last_name }} {{ $c->first_name }}
ID: {{ $c->id }} · {{ $c->created_at->format('Y. m. d.') }}
{{-- Fields --}} @php $fields = [ 'Email' => $c->email, 'Telefon' => $c->phone, 'Mobil' => $c->mobile, 'Város' => $c->city, 'Státusz' => $c->status, 'Forrás' => $c->source, 'Hírlevél'=> $c->is_subscribed ? 'Igen' : 'Nem', 'Csoportok' => $c->groups->pluck('name')->join(', ') ?: null, 'Adományok' => $c->donation_count > 0 ? $c->donation_count . ' db / ' . number_format($c->total_donated, 0, ',', ' ') . ' Ft' : null, 'Megjegyzés' => $c->notes, ]; @endphp
@foreach($fields as $label => $value) @if($value)
{{ $label }} {{ $value }}
@endif @endforeach
@endforeach
@endforeach @endif {{-- ── MERGE MODAL ──────────────────────────────────────── --}} @push('scripts') @php $pairData = $pairs->map(function ($p) { return [ 'a' => [ 'id' => $p['a']->id, 'name' => $p['a']->last_name . ' ' . $p['a']->first_name, 'detail' => $p['a']->email ?: ($p['a']->phone ?: $p['a']->city), ], 'b' => [ 'id' => $p['b']->id, 'name' => $p['b']->last_name . ' ' . $p['b']->first_name, 'detail' => $p['b']->email ?: ($p['b']->phone ?: $p['b']->city), ], ]; })->values(); @endphp @endpush @endsection