-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint.php
71 lines (62 loc) · 2.65 KB
/
print.php
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
64
65
66
67
68
69
70
71
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2006 Michael Earls |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| - phpIP - http://www.phpip.net/ |
+-------------------------------------------------------------------------+
*/
ob_start();
// include the layout file
include 'iplayout.php';
login_check();
if (isset ($_GET['ip'])) { $ip = strip_tags($_GET['ip']); }
if (isset ($_GET['netid'])) { $netid = strip_tags($_GET['netid']); }
echo "
<script language='JavaScript'>
<!--
setTimeout('window.print()', 1*1000);
//-->
</script>
";
echo "<html>";
echo "<head>";
echo "<title>";
echo "IP Address Report $ip";
echo "</title>";
echo "</head>";
echo "<body>";
echo "<center><h3>IP Address Report $ip</h3></center>";
echo "<center><table border=1>";
echo "<tr>";
echo "<td align=center><b>IP</b></td>";
echo "<td align=center><b>MASK</b></td>";
echo "<td align=center><b>DESCRIPTION</b></td>";
echo "<td align=center><B>CLIENT</b></td>";
echo "</tr>";
$iprangeEx = explode('.', $ip);
$sql = mysql_query("SELECT * FROM `addresses` WHERE `ip` LIKE '%$iprangeEx[0].$iprangeEx[1].$iprangeEx[2].%'
and `NetID` = '$netid' ORDER BY ID");
while ($row = mysql_fetch_array($sql))
{
echo "<tr>";
echo "<td align='center' width='100'>$row[ip]</td>";
echo "<td align='center' width='100'> $row[mask]</td>";
echo "<td align='center' width='250'> $row[description]</td>";
echo "<td align='center' width='250'> $row[client]</td>";
echo "</tr>";
}
echo "</table>";
echo "</center>";
echo "<br><br>";
?>