Files
ERP-upgrade/resources/views/network_operators/index.blade.php
2026-08-17 19:37:22 +00:00

166 lines
9.1 KiB
PHP

@extends('layouts.masterbeta')
@section('title', 'Cick ERP - MNO Partners')
@push('styles')
<style>
.avatar-circle { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: bold; font-size: 0.85rem; }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tech-badge { font-family: monospace; font-size: 0.75rem; background-color: #f1f3f9; color: #3e445b; padding: 2px 6px; border-radius: 4px; border: 1px solid #e2e8f0; }
</style>
@endpush
@section('breadcrumbs')
<a href="{{ url('/') }}" class="text-secondary text-decoration-none"><i class="bi bi-house me-2"></i></a>
<i class="bi bi-chevron-right text-secondary me-2" style="font-size: 0.8rem;"></i>
<a href="#" class="text-secondary text-decoration-none me-2" style="font-size: 0.95rem;">Core Entities</a>
<i class="bi bi-chevron-right text-secondary me-2" style="font-size: 0.8rem;"></i>
<span class="fw-bold" style="font-size: 0.95rem;">MNO Partners</span>
@endsection
@section('content')
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h4 class="fw-bold mb-1">Mobile Network Operators (MNO)</h4>
<p class="text-secondary mb-0" style="font-size: 0.9rem;">Manage MNO details, connections and others</p>
</div>
<button class="btn text-white fw-bold d-flex align-items-center" style="background-color: #5c4df0; border-radius: 8px;" id="btnOpenMnoModal">
<i class="bi bi-broadcast-pin me-2"></i> Add MNO Partner
</button>
</div>
<!-- Dynamic Metrics Cards -->
<div class="row g-4 mb-4">
<div class="col-xl-4 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;">ACTIVE CONNECTIONS</div>
<h3 class="fw-bold mb-0">{{ $totalActive }} <span class="fs-6 fw-normal text-success"><i class="bi bi-arrow-up"></i> Active</span></h3>
</div>
</div>
<div class="col-xl-4 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;">Countries </div>
<h3 class="fw-bold mb-0">{{ $uniqueCountries }} </h3>
</div>
</div>
<div class="col-xl-4 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;">REGISTERED MNO PARTNERS</div>
<h3 class="fw-bold mb-0">{{ $totalOperators }}</h3>
</div>
</div>
</div>
<div class="content-card">
<div class="p-3 border-bottom bg-light bg-opacity-50">
<form method="GET" action="{{ route('mnos.index') }}" class="row g-3">
<div class="col-md-6">
<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 here...">
</div>
</div>
<div class="col-md-3">
@include('network_operators.partials.countries')
</div>
<div class="col-md-3">
<select name="connection_status" class="form-select bg-white" onchange="this.form.submit()">
<option value="">Any Status</option>
<option value="Active" {{ request('link_type') == 'vpn' ? 'selected' : '' }}>Active</option>
<option value="Inactive" {{ request('link_type') == 'direct' ? 'selected' : '' }}>Inactive</option>
<option value="Pending" {{ request('link_type') == 'direct' ? 'selected' : '' }}>Pending</option>
</select>
</div>
</form>
</div>
<div class="table-responsive">
<table class="table table-custom table-hover mb-0">
<thead>
<tr>
<th>Operator</th>
<th>Country</th>
<th>Connection Type</th>
<th>Services</th>
<th>Status</th>
<th class="text-end">Actions</th>
</tr>
</thead>
<tbody>
@forelse($operators as $operator)
<tr>
<td>
<div class="d-flex align-items-center">
<div class="avatar-circle bg-primary bg-opacity-10 text-primary me-3">
{{ strtoupper(substr($operator->name, 0, 2)) }}
</div>
<div>
<div class="fw-bold text-dark">{{ $operator->name }}</div>
<div class="text-secondary" style="font-size: 0.8rem;">{{ $operator->contact_person ?? 'N/A' }}</div>
</div>
</div>
</td>
<td><span class="fw-semibold">{{ $operator->country }}</span></td>
<td>
<div class="text-dark fw-semibold" style="font-size: 0.85rem;"><i class="bi bi-shield-lock me-1 text-primary"></i> {{ $operator->connection_type ?? 'N/A' }}</div>
</td>
<td>
<div class="d-flex gap-1 flex-wrap">
@if(is_array($operator->services))
@foreach($operator->services as $service)
<span class="badge bg-secondary text-dark border bg-light" style="font-size: 0.65rem;">{{ strtoupper($service) }}</span>
@endforeach
@else
<span class="text-muted small">None</span>
@endif
</div>
</td>
<td>
<span class="d-flex align-items-center gap-2">
<span class="status-indicator {{ ($operator->connection_status == 'Active') ? 'bg-success' : 'bg-danger' }}"></span>
<span class="fw-semibold {{ ($operator->connection_status == 'Active') ? 'text-success' : 'text-danger' }}" style="font-size: 0.85rem;">
{{ $operator->connection_status ?? 'N/A' }}
</span>
</span>
</td>
<td class="text-end">
<div class="d-flex gap-1 justify-content-end align-items-center">
<a href="{{ route('mnos.show', $operator->id) }}" class="btn btn-sm btn-light text-secondary me-1" title="View Details">
<i class="bi bi-eye"></i>
</a>
<button class="btn btn-sm btn-light text-primary btn-edit-mno" data-id="{{ $operator->id }}" title="Edit MNO">
<i class="bi bi-pencil"></i>
</button>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="text-center py-4 text-muted">No MNO partners found.</td>
</tr>
@endforelse
</tbody>
</table>
<!-- Pagination Links Footer -->
@if($operators->hasPages())
<div class="p-3 border-top bg-light bg-opacity-50 d-flex justify-content-between align-items-center">
<div class="text-secondary small">
Showing {{ $operators->firstItem() }} to {{ $operators->lastItem() }} of {{ $operators->total() }} MNO partners
</div>
<div>
{{ $operators->links() }}
</div>
</div>
@endif
</div>
</div>
@endsection
@push('modals')
@include('network_operators.partials.mno_modals')
@endpush
@push('scripts')
<script src="{{ asset('public/assets/js/mno_index.js') }} "></script>
@endpush