phpipam /site/dashboard/statistics.php

Language PHP Lines 63
MD5 Hash 7de4fc3cbed17f40ac956aa89c799b34 Estimated Cost $352 (why?)
Repository https://bitbucket.org/bertramtruong/phpipam.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php

/*
 * Script to print some stats on home page....
 *********************************************/

/* get number of sections */
$sectionNum = sizeof(fetchSections ());

/* get number of subnets */
$subnetNum 	= sizeof(fetchAllSubnets ());

/* get number of IP addresses, split IPv4 / IPv6 */
$ipAddresses = fetchAllIPAddresses ();
$ipCount = sizeof($ipAddresses);
$IPv4Count = 0;
$IPv6Count = 0;

foreach ($ipAddresses as $ipAddress) {
	if ($ipAddress['ip_addr'] < 4294967295 ) 	{ $IPv4Count++; }
	else 										{ $IPv6Count++; }
}

/* get All users */
$userCount = sizeof(getAllUsers());

?>


<!-- stats table -->
<table class="table table-striped table-condensed table-hover">

	<!-- sections -->
	<tr>
		<td class="title">Number of Sections</td>
		<td><?php print $sectionNum; ?></td>
	</tr>

	<!-- subnets -->
	<tr>
		<td class="title">Number of Subnets</td>
		<td><?php print $subnetNum; ?></td>
	</tr>

	<!-- IPv4 addresses -->
	<tr>
		<td class="title">Number of IPv4 addresses</td>
		<td><?php print $IPv4Count; ?></td>
	</tr>

	<!-- IPv6 addresses -->
	<tr>
		<td class="title">Number of IPv6 addresses</td>
		<td><?php print $IPv6Count; ?></td>
	</tr>

	<!-- All users - only for admin! -->
	<tr>
		<td class="title">Number of users</td>
		<td><?php print $userCount; ?></td>
	</tr>

</table>
Back to Top