<?
Include("Includes/global.inc.php");
checkPermissions(2, 1800);
if ($notify != "") {
switch ($notify) {
case "insert":
$strError = "Record added successfully.";
break;
case "update":
$strError = "Record updated successfully.";
break;
case "insertSys":
$strError = "System added. <a href='showfull.php?hardwareID=$hardwareID'>Click here</a>
to add peripherals or software to it.";
break;
default:
$strError = $notify;
break;
}
}
writeHeader("Spare Systems");
declareError(TRUE);
?>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td class='smaller'>
<b>Status:</b> <a href='spareSystems.php?systemStatus=w'>Working</a> |
<a href='spareSystems.php?systemStatus=i'>In Service</a> |
<a href='spareSystems.php?systemStatus=n'>Need Service</a> |
<a href='spareSystems.php'>Show All</a>
</td>
</tr>
</table><p>
<?
If ($systemStatus) {
$sqlCondition = "h.hardwareStatus='$systemStatus' AND";
}
$strSQL = "SELECT t.type_desc, h.pk_asset, h.sparePart, h.hardwareStatus, h.ipAddress ";
$strSQL .= "FROM hardware as h, hw_types as t WHERE $sqlCondition t.accountID=$accountID AND ";
$strSQL .= "h.type=t.type_pk AND h.sparePart='1'";
$strSQL = determinePageNumber($strSQL);
$result = dbquery($strSQL);
while ($row = mysql_fetch_array($result)) {
$intUserID = $row['id'];
$pk_asset = $row['pk_asset'];
$sparePart = $row['sparePart'];
$strFirstName = $row['firstName'];
$strMiddleInit = $row['middleInit'];
$strLastName = $row['lastName'];
$strHardware = $row['type_desc'];
$strHwStatus = $row['hardwareStatus'];
$strIP = $row['ipAddress'];
If (!$wroteSpareOnce) {
echo "<UL>\n";
$wroteSpareOnce = TRUE;
}
$extraInfo = "(".writeStatus($strHwStatus).")";
If ($strIP) {
$extraInfo .= ", IP: ".$strIP;
}
?>
<LI style='line-height: 35%'>
<A HREF="showfull.php?hardwareID=<?=$pk_asset;?>&spare=1"><?=$strHardware;?></A>
<?=$extraInfo;?>
<p>
<?
}
If ($wroteSpareOnce) {
echo "</UL>\n";
}
createPaging("notify");
If (!$wroteSpareOnce) {
echo "No spare systems in inventory.";
}
writeFooter();
?>