| # | <%= t('admin.customers.table.name', 'Nama') %> | <%= t('admin.customers.table.phone_tag', 'Telepon / Tag ONU') %> | <%= t('admin.customers.table.package', 'Paket') %> | <%= t('admin.cust.f_mikrotik_conn','Koneksi MikroTik') %> | <%= t('admin.customers.table.address', 'Alamat') %> | <%= t('admin.customers.table.status', 'Status') %> | <%= t('admin.customers.table.unpaid', 'Tagihan Belum Bayar') %> | <%= t('admin.customers.table.actions', 'Aksi') %> | |
|---|---|---|---|---|---|---|---|---|---|
| <%= t('admin.customers.empty', 'Belum ada pelanggan') %> | |||||||||
| <%= i+1 %> |
<%= c.name %><% var _miss=[]; if(!c.phone)_miss.push('HP'); if(!c.lat||!c.lng)_miss.push('koordinat'); if(!c.genieacs_tag)_miss.push('ACS'); %><% if(_miss.length===0){ %><% } else { %><% } %>
<% if (c.customer_code) { %> <%= c.customer_code %> <% } %>
|
<%= c.phone || '-' %>
<% if (c.genieacs_tag) { %> <%= c.genieacs_tag %> <% } %>
|
<% if (c.package_name) { %>
<%= c.package_name %>
<%= (c.speed_down/1000).toFixed(0) %>/<%= (c.speed_up/1000).toFixed(0) %> Mbps • Rp <%= c.package_price ? c.package_price.toLocaleString('id-ID') : '-' %>
<% if (c.package_billing_type === 'prepaid' || c.expired_at) { %>
<%
const expDateStr = c.expired_at ? String(c.expired_at).slice(0, 10) : '-';
const isExpired = c.expired_at ? (new Date(c.expired_at) < new Date()) : false;
%>
Exp: <%= expDateStr %>
<% } %>
<% } else { %>-<% } %>
|
<%
const username = String(c.pppoe_username || c.hotspot_username || '').trim().toLowerCase();
const session = username && typeof activeSessionsMap !== 'undefined' && activeSessionsMap && activeSessionsMap.get ? activeSessionsMap.get(username) : null;
const isOnline = !!session;
const rxBytes = session && session.bytesIn ? session.bytesIn : (c.bytes_in || 0);
const txBytes = session && session.bytesOut ? session.bytesOut : (c.bytes_out || 0);
function fmtB(b) {
const num = Number(b) || 0;
if (num <= 0) return '0 B';
const k = 1024;
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
const i = Math.floor(Math.log(num) / Math.log(k));
return (num / Math.pow(k, i)).toFixed(1) + ' ' + sizes[i];
}
%>
<% if (isOnline) { %>
ONLINE
<%= session.uptime %>
<%= session.ip %><% if (session.type) { %> (<%= session.type.toUpperCase() %>)<% } %>
<% } else { %>
OFFLINE
Tidak Terhubung
<% } %>
RX: <%= fmtB(rxBytes) %>
TX: <%= fmtB(txBytes) %>
|
<% if (c.status==='active') { %><%= t('admin.customers.filter.active', 'Aktif') %>
<% } else if (c.status==='suspended') { %><% if (c.deactivate_cause==='auto_unpaid') { %> <%= t('admin.cust.inactive','Nonaktif') %> (auto)<% } else { %><%= t('admin.customers.filter.suspended', 'Suspend') %><% } %>
<% } else { %><%= t('admin.customers.filter.inactive', 'Nonaktif') %><% } %>
<% if (c.status === 'inactive' && (c.reg_total || c.reg_due_date || c.reg_voucher_code)) { %>
Est: Rp <%= Number(c.reg_total||0).toLocaleString('id-ID') %>
<% if (c.reg_due_date) { %> • JT <%= c.reg_due_date %><% } %>
<% if (c.reg_voucher_code) { %> • <%= c.reg_voucher_code %><% } %>
<% } %>
<%= t('admin.customers.auto_isolate.label', 'Auto Isolir') %>:
<%= c.auto_isolate === 0 ? t('admin.customers.auto_isolate.off', 'OFF') : t('admin.customers.auto_isolate.date_prefix', 'Tgl ') + (c.isolate_day || 10) %>
|
<% if (c.unpaid_count > 0) { %> <%= c.unpaid_count %> <%= t('admin.customers.unpaid_suffix', 'tagihan') %> <% } else { %><%= t('admin.customers.paid_label', 'Lunas') %><% } %> |
<% if (c.status === 'inactive') { %>
<% } %>
<% if (typeof session !== 'undefined' && session && !session.isCashier) { %>
<% if (c.package_id && (c.package_promo_cycles || 0) > 0) { %>
<% } %>
<% if (c.package_id && c.install_date && c.package_prorate_first_invoice) { %>
<% } %>
<% } %>
<% if (!c.pppoe_username) { %>
<% } %>
|
||
-------