function getTable($res, $width = '850', $obj = '') { $extra_table_attr = array('width' => $width); $tbl = new HTML_Table(get_class($this), 'display', 0, 0, 2, $extra_table_attr); $frm = new HTML_Form(); $kk_trick = array(); $tbl->addRow('', $kk_trick, '<tfoot>'); $tbl->addCell(tableFooter($obj), NULL, 'data', array('colspan' => '5')); $tbl->addRow('main_table'); $tbl->addCell($frm->addInput('checkbox', 'checkboxall', '', array('class' => 'check-all')), 'first', 'header'); $tbl->addCell('Location', null, 'header'); $tbl->addCell('Time on site', null, 'header'); $tbl->addCell('User', null, 'header'); $tbl->addCell('On-Page', null, 'header'); $tbl->addCell('Referer', null, 'header'); $tbl->addCell('', null, 'header'); if ($res) { $objGeoIP = new GeoIP(); while ($res->fetch($res)) { $objGeoIP->search_ip($res->ip); if ($objGeoIP->found()) { $country = $objGeoIP->getCountryName(); } else { $country = $res->ip; } $check_this = $frm->addInput('checkbox', 'check_row[]', $res->id, array('id' => 'check_row[]')); $tbl->addRow($class); $tbl->addCell($check_this); $tbl->addCell('<a href="http://www.geoiptool.com/es/?IP=' . $res->ip . '" target="_blank">' . $country . '</a>'); $tbl->addCell(round(($res->hora - $res->conected_from) / 60, 2) . ' Min.'); $tbl->addCell($res->user != '' ? $res->user : '******'); $tbl->addCell('<a href="http://www.' . $web->domain . $res->page . '" target="_blank">' . $res->page . '</a>'); $tbl->addCell('<a href="' . $res->referer . '" target="_blank">' . substr($res->referer, 0, 20) . '</a>'); $tbl->addCell('<a href="admin-generic-edit.php?id=' . $res->id . '&fld=' . strtolower(get_class()) . '"> <img src="/template/kadmin/images/icons/pencil.png" alt="Edit" /> </a> <a href="admin-generic-list.php?id=' . $res->id . '&fld=' . strtolower(get_class()) . '&action=delete" onClick="return confirmDel();"> <img src="/template/kadmin/images/icons/cross.png" alt="Delete" /> </a>'); } } return $tbl->display(); }