예제 #1
0
        dropdown("InventoryLocationID", $inventoryLocation);
        dropdown("InventoryOwnerID", $inventoryOwner);
        echo "<br />Picture 1 File Path: <input type='text' name='Picture1Location' id='Picture1Location' value='{$picture1}'/><a href='{$picture1}'><img src='{$picture1}' alt='Picture 1' height='100px' width='100px' /></a>";
        echo "<br />Picture 2 File Path: <input type='text' name='Picture2Location' id='Picture2Location' value='{$picture2}'/><a href='{$picture2}'><img src='{$picture2}' alt='Picture 2' height='200px' width='200px' /></a>";
        echo "<br />Date Sold: <input type='text' name='DateSold' id='DateSold' value='{$dateSold}' placemarker='dd-mmm-yyyy' />";
        dropdown("InventoryConditionID", $inventoryCondition);
        echo "<br />UPC: <input type='text' name='upc' id='upc' value='{$upc}'/>";
        echo "<br />Custm ID: <input type='text' name='customID' id='customID' value='{$customID}' />";
        echo "<input type='submit' name='update' value='update' />";
        echo "</form>";
        break;
    case "edit":
        $fields = "InventoryDescription, InventoryTypeID,\tPurchasePrice,\tPurchaseLocation,\tInventoryLocationID,\tInventoryOwnerID, Picture1Location, Picture2Location,\tDateSold, InventoryConditionID, UPC, CustomID";
        foreach ($fields as $field) {
            $newValue = $POST_[$field];
            $oldValue = getReturnValue("tInventory", $field, $newValue);
            if ($oldValue != $newValue) {
                $editQuery = "UPDATE tInventory SET {$field}='{$newValue}' Where InventoryID='{$id}'";
                if (!($result = mysql_query($editQuery))) {
                    echo "<p class='error'>Could not edit {$value} " . mysql_error() . "</p>";
                } else {
                    echo "<p class='debug'>{$field} updated from {$oldValue} to {$newValue}</p>";
                }
            }
        }
        break;
}
$fields = "InventoryDescription, InventoryTypeID,\tPurchasePrice,\tPurchaseLocation,\tInventoryLocationID,\tInventoryOwnerID, Picture1Location, Picture2Location,\tDateSold, InventoryConditionID, UPC, CustomID";
function filterDropDown()
{
    dropdownFields($fields, "Filter By", "filterBy", $filterBy);
예제 #2
0
<?php 
include_once './panels/getVariables.php';
$userID = getUser();
include_once './panels/menu.php';
echo "<div class='box'>";
$MenuID = $MenuName = $PagePath = $Sequence = $RequiresAuthentication = $ParentItem = $Color = $QueryString = "";
$MenuID = getPost('MenuID');
$MenuName = getPost('MenuName');
$PagePath = getPost('PagePath');
$Sequence = getPost('Sequence');
$RequiresAuthentication = getPost('RequiresAuthentication');
$ParentItem = getPost('ParentItem');
$Color = getPost('Color');
$QueryString = getPost('QueryString');
include_once './panels/dbFunction.php';
$returnID = getReturnValue("tMenu", "MenuName", $MenuName, "MenuID");
if ($returnID == null or $returnID == 0) {
    include_once './panels/dbMenuItem.php';
    addMenuItem($MenuName, $PagePath, $Sequence, $RequiresAuthentication, $ParentItem, $Color, $QueryString);
    echo "<form method='post' name='getList' action='editMenu.php?u={$userID}' autocomplete='on'>";
    echo "<input type='hidden' name='userid' value='{$userID}' />";
    echo "<input type='submit' value='Request Services'/>";
    echo "</form>";
} else {
    echo "<p class='error'>{$value} already exists</p>";
    echo "<form method='post' name='getList' action='newMenu.php?u={$userID}' autocomplete='on'>";
    echo "<input type='hidden' name='userid' value='{$userID}' />";
    echo "<input type='submit' value='Request Services'/>";
    echo "</form>";
}
?>