<body background="i.jpg">
<?php include("../../include/dbconnect.php");

?>
<title>Material Selection</title>
<body background=blater01.gif  topmargin=0>
<center> 
<table cellpadding=0 cellspacing=4 width=590>
  <tr> 
    <td style="padding:3px;" colspan=2 bgcolor="#93BEE2"><font face="Verdana, Arial, Helvetica, sans-serif"><b><b>Material 
      Inward Selection</b></font></td>
  </tr>
  <tr valign="top"> 
    <td colspan=2> <font >&nbsp;</font> </td>
  </tr>
</table>

<table width="862" border="1"  cellpadding="1">  
	<tr >
	<td width="53"  bgcolor="#D2D2FF"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>PO No</b></font></td>
	<td width="68"  bgcolor="#FFCEE7"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Date</b></font></td>
	<td width="167" bgcolor="#EAE2C4"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Supplier Name</b></font></td>	
	<td width="193" bgcolor="#CCCC66"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Material</b></font></td>

	<td width="68"  bgcolor="#FFFFDD"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Pending Qty</b></font></td>
	<td width="157" bgcolor="#D0E8E8"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b> Specificatins</b></font>	</td>												
	<td width="73"  bgcolor="#FFFFDD"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Select Item</b></font></td>	
	</tr>

<?
$sdt = date(d).'-'.date(m).'-'.date(Y); 




// This form contain a hidden field CustomerID which can be later used in next  page..
?>
<form name='myForm02' method='POST' action='con_entry.php' >

<?


$ind=0;
$sBuyQuery = mysql_query("SELECT  distinct matpo.record,rawmaterial.prodname,supplier.name,matpo.po_no,po_date, matpo.qty - received_qty,specifications,matpo.unit FROM rawmaterial,matpo,supplier where matpo.prodcode = rawmaterial.prodcode  and qty - (received_qty+rejected_qty) > 0  and matpo.bcode = supplier.bcode and rawmaterial.division ='con' group by matpo.record order by matpo.po_no,rawmaterial.prodname ") or die(mysql_error());
while($row1 = mysql_fetch_row($sBuyQuery))
{

		$date = substr($row1[4],8,2).'-'.substr($row1[4],5,2).'-'.substr($row1[4],0,4);
		?>
		<input type="hidden" name="porecord[<? echo($ind);?>]" value="<? echo($row1[0]);?>">

		
		<tr >
		<td width="53"  bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($row1[3]); ?></b></font></td>
		<td width="68" bgcolor="#FFCEE7"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($date); ?></b></font></td>
		<td width="167" bgcolor="#EAE2C4"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($row1[2]); ?></b></font></td>
		<td bgcolor="#CCCC66"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($row1[1]); ?></b></font></td>

		<td width="68" align="center" bgcolor="#FFFFDD"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?	echo($row1[5]); ?><?	echo($row1[7]); ?></b></font></td>
		<td width="157" bgcolor="#D0E8E8"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b> <textarea readonly  cols="20" rows="2"><?	echo($row1[6]); ?></textarea></b></font>
		<td width="73" align="center" bgcolor="#FFFFDD"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><input type="checkbox"  name="matselect[<? echo($ind);?>]" value="Yes"></b></font></td>		
												
		</tr>
		<?
		$ind++;	


}





?>

</table>
 
  
  
  <table cellpading=0 cellspacing=10 width= 50>
    <tr> 
      <td> <blockquote> <input type =submit name="submit" value = "Submit"></blockquote></td>
  </table>
</table>


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