$module_query = $mySQL_r->prepare("SELECT `module_id`, `name`, `namespace`, `version`, `install_date`, `backup`, `uninstall` FROM `core_modules` ORDER BY `uninstall` ASC, `module_id` ASC"); $module_query->execute(); $module_query->bind_result($mod_id, $name, $namespace, $version, $installed, $backup, $uninstall); $module_query->store_result(); while ($module_query->fetch()) { $row = array(); $row[] = Table::addCell($mod_id); $row[] = Table::addCell($name); $row[] = Table::addCell($namespace); $row[] = Table::addCell($version); $row[] = Table::addCell(date(DATET_SHORT, strtotime($installed))); if ($backup == 1 && $this->accessAdminPage(3)) { $row[] = Table::addCell('<a href="#" onclick="processData(\'/action/modules/backup?m=' . $mod_id . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-export"></span></a>'); } else { $row[] = Table::addCell(''); } if ($uninstall == 1 && $this->accessAdminPage(2)) { $row[] = Table::addCell('<a href="/action/modules/pre_uninstall?ns=' . $namespace . '"><span class="text-danger ' . B_ICON . ' ' . B_ICON . '-remove"></span></a>'); } else { $row[] = Table::addCell(''); } if ($this->accessAdminPage(4)) { $row[] = Table::addCell('<a href="/admin/modules/details/' . $namespace . '"><span class="' . B_ICON . ' ' . B_ICON . '-expand"></span></a>'); } $table->addRow($row); } $table->build(); print $table->getTable(); ?> </div> </div>
if ($event_query !== false) { $event_query->bind_param('ii', $start_record, $record_length); $event_query->bind_result($event_id, $time, $uri, $username, $user_ip, $namespace, $event); $event_query->execute(); $event_query->store_result(); while ($event_query->fetch()) { if ($this->inGroup(1)) { $row['select'] = Table::addCell('<input class="events_check" type="checkbox" value="' . $event_id . '" name="event[]" />'); } $row['ID'] = Table::addCell(str_pad($event_id, 4, 0, STR_PAD_LEFT), 'i_' . $event_id, '', '', true); $row['time'] = Table::addCell(date(DATET_SHORT, strtotime($time)), '', '', true); $row['user_id'] = Table::addCell($username, '', '', true); $row['user_ip'] = Table::addCell('<a href="ipblock_add?ip=' . $user_ip . '" target="_blank" class="bstooltip" data-title="Click to block IP">' . $user_ip . '</a>', '', '', true); $row['uri'] = Table::addCell($uri); $row['ns'] = Table::addCell($namespace, '', '', true); $row['event'] = Table::addCell($event); $event_view->addRow($row); } $event_query->free_result(); } $event_view->build(); print $event_view->getTable(); ?> <script type="text/javascript"> <?php $check = new TableCheck(); $check->setType('event')->addRequire('#event_delete_btn')->create(); print $check->getScript(); ?> </script> </div>
print $paginator->getPaginator(); } else { print '<div class="row pane">' . PHP_EOL; print ' <div class="col-xs-12">' . PHP_EOL; print ' <h4>Failed to load competitions.</h4>' . PHP_EOL; print ' </div>' . PHP_EOL; print '</div>' . PHP_EOL; } } else { $table = $page->getPlugin('table', array('competitions_table')); $table->setIndent(4)->addClass('table-bordered')->addClass('table-hover')->addClass('table-striped')->sort(true)->pager(true); $table->addHeader(array(Table::addTHeadCell('Title', true, '', '', true), Table::addTHeadCell('Date(s)'), Table::addTHeadCell('Location', true, '', '', true), Table::addTHeadCell('Entry Date'), Table::addTHeadCell('<abbr title="Number of Sessions"><b><span class="visible-xs visible-sm">S</span><span class="hidden-xs hidden-sm">Sessions</span></b></abbr>', false, '', '', true), Table::addTHeadCell('<abbr title="Number of Events"><b><span class="visible-xs visible-sm">E</span><span class="hidden-xs hidden-sm">Events</span></b></abbr>', false, '', '', true), Table::addTHeadCell('', false))); if ($meet = $page->getResource('competitions')) { while ($meet_query->fetch()) { if ($comp = $meet->fetchCompetition($comp_id)) { $table->addRow(array(Table::addCell($comp->title), Table::addCell('<span class="hidden">' . strtotime($comp->date['start']) . '</span>' . $comp->date['long']), Table::addCell('<a href="/location/' . $comp->getLocation('ID') . '">' . $comp->getLocation('city') . '</a>'), Table::addCell($comp->date['entry']), Table::addCell($comp->data['sessions']), Table::addCell($comp->data['events']), Table::addCell('<a href="/competitions/meet/' . $comp->ID . '">More...</a>'))); } } $table->build(); print '<div class="row pane">' . PHP_EOL; print ' <div class="col-xs-12">' . PHP_EOL; print $table->getTable(); print ' </div>' . PHP_EOL; print '</div>' . PHP_EOL; } else { print '<div class="row pane">' . PHP_EOL; print ' <div class="col-xs-12">' . PHP_EOL; print ' <h4>Failed to load competitions.</h4>' . PHP_EOL; print ' </div>' . PHP_EOL; print '</div>' . PHP_EOL; }
if ($this->accessAdminPage(3) || $this->accessAdminPage(4)) { $row['check'] = Table::addCell('<input class="articles_check" type="checkbox" value="' . $id . '" name="article[]" />'); } $row['id'] = Table::addCell($id); $row['title'] = Table::addCell($title, 'i_' . $id); $row['pub'] = Table::addCell(Form::toggleLink($this, $publish, '', 3, array('s' => array('h' => 'Click to unpublish article.', 'i' => 'eye-open', 'u' => '/action/news/articles_unpublish?a=' . $id, 'c' => 'processData(this.href);return false;'), 'f' => array('h' => 'Click to publish article.', 'i' => 'eye-close', 'u' => '/action/news/article_publish?a=' . $id, 'c' => 'processData(this.href);return false;')))); $row['perm'] = Table::addCell('<code>' . $perm . '</code>'); $row['user'] = Table::addCell($user); $row['group'] = Table::addCell($group); $row['revs'] = Table::addCell($revs); $row['hits'] = Table::addCell($hits); if ($this->accessAdminPage(2)) { $row['Edit'] = Table::addCell('<a href="article_edit/' . $id . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>'); } if ($this->accessAdminPage(4)) { $row['preview'] = Table::addCell('<a href="article_preview/' . $aid . '" target="_blank" id="aid_' . $id . '"><span class="' . B_ICON . ' ' . B_ICON . '-new-window"></span></a>'); } $articles->addRow($row); } } $articles->build(); print $articles->getTable(); ?> </div> </div> </div> </div> <script type="text/javascript"> $(function() { $("#selectAll").click(function(){ $(".articles_check").prop('checked', this.checked);
while ($group_query->fetch()) { if ($this->accessAdminPage(13) || $this->inGroup(13, true)) { $row['select'] = Table::addCell('<input class="groups_check" type="checkbox" value="' . $GID . '" name="group[]" />'); } $row['ID'] = Table::addCell($GID); $row['name'] = Table::addCell($g_name, 'i_' . $GID); $row['desc'] = Table::addCell($desc); $row['en'] = Table::addCell(Form::toggleLink($this, $enabled, '', 6, array('s' => array('h' => 'Click to disable group.', 'i' => 'ok-sign', 'u' => '/action/user/group_disable?g' . $GID, 'c' => 'processData(this.href);return false;'), 'f' => array('h' => 'Click to enable group.', 'i' => 'ban-circle', 'u' => '/action/user/group_enable?g=' . $GID, 'c' => 'processData(this.href);return false;')))); $row['np'] = Table::addCell($pages); if ($type == 'p') { $row['t'] = Table::addCell('<abbr title="Primary Group">P</abbr>'); } else { $row['t'] = Table::addCell('<abbr title="Secondary Group">S</abbr>'); } if ($this->accessAdminPage(13)) { $row['edit'] = Table::addCell('<a href="group_edit/' . $GID . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>'); } $group_view->addRow($row); } $group_view->build(); print $group_view->getTable(); ?> <script type="text/javascript"> $(function() { $("#selectAll").click(function(){ $(".groups_check").prop('checked', this.checked); if(this.checked){ $(".group_need_check").removeClass("disabled"); }else{ $("#edit_btn").addClass("disabled"); $(".group_need_check").addClass("disabled");
<div class="row pane"> <div class="col-xs-12"> <h1 class="page-header">Backup Modules</h1> <?php $table = $page->getPlugin('table', array('modules')); $table->setIndent(8)->addClass('table-bordered')->addClass('table-hover')->addClass('table-striped')->sort(true); $table->addHeader(array(Table::addTHeadCell('ID'), Table::addTHeadCell('Name'), Table::addTHeadCell('Namespace'), Table::addTHeadCell('Installed On'), Table::addTHeadCell('', false))); if ($this->inGroup(1)) { $module_query = $mySQL_r->prepare("SELECT `module_id`, `name`, `namespace`, `install_date` FROM `core_modules` ORDER BY `install_date` DESC"); } else { $module_query = $mySQL_r->prepare("SELECT `module_id`, `name`, `namespace`, `install_date` FROM `core_modules` WHERE `uninstall`='1' ORDER BY `install_date` DESC"); } $module_query->execute(); $module_query->bind_result($mod_id, $name, $namespace, $installed); $module_query->store_result(); while ($module_query->fetch()) { $row = array(); $row[] = Table::addCell($mod_id); $row[] = Table::addCell($name); $row[] = Table::addCell($namespace); $row[] = Table::addCell(date(DATET_SHORT, strtotime($installed))); $row[] = Table::addCell('<a href="#" onclick="processData(\'/action/modules/backup?m=' . $mod_id . '\')">Backup</a>'); $table->addRow($row); } $table->build(); print $table->getTable(); ?> </div> </div>
} $row['ID'] = Table::addCell($id); $row['action'] = Table::addCell($module . '::' . $action . '()', 'i_' . $id, '', true); $row['enable'] = Table::addCell(Form::toggleLink($this, $enable, '', '', array('s' => array('i' => 'ok'), 'f' => array('i' => 'remove')))); if ($last_run === NULL) { $last_run = 'Never'; } else { $last_run = date(DATET_SHORT, strtotime($last_run)); } $row['lastrun'] = Table::addCell($last_run, '', '', true); $row['desc'] = Table::addCell($desc); if ($this->accessAdminPage(52)) { $row['edit'] = Table::addCell('<a href="cron_edit/' . $id . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>'); } if ($this->inGroup(54, true)) { $row['run'] = Table::addCell('<a href="/action/core/cron_run?j=' . $id . '" onclick="processData(this.href);return false;"><span class="' . B_ICON . ' ' . B_ICON . '-play"></span></a>'); } $jobs->addRow($row); } $job_query->free_result(); $jobs->build(); print $jobs->getTable(); ?> </div> </div> </div> </div> <script type="text/javascript"> <?php $check = new TableCheck();
/** * Add cell */ public function testCountColumns() { $oTable = new Table(); $oTable->addRow(); $element = $oTable->addCell(); $this->assertEquals($oTable->countColumns(), 1); $element = $oTable->addCell(); $element = $oTable->addCell(); $this->assertEquals($oTable->countColumns(), 3); }
$table = $page->getPlugin('table', array('sessions')); $table->setIndent(' ')->addClass('table-bordered')->addClass('table-hover')->addClass('table-striped'); $thead = array(); $thead['ID'] = Table::addTHeadCell('ID'); $thead['Created'] = Table::addTHeadCell('Created'); $thead['IP'] = Table::addTHeadCell('IP'); $thead['LPR'] = Table::addTHeadCell('Last Page Request'); if ($this->accessAdminPage(20)) { $thead['destroy'] = Table::addTHeadCell(''); } $table->addHeader($thead); while ($session_query->fetch()) { $row['ID'] = Table::addCell($sessID); $row['Created'] = Table::addCell($sessCreate); $row['IP'] = Table::addCell($sessIP); $row['LPR'] = Table::addCell(date(DATET_SHORT, strtotime($sessLPR))); if ($this->accessAdminPage(20)) { $row['destroy'] = Table::addTHeadCell('<a href="#" onclick="processData(\'/action/user/session_destroy/' . $sessID . '\')">Destroy <span class="' . B_ICON . ' ' . B_ICON . '-remove-sign"</a>'); } $table->addRow($row); } $table->build(); ?> <div class="row pane"> <div class="col-xs-12"> <h1 class="page-header">Edit User</h1> <ul class="nav nav-tabs nav-justified" role="tablist"> <li class="active"><a href="#details" role="tab" data-toggle="tab">Details</a></li> <li><a href="#sessions" role="tab" data-toggle="tab">Sessions</a></li> </ul>
<div class="row pane"> <div class="col-xs-12"> <h1 class="page-header">Uninstall Module</h1> <?php $table = $page->getPlugin('table', array('modules')); $table->setIndent(8)->addClass('table-bordered')->addClass('table-hover')->addClass('table-striped')->sort(true); $table->addHeader(array(Table::addTHeadCell('ID'), Table::addTHeadCell('Name'), Table::addTHeadCell('Namespace'), Table::addTHeadCell('Installed On'), Table::addTHeadCell('', false))); if ($this->inGroup(1)) { $module_query = $mySQL_r->prepare("SELECT `module_id`, `name`, `namespace`, `install_date` FROM `core_modules` ORDER BY `install_date` DESC"); } else { $module_query = $mySQL_r->prepare("SELECT `module_id`, `name`, `namespace`, `install_date` FROM `core_modules` WHERE `uninstall`='1' ORDER BY `install_date` DESC"); } $module_query->execute(); $module_query->bind_result($mod_id, $name, $namespace, $installed); $module_query->store_result(); while ($module_query->fetch()) { $row = array(); $row[] = Table::addCell($mod_id); $row[] = Table::addCell($name); $row[] = Table::addCell($namespace); $row[] = Table::addCell(date(DATET_SHORT, strtotime($installed))); $row[] = Table::addCell('<a href="/action/modules/pre_uninstall?ns=' . $namespace . '">Uninstall</a>'); $table->addRow($row); } $table->build(); print $table->getTable(); ?> </div> </div>
if ($rown == 1) { $row['up'] = Table::addCell(''); } else { $row['up'] = Table::addCell('<a href="#" onclick="processData(\'/action/core/menu_up/' . $MID . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-chevron-up"></span></a>'); } if ($rown == $menu_query->num_rows) { $row['down'] = Table::addCell(''); } else { $row['down'] = Table::addCell('<a href="#" onclick="processData(\'/action/core/menu_down/' . $MID . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-chevron-down"></span></a>'); } } if ($this->accessAdminPage(42)) { $row['edit'] = Table::addCell('<a href="menu_edit/' . $MID . '/"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>'); } if ($this->accessAdminPage(42)) { $row['delete'] = Table::addCell('<a href="#" onclick="processData(\'/action/core/menu_remove/' . $MID . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-remove-sign"></span></a>'); } $menu->addRow($row); $rown++; } $menu_query->free_result(); $menu->build(); print $menu->getTable(); ?> </div> </div> </div> </div> <script type="text/javascript"> <?php
$block_query->bind_result($block_id, $time, $by, $ip, $expires, $left, $reason); $block_query->execute(); $block_query->store_result(); while ($block_query->fetch()) { if ($this->accessAdminPage(42) || $this->inGroup(43, true)) { $row['select'] = Table::addCell('<input class="blocks_check" type="checkbox" value="' . $block_id . '" name="block[]" />'); } $row['ID'] = Table::addCell($block_id); $row['on'] = Table::addCell(date(DATE_LONG, strtotime($time))); $row['by'] = Table::addCell($by); $row['ip'] = Table::addCell($ip, 'i_' . $block_id); $row['expires'] = Table::addCell(date(DATET_LONG, strtotime($expires))); $row['left'] = Table::addCell($left); $row['reason'] = Table::addCell($reason); if ($this->accessAdminPage(42)) { $row['edit'] = Table::addCell('<a href="ipblock_edit/' . $block_id . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>'); } $block->addRow($row); } $block_query->free_result(); $block->build(); print $block->getTable(); ?> </div> </div> </div> </div> <script type="text/javascript"> <?php $check = new TableCheck();
$option_query->bind_result($option_id, $name, $value, $desc); $option_query->execute(); $option_query->store_result(); while ($option_query->fetch()) { if (strlen($value) > 48) { $value = substr($value, 0, 47) . '…'; } if ($this->accessAdminPage(12)) { $row['select'] = Table::addCell('<input class="options_check" type="checkbox" value="' . $option_id . '" name="option[]" />'); } $row['ID'] = Table::addCell($option_id, '', '', '', true); $row['name'] = Table::addCell($name, 'i_' . $option_id, '', true); $row['value'] = Table::addCell($value, '', ''); $row['desc'] = Table::addCell($desc); if ($this->accessAdminPage(12)) { $row['edit'] = Table::addCell('<a href="option_edit/' . $option_id . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>'); } $option_view->addRow($row); } $option_query->free_result(); $option_view->build(); print $option_view->getTable(); ?> </div> </div> </div> </div> <script type="text/javascript"> $(function() { $("#selectAll").click(function(){
$thead['Group'] = Table::addTHeadCell('Group'); $thead['Username'] = Table::addTHeadCell('Username'); $thead['last'] = Table::addTHeadCell('Last Activity'); if ($page->inGroup(2020)) { $thead['logout'] = Table::addTHeadCell('Logout'); } $users->addHeader($thead); $user_query = $mySQL_r->prepare("SELECT `user`, CONCAT(`f_name`, ' ', `s_name`), `core_groups`.`name`, `username`, MAX(`lpr`) FROM `core_sessions`\nINNER JOIN `core_users` ON `user`=`core_users`.`id`\nLEFT JOIN `core_groups` ON `p_group`=`GID`\nGROUP BY `user` ORDER BY `lpr`"); $user_query->execute(); $user_query->bind_result($user_id, $name, $group, $username, $lpr); $user_query->store_result(); $n = 1; while ($user_query->fetch()) { $row = array(); $row['n'] = Table::addCell($n); $row['name'] = Table::addCell($name); $row['group'] = Table::addCell($group); $row['user'] = Table::addCell($username); $row['last'] = Table::addCell(date(DATET_SHORT, strtotime($lpr))); if ($page->inGroup(2020)) { $row['logout'] = Table::addTHeadCell('<a href="#" onclick="processData(\'/action/user/session_destroym/' . $user_id . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-log-out"</a>'); } $users->addRow($row); $n++; } $users->build(); print $users->getTable(); ?> </div> </div>
function format($type = 'all') { switch ($type) { case 'all': $variables['meetID'] = $this->ID; $variables['meetTitle'] = $this->title; $variables['meetDate'] = $this->date['long']; $variables['meetEntryDate'] = $this->date['entry']; // Parse Info template $info = ''; $this->parent->parent->debug($this::name_space . ': Parsing info template...'); if ($this->location !== false) { $variables['meetLocationID'] = $this->location->ID; $variables['meetLocationName'] = $this->location->name; $variables['meetLocationCity'] = $this->location->address['city']; if ($text = $this->parseTemplate($variables, dirname(__FILE__) . '/templates/full_comp-info.htm')) { $info = $text; } } else { if ($text = $this->parseTemplate($variables, dirname(__FILE__) . '/templates/full_comp-info_noLoc.htm')) { $info = $text; } } // Parse Notes template $notes = ''; if ($this->show['notes'] == true) { $this->parent->parent->debug($this::name_space . ': Parsing notes template...'); foreach ($this->notes as $type => $content) { if ($content != '') { $variables['noteType'] = ucfirst($type); $variables['noteContent'] = $content; if ($text = $this->parseTemplate($variables, dirname(__FILE__) . '/templates/full_comp-note.htm')) { $notes .= $text; } } } unset($variables['noteType'], $variables['noteContent']); } $docs = ''; // Parse results service template $res = ''; if ($this->res['enable'] == true && $this->res['text'] != '') { $this->parent->parent->debug($this::name_space . ': Parsing results service template...'); $variables['resServText'] = $this->res['text']; $variables['resServMeet'] = $this->res['meet']; $variables['resServSeries'] = $this->res['series']; $variables['resServer'] = $this->parent->parent->config->getOption('comp_resServer'); if ($text = $this->parseTemplate($variables, dirname(__FILE__) . '/templates/full_comp-resServ.htm')) { $res = $text; } } // Parse schedule template $schedule = $sessions = ''; if ($this->show['schedule'] == true) { $defSessionTable = new Table($this->parent, 'schedule'); $defSessionTable->setIndent(16); $defSessionTable->addClass('table-striped'); $defSessionTable->addClass('table-bordered'); $defSessionTable->addClass('table-condensed'); $defSessionTable->addClass('table-hover'); $defSessionTable->sort(true); $defSessionTable->pager(false); $defSessionTable->addHeader(array(Table::addTHeadCell('Event #'), Table::addTHeadCell('Gender'), Table::addTHeadCell('Age Group'), Table::addTHeadCell('Distance'), Table::addTHeadCell('Stroke'), Table::addTHeadCell('Round'))); $this->parent->parent->debug($this::name_space . ': Parsing event schedule...'); foreach ($this->data['S'] as $sNum => $session) { $sessionTable = clone $defSessionTable; $sessionTable->setID('m_' . $this->ID . '_sch_s_' . $sNum); // Parse session times template $sessionTimes = $this->parent->getPlugin('table', array('m_' . $this->ID . '_time_s_' . $sNum)); $sessionTimes->setIndent(16); $sessionTimes->addClass('table-condensed'); $this->parent->parent->debug($this::name_space . ': Parsing session times...'); $cols = array(); foreach ($session['t'] as $type => $time) { $type = $this->options['times'][$type]; $cols[] = Table::addCell('<b>' . $type . '</b>'); $cols[] = Table::addCell($time); } $sessionTimes->addRow($cols); $sessionTimes->build(); $sessionTimes = $sessionTimes->getTable(); unset($variables['type'], $variables['time'], $text); // Parse event template $this->parent->parent->debug($this::name_space . ': Parsing events template...'); foreach ($session['E'] as $event) { $eventNumber = $event['prefix'] == 1 ? $sNum . $event['num'] : $event['num']; $event = $this->parseEvent($event, true); $sessionTable->addRow(array(Table::addCell($eventNumber), Table::addCell($event['gender']), Table::addCell($event['age']), Table::addCell($event['distance']), Table::addCell($event['stroke']), Table::addCell($event['round']))); } $sessionTable->build(); // Parse session template $variables['sessionNumber'] = $session['number']; $variables['sessionDate'] = $session['date']; $variables['sessionTimes'] = $sessionTimes; $variables['events'] = $sessionTable->getTable(); if ($text = $this->parseTemplate($variables, dirname(__FILE__) . '/templates/full_comp-session.htm')) { $sessions .= $text; } } // End Session foreach unset($variables['sessionNumber'], $variables['sessionDate'], $variables['sessionTimes'], $sessionTable); $this->parent->parent->debug($this::name_space . ': Parsing schedule template...'); $variables['sessions'] = $sessions; if ($text = $this->parseTemplate($variables, dirname(__FILE__) . '/templates/full_comp-schedule.htm')) { $schedule = $text; } } $accordion = $this->parent->getPlugin('accordion'); $accordion->setID('acc_' . $this->ID); $accordion->addPage('_info', 'Information', $info); if ($res != '') { $accordion->addPage('_results', 'Results Service', $res); } if ($notes != '') { $accordion->addPage('_notes', 'Notes', $notes); } if ($docs != '') { $accordion->addPage('_documents', 'Documents', $docs); } if ($schedule != '') { $accordion->addPage('_schedule', 'Schedule', $schedule); } $accordion->setOpen(0); $accordion->create(); $variables['meet'] = $accordion->getAccordion(); if ($text = $this->parseTemplate($variables, dirname(__FILE__) . '/templates/full_comp.htm')) { return $text; } break; } }
<div class="col-xs-12"> <h2 class="sub-header">Latest Blocked IPs</h2> <?php $ips = $page->getPlugin('table', array('ips')); $ips->setIndent(' ')->addClass('table-striped'); $thead = array(); $thead['n'] = Table::addTHeadCell('#'); $thead['ip'] = Table::addTHeadCell('IP'); $thead['until'] = Table::addTHeadCell('Until'); $ips->addHeader($thead); $ip_query = $mySQL_r->prepare("\nSELECT `id`, INET_NTOA(`IP`), DATE_ADD(`time`, INTERVAL `length` DAY)\nFROM `core_ip`\nORDER BY `time` DESC\n"); $ip_query->execute(); $ip_query->bind_result($ban_id, $ip, $until); $ip_query->store_result(); while ($ip_query->fetch()) { $row = array(); $row['ID'] = Table::addCell($ban_id); $row['ip'] = Table::addCell($ip); $row['until'] = Table::addCell(date(DATET_LONG, strtotime($until))); $ips->addRow($row); } $ips->build(); print $ips->getTable(); ?> </div> </div> </div> <?php } ?> </div>
<div class="col-xs-12"> <h2 class="sub-header">Primary Groups</h2> <?php $groups = $page->getPlugin('table', array('groups')); $groups->setIndent(' ')->addClass('table-striped'); $thead = array(); $thead['ID'] = Table::addTHeadCell('ID'); $thead['Name'] = Table::addTHeadCell('Name'); $thead['Pages'] = Table::addTHeadCell('Pages'); $groups->addHeader($thead); $group_query = $mySQL_r->prepare("\nSELECT `core_groups`.`GID`, `name`, COUNT(`PID`)\nFROM `core_groups`\nLEFT JOIN `core_gpage` ON `core_gpage`.`GID`=`core_groups`.`GID`\nWHERE `type`='p' GROUP BY `core_groups`.`GID`\nORDER BY `name` ASC\n"); $group_query->execute(); $group_query->bind_result($group_id, $name, $pages); $group_query->store_result(); while ($group_query->fetch()) { $row['ID'] = Table::addCell($group_id); $row['name'] = Table::addCell($name); $row['pages'] = Table::addCell($pages); $groups->addRow($row); unset($row); } $groups->build(); print $groups->getTable(); ?> </div> </div> </div> <?php } ?> </div>
$module_query->bind_result($id, $name, $city, $county, $map); $module_query->store_result(); while ($module_query->fetch()) { $row = array(); if ($this->accessAdminPage(2) || $this->inGroup(2, true)) { $row['select'] = Table::addCell('<input class="locations_check" type="checkbox" value="' . $id . '" name="location[]" />'); } $row[] = Table::addCell($id); $row[] = Table::addCell($name, 'i_' . $id); $row[] = Table::addCell($city); $row[] = Table::addCell($county); $row[] = Table::addCell(Form::toggleLink($this, $map, '', '', array('s' => array('i' => 'ok'), 'f' => array('i' => 'remove')))); if ($this->accessAdminPage(2)) { $row[] = Table::addCell('<a href="/admin/location/edit/' . $id . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>'); } $row[] = Table::addCell('<a href="/location/' . $id . '" target="_blank"><span class="' . B_ICON . ' ' . B_ICON . '-new-window"></span></a>'); $table->addRow($row); } $table->build(); print $table->getTable(); ?> <script type="text/javascript"> $(function() { $("#selectAll").click(function(){ $(".locations_check").prop('checked', this.checked); if(this.checked){ $(".location_need_check").removeClass("disabled"); }else{ $("#edit_btn").addClass("disabled"); $(".location_need_check").addClass("disabled"); }
$thead['lock'] = Table::addTHeadCell('Lock', '', false); $session_view->addHeader($thead); $session_query = $mySQL_r->prepare("SELECT `core_sessions`.`id`, CONCAT(`core_users`.`f_name`, ' ', `core_users`.`s_name`), `core_users`.`username`, INET_NTOA(`ip`), `created`, `lpr` FROM `core_sessions` INNER JOIN `core_users` ON `core_sessions`.`user`=`core_users`.`id` ORDER BY `core_users`.`id` ASC, `core_sessions`.`lpr` DESC"); $session_query->execute(); $session_query->bind_result($session_id, $name, $username, $ip, $created, $lpr); $session_query->store_result(); while ($session_query->fetch()) { $row['check'] = Table::addCell('<input class="sessions_check" type="checkbox" value="' . $session_id . '" name="session[]" />'); $row['ID'] = Table::addCell($session_id, 'i_' . $session_id); $row['name'] = Table::addCell($name); $row['username'] = Table::addCell($username); $row['ip'] = Table::addCell($ip); $row['created'] = Table::addCell(date(DATET_SHORT, strtotime($created))); $row['lpr'] = Table::addCell(date(DATET_SHORT, strtotime($lpr))); $row['del'] = Table::addCell('<a href="#" onclick="processData(\'/action/user/session_destroy/' . $session_id . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-remove-sign"</a>'); $row['lock'] = Table::addCell('<a href="#" onclick="processData(\'/action/user/session_lock/' . $session_id . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-lock"</a>'); $session_view->addRow($row); } $session_view->build(); print $session_view->getTable(); ?> </div> </div> </div> </div> <script type="text/javascript"> <?php $check = new TableCheck(); $check->setType('session')->create(); print $check->getScript(); ?>