<?
Include("Includes/global.inc.php");
checkPermissions(1, 1800);
If ($objectID) {
If ($cboUser AND $cboSystem) {
$strSQL = "UPDATE peripherals SET fk_asset=$cboSystem, sparePart='0' WHERE accountID=$accountID AND pk_peripheral=$objectID";
$result = dbquery($strSQL);
} ElseIf ($cboUser == "spare") {
$strSQL = "UPDATE peripherals SET fk_asset=0, sparePart='1' WHERE accountID=$accountID AND pk_peripheral=$objectID";
$result = dbquery($strSQL);
}
If (($cboUser AND $cboSystem) OR ($cboUser == "spare")) {
If ($fromSystem) {
redirect("showfull.php", "notify=Peripheral moved successfully.&hardwareID=$fromSystem&spare=$spare");
} Else {
redirect("index.php", "notify=Peripheral moved successfully.");
}
}
} Else {
$strError = "Unexpected error: please return to the <a href='index.php'>home page</a>, and retry this operation.";
}
writeHeader("Reassign");
declareError(TRUE);
If ($objectID) {
buildUserSystemSelect($cboUser, $cboSystem, $objectID);
}
writeFooter();
?>