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

@@ -0,0 +1,103 @@
<div class="modal fade" id="editClientModal" tabindex="-1" aria-labelledby="editClientModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<form id="editClientForm" method="POST">
@csrf
@method('PUT')
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fw-bold" id="editClientModalLabel"><i class="bi bi-pencil-square text-primary me-2"></i>Edit Client Details</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row g-3">
<!-- Basic Info -->
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Client Name</label>
<input type="text" name="name" id="edit_name" class="form-control" required>
</div>
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Primary Email</label>
<input type="email" name="email" id="edit_email" class="form-control">
</div>
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Phone</label>
<input type="text" name="phone" id="edit_phone" class="form-control">
</div>
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Contact Person</label>
<input type="text" name="contact_person" id="edit_contact_person" class="form-control">
</div>
<!-- Categorization / Types -->
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Company Type</label>
<input type="text" name="company_type" id="edit_company_type" class="form-control">
</div>
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Contract Type</label>
<input type="text" name="contract_type" id="edit_contract_type" class="form-control">
</div>
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Industry</label>
<input type="text" name="industry" id="edit_industry" class="form-control">
</div>
<!-- Multi-select / Select2 Fields -->
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Services</label>
<select name="services[]" id="edit_services" class="form-select select2-tags" multiple="multiple"></select>
</div>
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Message Types</label>
<select name="message_types[]" id="edit_message_types" class="form-select select2-tags" multiple="multiple">
<option value="SMS">SMS</option>
<option value="USSD">USSD</option>
<option value="Voice">Voice</option>
<option value="Email">Email</option>
</select>
</div>
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Connections</label>
<select name="connections[]" id="edit_connections" class="form-select select2-tags" multiple="multiple"></select>
</div>
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Support Phones</label>
<select name="support_phones[]" id="edit_support_phones" class="form-select select2-tags" multiple="multiple"></select>
</div>
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Support Emails</label>
<select name="support_emails[]" id="edit_support_emails" class="form-select select2-tags" multiple="multiple"></select>
</div>
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Rate Emails</label>
<select name="rate_emails[]" id="edit_rate_emails" class="form-select select2-tags" multiple="multiple"></select>
</div>
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Support MS Teams</label>
<select name="support_skype[]" id="edit_support_skype" class="form-select select2-tags" multiple="multiple"></select>
</div>
<!-- Status & Meta -->
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Status</label>
<input type="text" name="status" id="edit_status" class="form-control">
</div>
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Currency</label>
<input type="text" name="currency" id="edit_currency" class="form-control">
</div>
<div class="col-md-4">
<label class="form-label text-muted small fw-bold">Country</label>
<input type="text" name="country" id="edit_country" class="form-control">
</div>
</div>
</div>
<div class="modal-footer bg-light">
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-sm px-4">Update Client</button>
</div>
</div>
</form>
</div>
</div>

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