@extends('layouts.master') @section('title', 'Profil Pelanggan') @section('page-title', 'Profil Pelanggan') @section('css') @endsection @section('content')
@if ($pelanggan->foto_pelanggan) Foto Pelanggan @else {{ strtoupper(substr((string) $pelanggan->nama, 0, 1)) }} @endif

{{ $pelanggan->nama }}

Kode: {{ $pelanggan->kode_pelanggan ?: '-' }}
@php $badge = [ 'aktif' => 'success', 'menunggak' => 'warning', 'non_aktif' => 'secondary', 'putus' => 'danger', ][$pelanggan->status] ?? 'secondary'; @endphp {{ ucfirst(str_replace('_', ' ', $pelanggan->status)) }} {{ $pelanggan->paketInternet->nama ?? 'Paket belum dipilih' }} @php $tipe = (string) ($pelanggan->tipe_autentikasi ?? 'hotspot_user'); @endphp {{ $tipe === 'ip_binding' ? 'IP Binding' : 'Hotspot User' }}
@if (($pelanggan->tipe_autentikasi ?? 'hotspot_user') !== 'hotspot_user')
@csrf
@endif Edit Kembali
Tagihan
{{ number_format($summary['jumlah_tagihan'], 0, ',', '.') }}
Lunas
{{ number_format($summary['jumlah_lunas'], 0, ',', '.') }}
Belum Lunas
{{ number_format($summary['jumlah_belum_lunas'], 0, ',', '.') }}
Total Tagihan
Rp {{ number_format($summary['total_tagihan'], 0, ',', '.') }}
Terbayar
Rp {{ number_format($summary['total_terbayar'], 0, ',', '.') }}
Sisa
Rp {{ number_format($summary['sisa'], 0, ',', '.') }}
Identitas & Kontak
Nama
{{ $pelanggan->nama ?: '-' }}
WhatsApp
{{ $pelanggan->nomor_wa ?: '-' }}
WA Alternatif
{{ $pelanggan->nomor_wa_alt ?: '-' }}
Telepon Lain
{{ $pelanggan->telepon_lain ?: '-' }}
Tanggal Aktif
{{ optional($pelanggan->tanggal_aktif)->format('d-m-Y') ?: '-' }}
Router MikroTik
@if ($pelanggan->mikrotikServer) {{ $pelanggan->mikrotikServer->name }} {{ $pelanggan->mikrotikServer->host }}:{{ $pelanggan->mikrotikServer->port }} @else - @endif
Hotspot Username
{{ $pelanggan->hotspot_username ?: '-' }}
IP Binding
@if ($pelanggan->hotspot_ip_binding_id) {{ $pelanggan->hotspot_ip_binding_address ?: '-' }} / {{ $pelanggan->hotspot_ip_binding_mac ?: '-' }} {{ $pelanggan->hotspot_ip_binding_type ?: '-' }} @if($pelanggan->hotspot_ip_binding_comment) | {{ $pelanggan->hotspot_ip_binding_comment }} @endif @else - @endif
Status Sinkron {{ ($pelanggan->tipe_autentikasi ?? 'hotspot_user') === 'ip_binding' ? 'IP Binding' : 'Hotspot' }}
@php $isIpBinding = ($pelanggan->tipe_autentikasi ?? 'hotspot_user') === 'ip_binding'; $syncStatus = $isIpBinding ? (string) ($pelanggan->ip_binding_last_sync_status ?? '') : (string) ($pelanggan->hotspot_last_sync_status ?? ''); $syncAt = $isIpBinding ? $pelanggan->ip_binding_last_sync_at : $pelanggan->hotspot_last_sync_at; $syncMessage = $isIpBinding ? (string) ($pelanggan->ip_binding_last_sync_message ?? '') : (string) ($pelanggan->hotspot_last_sync_message ?? ''); $syncBadge = $syncStatus === 'success' ? 'success' : ($syncStatus === 'failed' ? 'danger' : 'secondary'); $syncLabel = $syncStatus === 'success' ? 'Sukses' : ($syncStatus === 'failed' ? 'Gagal' : 'Belum Pernah'); @endphp {{ $syncLabel }} @if ($syncAt) {{ $syncAt->format('d-m-Y H:i:s') }} @endif @if ($syncMessage !== '') {{ $syncMessage }} @endif
Pembayaran Terakhir
@if ($summary['last_payment']) {{ optional($summary['last_payment']->tanggal_bayar)->format('d-m-Y') ?: '-' }} Rp {{ number_format((float) $summary['last_payment']->nominal_bayar, 0, ',', '.') }} @else - @endif
Alamat, Wilayah & Foto
Alamat
{{ $pelanggan->alamat ?: '-' }}
Wilayah
{{ $pelanggan->desa ?: '-' }}, {{ $pelanggan->kecamatan ?: '-' }}, {{ $pelanggan->kabupaten ?: '-' }}, {{ $pelanggan->provinsi ?: '-' }}
Koordinat
@if ($pelanggan->latitude && $pelanggan->longitude) {{ $pelanggan->latitude }}, {{ $pelanggan->longitude }} @php $gmapsUrl = "https://www.google.com/maps/dir/?api=1&destination={$pelanggan->latitude},{$pelanggan->longitude}&travelmode=driving"; @endphp Buka Peta @else - @endif
Catatan
{{ $pelanggan->catatan ?: '-' }}
Foto Profil
@if ($pelanggan->foto_pelanggan) Foto Pelanggan @else
Belum ada foto pelanggan
@endif
Foto Lokasi
@if ($pelanggan->foto_lokasi) Foto Lokasi @else
Belum ada foto lokasi
@endif
Grafik Pembayaran per Bulan (12 Bulan Terakhir)
Membandingkan total tagihan terbit dan nominal pembayaran masuk per bulan.
@forelse ($riwayatTagihan as $t) @php $terbayar = (float) ($t->total_terbayar_db ?? 0); $sisa = max(0, (float) ($t->total_tagihan ?? 0) - $terbayar); $statusBadge = [ 'terbit' => 'info', 'lunas' => 'success', 'draft' => 'secondary', 'batal' => 'danger', ][$t->status] ?? 'secondary'; @endphp @empty @endforelse
Periode Paket Tagihan Terbayar Sisa Status Jatuh Tempo Aksi
{{ optional($t->periode)->format('M Y') }} {{ $t->paketInternet->nama ?? '-' }} Rp {{ number_format((float) $t->total_tagihan, 0, ',', '.') }} Rp {{ number_format($terbayar, 0, ',', '.') }} Rp {{ number_format($sisa, 0, ',', '.') }} {{ strtoupper($t->status) }} {{ optional($t->jatuh_tempo)->format('d-m-Y') ?: '-' }}
Belum ada riwayat tagihan.
{{ $riwayatTagihan->withQueryString()->links() }}
@endsection @section('script') @endsection @section('scripts') @endsection