Files

53 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2011-04-24 00:52:50 +00:00
<?php
$no_refresh = true;
2015-07-13 20:10:26 +02:00
$pagetitle[] = 'Search';
2011-10-18 14:41:19 +00:00
2015-07-13 20:10:26 +02:00
$sections = array(
'ipv4' => 'IPv4 Address',
'ipv6' => 'IPv6 Address',
'mac' => 'MAC Address',
'arp' => 'ARP Table',
2017-06-26 07:58:17 -05:00
'fdb' => 'FDB Table'
2015-07-13 20:10:26 +02:00
);
2015-07-13 20:10:26 +02:00
if (dbFetchCell('SELECT 1 from `packages` LIMIT 1')) {
$sections['packages'] = 'Packages';
}
2011-04-24 00:52:50 +00:00
2015-07-13 20:10:26 +02:00
if (!isset($vars['search'])) {
$vars['search'] = 'ipv4';
}
2011-04-24 00:52:50 +00:00
print_optionbar_start('', '');
2015-07-13 20:10:26 +02:00
echo '<span style="font-weight: bold;">Search</span> &#187; ';
2011-04-24 00:52:50 +00:00
unset($sep);
2015-07-13 20:10:26 +02:00
foreach ($sections as $type => $texttype) {
echo $sep;
if ($vars['search'] == $type) {
echo "<span class='pagemenu-selected'>";
}
2011-04-24 00:52:50 +00:00
2016-02-17 13:59:58 +00:00
// echo('<a href="search/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $texttype .'</a>');
2015-07-13 20:10:26 +02:00
echo generate_link($texttype, array('page' => 'search', 'search' => $type));
2011-04-24 00:52:50 +00:00
2015-07-13 20:10:26 +02:00
if ($vars['search'] == $type) {
echo '</span>';
}
2011-04-24 00:52:50 +00:00
2015-07-13 20:10:26 +02:00
$sep = ' | ';
2011-04-24 00:52:50 +00:00
}
2015-07-13 20:10:26 +02:00
unset($sep);
2011-04-24 00:52:50 +00:00
print_optionbar_end();
2011-04-24 00:52:50 +00:00
2015-07-13 20:10:26 +02:00
if (file_exists('pages/search/'.$vars['search'].'.inc.php')) {
include 'pages/search/'.$vars['search'].'.inc.php';
2016-08-18 20:28:22 -05:00
} else {
2015-07-13 20:10:26 +02:00
echo report_this('Unknown search type '.$vars['search']);
2011-04-24 00:52:50 +00:00
}