Location: PHPKode > projects > NOLA > invlevelupd.php
<? include('includes/main.php'); ?>
<? //invlevelupd.php
     echo texttitle('Price Level Update');
    if ($id) {//user has select a price level to be updated
          if ($delete) { //if we should be deleting the entry
               checkpermissions('inv');
               if ($conn->Execute("delete from pricelevel where id=".sqlprep($id)) === false) {
                          echo texterror("Error deleting price level.");
               } else {
                          echo textsuccess("Price level deleted successfully.");
               };
               $description="";
          } elseif ($description) { //if we should update the entry
                  checkpermissions('inv');
                  if ($conn->Execute('update pricelevel set description='.sqlprep($description).' where id='.sqlprep($id)) === false) {
                     echo texterror("Error updating price level.");
                  } else {
                     echo textsuccess("Price Level updated successfully.");
                  };
           } else {
               echo '<form action="invlevelupd.php" method="post"><input type="hidden" name="nonprintable" value="1"><table><td><input type="hidden" name="id" value="'.$id.'"></td></tr>';
               $recordSet = &$conn->Execute('select id, description from pricelevel where id='.sqlprep($id));
               if (!$recordSet->EOF) echo '<tr><td>Price Level Description:</td><td><input type="text" name="description" size="30" value="'.$recordSet->fields[1].'"></td></tr>';
               echo '</tr></table><input type="submit" value="Update"></form> <a href="javascript:confirmdelete(\'invlevelupd.php?delete=1&id='.$id.'\')">Delete this Price Level</a>';
          };
     } else { //display Price Levels, let the user pick one to edit
          $recordSet = &$conn->Execute('select id,description from pricelevel order by description');
          if (!$recordSet->EOF) {
             echo '<form action="invlevelupd.php" method="post"><table><tr><td>Price Level:</td><td><select name="id">';
             while (!$recordSet->EOF) {
                 echo '<option value="'.$recordSet->fields[0].'">'.$recordSet->fields[1]."\n";
                 $recordSet->MoveNext();
             };
             echo '</select></td></tr></table><input type="submit" value="Select"></form>';
         };
         echo '<a href="invleveladd.php">Add new Inventory Price Level</a>';
     };



?>
<? include('includes/footer.php'); ?>
Return current item: NOLA