@extends('layouts.main') @section('content')
@php $uCard = auth()->user(); $pCard = optional($uCard->profile); $provinceCard = optional($pCard->province)->name ?? ($pCard->other_province ?? null); $regencyCard = optional($pCard->regency)->name ?? ($pCard->other_regency ?? null); $districtCard = optional($pCard->district)->name ?? ($pCard->other_district ?? null); @endphp
@if($pCard && $pCard->foto) {{ $uCard->name }} @else Default photo @endif
{{ $uCard->name ?? '-' }}
@php // Ambil semua role yang dimiliki user menggunakan helper method $allUserRoles = $uCard ? $uCard->getAllRoles() : []; @endphp @if(!empty($allUserRoles))
@foreach($allUserRoles as $role) {{ ucfirst($role) }} @endforeach
@endif @if($uCard->email)
{{ $uCard->email }}
@endif
@php $keanggotaan = $uCard->keanggotaan ?? null; $isAnggotaAktif = $keanggotaan && $keanggotaan->status === 'aktif'; $isPending = $keanggotaan && $keanggotaan->status === 'pending'; @endphp @if($isAnggotaAktif)
@php $titleVisible = data_get($cardSetting, 'title.visible', true); @endphp @if($titleVisible)
{{ data_get($cardSetting, 'title.text', '') }}
@endif
@if($pCard && $pCard->foto) @else @endif
@php // Prioritaskan nomor anggota, jika tidak ada baru gunakan ID $qrData = !empty($keanggotaan->nomor_anggota) ? $keanggotaan->nomor_anggota : ($uCard->id ?? ''); $qrSvg = \SimpleSoftwareIO\QrCode\Facades\QrCode::size(80)->generate($qrData); $qrBase64 = base64_encode($qrSvg); @endphp QR Code
@else

Bergabung Sebagai Anggota KOGTIK

@if($isPending)

Permohonan Anda sedang menunggu persetujuan administrator.

Status: Pending
@else

Dapatkan akses ke berbagai manfaat keanggotaan dan kartu anggota resmi.

@csrf
@endif
@endif
@php $user = auth()->user(); $isSuperAdmin = $user->role === 'superadmin'; $isAdmin = $user->role === 'admin'; $userKeanggotaan = $user->keanggotaan ?? null; $userIsAnggotaAktif = $userKeanggotaan && $userKeanggotaan->status === 'aktif'; // Tampilkan tombol jika: // - Superadmin atau Admin // - DAN user adalah anggota aktif (karena setting hanya untuk kartu anggota) $shouldShowButtons = ($isSuperAdmin || $isAdmin) && $userIsAnggotaAktif; @endphp {{-- Tiga tombol utama --}} @if($shouldShowButtons)
@endif

Data Profile

Edit Profile
@php $p = optional($user->profile); $provinceName = optional($p->province)->name ?? ($p->other_province ?? null); $regencyName = optional($p->regency)->name ?? ($p->other_regency ?? null); $districtName = optional($p->district)->name ?? ($p->other_district ?? null); @endphp

Informasi Pribadi

{{ $user->name ?? '-' }}

{{ $user->email ?? '-' }}

@if($p && $p->no_hp)

{{ $p->no_hp }}

@endif @if($p && $p->jenis_kelamin)

{{ $p->jenis_kelamin }}

@endif @if($p && $p->tanggal_lahir)

{{ \Carbon\Carbon::parse($p->tanggal_lahir)->format('d F Y') }}

@endif
@if($p && ($p->pekerjaan || $p->jabatan))

Informasi Profesi

@if($p->jabatan)

{{ $p->jabatan }}

@endif @if($p->pekerjaan)

{{ $p->pekerjaan }}

@endif
@endif @if($p && $p->alamat)

Alamat

{{ $p->alamat }}

@endif @if($provinceName || $regencyName || $districtName)

Informasi Wilayah

@if($provinceName)

{{ $provinceName }}

@endif @if($regencyName)

{{ $regencyName }}

@endif @if($districtName)

{{ $districtName }}

@endif
@endif @if($user->keanggotaan)

Informasi Keanggotaan

@if($user->keanggotaan->nomor_anggota)

{{ $user->keanggotaan->nomor_anggota }}

@endif @if($user->keanggotaan->status)

{{ ucfirst($user->keanggotaan->status) }}

@endif
@endif
@php $currentUser = auth()->user(); $currentUserKeanggotaan = $currentUser->keanggotaan ?? null; $currentUserIsAnggotaAktif = $currentUserKeanggotaan && $currentUserKeanggotaan->status === 'aktif'; @endphp @if($currentUserIsAnggotaAktif)

Pengaturan Teks Kartu

Mengedit: Pilih teks pada kartu
x
@php $bgDir = public_path('assets/images/card'); $bgFiles = glob($bgDir . '/*.{png,jpg,jpeg,gif,webp}', GLOB_BRACE); @endphp @if(count($bgFiles) > 0) @foreach($bgFiles as $file) @php $filename = basename($file); @endphp @php $isUploaded = DB::table('idcardbegrounds')->where('filename', $filename)->exists(); @endphp
{{ $filename }} @if($isUploaded) @endif
@endforeach @endif
@endif @endsection @push('styles') @endpush