<body background="i.jpg">
<?php include("../../include/dbconnect.php");
$f_date = substr($from_date,6,4).'-'.substr($from_date,3,3).'-'.substr($from_date,0,2);
$t_date = substr($to_date,6,4).'-'.substr($to_date,3,3).'-'.substr($to_date,0,2);

?>


<title>Rejected Print report</title>
<body background=blater01.gif  topmargin=0>
<center> 
<table cellpadding=0 cellspacing=4 width=868>
  <tr> 
    <td style="padding:3px;" colspan=2 bgcolor="#93BEE2"><font face="Verdana, Arial, Helvetica, sans-serif"><b><b> Rejected Qty Report</b></font></td>
  </tr>
  <tr valign="top"> 
    <td colspan=2 align="center" bgcolor="#CCFF00"> <font  size="+1"  color="#0000FF" >Rejected Qty Status from <? echo($from_date);?> to <? echo($to_date);?></font> </td>
  </tr>
</table>
<table border=0 cellpadding=3 cellspacing=4 width="590">
<table width="862" border="1"  cellpadding="1">  
	<tr >

	<td width="194" bgcolor="#CCCC66"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Customer</b></font></td>
	<td width="171" bgcolor="#FF66CC"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Product</b></font></td>
	<td width="131" bgcolor="#99CCCC"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Drawing No</b></font></td>
	<td width="68" bgcolor="#FFCC66"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Invoice No & Date</b></font></td>
	<td width="77" bgcolor="#CECECE"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Rejected Qty</b></font></td>	
	<td width="181" bgcolor="#F8F59E"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b> Remarks</b></font></td>

	</tr>
<?

$sBuyQuery = mysql_query("SELECT  bcode,prodcode,drawing_no,invno,rejected_qty,remarks,invdate from salesreg where rejected_qty >0 and $order_type >= '$f_date' and $order_type <= '$t_date' order by invdate  ") or die(mysql_error());
while($row1 = mysql_fetch_row($sBuyQuery))
{
		$invdt = substr($row1[6],8,2).'-'.substr($row1[6],5,2).'-'.substr($row1[6],0,4);
		$result =mysql_query("select name from buy where bcode = '$row1[0]'") or die(mysql_error());
		$row = mysql_fetch_row($result);
		$bname = $row[0];

		$result =mysql_query("select prodname from product where bcode = '$row1[0]' and prodcode='$row1[1]'") or die(mysql_error());
		$row = mysql_fetch_row($result);
		$prodname = $row[0];		

		?>

		<tr >
		
		<td bgcolor="#CCCC66"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($bname); ?></b></font></td>
		<td width="171" bgcolor="#FF66CC"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($prodname); ?></b></font></td>
		<td width="131" bgcolor="#99CCCC" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($row1[2]); ?></b></font></td>
		<td width="68" bgcolor="#FFCC66"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($row1[3].'&nbsp;/&nbsp;'.$invdt); ?></b></font></td>
		<td width="77" bgcolor="#CECECE"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($row1[4]); ?></b></font></td>
		<td width="181" bgcolor="#F8F59E"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><? echo($row1[5]);?></b></font></td>

		</tr>
		<?
	


}





?>

</table>
 
  
  




<br><br><font size=1><center><a href= "../../index.html">Return to index page</a></center></font>
</body></form>
