{{-- resources/views/pesanan_kartu/index.blade.php --}} @extends('layouts.dashboard') @section('title', 'Pesanan Kartu Anggota') @section('page-title', 'Kelola Pesanan Kartu') @section('content') @php $authUser = auth()->user(); $role = strtolower(trim((string) ($authUser->role ?? ''))); $rolesBolehPesan = [ 'superadmin','dpp','dpd_pengurus','dpd_operator','dpc_pengurus','dpc_operator','ranting_pengurus','ranting_operator', ]; $rolesBolehProses = ['joudie', 'dpp', 'superadmin']; $rolesBolehAktif = ['joudie']; $canPesan = in_array($role, $rolesBolehPesan, true); $canProses = in_array($role, $rolesBolehProses, true); $canAktif = in_array($role, $rolesBolehAktif, true); @endphp @push('styles') @endpush

Pesanan Kartu Anggota

{{ $pesanan->total() }} pesanan ditemukan
@if($canPesan) Buat Nota Baru @endif
Total Pesanan
{{ number_format($pesanan->total(), 0, ',', '.') }}
Halaman Aktif
{{ $pesanan->currentPage() }}
Per Halaman
{{ $pesanan->perPage() }}
Data Tampil
{{ $pesanan->count() }}
Keterangan Pemesanan Kartu Anggota
Saat melakukan pemesanan kartu anggota, pembayaran dilakukan terlebih dahulu melalui rekening berikut:
Rekening Pembayaran
BRI Koperasi Inkonera
2180.01.000571.304
  • Upload bukti pembayaran melalui nota pesanan di aplikasi KTA HNSI.
  • Setelah pembayaran berhasil dan diverifikasi, kartu anggota elektronik sudah bisa di-download oleh operator.
  • Kartu anggota elektronik tersebut selanjutnya bisa dicetak dalam bentuk fisik.
{{-- Desktop / tablet besar --}}
@forelse($pesanan as $nota) @php $namaPemesan = $nota->nama_pemesan ?? null; $nikPemesan = $nota->nik ?? null; $waPemesan = $nota->nomor_wa_pemesan ?? $nota->hp_pemesan ?? $nota->nomor_wa ?? null; $provNama = $nota->provinsi_pemesan ?? $nota->prov ?? $nota->provinsi ?? $nota->provinsi_name ?? $nota->prov_name ?? null; $kabNama = $nota->kabupaten_pemesan ?? $nota->kab ?? $nota->kabupaten ?? $nota->kota_name ?? $nota->kabupaten_name ?? $nota->kota ?? null; $kecNama = $nota->kecamatan_pemesan ?? $nota->kec ?? $nota->kecamatan ?? $nota->kecamatan_name ?? null; $provId = $nota->prov_id ?? $nota->alamat_provinsi_id ?? $nota->alamatprovinsiid ?? $nota->provinsi_id ?? $nota->province_id ?? null; $kotaId = $nota->kota_id ?? $nota->kab_id ?? $nota->alamat_kota_id ?? $nota->alamatkotaid ?? $nota->alamat_kabupaten_id ?? $nota->alamatkabupatenid ?? $nota->kabupaten_id ?? $nota->regency_id ?? $nota->city_id ?? null; $kecId = $nota->kec_id ?? $nota->alamat_kecamatan_id ?? $nota->alamatkecamatanid ?? $nota->kecamatan_id ?? $nota->district_id ?? null; $provTampil = (!is_null($provNama) && trim((string) $provNama) !== '') ? $provNama : ((!is_null($provId) && trim((string) $provId) !== '') ? ('Prov ID: ' . $provId) : null); $kabTampil = (!is_null($kabNama) && trim((string) $kabNama) !== '') ? $kabNama : ((!is_null($kotaId) && trim((string) $kotaId) !== '') ? ('Kab/Kota ID: ' . $kotaId) : null); $kecTampil = (!is_null($kecNama) && trim((string) $kecNama) !== '') ? $kecNama : ((!is_null($kecId) && trim((string) $kecId) !== '') ? ('Kec ID: ' . $kecId) : null); $lokParts = array_values(array_filter([$provTampil, $kabTampil, $kecTampil], fn($v) => !is_null($v) && trim((string) $v) !== '')); $lokasiTampil = count($lokParts) ? implode(', ', $lokParts) : '-'; $total = (int) ($nota->total_harga ?? 0); $jmlItem = (int) ($nota->jml_item ?? 0); $statusBayar = strtolower(trim((string) ($nota->status_bayar ?? 'belum'))); $statusBayar = in_array($statusBayar, ['belum','lunas','gratis'], true) ? $statusBayar : 'belum'; $bgClass = match($statusBayar) { 'lunas' => 'success', 'gratis' => 'info', default => 'warning', }; $statusKartuRaw = $nota->status_kartu ?? ($nota->statuskartu ?? null); $statusKartu = strtolower(trim((string) ($statusKartuRaw ?? ''))); $badgeKartu = match($statusKartu) { 'pesan' => 'warning', 'proses' => 'primary', 'aktif' => 'success', 'batal' => 'danger', default => 'secondary', }; $labelKartu = match($statusKartu) { 'pesan' => 'Pesan', 'proses' => 'Proses', 'aktif' => 'Aktif', 'batal' => 'Batal', default => '-', }; $buktiPath = $nota->bukti_transfer ?? null; $hasBukti = is_string($buktiPath) && trim($buktiPath) !== ''; $tglTampil = '-'; try { if (!empty($nota->tgl_pesan)) { $tglTampil = \Carbon\Carbon::parse($nota->tgl_pesan)->format('d/m/Y'); } } catch (\Throwable $e) { $tglTampil = '-'; } $bolehProsesUi = $canProses && ($statusKartu === 'pesan'); $bolehAktifUi = $canAktif && ($statusKartu === 'proses'); $disableHapus = in_array($statusKartu, ['proses', 'aktif'], true); @endphp @empty @endforelse
No. Pesanan Tgl Pesan Pemesan Bukti Jml Item Total Billing Bayar Status Kartu Aksi
#{{ $nota->no_pesanan }}
{{ $tglTampil }}
{{ $namaPemesan ?: ($nikPemesan ?: 'Anonim') }}
@if(!empty($waPemesan)) {{ $waPemesan }} @endif {{ $lokasiTampil }} @if($lokasiTampil === '-' && empty($provId) && empty($kotaId) && empty($kecId)) Alamat belum diisi. @endif
@if($hasBukti) @endif
{{ $hasBukti ? 'Sudah upload' : 'Belum ada' }}
{{ $jmlItem }} Rp {{ number_format($total, 0, ',', '.') }} {{ ucfirst($statusBayar) }} {{ $labelKartu }}
@if($bolehProsesUi) @endif @if($bolehAktifUi) @endif @if(!$disableHapus)
@csrf @method('DELETE')
@endif
Belum ada pesanan kartu

Mulai buat nota pesanan pertama Anda

{{-- Mobile --}}
@forelse($pesanan as $nota) @php $namaPemesan = $nota->nama_pemesan ?? null; $nikPemesan = $nota->nik ?? null; $waPemesan = $nota->nomor_wa_pemesan ?? $nota->hp_pemesan ?? $nota->nomor_wa ?? null; $provNama = $nota->provinsi_pemesan ?? $nota->prov ?? $nota->provinsi ?? $nota->provinsi_name ?? $nota->prov_name ?? null; $kabNama = $nota->kabupaten_pemesan ?? $nota->kab ?? $nota->kabupaten ?? $nota->kota_name ?? $nota->kabupaten_name ?? $nota->kota ?? null; $kecNama = $nota->kecamatan_pemesan ?? $nota->kec ?? $nota->kecamatan ?? $nota->kecamatan_name ?? null; $provId = $nota->prov_id ?? $nota->alamat_provinsi_id ?? $nota->alamatprovinsiid ?? $nota->provinsi_id ?? $nota->province_id ?? null; $kotaId = $nota->kota_id ?? $nota->kab_id ?? $nota->alamat_kota_id ?? $nota->alamatkotaid ?? $nota->alamat_kabupaten_id ?? $nota->alamatkabupatenid ?? $nota->kabupaten_id ?? $nota->regency_id ?? $nota->city_id ?? null; $kecId = $nota->kec_id ?? $nota->alamat_kecamatan_id ?? $nota->alamatkecamatanid ?? $nota->kecamatan_id ?? $nota->district_id ?? null; $provTampil = (!is_null($provNama) && trim((string) $provNama) !== '') ? $provNama : ((!is_null($provId) && trim((string) $provId) !== '') ? ('Prov ID: ' . $provId) : null); $kabTampil = (!is_null($kabNama) && trim((string) $kabNama) !== '') ? $kabNama : ((!is_null($kotaId) && trim((string) $kotaId) !== '') ? ('Kab/Kota ID: ' . $kotaId) : null); $kecTampil = (!is_null($kecNama) && trim((string) $kecNama) !== '') ? $kecNama : ((!is_null($kecId) && trim((string) $kecId) !== '') ? ('Kec ID: ' . $kecId) : null); $lokParts = array_values(array_filter([$provTampil, $kabTampil, $kecTampil], fn($v) => !is_null($v) && trim((string) $v) !== '')); $lokasiTampil = count($lokParts) ? implode(', ', $lokParts) : '-'; $total = (int) ($nota->total_harga ?? 0); $jmlItem = (int) ($nota->jml_item ?? 0); $statusBayar = strtolower(trim((string) ($nota->status_bayar ?? 'belum'))); $statusBayar = in_array($statusBayar, ['belum','lunas','gratis'], true) ? $statusBayar : 'belum'; $bgClass = match($statusBayar) { 'lunas' => 'success', 'gratis' => 'info', default => 'warning', }; $statusKartuRaw = $nota->status_kartu ?? ($nota->statuskartu ?? null); $statusKartu = strtolower(trim((string) ($statusKartuRaw ?? ''))); $badgeKartu = match($statusKartu) { 'pesan' => 'warning', 'proses' => 'primary', 'aktif' => 'success', 'batal' => 'danger', default => 'secondary', }; $labelKartu = match($statusKartu) { 'pesan' => 'Pesan', 'proses' => 'Proses', 'aktif' => 'Aktif', 'batal' => 'Batal', default => '-', }; $buktiPath = $nota->bukti_transfer ?? null; $hasBukti = is_string($buktiPath) && trim($buktiPath) !== ''; $tglTampil = '-'; try { if (!empty($nota->tgl_pesan)) { $tglTampil = \Carbon\Carbon::parse($nota->tgl_pesan)->format('d/m/Y'); } } catch (\Throwable $e) { $tglTampil = '-'; } $bolehProsesUi = $canProses && ($statusKartu === 'pesan'); $bolehAktifUi = $canAktif && ($statusKartu === 'proses'); $disableHapus = in_array($statusKartu, ['proses', 'aktif'], true); @endphp
#{{ $nota->no_pesanan }}
{{ $tglTampil }}
{{ $labelKartu }}
Pemesan
{{ $namaPemesan ?: ($nikPemesan ?: 'Anonim') }}
@if(!empty($waPemesan))
{{ $waPemesan }}
@endif
{{ $lokasiTampil }}
Jumlah Item
{{ $jmlItem }}
Total
Rp {{ number_format($total, 0, ',', '.') }}
Billing Bayar
{{ ucfirst($statusBayar) }}
Bukti
{{ $hasBukti ? 'Sudah upload' : 'Belum ada' }}
Aksi Bukti
@if($hasBukti) Lihat Download @endif
Aksi Nota
@if($bolehProsesUi) @endif @if($bolehAktifUi) @endif @if(!$disableHapus)
@csrf @method('DELETE')
@endif
@empty
Belum ada pesanan kartu

Mulai buat nota pesanan pertama Anda

@endforelse
@if($pesanan->hasPages()) @endif
{{-- MODAL UPLOAD BUKTI TRANSFER --}} {{-- MODAL PROSES --}} {{-- MODAL AKTIF --}} {{-- MODAL DETAIL --}} {{-- TOAST SUCCESS --}} @if(session('success'))
@endif @endsection @push('scripts') @endpush