<?
 session_start();
 if($user!='Administrator')
 {
   print "<font face=verdana color=red>You are not authorized </font>";
   include("itemlist.php");
   return;
 }
?>
<style>
 td{font-family:verdana;font-size:14;color:black;}
 th{font-family:verdana;font-size:14;color:white;background-color:#5b5858}
 body{background-color:#e5e3c9;}
 input
  {border-style:ridge;
   border-color:black;
   height:25px;
   border-size=1;
   font-family:verdana;
   color:black;
  }
 select
  {border-style:ridge;
   border-color:black;
   height:25px;
   border-size=1;
   font-family:verdana;
   color:black;
  }
 .button
  {border-style:ridge;
   border-color:#22437f;
   background-color:white;
   height:25px;
   font-weight:bold;
   border-size=1;
   font-family:sans-serif;
   color:BLACK;
  }
</style>
<body onload=document.f1.group.focus()>
<center>
<form name=f1 action="upditem.php" method=post>
<table border=0>
<tr><td colspan=2 align=center bgcolor=#5b5858 height=25><font color=white><b>E D I T &nbsp;I T E M &nbsp; M A S T E R</td></tr>
<tr><td> Select Group</td><td>
<?
 include("opendb.php");
 $result=mysqli_query($db,"select groupcode,name from groups");
 print "<select name=group>";
 while($row=mysqli_fetch_row($result))
 {
  print "<option value='$row[0]'>$row[1]</option>";
 }
 print "</select>";
 $result2=mysqli_query($db,"select * from itemmas where itemcode='$itemcode'");
 $row2=mysqli_fetch_row($result2);
 print "<input type=hidden name=itemcode value='$row2[0]'>";
?>
</td></tr>
<tr><td>Item Name</td><td><input type=text size=40 name=iname value='<?print $row2[2]?>'></td></tr>
<tr><td>Description</td><td><input type=text size=40 name=descri value='<?print $row2[3]?>'></td></tr>

<tr><td colspan=2 align=center bgcolor=#5b5858 height=25>
<input type=submit value="Update"> <input type=button value="Cancel" onClick=document.location='itemlist.php'>
</td></tr>
