@php($permissions = userPermissions())
@if (request()->path() == 'admin/list/new-join' || request()->path() == 'admin/newClientSearchReport')
Total : {{ $list->total() }}
@if ($export == 'yes') @if (checkSettings('enforce-download-permission') != 'enable' || auth()->user()->can('recent-client-export')) Download CSV @endif @endif @endif @if (request()->path() == 'admin/list/close-list') @if (checkSettings('enforce-download-permission') != 'enable' || auth()->user()->can('close-client-export')) Export @endif @if (checkSettings('multiple_client_restore') == 'enable' && in_array('can-open', $permissions)) @endif
Total Closed: {{ $closeTotal ?? 0 }}
@endif @if (request()->path() == 'admin/close-search-list') @if (checkSettings('enforce-download-permission') != 'enable' || auth()->user()->can('close-client-list-export')) Download CSV @endif @if (checkSettings('multiple_client_restore') == 'enable' && in_array('can-open', $permissions)) @endif @if (checkSettings('multiple_mac_customer_destroy') == 'enable' && in_array('mac-customer_destroy', $permissions)) @endif @endif @if (request()->path() == 'admin/list/expired-Clients' || request()->path() == 'admin/expire-customer-search')
@if (request()->path() == 'admin/expire-customer-search') @if (checkSettings('enforce-download-permission') != 'enable' || auth()->user()->can('expire-client-export')) Download CSV @endif {{-- @else --}} @endif
@endif @if (request()->path() == 'admin/free-cleint' || request()->path() == 'admin/freeClientSearch')
Total Free Client: {{ $list->count() }}
@endif
@if (request()->path() == 'admin/pending-customer' || request()->path() == 'admin/pending-customer-search')
@if (request()->path() == 'admin/pending-customer-search') @if (checkSettings('enforce-download-permission') != 'enable' || auth()->user()->can('pending-client-export')) Export Excel @endif @endif @if (checkSettings('local-user-first-approve') == 'enable') @if (in_array('local-user-first-approve', $permissions)) @elseif (in_array('new-customer-approve', $permissions)) @endif @else @if (in_array('new-customer-approve', $permissions)) @endif @endif @if (in_array('pending-customer-delete', $permissions)) @endif
@endif @if (checkSettings('all-client-dataTable') == 'enable' && request()->path() == 'admin/clients') @elseif (request()->path() == 'admin/expire-customer-search' || request()->path() == 'admin/getResellerPopList' || request()->path() == 'admin/online-customer-search' || request()->path() == 'admin/list/new-join' || request()->path() == 'admin/newClientSearchReport' || request()->path() == 'admin/disable-customer-search' || request()->path() == 'admin/deactive-customer' || request()->path() == 'admin/active-customer' || request()->path() == 'admin/free-client' || request()->path() == 'admin/freeClientSearch')
@else
@endif {{-- This summary used to open a row inside the heading row below. Rows cannot nest, so the browser closed the heading row early as an empty, transparent one and pushed the th cells into an implicit row of its own. Two visible symptoms: the heading lost its colour on this page, and once the heading became sticky the scrolling rows showed through that empty row as a gap above it. Its own row now, with an opaque background so nothing shows through while the heading is pinned. --}} @if (request()->path() == 'admin/clientSearchReport') @endif @if (request()->path() == 'admin/pending-customer' || request()->path() == 'admin/clientSearchReport' || request()->path() == 'admin/pending-customer-search') @endif @if ( (request()->path() == 'admin/list/close-list' || request()->path() == 'admin/close-search-list') && (checkSettings('multiple_client_restore') == 'enable' || checkSettings('multiple_mac_customer_destroy') == 'enable')) @endif @if (request()->path() == 'admin/clients') @else @endif @if (request()->path() == 'admin/list/close-list' || request()->path() == 'admin/close-search-list') @endif @if (request()->path() == 'admin/list/new-join' || request()->path() == 'admin/newClientSearchReport') @can('show-marketer-in-recent-client') @endcan @endif @if (request()->path() == 'admin/pending-customer') @endif @if (auth()->user()->hasRole(['Sub Reseller', 'Sub Reseller Technician'])) @endif @php($catTotalLength = 0) @php($totalOtc = 0) @php($totalMrc = 0) @php($apiCheck = checkAPI()) @php( $isSubResellerRole = auth()->user()->hasRole(['Sub Reseller', 'Sub Reseller Technician']) ) @if (request()->path() == 'admin/list/disable-customer' || request()->path() == 'admin/list/expired-Clients')

Total = {{ $list->total() }}

@endif @if (request()->path() == 'admin/disable-customer-search' || request()->path() == 'admin/expire-customer-search' || request()->path() == 'admin/pending-customer' || request()->path() == 'admin/pending-customer-search' || request()->path() == 'admin/active-customer-search' || request()->path() == 'admin/close-search-list')

Total = {{ $list->count() }}

@endif @foreach ($list as $r) {{-- Sub reseller sees the sub package rate, everyone else the mother package rate --}} @php($rowPackageRate = $isSubResellerRole && ($r->pops->subreseller ?? '') == 'yes' ? $r->subpack->rate ?? 0 : $r->packages->package_rate ?? 0) {{-- {{ dd($r)}} --}} clients_status == 'deactive') class="deactive" @endif> @if (request()->path() == 'admin/clientSearchReport') @elseif(request()->path() == 'admin/pending-customer' || request()->path() == 'admin/pending-customer-search') @elseif ( (request()->path() == 'admin/list/close-list' || request()->path() == 'admin/close-search-list') && (checkSettings('multiple_client_restore') == 'enable' || checkSettings('multiple_mac_customer_destroy') == 'enable')) @endif @if (request()->path() == 'admin/list/close-list' || request()->path() == 'admin/close-search-list') @endif @if (request()->path() == 'admin/list/new-join' || request()->path() == 'admin/newClientSearchReport') @can('show-marketer-in-recent-client') @endcan @endif @if (request()->path() == 'admin/pending-customer') @endif @php($totalOtc += $r->clientsinfo->otc) @php($totalMrc += $rowPackageRate) @php($catTotalLength += $r->clientsinfo->cat_length ?? 0) @endforeach @if (request()->path() == 'admin/list/new-join' || request()->path() == 'admin/list/close-list' || request()->path() == 'admin/close-search-list' || request()->path() == 'admin/newClientSearchReport' || request()->path() == 'admin/clientSearchReport') @if (request()->path() == 'admin/clientSearchReport') @endif @if ( (request()->path() == 'admin/list/close-list' || request()->path() == 'admin/close-search-list') && checkSettings('multiple_client_restore') == 'enable') @endif @if (auth()->user()->hasPermissionTo('source_mrc_hide')) @else @endif @if (checkSettings('radius_customer_bandwidth_limit') == 'enable')
@endif @if (request()->path() == 'admin/list/new-join' || request()->path() == 'admin/newClientSearchReport') @can('show-marketer-in-recent-client') @endcan @endif @endif

{{ $status }}

{!! $packages_count !!}

{!! $billing_count !!}

ID User name Status Expire @if (request('sort') == 'expire_date') @if (request('order') == 'asc') @else @endif @else @endif ExpireBill Info Package POP/Manager Name Contact User Info DateClose DateRemarksMKAMCreated By
@if (in_array('customer-recharge', $permissions)) @if ($r->pops->bill_generate != 'yes') {{-- A free client is never charged, so the cost preview must not quote one. --}} @php($rowIsFree = ($r->is_free ?? 0) == 1) @if (auth()->user()->hasRole(['Reseller Admin', 'Admin', 'Accounts Executive', 'Reseller', 'Reseller Technician'])) @elseif(auth()->user()->hasRole(['Sub Reseller', 'Sub Reseller Technician'])) @endif expire_date)) }}> billing_cycle }}> @else @endif @endif @if ($r->pop->bill_generate == 'yes') @if (!globalPermission('payment-bill-by-bill')) @if (in_array('money-receipt-entry', $permissions)) @endif @endif CID: {{ $r->id }} @else @if (in_array('customer-recharge', $permissions)) @if (checkSettings('reseller-client-dynamic-recharge') == 'enable' && in_array('dynamic-recharge', $permissions)) @if (request()->path() == 'admin/clients') @if ($r->client_approval == 'approved') @endif @endif @else @if ($r->client_approval == 'approved') @endif @endif @endif @if (globalPermission('reseller-client-billing') && in_array('view-client-account-balance', $permissions)) CID: {{ $r->id }} @else CID: {{ $r->id }} @endif @endif @if (!checkAPI() || checkSettings('api_bandwidth_usage') == 'enable') Log @endif @if ($r->deleted_at != null) Details @else Details @endif @if (checkSettings('singleInvoice') == 'enable' && $r->pop->bill_generate == 'yes') @endif
@if ($r->deleted_at != null) @else @endif
{{ $r->isStatic ? $r->ip_address : $r->userid }} @if (in_array('view-client-password', $permissions)) @if (!$r->isStatic)
{{ $r->password }} @endif @endif
@if (checkSettings('customer_code') == 'enable') {{ $r->customer_code ?? '' }} @endif @if ($r->is_free == 1)

Free

@endif @if (request()->path() == 'admin/clientSearchReport' && checkAPI()) @endif @if (request()->path() == 'admin/list/close-list' || (request()->path() == 'admin/close-search-list' && $r->deleted_at != null)) Closed at
{{ $r->deleted_at }}
@endif @if (request()->path() == 'admin/list/disable-customer' || request()->path() == 'admin/disable-customer-search') @foreach ($con_history as $con) @isset($con->client_id) @if ($r->id == $con->client_id) {{ $con->created_at }} @if ($con->details != null) Action : {{ Str::limit($con->details, 30) }} @endif @endif @endisset @endforeach @endif @if (request()->path() == 'admin/clients' || request()->path() == 'admin/customer_search')
@if (checkAPI() || globalPermission('radiusClientOnlineCheckThroughApi')) @if (!empty($ajaxOnlineStatus)) ... @else @if (checkSettings('showClientUpDownInfo') == 'enable') @if (array_key_exists($r->userid, $online['usersBandwidth'])) Download⬇️ {{ number_format($online['usersBandwidth'][$r->userid]['tx-byte'] / 1048576, 2, '.', '') }}MB Upload⬆️ {{ number_format($online['usersBandwidth'][$r->userid]['rx-byte'] / 1048576, 2, '.', '') }}MB @endif @endif @endif @else @if ($r->isStatic && \App\Classes\MikrotikService\StaticOnlineStatus::hasData($r)) @elseif (isset($online) && in_array($r->userid, $online)) Online @else Offline @endif @endif
@if ($r->ignoreMKCheck == 1)

Ignore MK : ✅

@endif @endif
@if (checkSettings('radius_customer_bandwidth_limit') == 'enable')

D⬇️ @if ($r->down_bandwidth >= 1024) {{ number_format($r->down_bandwidth / 1024, 2, '.', '') }}GB @else {{ $r->down_bandwidth }}MB @endif

U⬆️ @if ($r->up_bandwidth >= 1024) {{ number_format($r->up_bandwidth / 1024, 2, '.', '') }}GB @else {{ $r->up_bandwidth }}MB @endif

@endif
@if ($r->experity_check == 'No')
VIP
@endif
@if ($r->clients_status == 'active') Active @elseif($r->clients_status == 'deactive') Deactive @elseif($r->clients_status == 'expired') Expired @elseif($r->clients_status == 'disable') Disabled @endif BD: {{ date('d-M-Y', strtotime($r->expire_date)) }}
@if ($r->payment_dadeline != 0) PD: {{ \Carbon\Carbon::parse($r->expire_date)->addDay($r->payment_dadeline)->format('d-M-Y') }} @else PD: {{ \Carbon\Carbon::parse($r->expire_date)->addDay($r->payment_dadeline)->format('d-M-Y') }} @endif {{-- @cannot, not @can: the permission is a "hide" switch, so only users WITHOUT it see how many days are left. --}} @cannot('hide-customer-remaining-day') @if (in_array($r->clients_status, ['active', 'expired'])) @php($effectiveExpire = \Carbon\Carbon::parse($r->expire_date)->addDay($r->payment_dadeline)) @php($daysRemaining = \Carbon\Carbon::today()->diffInDays($effectiveExpire, false)) @if ($daysRemaining >= 0) {{ $daysRemaining }} {{ $daysRemaining == 1 ? 'day' : 'days' }} remaining @endif @endif @endcannot @can('change-expire-date') @endcan @if (checkSettings('auto_deactive_check') == 'enable')

@if (!empty($r->auto_deactive)) AD: {{ date('d-M-Y', strtotime($r->auto_deactive ?? '')) }} @endif @endif

Bill Date: {{ $r->billing_cycle }} @if (globalPermission('free-day-to-create-customer'))
Free Day at Create : {{ $r->free_day_to_create_customer ?? 0 }} @endif
@if (isset($r->pops->bill_generate) && $r->pops->bill_generate == 'yes') Billing Type: {{ getBillingType($r) == 'monthly' ? 'Monthly' : 'Day to Day' }}
Package Rate: {{ $rowPackageRate }}
Discount: {{ $r->parmanent_discount }}
Monthly Bill: {{ max($rowPackageRate - ($r->parmanent_discount ?? 0), 0) }}
OTC : {{ $r->clientsinfo->otc ?? 0 }}
@if (isset($r->clientsinfo->otc_due)) @if ($r->clientsinfo->otc_due > 0) OTC Due: {{ $r->clientsinfo->otc_due ?? 0 }} @endif @endif @else @if (globalPermission('ResellerClientOnlineRecharge')) Client Bill: {{ getResellerClientPaymentAmount($r) }}
Pending Amount: {{ $r->un_recharge_amount ?? 0 }} @endif @if (globalPermission('reseller-client-billing') && in_array('view-client-account-balance', $permissions)) @php($resellerClientBalance = isset($r->customer_account_balance_reseller) ? $r->customer_account_balance_reseller : 0) @if ($resellerClientBalance >= 0) Due: {{ number_format($resellerClientBalance, 2) }} @elseif ($resellerClientBalance < 0) Advance: {{ number_format(abs($resellerClientBalance), 2) }} @endif @endif @endif

@if ($r->pops->bill_generate == 'yes') @php($due_amount = isset($r->customerAccount) ? $r->customerAccount->dueAmount : 0);

0) style="background: #fb7185;" @else style="background: #008000;" @endif> @if ($due_amount >= 0) Due: @else Advance: @endif @if ($due_amount >= 0) {{ $due_amount ?? 0 }} @else {{ $due_amount * -1 ?? 0 }} @endif

@endif
@if (in_array('show-sub-package', $permissions) && $r->pops->subreseller == 'yes') {{ $r->subpack->name ?? '' }} @if (in_array('show-sub-package-rate', $permissions)) ({{ $r->subpack->rate ?? '' }}) @endif @endif @if (in_array('show-mother-package', $permissions)) {{ $r->packages->package_name ?? '' }} @if (in_array('show-motherpackage-rate', $permissions)) ({{ $r->packages->package_rate ?? '' }}) @endif {{-- @if ($expireProfile = getClientExpireProfile($r)) {{ $expireProfile }} @endif --}} @endif @if (in_array('package_change_without_cost', $permissions)) Package Change @else @if (in_array('package_change_without_cost_expire', $permissions) && $r->clients_status == 'expired') Package Change @endif @endif @if (checkCrmRansferPermission(request()->path())) {{ $r->crm_status }} -> Transfer @if ($r->crm_status == 'Fiber') Item Return @endif @if ($r->crm_status == 'Store') Show Return Item @endif {{-- Opens in a popup. The href stays a real link so it still works without javascript, and the crm_status_change class is deliberately not on it: that handler fills the transfer modal, which has nothing to do with this button. --}} History @if (getLastCRMDate($r->id)) Check Date : {{ \Carbon\Carbon::parse(getLastCRMDate($r->id))->format('d-M-Y') }} @endif @endif @if (optional($r->pops->reseller)->name) Manager: {{ $r->pops->reseller->name }} @endif @if ($r->pops->experity_check == 'Yes') POP: {{ $r->pops->popname ?? '' }}@if ($r->pops->subreseller == 'yes') (Sub) @endif @else POP: {{ $r->pops->popname ?? '' }}@if ($r->pops->subreseller == 'yes') (Sub) @endif @endif @can('view-mikrotik-ip') @if (optional($r->pop->nas)->nasname) MK: {{ $r->pop->nas->nasname }} @endif @endcan @if (optional($r->clientsinfo)->area) Area :{{ $r->clientsinfo->area ?? '' }} @endif @if ($r->deleted_at == null && in_array('pop_change_on_client_edit', $permissions)) @endif {{ $r->clientsinfo->clients_name ?? '' }} {{ $r->clientsinfo->contact_no ?? '' }} @if (!empty($r->clientsinfo->contact_no)) @endif

@if ($r->ip_address) IP: {{ $r->ip_address ?? '' }},
@endif @if ($r->mac) MAC: {{ $r->mac ?? '' }},
@endif @if ($r->distribution_point) Distribution point: {{ $r->distribution_point ?? '' }},
@endif @if ($r->connection_type) Connection type: {{ $r->connection_type ?? '' }},
@endif @if ($r->customer_type) Client type: {{ $r->customer_type ?? '' }},
@endif @if ($r->clientsinfo->dob) DOB: {{ $r->clientsinfo->dob ?? '' }},
@endif @if ($r->clientsinfo->father_name) Father: {{ $r->clientsinfo->father_name ?? '' }},
@endif @if ($r->clientsinfo->mother_name) Mother: {{ $r->clientsinfo->mother_name ?? '' }},
@endif @if ($r->clientsinfo->national_id) NID: {{ $r->clientsinfo->national_id ?? '' }},
@endif @if ($r->clientsinfo->passport_no) Passport: {{ $r->clientsinfo->passport_no ?? '' }},
@endif @if ($r->clientsinfo->division) Division: {{ $r->clientsinfo->divisions->name ?? '' }},
@endif @if ($r->clientsinfo->district) District: {{ $r->clientsinfo->districts->name ?? '' }},
@endif @if ($r->clientsinfo->thana) Upazila: {{ $r->clientsinfo->thanas->name ?? '' }},
@endif @if ($r->clientsinfo->area) Area :{{ $r->clientsinfo->area ?? '' }},
@endif @if ($r->clientsinfo->road_name) Road Name: {{ $r->clientsinfo->road_name ?? '' }},
@endif @if ($r->clientsinfo->road_no) Road No: {{ $r->clientsinfo->road_no ?? '' }},
@endif @if ($r->clientsinfo->block_sector) Block/Sector: {{ $r->clientsinfo->block_sector ?? '' }},
@endif @if ($r->clientsinfo->building_no) Building No: {{ $r->clientsinfo->building_no ?? '' }},
@endif @if ($r->clientsinfo->building_name) Building Name: {{ $r->clientsinfo->building_name ?? '' }},
@endif @if ($r->clientsinfo->flat_no) Flat No: {{ $r->clientsinfo->flat_no ?? '' }},
@endif @if ($r->clientsinfo->owner_name) House Owner : {{ $r->clientsinfo->owner_name ?? '' }},
@endif @if ($r->clientsinfo->owner_number) House Owner No: {{ $r->clientsinfo->owner_number ?? '' }},
@endif @if ($r->clientsinfo->other_contact) Clients Other Contact : {{ $r->clientsinfo->other_contact ?? '' }},
@endif @if ($r->clientsinfo->email) Email : {{ $r->clientsinfo->email ?? '' }},
@endif @if ($r->clientsinfo->client_latitude) Latitude : {{ $r->clientsinfo->client_latitude ?? '' }},
@endif @if ($r->clientsinfo->client_longitude) Longitude : {{ $r->clientsinfo->client_longitude ?? '' }},
@endif @if (checkSettings('select_option_for_box_and_ponsetting') == 'enable') @if (!empty($r->clientsinfo->map_box_id)) Map Box : {{ optional($r->clientsinfo->mapBox)->name ?? '' }},
@endif @else @if ($r->clientsinfo->box) Box :{{ $r->clientsinfo->box ?? '' }},
@endif @endif @if ($r->clientsinfo->cable_type) Cable Type :{{ $r->clientsinfo->cable_type ?? '' }},
@endif @if ($r->required_cable != 0) Cable(Meter): {{ $r->required_cable ?? '' }},
@endif @if ($r->clientsinfo->olt_pon) OLT/PON : {{ $r->clientsinfo->olt_pon ?? '' }},
@endif @if ($r->clientsinfo->cable_id) Cable ID : {{ $r->clientsinfo->cable_id ?? '' }},
@endif @if ($r->clientsinfo->cat_type) Cable(CAT-5/CAT-6): {{ $r->clientsinfo->cat_type ?? '' }},
@endif @if ($r->clientsinfo->cat_length) {{ $r->clientsinfo->cat_type ?? 'CAT' }} Length(Meter): {{ $r->clientsinfo->cat_length ?? '' }},
@endif @if (checkSettings('select_option_for_box_and_ponsetting') == 'enable') @if (!empty(optional($r->clientsinfo)->onu_serial)) ONU MAC/Pon No/Serial No: {{ optional(optional($r->clientsinfo)->pon)->name ?? optional($r->clientsinfo)->onu_serial }},
@endif @else @if (!empty(optional($r->clientsinfo)->onu_serial)) ONU MAC/Pon No/Serial No: {{ optional($r->clientsinfo)->onu_serial }},
@endif @endif @if ($r->clientsinfo->olt_pon) OLT No: {{ $r->clientsinfo->olt_pon ?? '' }},
@endif @if ($r->clientsinfo->olt_no) OLT Card Slot No: {{ $r->clientsinfo->olt_no ?? '' }},
@endif @if ($r->clientsinfo->pon_port) PON Module Port No: {{ $r->clientsinfo->pon_port ?? '' }}
@endif @if ($r->clientsinfo->client_latitude && $r->clientsinfo->client_longitude) View Map @endif

CD: {{ date('d-M-Y h:i:sa', strtotime($r->created_at)) }}
@if ($r->clientsinfo->joinDate) JD: {{ date('d-M-Y', strtotime($r->clientsinfo->joinDate)) }} @endif @can('billing_start_time') @if ($r->billing_start_date) Bill Start Date: {{ date('d-M-Y', strtotime($r->billing_start_date)) }} @endif @endcan
{{ $r->deleted_at->format('d-M-Y h:s:a') }} {{-- closeLogs is only passed by the close list pages, so the partial stays usable on every other list. --}} @php($closeLog = ($closeLogs ?? collect())->get($r->id)) @if ($closeLog) Closed By: {{ $closeLog->user->name ?? 'Unknown' }} @if (!empty($closeLog->details)) {{ Str::limit($closeLog->details, 40) }} @endif @endif
{{ $r->clientsinfo->remarks ?? '' }}
{{ optional($r->clientReferer)->firstname . ' ' . optional($r->clientReferer)->lastname }} {{ $r->adminUser->name ?? '' }}
Total Fiber: {{ $list->sum('required_cable') }} Meter,
CAT: {{ $catTotalLength }} Meter,
OTC: {{ $totalOtc }} Taka
Fiber: {{ $list->sum('required_cable') }} Meter,
CAT: {{ $catTotalLength }} Meter,
OTC: {{ $totalOtc }} Taka
MRC: {{ $totalMrc }} TK

Total D⬇️ {{ number_format($list->sum('down_bandwidth') / 1024, 2, '.', '') }} GB

Total U⬆️ {{ number_format($list->sum('up_bandwidth') / 1024, 2, '.', '') }} GB

Total ⬆️ {{ number_format(($list->sum('down_bandwidth') + $list->sum('up_bandwidth')) / 1024, 2, '.', '') }} GB @if (isset($package_limit))

Total Limit ⬆️ {{ number_format($package_limit / 1024, 2, '.', '') }} GB

@endif
@if (request()->path() == 'admin/clients') @endif @if (request()->path() == 'admin/clientSearchReport') @endif
@if (globalPermission('store-items')) @endif {{-- CRM transfer history popup. Shaped like the store items popup above, and for the same two reasons: the layout loads jQuery below this markup, so binding waits for it; and the customer list is re-rendered into the page by ajax, which runs this script again, so the handler is bound once, delegated from document, and the modal lives in rather than in the markup that gets replaced. --}} {{-- Single customer POP change popup. Same shape as the CRM history popup above: the list is re-rendered by ajax, so the handler is bound once from document and the modal is built in . The modal is created after the global Select2 initializer has run, so its select is initialized here with the modal as dropdownParent. --}} @if (in_array('pop_change_on_client_edit', $permissions)) @endif