<?
include_once('includes/top.php');
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
//$br=$_SESSION['branch'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}
/*
$qry=mysqli_query($db,"select * from sparestock");
while($row=mysqli_fetch_array($qry))
{
	$mitem_code = $row[itemcode];
	$mbrcode = $row[brcode];
	if(strlen($row[item_grp])<=0)
	{
		//$brqry="select gname from partmaster where brcode='$mbrcode' and partcode = '$mitem_code'";
                $brqry="select gname from partmaster where  partcode = '$mitem_code'";
                //echo $brqry;
		$brrs=mysqli_query($db,$brqry);
		$brrw=mysqli_fetch_array($brrs);
		$mgname=$brrw[0];
		$sql="update sparestock set item_grp= '$mgname' where itemcode = '$mitem_code' and brcode='$brcode'";
		mysqli_query($db,$sql)or die(mysqli_error($db));
		//print $i."==".$sql."<br>";
	}
}
*/

$yeardat=explode('-',$fin_year);
$startingyr=$yeardat[0];

?>
<link type="text/css" href="includes/style1.css" rel="stylesheet" />
<link type="text/css" href="css/form.css" rel="stylesheet" />
<style>
  //tr1{background-color:white}
  th{background-color:steelblue;color:white}
</style>
<body bgcolor="#0033FF">
<?php //include('includes/top.php'); ?>
<font style="font-family: 'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:15px; color:white;">  &nbsp;&nbsp;REPORTS >> STOCK REPORT</font>
<center>
<h3><font color='white'>STOCK VERIFICATION REPORT DATE WISE</font></H3>
<form action='stockentry_intermediate.php' method='post' name='f1'>
<table cellspacing=1 cellpadding=1 bgcolor='steelblue'>
<tr><td bgcolor='white' align=center>
<table class=noprint>
  <!--
<tr><td>Date from </td><td>dd <input type=text name='d1' size=2 value='1'>
mm <input type=text name='m1' size=2 value='4'>
yy <input type=text name='y1' size=4 value='<?print $startingyr ?>'></td></tr>
<tr><td align=right>to </td><td>dd <input type=text name='d2' size=2 value='<?print date("d")?>'>
mm <input type=text name='m2' size=2 value='<?print date("m")?>'>
yy <input type=text name='y2' size=4 value='<?print date("Y")?>'>
</td></tr>
  -->
<? $mgrp=mysqli_query($db,"select distinct(gname) from groupmaster order by gname");
?>
<tr><td align='center'>Item Group :  </td><td>
<select name='type' >

<?while($grrow=mysqli_fetch_array($mgrp))
{?>
<option><?print $grrow[0]?></option>
<?}?>
<tr><td colspan=2 align=center bgcolor='lightsteelblue'><input type=submit value='Show' name='show'></td></tr>
</table>
</td></tr>
</table>
</form>