Location: PHPKode > projects > PhpMyInventory > pmi281/move_software.php
<?
  Include("Includes/global.inc.php");
  checkPermissions(1, 1800);

  If ($objectID) {
      If ($cboUser AND $cboSystem) {
          $strSQL = "UPDATE software SET hardware_id=$cboSystem, sparePart='0' WHERE accountID=$accountID AND id=$objectID";
          $result = dbquery($strSQL);
      } ElseIf ($cboUser == "spare") {
          $strSQL = "UPDATE software SET hardware_id=0, sparePart='1' WHERE accountID=$accountID AND id=$objectID";
          $result = dbquery($strSQL);
      }
      If (($cboUser AND $cboSystem) OR ($cboUser == "spare")) {
          If ($fromSystem) {
              redirect("showfull.php", "notify=Software moved successfully.&hardwareID=$fromSystem&spare=$spare");
          } Else {
              redirect("index.php", "notify=Software 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();
?>
Return current item: PhpMyInventory