@extends('layouts.app') @section('title', 'Client Profile - ISP ERP System') @section('page-title', 'Client Profile') @section('styles') @endsection @section('content')
@if($activeClient->profile_picture) Profile @else @endif

{{ $activeClient->full_name ?? 'N/A' }}/{{ $activeClient->username_ip ?? 'N/A' }}

{{ $activeClient->email_address ?? 'N/A' }}
Client Code/Login Id: {{ $activeClient->client_login_id ?? 'N/A' }}
Login Password: @if($activeClient->client_login_plain_password) •••••••• @else N/A @endif
Client ID/IP: {{ $activeClient->username_ip ?? 'N/A' }}
Password: @if($activeClient->password) •••••••• @else N/A @endif
Billing Status: @if($activeClient->billingStatus) {{ $activeClient->billingStatus->name ?? 'Active' }} @else Active @endif
Online Status: @php $onlineStatus = $activeClient->client->is_online ?? $isOnline ?? false; @endphp @if($onlineStatus) Online @else Offline @endif
Mikrotik Status:
Creation Date: {{ $activeClient->created_at ? $activeClient->created_at->format('d M Y') : 'N/A' }}
Registration Date: {{ $activeClient->joining_date ? \Carbon\Carbon::parse($activeClient->joining_date)->format('d M Y') : 'N/A' }}
Client Login Access:
Update Information

Profile Client Profile

Internet Service Information

Package: {{ $activeClient->package ?? ($package ? $package->name : 'N/A') }}
Joining Date: {{ $activeClient->joining_date ? \Carbon\Carbon::parse($activeClient->joining_date)->format('d M Y') : 'N/A' }}
Profile: {{ $activeClient->profile ?? 'N/A' }}
Client Type: @if($activeClient->clientType || $activeClient->client_type) {{ $activeClient->clientType ? $activeClient->clientType->name : $activeClient->client_type }} @else N/A @endif
Billing Start Month: {{ $activeClient->billing_start_month ? \Carbon\Carbon::parse($activeClient->billing_start_month)->format('d M Y') : 'N/A' }}
Username/IP: {{ $activeClient->username_ip ?? ($activeClient->client->username ?? 'N/A') }}
Expire Date: {{ $activeClient->expire_date ?? 'N/A' }}
Password: {{ $activeClient->password ?? ($activeClient->client->password ?? 'N/A') }}
Monthly Bill: {{ number_format($activeClient->monthly_bill ?? 0, 2) }} BDT
Balance Due: {{ number_format($activeClient->client->total_due ?? 0, 2) }} BDT
Reference By: {{ $activeClient->reference_by ?? 'N/A' }}
Connection Setup By: @if($assignedEmployees->count() > 0) {{ $assignedEmployees->pluck('name')->join(', ') }} @else {{ $activeClient->connected_by ?? 'N/A' }} @endif
Assigned To Employees: @if($assignedEmployees->count() > 0) {{ $assignedEmployees->pluck('name')->join(', ') }} @else N/A @endif
Last Log in: {{ $activeClient->client->last_seen ? \Carbon\Carbon::parse($activeClient->client->last_seen)->format('d-M-Y h:i A') : 'N/A' }}

Installation Charge Information

Charge Created On: {{ $activeClient->created_at ? $activeClient->created_at->format('d M Y') : 'N/A' }}
Installation Fee: {{ number_format($activeClient->service_charge ?? 0, 2) }} BDT
Paid Amount: {{ number_format(0, 2) }} BDT
Due Amount: {{ number_format($activeClient->service_charge ?? 0, 2) }} BDT
Payment Method: N/A
Payment Date: {{ $activeClient->created_at ? $activeClient->created_at->format('d M Y') : 'N/A' }}
Received By: N/A

Change Profile Picture

Preview
function openLoginPasswordChangeModal(clientId) { document.getElementById('loginPasswordChangeModal').style.display = 'block'; document.getElementById('loginPasswordChangeClientId').value = clientId; } function closeLoginPasswordChangeModal() { document.getElementById('loginPasswordChangeModal').style.display = 'none'; document.getElementById('loginPasswordChangeForm').reset(); } function handleLoginPasswordChange(event) { event.preventDefault(); const form = event.target; const formData = new FormData(form); const clientId = formData.get('client_id'); // Validate passwords const newPassword = formData.get('new_password'); const confirmPassword = formData.get('confirm_password'); if (!newPassword || newPassword.trim() === '') { alert('Please enter a password'); return; } if (newPassword !== confirmPassword) { alert('Passwords do not match'); return; } // Disable submit button const submitBtn = form.querySelector('button[type="submit"]'); const originalText = submitBtn.innerHTML; submitBtn.disabled = true; submitBtn.innerHTML = ' Updating...'; // Make AJAX request fetch(`/active-clients/${clientId}/change-login-password`, { method: 'POST', headers: { 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content'), 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify({ new_password: newPassword }) }) .then(response => response.json()) .then(data => { if (data.success) { alert(data.message || 'Login password changed successfully'); closeLoginPasswordChangeModal(); // Reload page to show updated password setTimeout(() => { window.location.reload(); }, 500); } else { alert(data.message || 'Failed to change login password'); submitBtn.disabled = false; submitBtn.innerHTML = originalText; } }) .catch(error => { console.error('Error:', error); alert('An error occurred while changing login password. Please try again.'); submitBtn.disabled = false; submitBtn.innerHTML = originalText; }); } // Close modal when clicking outside window.onclick = function(event) { const profileModal = document.getElementById('profileImageModal'); const passwordModal = document.getElementById('passwordChangeModal'); const loginPasswordModal = document.getElementById('loginPasswordChangeModal'); if (event.target == profileModal) { profileModal.style.display = 'none'; } if (event.target == passwordModal) { passwordModal.style.display = 'none'; } if (event.target == loginPasswordModal) { loginPasswordModal.style.display = 'none'; } }

Change Password

Change Login Password

@endsection