<?php
require "./Cart.php";

if (isset($DelItem)) {
     $sql =    "DELETE FROM Items WHERE ItemID='$ItemID'";
     mysql_query($sql);
}

adminHeader("$Company","Update An Item");

echo "<FORM ACTION=\"$PHP_SELF?topic=editItem.php\" METHOD=\"POST\">";
echo "<INPUT TYPE=\"submit\" NAME=\"Submit\" VALUE=\"Click here to Add an Item\">";
echo "</FORM>";

echo "<FORM ACTION=\"$PHP_SELF?topic=editItem.php\" METHOD=\"POST\">";
blueFont("Arial","Select An Item to Update<BR>");
echo "<SELECT NAME=\"ItemID\" SIZE=\"1\">";
$result=mysql_query("SELECT ItemID,ItemName,ItemSKU FROM Items ORDER BY ItemName");
while (list($ItemID,$ItemName,$ItemSKU) = mysql_fetch_row($result)) {
     echo "<OPTION VALUE='$ItemID'> $ItemName - $ItemSKU </OPTION>";
}
echo "</SELECT> ";
echo "<INPUT TYPE=\"submit\" NAME=\"Submit\" VALUE=\"Update Selected Item\">";
echo "</FORM>";

echo "<FORM ACTION=\"$PHP_SELF?topic=removeItem.php\" METHOD=\"POST\">";
blueFont("Arial","Select An Item to Remove<BR>");
echo "<SELECT NAME=\"Item\" SIZE=\"1\">";
mysql_data_seek($result,0);
while (list($ItemID,$ItemName,$ItemSKU) = mysql_fetch_row($result)) {
     echo "<OPTION VALUE='$ItemID;$ItemName'> $ItemName - $ItemSKU </OPTION>";
}
mysql_free_result($result);
echo "</SELECT> ";

echo "<INPUT TYPE=\"submit\" NAME=\"Submit\" VALUE=\"Remove Selected Item\">";
echo "</FORM>";

adminFooter($Relative);
?>
