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

include("../opendb.php");
//include("../test.php");
//include("calcsparestock_br.php");
?>
<link rel="stylesheet" href="../style.css" type="text/css" />

<style>
        td{font-size:15}
	th{background-color:steelblue;color:white;font-size:15}
</style>
<center>
<h3>SPARE STOCK</H3>
<form action='../util/seaitminbr.php'>
<table bgcolor='lightsteelblue'>
<tr><td>Search by Partcode </td><td><input type=text name='pcode'></td>
<td><input type=submit value='Search' name='sea'>
</td></tr>
</table>
</form>

<?
if($brcode=='ERA153')
{
?>
<hr>
<form action='../util/seainbr.php'>
<table bgcolor='steelblue'>
<tr><td>Group </td><td><select name='grp'>
<?
$re=mysqli_query($db,"select distinct group1 from partmaster order by group1");
while($ro=mysqli_fetch_row($re))
{
 print "<option>$ro[0]</option>";
}
print "<option>All</option>";
} // end if
?>
<tr><td>Branch</td><td><select name='brn'>
<?
$re1=mysqli_query($db,"select brcode,brname from branch order by brname")or die(mysqli_error());
while($ro=mysqli_fetch_row($re1))
{
 print "<option value='$ro[0]'>$ro[1]</option>";
}
print "<option>All</option>";
?>
<tr><td colspan=2 align=center><input type=submit value='Search' name='sea'>
</td></tr>
</table>
</form>
