@extends('layouts.master') @section('title', 'Pelanggan') @section('page-title', 'Master Pelanggan') @section('css') @endsection @section('content')

Master Pelanggan

Kelola data pelanggan, status layanan, dan lokasi instalasi.
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
Filter Pelanggan
Reset
@php $no = $pelanggan->firstItem(); @endphp @forelse ($pelanggan as $row) @empty @endforelse
# Kode Nama WA Paket Router Alamat Status Aksi
{{ $no++ }} {{ $row->kode_pelanggan }}
{{ $row->nama }}
@php $tipe = (string) ($row->tipe_autentikasi ?? 'hotspot_user'); $tipeBadge = $tipe === 'ip_binding' ? 'dark' : 'primary'; $tipeLabel = $tipe === 'ip_binding' ? 'IP Binding' : 'Hotspot User'; @endphp {{ $tipeLabel }}
WA: {{ $row->nomor_wa ?: '-' }}
Paket: {{ $row->paket->nama ?? '-' }}
Router: {{ $row->mikrotikServer->name ?? '-' }}
{{ $row->alamat }}
@php $syncStatus = $tipe === 'ip_binding' ? (string) ($row->ip_binding_last_sync_status ?? '') : (string) ($row->hotspot_last_sync_status ?? ''); $syncBadge = $syncStatus === 'success' ? 'success' : ($syncStatus === 'failed' ? 'danger' : 'secondary'); $syncLabel = $syncStatus === 'success' ? 'Sinkron OK' : ($syncStatus === 'failed' ? 'Sinkron Gagal' : 'Belum Sinkron'); @endphp {{ $syncLabel }}
{{ $row->nomor_wa ?: '-' }} {{ $row->paket->nama ?? '-' }} {{ $row->mikrotikServer->name ?? '-' }} {{ $row->alamat }} @php $badge = [ 'aktif' => 'success', 'menunggak' => 'warning', 'non_aktif' => 'secondary', 'putus' => 'danger', ][$row->status] ?? 'secondary'; @endphp {{ ucfirst(str_replace('_', ' ', $row->status)) }} Profil @if (($row->tipe_autentikasi ?? 'hotspot_user') !== 'hotspot_user')
@csrf
@endif @if ($row->latitude && $row->longitude) @php $lat = (float) $row->latitude; $lng = (float) $row->longitude; $gmapsUrl = "https://www.google.com/maps/dir/?api=1&destination={$lat},{$lng}&travelmode=driving"; @endphp Rute @else @endif Edit
@csrf @method('delete')
Belum ada data pelanggan.
{{ $pelanggan->withQueryString()->links() }}
@endsection