2011-04-24 00:52:50 +00:00
|
|
|
<?php
|
|
|
|
|
2016-10-13 14:59:06 -05:00
|
|
|
$no_refresh = true;
|
|
|
|
|
2011-10-18 14:41:19 +00:00
|
|
|
$pagetitle[] = 'Search';
|
|
|
|
|
2015-01-07 09:22:39 +00:00
|
|
|
$sections = [
|
|
|
|
'ipv4' => 'IPv4 Address',
|
|
|
|
'ipv6' => 'IPv6 Address',
|
2024-01-05 05:39:12 +01:00
|
|
|
'mac' => 'MAC Address',
|
|
|
|
'arp' => 'ARP Table',
|
|
|
|
'fdb' => 'FDB Table',
|
2015-01-07 09:22:39 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
if (dbFetchCell('SELECT 1 from `packages` LIMIT 1')) {
|
|
|
|
$sections['packages'] = 'Packages';
|
|
|
|
}
|
2011-04-24 00:52:50 +00:00
|
|
|
|
2019-04-11 23:26:42 -05:00
|
|
|
$search_type = basename($vars['search'] ?? 'ipv4');
|
2011-04-24 00:52:50 +00:00
|
|
|
|
|
|
|
print_optionbar_start('', '');
|
|
|
|
|
2011-04-29 23:09:35 +00:00
|
|
|
echo '<span style="font-weight: bold;">Search</span> » ';
|
|
|
|
|
2011-04-24 00:52:50 +00:00
|
|
|
unset($sep);
|
|
|
|
foreach ($sections as $type => $texttype) {
|
|
|
|
echo $sep;
|
2011-09-19 11:15:01 +00:00
|
|
|
if ($vars['search'] == $type) {
|
2011-04-24 00:52:50 +00:00
|
|
|
echo "<span class='pagemenu-selected'>";
|
|
|
|
}
|
|
|
|
|
2016-02-17 13:59:58 +00:00
|
|
|
// echo('<a href="search/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $texttype .'</a>');
|
2011-09-19 11:15:01 +00:00
|
|
|
echo generate_link($texttype, ['page' => 'search', 'search' => $type]);
|
2011-04-24 00:52:50 +00:00
|
|
|
|
2011-09-19 11:15:01 +00:00
|
|
|
if ($vars['search'] == $type) {
|
|
|
|
echo '</span>';
|
|
|
|
}
|
2011-04-24 00:52:50 +00:00
|
|
|
|
|
|
|
$sep = ' | ';
|
|
|
|
}
|
2015-07-13 20:10:26 +02:00
|
|
|
|
2011-04-24 00:52:50 +00:00
|
|
|
unset($sep);
|
|
|
|
|
2017-01-25 11:43:45 -06:00
|
|
|
print_optionbar_end();
|
2011-04-24 00:52:50 +00:00
|
|
|
|
2019-04-11 23:26:42 -05:00
|
|
|
if (file_exists("includes/html/pages/search/$search_type.inc.php")) {
|
|
|
|
include "includes/html/pages/search/$search_type.inc.php";
|
2016-08-18 20:28:22 -05:00
|
|
|
} else {
|
2023-09-13 23:35:49 -05:00
|
|
|
echo report_this('Unknown search type ' . htmlspecialchars($search_type));
|
2011-04-24 00:52:50 +00:00
|
|
|
}
|