completed clients and MNO module

This commit is contained in:
Kwesi Banson Jnr
2026-08-12 20:25:43 +00:00
parent cab4591777
commit 65245e5bc9
27 changed files with 1607 additions and 471 deletions

View File

@@ -38,9 +38,8 @@
</div>
</div>
<div>
<!-- Button to trigger the Edit modal or go to edit page -->
<button class="btn btn-primary fw-bold shadow-sm px-4" data-bs-toggle="modal" data-bs-target="#editClientModal">
<i class="bi bi-pencil-square me-2"></i> Edit Client
<button type="button" class="btn btn-sm btn-outline-primary edit-client-btn" data-client-id="{{ $showclient->id }}" data-bs-toggle="modal" data-bs-target="#editClientModal">
<i class="bi bi-pencil me-1"></i> Edit Client
</button>
</div>
</div>
@@ -129,11 +128,9 @@
<div class="mb-3">
<div class="text-muted small mb-2">Subscribed Services</div>
<div>
@php
$services = json_decode($showclient->services, true) ?? [];
@endphp
@if(count($services) > 0)
@foreach($services as $service)
@if(count($showclient->services) > 0)
@foreach($showclient->services as $service)
<span class="badge bg-secondary bg-opacity-10 text-secondary border me-1">{{ $service }}</span>
@endforeach
@else
@@ -156,16 +153,15 @@
<div class="mb-2">
<div class="text-muted small mb-1">Message Types</div>
<div>
@php
$msgTypes = json_decode($showclient->message_types, true) ?? [];
@endphp
@if(count($msgTypes) > 0)
@foreach($msgTypes as $type)
@if($showclient->message_types !== null)
@if(count($showclient->message_types) > 0)
@foreach($showclient->message_types as $type)
<span class="badge bg-info bg-opacity-10 text-info border border-info me-1">{{ $type }}</span>
@endforeach
@else
<span class="text-muted small">N/A</span>
@endif
@endif
</div>
</div>
</div>
@@ -250,11 +246,11 @@
</div>
<div class="card-body">
<!-- Helper Macro for JSON Emails/Phones -->
<!-- JSON Emails/Phones -->
@php
function renderBadges($jsonString, $type = 'email') {
$items = json_decode($jsonString, true) ?? [];
if(count($items) === 0) return '<span class="text-muted small">N/A</span>';
function renderBadges($items, $type = 'email') {
if(gettype($items) == 'string') return '<span class="text-muted small">'.$items.'</span>';
elseif(count($items) === 0) return '<span class="text-muted small">N/A</span>';
$html = '';
foreach($items as $item) {
$icon = $type == 'email' ? 'bi-envelope' : 'bi-telephone';
@@ -263,27 +259,43 @@
return $html;
}
@endphp
<div class="mb-3">
<div class="text-muted small mb-1">Finance Emails</div>
<div>{!! renderBadges($showclient->finance_email, 'email') !!}</div>
@if($showclient->finance_email == null)
<span class="text-muted small">N/A</span>
@else
<div>{!! renderBadges($showclient->finance_email, 'email') !!}</div>
@endif
</div>
<div class="mb-3">
<div class="text-muted small mb-1">Support Emails</div>
<div>{!! renderBadges($showclient->support_emails, 'email') !!}</div>
@if($showclient->support_emails == null)
<span class="text-muted small">N/A</span>
@else
<div>{!! renderBadges($showclient->support_emails, 'email') !!}</div>
@endif
</div>
<div class="mb-3">
<div class="text-muted small mb-1">Rate Emails</div>
<div>{!! renderBadges($showclient->rate_emails, 'email') !!}</div>
@if($showclient->rate_emails == null)
<span class="text-muted small">N/A</span>
@else
<div>{!! renderBadges($showclient->rate_emails, 'email') !!}</div>
@endif
</div>
<div class="mb-0">
<div class="text-muted small mb-1">Support Phones</div>
<div>{!! renderBadges($showclient->support_phones, 'phone') !!}</div>
@if($showclient->support_phones == null)
<span class="text-muted small">N/A</span>
@else
<div>{!! renderBadges($showclient->support_phones, 'phone') !!}</div>
@endif
</div>
</div>
</div>
@@ -440,6 +452,7 @@
</thead>
<tbody>
@foreach($recent_payments as $payment)
<?php //dump($payment); ?>
<tr>
<td class="fw-bold text-dark">{{ $payment->invoice_number ?? 'N/A' }}</td>
@@ -459,6 +472,7 @@
<span class="text-muted small">-</span>
@endif
</td>
<td>{{ $payment->invoice_amount }} </td>
<td class="text-muted small">{{ $payment->invoice_date ? \Carbon\Carbon::parse($payment->invoice_date)->format('d M Y') : 'N/A' }}</td>
<td>
<span class="badge bg-info bg-opacity-10 text-info text-uppercase">{{ $payment->invoice_status ?? 'Pending' }}</span>
@@ -558,9 +572,12 @@
</div>
@include('clients.partials.shortcode-payment-docs-modal')
@include('clients.partials.edit-modal')
@endsection
@push('scripts')
<script src="{{ asset('public/assets/js/client-show-modal.js') }}"></script>
<script>
</script>
@endpush
@endpush
0546907824