File: default.php3

package info (click to toggle)
irm 1.0.3-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 816 kB
  • ctags: 753
  • sloc: php: 3,440; sh: 346; makefile: 40
file content (77 lines) | stat: -rw-r--r-- 3,002 bytes parent folder | download
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
72
73
74
75
76
77
<?
#    IRM - The Information Resource Manager
#    Copyright (C) 1999 Yann Ramin
#
#    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 (in file COPYING) for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#    $Id: default.php3,v 1.3 2000/05/04 01:30:37 atrus Exp $
#
################################################################################
#                                  CHANGELOG                                   #
################################################################################
#  11/06/99 - Yann Ramin: 	Added reports feature. #
################################################################################

include("../../irm.inc");
include("../../reports.inc.php3");
AuthCheck("normal");
$db = new DB;
PRINT "<html><body bgcolor=#ffffff>";
if ($go == "yes") {

# 1. Get some number data

$query = "SELECT ID FROM computers";
$result = $db->query($query);
$number_of_computers = $db->numrows($result);
$query = "SELECT ID FROM software";
$result = $db->query($query);
$number_of_software = $db->numrows($result);

# 2. Spew out the data in a table

PRINT "<table border=0 width=100%>";
PRINT "<tr><td>Number of Computers:</td><td>$number_of_computers</td></tr>";	
PRINT "<tr><td>Amount of Software:</td><td>$number_of_software</td></tr>";

PRINT "<tr><td colspan=2><b>Operating Systems:</b></td></tr>";

# 3. Get some more number data (operating systems per computer)

$query = "SELECT * FROM dropdown_os ORDER BY name";
$result = $db->query($query);
$i = 0;
$number = $db->numrows($result);
while ($i < $number) {
	$os = $db->result($result, $i, "name");
	$query = "SELECT ID,os FROM computers WHERE (os = '$os')";
	$result2 = $db->query($query);
	$counter = $db->numrows($result2);
	PRINT "<tr><td>$os</td><td>$counter</td></tr>";
	$i++;
}
PRINT "</table>";
} else {
	?>
	Welcome to the Default Report!  This report is designed to be a functional model
	of a real IRM Report.  It provides some simple data, but could really be extended with graphics, percentages, graphs, and user settable options.
	But it serves as a good jumping point for making your own report. (NOTE: The IRM
	header is not nessecary, I just put it in.  You must do a 'connectDB();' though.)
	<p>To generate the report, click on this button: <form action=default.php3><input type=submit value=Go><input type=hidden name=go value=yes></form>

<?
}
PRINT "</body></html>";
?>