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


// Get all _POST VALUES HERE..
foreach($_POST as $q=>$r)
{
	$_POST[$q] = trim($r);
}

$myCompany = $_POST['Company'];




?>
<title>Print Invoice</title>
<body background=blater01.gif  topmargin=0>
<center> 


<form name='myForm01' method='POST' action='<?=$_SERVER[PHP_SELF]?>'>
<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>Print Labour Invoice </b></font></td>
  </tr>
  <tr valign="top"> 
    <td colspan=2> <font >&nbsp;</font> </td>
  </tr>
</table>
<table border=0 cellpadding=3 cellspacing=4 width="590">
<?

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



 $result= mysql_query(" select distinct compcode,name from company order by name desc")or die( mysql_error() );?>



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

  <SELECT name='Company' onChange="javascript:submit();">
<?php 
	 echo "<option selected value=\" 0\"> Select Company";	  
      while ( $row1= mysql_fetch_row($result))
      {
	  
	  	$dts = $row1[1];
	  	if(isset($myCompany) && eregi("$myCompany",$row1[0]))
		{
			echo "<option selected value=\"$row1[0]\">$dts";
	  	}
	  	else
	  	{
			echo "<option value=\"$row1[0]\">$dts";
	  	}
	}
?>
</select>  
</td></tr>
</table>
  </form>
 <form name='myForm02' method='POST' action='invoice_print.php'  target="_blank"> 
  
<table>
<?  


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



$result= mysql_query(" select distinct invdate,invno, name from labourinv join buy on labourinv.bcode = buy.bcode  where account_year='$account_year' and compcode ='$myCompany' order by invno desc")or die( mysql_error() );?>
<tr > 
  <td width="139" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Select Invoice
    &nbsp;</b></font></td><td>

  <SELECT name='invno' >
<?php 
	 echo "<option selected value=\" 0\"> Select Invoice";	  
      while ( $row1= mysql_fetch_row($result))
      {
	  
	  	$dts = $row1[1].'&nbsp;'.british($row1[0]).'&nbsp;'.$row1[2];

			echo "<option value=\"$row1[1]\">$dts";

	}
?>
</select>  
</td></tr>
<tr><td><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>With Heading</b></font></td><td> <font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><input type="radio" name="head" value="Yes">Yes <input type="radio" name="head" value="No" checked>No</b></font></td></tr>

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




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

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