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

  writeHeader("Spare Software");

  $strSQL = "SELECT s.id, s.serial, st.Name, st.Maker, st.Version FROM software as s, 
    software_types as st WHERE s.sparePart='1' AND st.id=s.type_id AND st.accountID=$accountID
    ORDER BY name ASC";
  $strSQL = determinePageNumber($strSQL);
  $result = dbquery($strSQL);
?>

 <p>Note: Software assigned to a spare system is not also considered "spare." Such
 software is assigned to a system. Only software that truly has no association will wind up here.
 
  <p><table border='0' cellpadding='4' cellspacing='0' width='100%'>
  <TR class='title'>
     <TD><b>Name</b></TD>
     <TD><b>Manufacturer</b></TD>
     <TD><b>Version</b></TD>
     <TD><b>Serial Number</b></TD>
     <TD><b>Action</b></TD></TR> <?

  $iCount = 0;
  $rowStyle = "";
  while ($row = mysql_fetch_array($result)) {

    $int_S_id      = $row["id"];
    $strSerial     = $row["serial"];
    $strName       = $row['Name'];
    $strMaker      = $row['Maker'];
    $strVersion    = $row['Version'];

?>
    <TR class='<? echo alternateRowColor(); ?>'><TD><? echo $strName; ?></TD>
    <TD><? echo $strMaker; ?></TD>
    <TD><? echo $strVersion; ?></TD>
    <TD><? echo writeNA($strSerial); ?></TD>
    <TD>
    <?
      If ($sessionSecurity > 1) {
          echo "N/A";
      } Else {
    ?>
         <A HREF="admin_software.php?software_id=<?=$int_S_id;?>&uid=<?=$uid;?>">Edit</A>
         <A HREF="move_software.php?objectID=<?=$int_S_id;?>&fromSystem=0">Move</A>
        <?
          If ($sessionSecurity < 1) {
        ?>
         <A HREF="delete.php?softwareID=<?=$int_S_id;?>" onClick="return warn_on_submit('Are you sure you want to delete this?');">Delete</A>
        <?
          }
          echo "</TD>";
      }   
  }
  echo "</table>";

  createPaging();
  writeFooter();
?>
Return current item: PhpMyInventory