worked on short code and sender ID modules
This commit is contained in:
@@ -3,7 +3,22 @@
|
||||
@section('title', 'Click ERP - SMS Sender IDs')
|
||||
|
||||
@push('styles')
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
||||
<style>
|
||||
/* Keep your existing styles here... */
|
||||
|
||||
/* Select2 Bootstrap 5 / Custom tweaks */
|
||||
.select2-container .select2-selection--single {
|
||||
height: 38px;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 0.375rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.network-badge { font-size: 0.65rem; padding: 0.2rem 0.4rem; border-radius: 4px; border: 1px solid #e2e8f0; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
|
||||
.net-approved { background-color: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
|
||||
.net-pending { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; border-color: rgba(245, 158, 11, 0.2); }
|
||||
@@ -29,34 +44,35 @@
|
||||
<p class="text-secondary mb-0" style="font-size: 0.9rem;">Manage alphanumeric masks, shortcodes, and MNO registration statuses.</p>
|
||||
</div>
|
||||
<button class="btn text-white fw-bold d-flex align-items-center" style="background-color: #5c4df0; border-radius: 8px;" id="btnOpenSenderModal">
|
||||
<i class="bi bi-plus-lg me-2"></i> Request Sender ID
|
||||
<i class="bi bi-plus-lg me-2"></i> Add Sender ID
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- KPIs -->
|
||||
<!-- KPIs -->
|
||||
<div class="row g-4 mb-4">
|
||||
<div class="col-xl-3 col-md-6">
|
||||
<div class="content-card p-3 h-100 border-start border-4 border-0" style="border-left-color: #5c4df0 !important;">
|
||||
<div class="text-secondary fw-bold mb-1" style="font-size: 0.75rem; letter-spacing: 0.5px;">TOTAL SENDER IDs</div>
|
||||
<h3 class="fw-bold mb-0">48</h3>
|
||||
<h3 class="fw-bold mb-0">{{ $totalCount }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-md-6">
|
||||
<div class="content-card p-3 h-100 border-start border-4 border-0" style="border-left-color: #10b981 !important;">
|
||||
<div class="text-secondary fw-bold mb-1" style="font-size: 0.75rem; letter-spacing: 0.5px;">FULLY APPROVED</div>
|
||||
<h3 class="fw-bold mb-0">36</h3>
|
||||
<h3 class="fw-bold mb-0">{{ $approvedCount }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-md-6">
|
||||
<div class="content-card p-3 h-100 border-start border-4 border-0" style="border-left-color: #f59e0b !important;">
|
||||
<div class="text-secondary fw-bold mb-1" style="font-size: 0.75rem; letter-spacing: 0.5px;">PENDING MNO REVIEW</div>
|
||||
<h3 class="fw-bold mb-0">9</h3>
|
||||
<div class="text-secondary fw-bold mb-1" style="font-size: 0.75rem; letter-spacing: 0.5px;">APPLIED</div>
|
||||
<h3 class="fw-bold mb-0">{{ $pendingCount }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-md-6">
|
||||
<div class="content-card p-3 h-100 border-start border-4 border-0" style="border-left-color: #ef4444 !important;">
|
||||
<div class="text-secondary fw-bold mb-1" style="font-size: 0.75rem; letter-spacing: 0.5px;">REJECTED / BLOCKED</div>
|
||||
<h3 class="fw-bold mb-0">3</h3>
|
||||
<h3 class="fw-bold mb-0">{{ $rejectedCount }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,120 +80,119 @@
|
||||
<!-- Data Table -->
|
||||
<div class="content-card">
|
||||
<div class="p-3 border-bottom bg-light bg-opacity-50">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-5">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-white border-end-0 text-secondary"><i class="bi bi-search"></i></span>
|
||||
<input type="text" class="form-control bg-white border-start-0 ps-0" placeholder="Search by sender name or client...">
|
||||
<form action="{{ route('senderids.index') }}" method="GET">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-5">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-white border-end-0 text-secondary"><i class="bi bi-search"></i></span>
|
||||
<input type="text" name="search" value="{{ request('search') }}" class="form-control bg-white border-start-0 ps-0" placeholder="Search by sender ID, MNO, or supplier...">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select name="direct_mno" class="form-select bg-white" onchange="this.form.submit()">
|
||||
<option value="">Direct MNO: All</option>
|
||||
<option value="YES" {{ request('direct_mno') == 'YES' ? 'selected' : '' }}>YES</option>
|
||||
<option value="NO" {{ request('direct_mno') == 'NO' ? 'selected' : '' }}>NO</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select name="status" class="form-select bg-white" onchange="this.form.submit()">
|
||||
<option value="">Status: All</option>
|
||||
<option value="Approved" {{ request('status') == 'Approved' ? 'selected' : '' }}>Approved</option>
|
||||
<option value="Applied" {{ request('status') == 'Applied' ? 'selected' : '' }}>Applied</option>
|
||||
<option value="Rejected" {{ request('status') == 'Rejected' ? 'selected' : '' }}>Rejected</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<button type="submit" class="btn text-white w-100" style="background-color: #5c4df0;">
|
||||
<i class="bi bi-funnel"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select class="form-select bg-white">
|
||||
<option value="">All Clients</option>
|
||||
<option value="client_1">Click Tech Corp</option>
|
||||
<option value="client_2">Alpha Telecom</option>
|
||||
<option value="internal">Internal System</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select class="form-select bg-white">
|
||||
<option value="">Status: All</option>
|
||||
<option value="approved">Fully Approved</option>
|
||||
<option value="pending">Pending Review</option>
|
||||
<option value="rejected">Rejected</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<button class="btn btn-secondary w-100"><i class="bi bi-funnel"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-custom table-hover mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sender Name</th>
|
||||
<th>Client / Owner</th>
|
||||
<th>Type</th>
|
||||
<th>Network Status</th>
|
||||
<th>Global Status</th>
|
||||
<th>Sender ID</th>
|
||||
<th>Direct MNO</th>
|
||||
<th>MNO/Supplier</th>
|
||||
<th>Type & Bind</th>
|
||||
<th>Status</th>
|
||||
<th class="text-end">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Row 1 -->
|
||||
<tr>
|
||||
<td>
|
||||
<div class="sender-id-text fw-bold">ABSA-OTP</div>
|
||||
<div class="text-secondary mt-1" style="font-size: 0.75rem;">Created: May 12, 2026</div>
|
||||
</td>
|
||||
<td><span class="badge bg-dark bg-opacity-10 text-dark border">Internal System</span></td>
|
||||
<td><span class="badge bg-secondary bg-opacity-10 text-secondary border">Alphanumeric</span></td>
|
||||
<td>
|
||||
<div class="d-flex gap-1 flex-wrap">
|
||||
<span class="network-badge net-approved"><i class="bi bi-check-circle-fill"></i> MTN</span>
|
||||
<span class="network-badge net-approved"><i class="bi bi-check-circle-fill"></i> Telecel</span>
|
||||
<span class="network-badge net-approved"><i class="bi bi-check-circle-fill"></i> AT</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><span class="badge bg-success bg-opacity-10 text-success px-2 py-1"><i class="bi bi-check-all me-1"></i>Active</span></td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-light text-primary me-1 btn-edit-sender"
|
||||
data-id="1" data-sender="NEXUS-OTP" data-client="internal" data-type="alpha" data-purpose="Sending internal authentication codes." data-status="approved">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-light text-danger"><i class="bi bi-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Row 2 -->
|
||||
<tr>
|
||||
<td>
|
||||
<div class="sender-id-text fw-bold">CLICKML</div>
|
||||
<div class="text-secondary mt-1" style="font-size: 0.75rem;">Created: Jun 02, 2026</div>
|
||||
</td>
|
||||
<td><span class="badge bg-info bg-opacity-10 text-info border border-info-subtle">Client: Abusua Solutions</span></td>
|
||||
<td><span class="badge bg-secondary bg-opacity-10 text-secondary border">Alphanumeric</span></td>
|
||||
<td>
|
||||
<div class="d-flex gap-1 flex-wrap">
|
||||
<span class="network-badge net-approved"><i class="bi bi-check-circle-fill"></i> MTN</span>
|
||||
<span class="network-badge net-pending"><i class="bi bi-clock-fill"></i> Telecel</span>
|
||||
<span class="network-badge net-pending"><i class="bi bi-clock-fill"></i> AT</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><span class="badge bg-warning bg-opacity-10 text-warning px-2 py-1"><i class="bi bi-hourglass-split me-1"></i>Pending</span></td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-light text-primary me-1 btn-edit-sender"
|
||||
data-id="2" data-sender="CLICKTECH" data-client="client_1" data-type="alpha" data-purpose="Marketing updates and promotions for hosting services." data-status="pending">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-light text-danger"><i class="bi bi-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Row 3 -->
|
||||
<tr>
|
||||
<td>
|
||||
<div class="sender-id-text fw-bold">1334</div>
|
||||
<div class="text-secondary mt-1" style="font-size: 0.75rem;">Created: Jun 10, 2026</div>
|
||||
</td>
|
||||
<td><span class="badge bg-info bg-opacity-10 text-info border border-info-subtle">Client: Alpha Telecom</span></td>
|
||||
<td><span class="badge bg-primary bg-opacity-10 text-primary border border-primary-subtle">Shortcode</span></td>
|
||||
<td>
|
||||
<div class="d-flex gap-1 flex-wrap">
|
||||
<span class="network-badge net-rejected"><i class="bi bi-x-circle-fill"></i> MTN</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><span class="badge bg-danger bg-opacity-10 text-danger px-2 py-1"><i class="bi bi-x-octagon me-1"></i>Rejected</span></td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-light text-primary me-1 btn-edit-sender"
|
||||
data-id="3" data-sender="1334" data-client="client_2" data-type="shortcode" data-purpose="Interactive USSD/SMS fallback." data-status="rejected">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-light text-danger"><i class="bi bi-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
@forelse($senderIds as $sender)
|
||||
<tr>
|
||||
<td>
|
||||
<div class="sender-id-text fw-bold">{{ $sender->senderid }}</div>
|
||||
<div class="text-secondary mt-1" style="font-size: 0.75rem;">Created: {{ $sender->created_at ? $sender->created_at->format('M d, Y') : 'N/A' }}</div>
|
||||
</td>
|
||||
<td>
|
||||
@if($sender->direct_mno == 'YES')
|
||||
<span class="badge bg-primary bg-opacity-10 text-primary border">YES</span>
|
||||
@else
|
||||
<span class="badge bg-secondary bg-opacity-10 text-secondary border">NO</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($sender->direct_mno == 'YES')
|
||||
<div class="fw-medium">{{ $sender->mno_name ?? 'N/A' }}</div>
|
||||
<div class="text-muted small">MNO Name</div>
|
||||
@else
|
||||
<div class="fw-medium">{{ $sender->supplier_name ?? 'N/A' }}</div>
|
||||
<div class="text-muted small">Supplier</div>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="fw-medium">{{ $sender->type ?? 'N/A' }}</div>
|
||||
<div class="text-muted small">Bind: {{ $sender->bind_name ?? 'default' }}</div>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$statusClass = 'bg-secondary text-secondary';
|
||||
$icon = 'bi-dash-circle';
|
||||
if($sender->status == 'APPROVED') { $statusClass = 'bg-success text-success'; $icon = 'bi-check-all'; }
|
||||
elseif($sender->status == 'PENDING') { $statusClass = 'bg-warning text-warning'; $icon = 'bi-hourglass-split'; }
|
||||
elseif($sender->status == 'REJECTED') { $statusClass = 'bg-danger text-danger'; $icon = 'bi-x-octagon'; }
|
||||
@endphp
|
||||
<span class="badge {{ $statusClass }} bg-opacity-10 px-2 py-1"><i class="bi {{ $icon }} me-1"></i>{{ $sender->status }}</span>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-light text-primary me-1 btn-edit-sender"
|
||||
data-id="{{ $sender->id }}"
|
||||
data-senderid="{{ $sender->senderid }}"
|
||||
data-direct_mno="{{ $sender->direct_mno }}"
|
||||
data-mno_name="{{ $sender->mno_name }}"
|
||||
data-supplier_name="{{ $sender->supplier_name }}"
|
||||
data-type="{{ $sender->type }}"
|
||||
data-bind_name="{{ $sender->bind_name }}"
|
||||
data-status="{{ $sender->status }}"
|
||||
data-remarks="{{ $sender->remarks }}">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
<form action="{{ route('senderids.destroy', $sender->id) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-sm btn-light text-danger" onclick="return confirm('Are you sure you want to delete this Sender ID?')">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="text-center py-4 text-secondary">No Sender IDs found.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="d-flex justify-content-end mt-3">
|
||||
{{ $senderIds->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -188,66 +203,95 @@
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-light">
|
||||
<h5 class="modal-title fw-bold" id="senderModalTitle">Request Sender ID</h5>
|
||||
<h5 class="modal-title fw-bold" id="senderModalTitle">Add Sender ID</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<form id="senderForm">
|
||||
<form id="senderForm" method="POST" action="{{ route('senderids.store') ?? '#' }}">
|
||||
@csrf
|
||||
<div class="modal-body p-4">
|
||||
<input type="hidden" id="senderRecordId" name="id">
|
||||
|
||||
<div class="row g-3 mb-4">
|
||||
<div id="senderIdModalAlert"></div>
|
||||
|
||||
<div class="row g-3">
|
||||
<!-- Sender ID -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-secondary fw-semibold" style="font-size: 0.85rem;">Sender Name / Shortcode *</label>
|
||||
<input type="text" class="form-control fw-bold" id="senderName" name="sender_name" required maxlength="11" placeholder="e.g. NEXUS">
|
||||
<div class="form-text">Max 11 chars (Alphanumeric) or 15 digits (Numeric). No spaces.</div>
|
||||
<label class="form-label text-secondary fw-semibold small">Sender ID *</label>
|
||||
<input type="text" name="senderid" id="edit_senderid" class="form-control" required placeholder="e.g. CLICK_SMS" maxlength="20">
|
||||
</div>
|
||||
|
||||
<!-- Direct MNO Toggle -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-secondary fw-semibold" style="font-size: 0.85rem;">Type</label>
|
||||
<select class="form-select" id="senderType" name="type">
|
||||
<option value="alpha">Alphanumeric</option>
|
||||
<option value="shortcode">Numeric Shortcode</option>
|
||||
<label class="form-label text-secondary fw-semibold small">Direct MNO? *</label>
|
||||
<select name="direct_mno" id="edit_direct_mno" class="form-select" required>
|
||||
<option value="YES" selected>YES</option>
|
||||
<option value="NO">NO</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-secondary fw-semibold" style="font-size: 0.85rem;">Client / Owner *</label>
|
||||
<select class="form-select" id="senderClient" name="client_id" required>
|
||||
<option value="" selected disabled>Select Client...</option>
|
||||
<option value="internal">Internal System (Nexus ERP)</option>
|
||||
<option value="client_1">Click Tech Corp</option>
|
||||
<option value="client_2">Alpha Telecom</option>
|
||||
<!-- MNO Name (Visible by default) -->
|
||||
<div class="col-md-12" id="wrapper_mno_name">
|
||||
<label class="form-label text-secondary fw-semibold small">MNO Name *</label>
|
||||
<select name="mno_name" id="edit_mno_name" class="form-select">
|
||||
<option value="">Select Network Operator</option>
|
||||
@foreach($networkOperators as $mno)
|
||||
<option value="{{ $mno->name }}">{{ $mno->name }} ({{ $mno->country }})</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Supplier Name (Hidden by default) -->
|
||||
<div class="col-md-12" id="wrapper_supplier_name" style="display: none;">
|
||||
<label class="form-label text-secondary fw-semibold small">Supplier / Aggregator Name *</label>
|
||||
<select name="supplier_name" id="edit_supplier_name" class="form-select">
|
||||
<option value="">Select Supplier</option>
|
||||
@foreach($clients as $client)
|
||||
<option value="{{ $client->name }}">{{ $client->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Type & Bind Name -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-secondary fw-semibold small">Type</label>
|
||||
<select name="type" id="edit_type" class="form-select">
|
||||
<option value="Alphanumeric">Alphanumeric</option>
|
||||
<option value="Numeric">Numeric</option>
|
||||
<option value="Shortcode">Shortcode</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-secondary fw-semibold small">Bind Name</label>
|
||||
<input type="text" name="bind_name" id="edit_bind_name" class="form-control" value="default" maxlength="50">
|
||||
</div>
|
||||
|
||||
<!-- Status -->
|
||||
<div class="col-md-12">
|
||||
<label class="form-label text-secondary fw-semibold small">Status</label>
|
||||
<select name="status" class="form-select">
|
||||
<option value="" selected>-- Select --</option>
|
||||
<option value="Applied to MNO">Applied to MNO</option>
|
||||
<option value="Applied to Aggregator">Applied to Aggregator</option>
|
||||
<option value="Approved on MNO">Approved on MNO</option>
|
||||
<option value="Approved on Aggregator">Approved on Aggregator</option>
|
||||
<option value="Active">Active</option>
|
||||
<option value="Pending">Pending</option>
|
||||
<option value="Inactive">Inactive</option>
|
||||
<option value="Rejected">REJECTED</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-secondary fw-semibold" style="font-size: 0.85rem;">Purpose & Sample Message *</label>
|
||||
<textarea class="form-control" id="senderPurpose" name="purpose" rows="3" required placeholder="Required by MNOs for whitelisting. Provide a sample of the SMS content that will be sent."></textarea>
|
||||
<div class="form-text">Example: "Your verification code is 12345. Valid for 5 minutes."</div>
|
||||
</div>
|
||||
|
||||
<h6 class="fw-bold mb-3 text-secondary text-uppercase" style="font-size: 0.75rem;">MNO Submission Targets</h6>
|
||||
<div class="p-3 bg-light rounded border border-secondary-subtle">
|
||||
<div class="form-check form-check-inline me-4">
|
||||
<input class="form-check-input" type="checkbox" id="mnoMtn" name="networks[]" value="mtn" checked>
|
||||
<label class="form-check-label fw-semibold text-dark" for="mnoMtn">MTN Ghana</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline me-4">
|
||||
<input class="form-check-input" type="checkbox" id="mnoTelecel" name="networks[]" value="telecel" checked>
|
||||
<label class="form-check-label fw-semibold text-dark" for="mnoTelecel">Telecel</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" id="mnoAt" name="networks[]" value="at" checked>
|
||||
<label class="form-check-label fw-semibold text-dark" for="mnoAt">AT</label>
|
||||
|
||||
<!-- Remarks -->
|
||||
<div class="col-12">
|
||||
<label class="form-label text-secondary fw-semibold small">Remarks</label>
|
||||
<textarea name="remarks" id="edit_remarks" class="form-control" rows="2" placeholder="Optional notes..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn text-white fw-bold px-4" style="background-color: #5c4df0;" id="btnSubmitSender">
|
||||
Submit Registration
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn text-white fw-bold btn-sm px-4" style="background-color: #5c4df0;" id="btnSubmitSender">
|
||||
Save Sender ID
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -257,63 +301,9 @@
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
<script src="{{ asset('public/assets/js/sender-ids.js') }}"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
const senderModal = new bootstrap.Modal(document.getElementById('senderModal'));
|
||||
const $form = $('#senderForm');
|
||||
|
||||
// Force Uppercase and trim spaces on Sender ID input
|
||||
$('#senderName').on('input', function() {
|
||||
$(this).val($(this).val().toUpperCase().replace(/\s/g, ''));
|
||||
});
|
||||
|
||||
// --- OPEN MODAL FOR CREATE ---
|
||||
$('#btnOpenSenderModal').on('click', function() {
|
||||
$form[0].reset();
|
||||
$('#senderRecordId').val('');
|
||||
|
||||
$('#senderModalTitle').text('Request Sender ID');
|
||||
$('#btnSubmitSender').html('<i class="bi bi-send me-2"></i>Submit Registration');
|
||||
|
||||
senderModal.show();
|
||||
});
|
||||
|
||||
// --- OPEN MODAL FOR EDIT ---
|
||||
$('.btn-edit-sender').on('click', function() {
|
||||
const data = $(this).data();
|
||||
|
||||
$form[0].reset();
|
||||
$('#senderRecordId').val(data.id);
|
||||
|
||||
$('#senderName').val(data.sender);
|
||||
$('#senderType').val(data.type);
|
||||
$('#senderClient').val(data.client);
|
||||
$('#senderPurpose').val(data.purpose);
|
||||
|
||||
$('#senderModalTitle').text('Edit Sender ID: ' + data.sender);
|
||||
$('#btnSubmitSender').html('<i class="bi bi-save me-2"></i>Update Request');
|
||||
|
||||
senderModal.show();
|
||||
});
|
||||
|
||||
// --- HANDLE FORM SUBMISSION ---
|
||||
$form.on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const $btn = $('#btnSubmitSender');
|
||||
const originalText = $btn.html();
|
||||
|
||||
$btn.html('<span class="spinner-border spinner-border-sm me-2"></span> Processing...');
|
||||
$btn.prop('disabled', true);
|
||||
|
||||
setTimeout(() => {
|
||||
const formData = $(this).serializeArray();
|
||||
console.log('Sender ID Request Payload:', formData);
|
||||
|
||||
$btn.html(originalText).prop('disabled', false);
|
||||
senderModal.hide();
|
||||
alert('Sender ID request saved and queued for MNO submission.');
|
||||
}, 800);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
74
resources/views/senderids/partials/create.blade.php
Normal file
74
resources/views/senderids/partials/create.blade.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<form id="createSenderIdForm" method="POST" action="{{ route('senderids.store') }}">
|
||||
@csrf
|
||||
<div class="modal-body p-4">
|
||||
<div id="senderIdModalAlert"></div>
|
||||
|
||||
<div class="row g-3">
|
||||
<!-- Sender ID -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-secondary fw-semibold small">Sender ID *</label>
|
||||
<input type="text" name="senderid" class="form-control" required placeholder="e.g. CLICK_SMS">
|
||||
</div>
|
||||
|
||||
<!-- Direct MNO Toggle -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-secondary fw-semibold small">Direct MNO? *</label>
|
||||
<select name="direct_mno" id="create_direct_mno" class="form-select" required>
|
||||
<option value="YES" selected>YES</option>
|
||||
<option value="NO">NO</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- MNO Name (Visible by default) -->
|
||||
<div class="col-md-12" id="wrapper_mno_name">
|
||||
<label class="form-label text-secondary fw-semibold small">MNO Name *</label>
|
||||
<input type="text" name="mno_name" id="input_mno_name" class="form-control" placeholder="Enter specific Network Operator">
|
||||
</div>
|
||||
|
||||
<!-- Supplier Name (Hidden by default) -->
|
||||
<div class="col-md-12" id="wrapper_supplier_name" style="display: none;">
|
||||
<label class="form-label text-secondary fw-semibold small">Supplier / Aggregator Name *</label>
|
||||
<input type="text" name="supplier_name" id="input_supplier_name" class="form-control" placeholder="Enter supplier name">
|
||||
</div>
|
||||
|
||||
<!-- Type & Bind Name -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-secondary fw-semibold small">Type</label>
|
||||
<select name="type" class="form-select">
|
||||
<option value="Alphanumeric">Alphanumeric</option>
|
||||
<option value="Numeric">Numeric</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-secondary fw-semibold small">Bind Name</label>
|
||||
<input type="text" name="bind_name" class="form-control" value="default">
|
||||
</div>
|
||||
|
||||
<!-- Status -->
|
||||
<div class="col-md-12">
|
||||
<label class="form-label text-secondary fw-semibold small">Status</label>
|
||||
<select name="status" class="form-select">
|
||||
<option value="" selected>-- Select --</option>
|
||||
<option value="Applied to MNO">Applied to MNO</option>
|
||||
<option value="Applied to Aggregator">Applied to Aggregator</option>
|
||||
<option value="Approved on MNO">Approved on MNO</option>
|
||||
<option value="Approved on Aggregator">Approved on Aggregator</option>
|
||||
<option value="Active">Active</option>
|
||||
<option value="Pending">Pending</option>
|
||||
<option value="Inactive">Inactive</option>
|
||||
<option value="Rejected">REJECTED</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Remarks -->
|
||||
<div class="col-12">
|
||||
<label class="form-label text-secondary fw-semibold small">Remarks</label>
|
||||
<textarea name="remarks" class="form-control" rows="2" placeholder="Optional notes..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" id="btnSubmitSenderId" class="btn text-white btn-sm fw-bold px-4" style="background-color: #5c4df0;">Save Sender ID</button>
|
||||
</div>
|
||||
</form>
|
||||
Reference in New Issue
Block a user