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

?>

<title>Sales Register  for a Period</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 class="Wf"><b>Print Sales Register for the period</b></font></td>
</tr><tr valign="top"><td colspan=2>
<font class="Wf">&nbsp;</font>
</td>
</tr>
</table>


<form method="POST"  name="rej_select" action="salesreg.php">
<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>

<?

$today = date(d).'-'.date(m).'-'.date(Y);
?>

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

<?


$sBuyQuery = mysql_query("SELECT distinct compcode,name from company order by name desc") or die(mysql_error());


?>
<SELECT name=compcode  >
<?

while($row1 = mysql_fetch_row($sBuyQuery))
{
	$temp = $row1[1];
	echo "<option value=\"$row1[0]\">$temp";
}

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


$sBuyQuery = mysql_query("SELECT distinct  taxtype from salesreg order by taxtype ") or die(mysql_error());


?>
<SELECT name= "taxtype"   >
<?

while($row1 = mysql_fetch_row($sBuyQuery))
{
	$temp = $row1[0];
	echo "<option value=\"$row1[0]\">$temp";
}

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

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


$sBuyQuery = mysql_query("SELECT distinct vat_percent from salesreg order by taxtype ") or die(mysql_error());


?>
<SELECT name= "vat_percent"   >
<?

while($row1 = mysql_fetch_row($sBuyQuery))
{
	$temp = $row1[0].'&nbsp;%';
	echo "<option value=\"$row1[0]\">$temp";
}

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


            <tr class="small_site_font_black">
              <td width="25%" align="center" valign="top"><span id="lbl_from_date">From Date </span></td>
              <td width="26%">
                        <?
						 // echo $from_date;
						  if(empty($from_date))
						  {
						   $from_date=strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d"),date("Y"))); 
						  }
						?>
						  <INPUT NAME="from_date" TYPE="text" class="text_box_button" VALUE="<?=$from_date?>" SIZE="15" readonly  >
                          <A HREF="#" onClick="cal.select(document.rej_select.from_date,'anchor1','dd/MM/yyyy'); return false;"NAME="anchor1" ID="anchor1"><img  src="../../images/cal.gif" border="0"></A> <BR>
			  </td>
              <td width="15%" valign="top"><span id="lbl_to_date">To Date </span></td>
              <td width="34%">
                         <? 
						//    echo $to_date;
						   if(empty($to_date))
						    {
						      $to_date =strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d")+6,date("Y"))); 
						    }
						 ?> 
						  <INPUT NAME="to_date" TYPE="text" class="text_box_button" VALUE="<?=$to_date;?>" SIZE="15" onBlur="return diff(document.rej_select.from_date.value,this.value);" readonly>
                          <A HREF="#" onClick="cal.select(document.rej_select.to_date,'anchor2','dd/MM/yyyy'); return false;"NAME="anchor2" ID="anchor2"><img src="../../images/cal.gif" border="0"></A> <BR>
			  </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="../../index.html">Exit </a></font></center>

</body>
</form>
