<?php   include("../../include/dbconnect.php");?>
<title>Purchase Invoice Ledger</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="Arial, Helvetica, sans-serif" ><b>Purchase Invoice Details</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"><form name="myForm01" method="Post" action="amtpurchase.php"  target="_blank">
  <tr>
    <td > <font face="Arial, Helvetica, sans-serif" class="sbd"><b>Select Company</b></font> 
    </td>
    <td colspan=2> <font face="Arial, Helvetica, sans-serif"> 
      <select name= compcode>
        <?php $query="select distinct compcode,name from company order by name ";
      $query=stripslashes($query);
      $result=mysqli_query($conn,$query) or
      die( mysqli_error() );
      
      while ( $row= mysqli_fetch_row($result))
      {
          echo "<option value='$row[0]'>";
	  echo $row[1];
	  echo "\n";
      }
?>
      </select>
      </font></td>
  </tr>
  <?php
$query= mysqli_query($conn,"select bcode,name,city from buy where buyertype != 'Customer' order by name") or die(mysqli_error());
?>
  <tr> 
    <td nowrap ><font face="Arial, Helvetica, sans-serif" class="sbd"><b>Select 
      Customer / All</b></font></td>
    <td> <font face="Arial, Helvetica, sans-serif"><SELECT name='bcode[]'  multiple size="5"> 
      <?php
     echo "<option selected value=\" 0\"> Select Customer Name";
    while($row = mysqli_fetch_row($query))
    {
          echo "<option value='$row[0]'>";
          echo ($row[1].'&nbsp;'.$row[2]);
	  echo "\n";	  
    }
?></SELECT>
      </font></td>
  </tr>
  <td nowrap></div> <SCRIPT LANGUAGE="JavaScript" src="../../include/CalendarPopup.js"></SCRIPT> 
    <SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT> 
    <?
$today = date(d).'-'.date(m).'-'.date(Y);
?>
  <tr> 
    <td nowrap ><font face="Arial, Helvetica, sans-serif" class="sbd"><b>From 
      Date</b></font></td>
    <?
// echo $from_date;
if(empty($from_date))
{
$from_date = $mystartdt;
 //$from_date=strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d"),date("Y"))); 
}
?>
    <td> <font face="Arial, Helvetica, sans-serif"> 
      <INPUT NAME="from_date" TYPE="text" class="text_box_button" VALUE="<?=$from_date?>" SIZE="15" >
      <A HREF="#" onClick="cal.select(document.myForm01.from_date,'anchor1','dd/MM/yyyy'); return false;"NAME="anchor1" ID="anchor1"><img  src="../../images/cal.gif" border="0"></A> 
      <BR>
      </font></td>
  </tr>
  <tr> 
    <td nowrap ><font face="Arial, Helvetica, sans-serif" class="sbd"><b>To Date</b></font></td>
    <? 
//    echo $to_date;
if(empty($to_date))
{
$to_date =strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d"),date("Y"))); 
}
?>
    <td> <font face="Arial, Helvetica, sans-serif"> 
      <INPUT NAME="to_date" TYPE="text" class="text_box_button" VALUE="<?=$to_date?>" SIZE="15" >
      <A HREF="#" onClick="cal.select(document.myForm01.to_date,'anchor1','dd/MM/yyyy'); return false;"NAME="anchor1" ID="anchor1"><img  src="../../images/cal.gif" border="0"></A> 
      <BR>
      </font></td>
  </tr>
  <table cellpading=0 cellspacing=10 width= 50>
    <tr>
      <td> <blockquote> <input type =submit name="submit" value = "Submit"></td></blockquote>
  </table>
</table>
                                                                             
</body>
<tr><td><h2><font color="#000080"><font size="+1"><a href="../../index.html">Return to Index</a> 
