<? session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
include("../opendb.php");

if($edit)
{
  $sql="update loc_master set lname='$lname',rem='$rem' where code='$code' and brcode='$brcode'";
 mysqli_query($db,$sql) or die(mysqli_error());
 include("location.php");
 return;
}
$re=mysqli_query($db,"select * from loc_master where code='$code' and brcode='$brcode'");
$row=mysqli_fetch_array($re);
?>
<style>
body,td{font-family:'arial narrow';letter-spacing:1;}
tr{background-color:c1d7bb}
.mnu{margin-left:5}
</style>
<body bgcolor='ivory'>

<CENTER>
<FORM ACTION='<?print $PHP_SELF?>' METHOD='POST'>
<input type=hidden name='code' value='<?print $code?>'>
<table cellspacing=1 cellpadding=1 bgcolor=green>
<tr><td align=center>
<table>
<tr><td colspan=2 align=center>EDIT LOCATION MASTER</TD></TR>
<tr><td><font color=red>Name </td><td><input type=text name='lname' size=40 value='<?print $row[lname]?>'></td></tr>
<tr><td>Remark </td><td><input type=text name='rem' size=40 value='<?print $row[rem]?>'></td></tr>
<TR><TD COLSPAN=2 ALIGN=CENTER><INPUT TYPE=SUBMIT name='edit' VALUE='  SAVE  '></TD></TR>

</table>
</td></tr>
</table>
</form>
