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

// Get all _POST VALUES HERE..

foreach($_POST as $p=>$t)
{
	$_POST[$p] = trim($t);
}

$myCompany = $_POST['Company'];




?>
<title>Material Indent</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 Indent Preparation</b></font></td>
  </tr>
  <tr valign="top"> 
    <td colspan=2> <font >&nbsp;</font> </td>
  </tr>
</table>
<table border=0 cellpadding=3 cellspacing=4 width="602">
<tr> 
<td width="139" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Company
  &nbsp;</b></font></td><td>
  </body>
<?

// Pull all the data from Company master & populate it

$stQuery = mysql_query("select compcode,name from company order by name")or die( mysql_error() );



?>
<form name='myForm01' method='POST' action='<?=$_SERVER[PHP_SELF]?>'>
  <SELECT name='Company' onChange="javascript:submit();">
    <?
echo "<option selected value=\"0\"> Select Company";
while($row = mysql_fetch_row($stQuery))
{
	
	$temp = $row[1];
	if(isset($myCompany) && eregi("$myCompany",$row[0]))
	{
		echo "<option selected value=\"$row[0]\">$temp";
	}
	else{
		echo "<option value=\"$row[0]\">$temp";
	}
}
?>
  </SELECT></td></tr>
  
  

  
  
  
  
  
</form><tr >
       


  <form name='myForm02' method='POST' action='entry.php' >
  <input type="hidden" name="compcode" value=<?echo($myCompany);?>>

      <?
      $sdt = date(d).'-'.date(m).'-'.date(Y); 
	  // Pull all the data from Standard master & populate it

$accslct = mysql_query("select account_year from company where compcode ='$myCompany' ") or die(mysql_error());
$accrow = mysql_fetch_row($accslct);
$account_year = $accrow[0];

$indselect = mysql_query("select max(indent_no) from matindent where compcode ='$myCompany' and account_year='$account_year' ") or die(mysql_error());
$indrow = mysql_fetch_row($indselect);
$indent_no = $indrow[0]+1;

?>
  <input type="hidden" name="account_year" value=<? echo($account_year);?>>


      <tr > 
        <td width="139" height="31" align="right" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366"> Indent No
          &nbsp;</font></b></font></td>
        <td width="145" > <input type="text"    onKeyPress="return event.keyCode!=13"   name="indent_no"  value=<? echo($indent_no);?> > 
        </td>
        <td width="96" ></td><td width="83" ></td>
      </tr>
	  
      <tr > 
        <td width="139" height="31" align="right" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Date of Indent
          &nbsp;</font></b></font></td>
        <td width="145" > <input type="text"    onKeyPress="return event.keyCode!=13"   name="today" value= <?php echo($sdt); ?> > 
        </td>
        <td width="96" ></td><td width="83" ></td>
      </tr>	  


		</table>
		
	  <table border=0 cellpadding=3 cellspacing=4 width="781">
        <tr> 
        <td align="center" width="122" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Material</font></b></font></td>
        <td align="center" width="128" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Qty</font></b></font></td>
        <td align="center" width="128" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Unit</font></b></font></td>
        <td align="right" width="66" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Req. Date</font></b></font></td>	 
        <td align="center" width="178" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Used For</font></b></font></td>	 		
        <td align="center" width="233" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Specifications</font></b></font></td>	 
	 </tr>

<?		
		for($ind=0;$ind<=10;$ind++)
		{

    $sProdQuery = mysql_query("SELECT distinct prodcode,prodname FROM rawmaterial  order by prodname ");
?>
<tr><td>
   <SELECT name='prodcode[<? echo($ind);?>]' >

<?
     echo "<option selected value=\" 0\"> Select Material";
    while($row = mysql_fetch_row($sProdQuery))
    {

            echo "<option value=\"$row[0]\">$row[1]";
        
    }
?>
        </SELECT>
</td>



	  <?
	      $sPQuery = mysql_query("SELECT distinct packing FROM product  ");
	  ?>
        <td width="128" > <input type="text"    onKeyPress="return event.keyCode!=13"    maxlength="15" size="15" name="qty[<? echo($ind);?>]" value= ' ' > </td>
        <td width="77" >
		<select name ="unit[<? echo($ind);?>]">
		<option value="Kgs">Kgs</option>
		<option value="Ltrs">Ltrs</option>		
		<option value="MT">MT</option>
		<option value="Nos">Nos</option>
		<option value="Pair">Pairs</option>
		<option value="Feet">Feet</option>
		<option value="Set">Set</option>
		<option value="Case">Case</option>														
				
		</select>
		 </td>		
        <td width="66" > <input type="text"    onKeyPress="return event.keyCode!=13"    maxlength="11" size="11" name="date[<? echo($ind);?>]" value= '<?php echo($sdt); ?> ' > </td>
        <td width="178" > <input type="text"    onKeyPress="return event.keyCode!=13"   name="used_for[<? echo($ind);?>]" value= ' ' > </td>				
        <td width="233" > <input type="text"    onKeyPress="return event.keyCode!=13"   name="remarks[<? echo($ind);?>]" value= ' ' > </td>
		
</tr>
<?
}?>

     

	  
  <tr> 
    <td align="right" width="122" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Post Requirement 
      </b></font></td>
    <td width="128" ><input type="radio"    onKeyPress="return event.keyCode!=13"   name="upd" value = "No"> <font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Not 
      Confirm </b></font>&nbsp; <tr> 
    <td width="122" ></td>
    <td width="128" ><input type="radio"    onKeyPress="return event.keyCode!=13"   name="upd" value = "Yes"> <font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Confirm 
      </b></font> </td>
  </tr>
  <tr> 
    <td width="122" ></td>
    <td width="128" >&nbsp; </td>      
		
	
<table cellpading=0 cellspacing=10 width= 50>
<tr><td>
 <blockquote>  <input type =submit name="submit" value = "Submit"></td></blockquote>
</table>
</table>

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