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/index.php

69 lines
1.5 KiB

<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
Copyright (C) 2011-2023 Thomas Hooge
SPDX-License-Identifier: GPL-3.0-or-later
*****************************************************************************/
include("includes.php");
include("header.php");
// asset
$query = "SELECT
COUNT(asset_id) AS asset_counter
FROM
asset";
$assets = $db->db_select($query);
$smarty->assign("asset_counter", $assets[0]['asset_counter']);
// location
$query = "SELECT
COUNT(location_id) AS location_counter
FROM
location";
$locations = $db->db_select($query);
$smarty->assign("location_counter", $locations[0]['location_counter']);
// node
$query = "SELECT
COUNT(node_id) AS node_counter
FROM
node";
$nodes = $db->db_select($query);
$smarty->assign("node_counter", $nodes[0]['node_counter']);
// subnet
$query = "SELECT
COUNT(subnet_id) AS subnet_counter
FROM
subnet";
$subnets = $db->db_select($query);
$smarty->assign("subnet_counter", $subnets[0]['subnet_counter']);
// vlan
$query = "SELECT
COUNT(vlan_id) AS vlan_counter
FROM
vlan";
$vlans = $db->db_select($query);
$smarty->assign("vlan_counter", $vlans[0]['vlan_counter']);
// zone
$query = "SELECT
COUNT(zone_id) AS zone_counter
FROM
zone";
$zones = $db->db_select($query);
$smarty->assign("zone_counter", $zones[0]['zone_counter']);
$smarty->display("index.tpl");
include("footer.php");
?>