<? ob_start();
session_start();
 include("../../include/dbconnect.php");

echo("Record : $precord<br>");
?>

<title>MIN View / Edit</title>
<body background="blater01.gif" topmargin=0>
<center>
<table cellpadding=0 cellspacing=4 width=861>
<tr>
<td style="padding:3px;" colspan=2 bgcolor="#93BEE2" align="center"><font class="Wf"><b>PREPARED MIN VIEW / EDIT</b></font></td>
</tr><tr valign="top"><td colspan=2>
<font class="Wf">&nbsp;</font>
</td>
</tr>
</table>


<form method="POST"  name="inspection" action="matupdate.php?record=<?echo($precord);?>">
<table border=0 cellpadding=3 cellspacing=4 width="590">


<SCRIPT LANGUAGE="JavaScript" src="../../include/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>

<table width="862" border="1"  cellpadding="1">  
<?


		$query = "select rawmaterial.prodname,po_no,po_date,supplier.name,receipt,issue,balance,rejected_qty,invno,inv_date,min_no,min_date,tc_no,tc_date,id_no,sample_size,finish_spec,finish_checking,finish_observe ,burr_spec,burr_checking,burr_observe,bend_spec,bend_checking,bend_observe,thick_spec,thick_checking,thick_observe,width_spec,width_checking,width_observe,diameter_spec,diameter_checking,diameter_observe,hard_spec,hard_checking,hard_observe,carbon_spec,carbon_checking,carbon_observe,inspector,incharge_qc,status,receipt_nos,issue_nos,balance_nos from mat_purreg,supplier,rawmaterial where mat_purreg.record = '$precord' and mat_purreg.bcode = supplier.bcode and mat_purreg.prodcode = rawmaterial.prodcode";
		$result = mysql_query($query) or die(mysql_error());
		while($row = mysql_fetch_row($result))
		{
			 $product=$row[0];
			 $po_no=$row[1];
			 $po_date=$row[2];
			 $name=$row[3];
			 $_receipt=$row[4];
			 $_issue=$row[5];
			 $_balance=$row[6];
			 $_rejected_qty=$row[7];
			 $_inv_no=$row[8];
			 $invdate=substr($row[9],8,2).'-'.substr($row[9],5,2).'-'.substr($row[9],0,4);
			 $_min_no=$row[10];
			 $mindate=substr($row[11],8,2).'-'.substr($row[11],5,2).'-'.substr($row[11],0,4);
			 $_tc_no=$row[12];
			 $tcdate=substr($row[13],8,2).'-'.substr($row[13],5,2).'-'.substr($row[13],0,4);;
			 $_id_no=$row[14];
			 $_sample_size=$row[15];
			 $_finish_spec=$row[16];
			 $_finish_checking=$row[17];
			 $_finish_observe =$row[18];
			 $_burr_spec=$row[19];
			 $_burr_checking=$row[20];
			 $_burr_observe=$row[21];
			 $_bend_spec=$row[22];
			 $_bend_checking=$row[23];
			 $_bend_observe=$row[24];
			 $_thick_spec=$row[25];
			 $_thick_checking=$row[26];
			 $_thick_observe=$row[27];
			 $_width_spec=$row[28];
			 $_width_checking=$row[29];
			 $_width_observe=$row[30];
			 $_diameter_spec=$row[31];
			 $_diameter_checking=$row[32];
			 $_diameter_observe=$row[33];
			 $_hard_spec=$row[34];
			 $_hard_checking=$row[35];
			 $_hard_observe=$row[36];
			 $_carbon_spec=$row[37];
			 $_carbon_checking=$row[38];
			 $_carbon_observe=$row[39];
			 $_inspector=$row[40];
			 $_incharge_qc=$row[41];
			 $_status=$row[42];
			 $_receipt_nos=$row[43];
			 $_issue_nos=$row[44];
			 $_balance_nos=$row[45];
			
			?>

			<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>
		
						


			</tr>
			<tr >
			<td width="53"  bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><? echo($po_no);?></b></font></td>
			<td width="68" bgcolor="#FFCEE7"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><? echo($po_date);?></b></font></td>
			<td width="167" bgcolor="#EAE2C4"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><? echo($name);?></b></font></td>
			<td bgcolor="#CCCC66"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><? echo($product);?></b></font></td>
	
			

													
			</tr>
			</table>
			<input type="hidden" name="p_record" value="<? echo($precord);?>">

			<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>MIN No</b></font></td>
			<td><input type="text"    onKeyPress="return event.keyCode!=13"   name="min_no" size="15" value=<? echo($_min_no);?>></td>
              <td width="25%" align="center" valign="top" bgcolor="#D2D2FF"><span id="lbl_mindate"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Min Date</b></font> </span></td>
              <td width="26%">
                        <?
						 // echo $invdate;
						  if(empty($mindate))
						  {
						   $mindate=strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d"),date("Y"))); 
						  }
						?>
						  <INPUT NAME="mindate" TYPE="text" class="text_box_button" VALUE="<?=$mindate?>" SIZE="15" readonly  >
                          <A HREF="#" onClick="cal.select(document.inspection.mindate,'anchor1','dd/MM/yyyy'); return false;"NAME="anchor1" ID="anchor1"><img  src="../../images/cal.gif" border="0"></A> <BR>
			  </td>
			</tr>

			<tr>
			<td width="53"  bgcolor="#D2D2FF"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Invoice No</b></font></td>
			<td><input type="text"    onKeyPress="return event.keyCode!=13"   name="inv_no" size="15" value="<? echo($_inv_no);?>"></td>
              <td width="25%" align="center" valign="top" bgcolor="#D2D2FF"><span id="lbl_invdate"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Invoice Date</b></font> </span></td>
              
    <td width="26%"> 
      <?
						 // echo $invdate;
						  if(empty($invdate))
						  {
						   $invdate=strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d"),date("Y"))); 
						  }
						?>
		<input name="invdate" type="text" class="text_box_button" value="<?=$invdate?>" size="15" readonly  >						
      <A HREF="#" onClick="cal.select(document.inspection.invdate,'anchor1','dd/MM/yyyy'); return false;"NAME="anchor1" ID="anchor1"><img  src="../../images/cal.gif" border="0">
      
      </A> <BR>
			  </td>
			</tr>
			
			<tr>
			<td width="53"  bgcolor="#D2D2FF"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>T.C. No</b></font></td>
			<td><input type="text"    onKeyPress="return event.keyCode!=13"   name="tc_no" size="50" value="<? echo($_tc_no);?>"></td>
              <td width="25%" align="center" valign="top" bgcolor="#D2D2FF"><span id="lbl_tcdate"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>T.C. Date </b></font></span></td>
              <td width="26%">
                        <?
						 // echo $tcdate;
						  if(empty($tcdate))
						  {
						   $tcdate=strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d"),date("Y"))); 
						  }
						?>
						  <INPUT NAME="tcdate" TYPE="text" class="text_box_button" VALUE="<?=$tcdate?>" SIZE="15" readonly  >
                          <A HREF="#" onClick="cal.select(document.inspection.tcdate,'anchor1','dd/MM/yyyy'); return false;"NAME="anchor1" ID="anchor1"><img  src="../../images/cal.gif" border="0"></A> <BR>
			  </td>
			</tr>
			<tr>
			<td width="53"  bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>ID No</b></font></td>
			<td><input type="text"    onKeyPress="return event.keyCode!=13"   name="id_no" size="50" value="<? echo($_id_no);?>"></td>
			<td width="53"  bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Sample Size</b></font></td>
			<td><input type="text"    onKeyPress="return event.keyCode!=13"   name="sample_size" size="50" value="<? echo($_sample_size);?>"></td></tr>
			</table>

			<table width="862" border="1"  cellpadding="1">  
			<tr>
			<td bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Sl No</b></font></td>
			<td bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Characteristics</b></font></td>			
			<td bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Specification Requirements</b></font></td>			
			<td bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Methord of Checking</b></font></td>			
			<td bgcolor="#D2D2FF" align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Observations</b></font></td>			
			</tr>
			<tr bgcolor="#FFB0B0">
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>1</b></font></td>
			<td  colspan="100%" align="left"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Appearance</b></font></td>			
			</tr>
			
			<tr>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;</b></font></td>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>(i) Finish</b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="finish_spec" value="<? echo($_finish_spec);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="finish_checking" value="<? echo($_finish_checking);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="finish_observe" value="<? echo($_finish_observe);?>"></td>			
			</tr>
			
			<tr>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;</b></font></td>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>(ii) Free from Burrs / Scaling</b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="burr_spec" value="<? echo($_burr_spec);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="burr_checking" value="<? echo($_burr_checking);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="burr_observe" value="<? echo($_burr_observe);?>"></td>			
			</tr>
	
			<tr bgcolor="#FFB0B0">
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>2</b></font></td>
			<td  colspan="100%" align="left"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Physical Test</b></font></td>			
			</tr>			

			<tr>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;</b></font></td>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Bend Test</b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="bend_spec" value="<? echo($_bend_spec);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="bend_checking" value="<? echo($_bend_checking);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="bend_observe" value="<? echo($_bend_observe);?>"></td>			
			</tr>

			<tr bgcolor="#FFB0B0">
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>3</b></font></td>
			<td  colspan="100%" align="left"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Dimension</b></font></td>			
			</tr>
			
			<tr>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;</b></font></td>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>(i) Thickness</b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="thick_spec" value="<? echo($_thick_spec);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="thick_checking" value="<? echo($_thick_checking);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="thick_observe" value="<? echo($_thick_observe);?>"></td>			
			</tr>			
			<tr>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;</b></font></td>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>(ii) Width</b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="width_spec" value="<? echo($_width_spec);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="width_checking" value="<? echo($_width_checking);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="width_observe" value="<? echo($_width_observe);?>"></td>			
			</tr>
			<tr>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;</b></font></td>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>(iii) Diameter</b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="diameter_spec" value="<? echo($_diameter_spec);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="diameter_checking" value="<? echo($_diameter_checking);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="diameter_observe" value="<? echo($_diameter_observe);?>"></td>			
			</tr>			
			<tr bgcolor="#FFB0B0">
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>4</b></font></td>
			<td  colspan="100%" align="left"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Mettallurcy</b></font></td>			
			</tr>						

			<tr>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;</b></font></td>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Hardness in Annealed Condition</b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><textarea name="hard_spec" rows="2" cols="20"><? echo($_hard_spec);?></textarea></b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><textarea name="hard_checking" rows="2" cols="20"><? echo($_hard_checking);?></textarea></b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><textarea name="hard_observe" rows="2" cols="20"><? echo($_hard_observe);?></textarea></b></font></td>			
			</tr>
			<tr>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;</b></font></td>
			<td  align="center"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>% of Carbon Hardness(After Hardening)</b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><textarea name="carbon_spec" rows="2" cols="20"><? echo($_carbon_spec);?></textarea></b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><textarea name="carbon_checking" rows="2" cols="20"><? echo($_carbon_checking);?></textarea></b></font></td>			
			<td  align="center" bgcolor="#E1B7FB"><textarea name="carbon_observe" rows="2" cols="20"><? echo($_carbon_observe);?></textarea></b></font></td>			
			</tr>						
			
			</table>
			<table width="862" border="1"  cellpadding="1">  
			<tr bgcolor="#FFB0B0">
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Accepted Qty</b></font></td>
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Consumed Qty</b></font></td>			
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Stock</b></font></td>			
			<td   align="center"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Rejected Qty</b></font></td>			

			</tr>
			<tr>
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"    align="right" name="receipt" value="<? echo($_receipt);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"    align="right" name="issue" value="<? echo($_issue);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"    align="right" name="balance" value="<? echo($_balance);?>"></td>									
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"     align="right" name="rejected_qty" value="<? echo($_rejected_qty);?>"></td>			

			</tr>
			
			<tr bgcolor="#FFB0B0">
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Accepted Qty(Nos)</b></font></td>
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Consumed Qty(Nos)</b></font></td>			
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Stock(Nos)</b></font></td>			


			</tr>			
			
			</tr>
			<tr>
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"    align="right" name="receipt_nos" value="<? echo($_receipt_nos);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"    align="right" name="issue_nos" value="<? echo($_issue_nos);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"    align="right" name="balance_nos" value="<? echo($_balance_nos);?>"></td>									
			</tr>			
			
			
			
						</table>			
			
			<table width="862" border="1"  cellpadding="1">  
			<tr bgcolor="#FFB0B0">
			<td  align="center"><font  color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Inspector</b></font></td>
			<td   align="center"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Incharge Q.C</b></font></td>			
			<td   align="center"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Accepted / Rejected</b></font></td>						
			</tr>
			<tr>
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="inspector" value="<? echo($_inspector);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="incharge_qc" value="<? echo($_incharge_qc);?>"></td>			
			<td  align="center" bgcolor="#E1B7FB"><input type="text"    onKeyPress="return event.keyCode!=13"   name="status" value="<? echo($_status);?>"></td>			
			</tr>
						</table>
						
						
									
			
			
			<?
			
			
			
			
						
		}		



?>  









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

<center><font color="#000080"><font size="+1"><a href="/wilson/stores.html">Exit </a></font></center>

</body>
</form>
