wenn ich die Seite aufrufe, sollte eigentlich die id von der Abteilung mitgeliefert werden. Aber irgendwie funktioniert das nicht. An was kann das liegen?
PHP-Code:
<?
$intSecurity = 2;
$intTimeOut = 1800;
include "includes/security.inc.php";
include "includes/db.inc.php";
include "includes/functions.inc.php";
include "includes/showfull.inc.php";
include "includes/header.inc.php";
if ($id AND !$spare) { // Asset has been selected
$strSQL = "SELECT * FROM hardware as h, hw_types as t, tblSecurity as s, Abteilung as a WHERE ";
$strSQL .= "s.id=h.userID AND h.type=t.type_pk AND h.pk_asset=$id AND a.id_abteilung=s.fk_abteilung";
$result = dbquery($strSQL);
While ($row = mysql_fetch_array($result)) {
$intUserID = $row["id"];
$type_desc = $row["type_desc"];
$serial_num = $row["serial_num"];
$spare = $row["sparePart"];
$o_s = $row["o_s"];
$strFirstName = $row["firstName"];
$strMiddleInit = $row["middleInit"];
$strLastName = $row["lastName"];
$stridAbteilung = $row["fk_abteilung"];
$strAbteilung = $row["name"];
?>
<center><H3>System Inventory</H3></center>
<font size='+1'><? echo "Asset ID: $id"; ?></font> <a href='move_hardware.php?hardware_id=<?echo $id;?>'>Change User?</a>
<A HREF="admin_hardware.php?id=<? echo $id; ?>">Edit Hardware?</A>
<A HREF='move_abteilung.php?id_abteilung=<? echo $fk_abteilung; ?>'>Change Department?</A>
<p><table border='0' cellpadding='4' cellspacing='0'>
<?
If ($spare) {
$strUserName = "Spare";
$intUserID = 0;
} Else {
$strUserName = buildName($strFirstName, $strMiddleInit, $strLastName, 1);
}
?><TR bgcolor='#F5DEB3'><TD>Department:</TD><TD><i><? echo $strAbteilung; ?></i></TD></TR>
<TR bgcolor='#FFFFCC'><TD>Hostname:</TD><TD><i><? echo $strUserName; ?></i></TD></TR>
<TR bgcolor='#F5DEB3'><TD>Type:</TD><TD><i><? echo "$type_desc\n"; ?></i></TD></TR>
<TR bgcolor='#FFFFCC'><TD>Serial Number: </TD><TD><i><? echo "$serial_num\n"; ?></i></TD></TR>
<TR bgcolor='#F5DEB3'><TD>OS:</TD><TD><i><? echo "$o_s\n"; ?></i></TD></TR>
</table>
<?
buildlist($id, $intUserID, 1);
}
} elseif ($id AND $spare) {
$strSQL = "SELECT * FROM hardware as h, hw_types as t WHERE ";
$strSQL .= "h.type=t.type_pk AND h.pk_asset=$id";
$result = dbquery($strSQL);
While ($row = mysql_fetch_array($result)) {
$type_desc = $row["type_desc"];
$serial_num = $row["serial_num"];
$spare = $row["sparePart"];
$o_s = $row["o_s"];
?>
<center><H3>System Inventory</H3></center>
<font size='+1'><? echo "Asset ID: $id"; ?></font>
<a href='move_hardware.php?hardware_id=<?echo $id;?>'>Change User?</a>
<A HREF="admin_hardware.php?id=<? echo $id; ?>">Edit Hardware?</A>
<A HREF='move_abteilung.php?id_abteilung=<? echo $fk_abteilung; ?>'>Change Department?</A>
<p><table border='0' cellpadding='4' cellspacing='0'>
<TR bgcolor='#FFFFCC'><TD>Hostname:</TD><TD><i>Spare</i></TD></TR>
<TR bgcolor='#F5DEB3'><TD>Type:</TD><TD><i><? echo "$type_desc\n"; ?></TD></TR>
<TR bgcolor='#FFFFCC'><TD>Serial Number: </TD><TD><i><? echo "$serial_num\n"; ?></TD></TR>
<TR bgcolor='#F5DEB3'><TD>OS:</TD><TD><i><? echo "$o_s\n"; ?></TD></TR>
</table>
<?
buildlist($id, 0, 1);
}
} elseif ($asset == "spare") {
// show hardware summary, and allow deletes.
buildlist ("spare", "Spare Parts", 2);
}
include "includes/footer.inc.php";
?>
Kommentar