rs->isEmpty()) {
if ($filter->show()) {
echo '
' . __('No record matches the filter') . '
';
} else {
echo '' . __('No record') . '
';
}
} else {
$pager = new dcPager($filter->page, $this->rs_count, $filter->nb, 10);
$pager->base_url = $pager_url;
$epc_id = [];
if (isset($_REQUEST['epc_id'])) {
foreach ($_REQUEST['epc_id'] as $v) {
$epc_id[(int) $v] = true;
}
}
$cols = [
'key' => '' . __('Key') . ' | ',
'value' => '' . __('Value') . ' | ',
'date' => '' . __('Date') . ' | '
];
$html_block = '' .
(
$filter->show() ?
sprintf(__('List of %s records matching the filter.'), $this->rs_count) :
sprintf(__('List of %s records.'), $this->rs_count)
) . '' .
'' . implode($cols) . '
%s
%s
';
if ($enclose_block) {
$html_block = sprintf($enclose_block, $html_block);
}
$blocks = explode('%s', $html_block);
echo $pager->getLinks() . $blocks[0];
while ($this->rs->fetch()) {
echo $this->line(isset($epc_id[$this->rs->epc_id]));
}
echo $blocks[1] . $blocks[2] . $pager->getLinks();
}
}
private function line($checked)
{
$cols = [
'check' => '' . form::checkbox(['epc_id[]'], $this->rs->epc_id, ['checked' => $checked]) . ' | ',
'key' => '' . html::escapeHTML($this->rs->epc_key) . ' | ',
'value' => '' . html::escapeHTML($this->rs->epc_value) . ' | ',
'date' => '' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->epc_upddt) . ' | '
];
return
'' .
implode($cols) .
'
';
}
}