<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);
}

$myDate = $_POST['Date'];


?>
<title>Print Invoice</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>Print 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 account_year from company  ") or die(mysql_error());
$row = mysql_fetch_row($result);

$account_year = $row[0];


$result= mysql_query(" select distinct invdate from labourinv  where account_year='$account_year' order by invdate")or die( mysql_error() );


?>
<form name='myForm01' method='POST' action='<?=$_SERVER[PHP_SELF]?>'>

  
  
<tr > 
  <td width="139" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Date
    &nbsp;</b></font></td><td>

  <SELECT name='Date' onChange="javascript:submit();">
<?php 
	 echo "<option selected value=\" 0\"> Select Date";	  
      while ( $row1= mysql_fetch_row($result))
      {
	  
	  	$dts = substr($row1[0],8,2).'-'.substr($row1[0],5,2).'-'.substr($row1[0],0,4);
	  	if(isset($myDate) && eregi("$myDate",$row1[0]))
		{
			echo "<option selected value=\"$row1[0]\">$dts";
	  	}
	  	else
	  	{
			echo "<option value=\"$row1[0]\">$dts";
	  	}
	}
?>
</select>  
</td></tr>
  
  
  
  
  
</form><tr >
<td width="139" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Invoice Nos 
  &nbsp;</b></font></td><td>
<?

// Pull all Customers from Customer  based on Selected Area id and populate it.


$sBuyQuery = mysql_query("SELECT distinct invno FROM labourinv WHERE (invdate ='$myDate')  order by compcode,invno ");


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

<input type="hidden" name="tdate" value=<?echo($myDate);?>>
<input type="hidden" name="account_year1" value=<?echo($account_year);?>>
<SELECT name=invnos[] multiple size="5" >
<?
while($row1 = mysql_fetch_row($sBuyQuery))
{
	$temp = $row1[0].'&nbsp;&nbsp;'.$row1[1];
	$ino=$row1[0];
	echo "<option value=\"$ino\">$temp";
}

?>
</SELECT></td></tr>




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