IP Reg is a IPAM tool to keep track of assets, nodes (IP addresses, MAC addresses, DNS aliases) within different subnets, over different locations or even VLAN's. Written in PHP, used with a MySQL-database to have a unique insight in your local network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ipreg/header.php

71 lines
1.6 KiB

<?php
session_start();
ob_start();
// includes
include("config.php");
include("dbconnect.php");
include("functions.php");
// check for session
if(empty($_SESSION['suser_id'])) {
header("Location: login.php");
exit;
}
// fill search box
if (isset($_POST['search'])) {
$search = $_POST['search'];
$_SESSION['search'] = $search;
} else {
if(isset($_SESSION['search'])) {
$search = $_SESSION['search'];
} else {
$search = '';
}
}
// start header output
?>
<html>
<header>
<title>IP Reg</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</header>
<body>
<form method="POST" action="search.php">
<table border="0" width="100%">
<tr>
<td>
View by: <a href="asset.php">Asset</a> -
<a href="assetclass.php">Assetclass</a> -
<a href="location.php">Location</a> -
<a href="subnet.php">Subnet</a> -
<a href="vlan.php">VLAN</a>&nbsp;
.:<input type="text" name="search" value="<?php echo $search; ?>"><input type="submit" value="Search!">
</td>
<td align="right">
<?php
$suser_id = $_SESSION['suser_id'];
$result = mysql_query("SELECT displayname FROM user WHERE user_id='$suser_id'");
while ($row = mysql_fetch_object($result)) {
echo $displayname = $row->displayname . ' - ';
}
// TEMP display only if admin
if($_SESSION['suser_level'] >= 2) {
echo '<a href="nodeadd.php">Add new node</a> - ';
}
?>
<a href="options.php">Options</a> -
<a href="logout.php">Log out</a>
</td>
</tr>
</table>
</form>
<hr>