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






?>
<SCRIPT LANGUAGE="JavaScript" src="../../include/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>
<title>Receipt</title>
<body background="images/blater01.gif" topmargin=0>
<center> 
<table border=0 cellpadding=3 cellspacing=4 width="677" bgcolor="#E6E6FF">
  <tr> 
    <td  colspan="100%"  bgcolor="#93BEE2"><font face="Verdana, Arial, Helvetica, sans-serif"><b><b>Sales 
      Register (Van Sales)</b></font></td>
  </tr>



  <?

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

$result= mysqli_query($conn," select distinct compcode,name from company  order by name")or die( mysqli_error() );


?>

    <tr > 
      <td  width="59" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Company 
        &nbsp;</b></font></td>
      <td width="148" > <select name='compcode'>
          <?php 
	 echo "<option selected value=\" 0\"> Select Company";	  
      while ( $row1= mysqli_fetch_row($result))
      {

			echo "<option value=\"$row1[0]\">$row1[1]";
	}
?>
      </select> </td>
    <tr> 

  
<form name='regform' method='POST' action='salesreport.php'  target="_blank">		
      <?
	//$prodresult = mysqli_query($conn,"select distinct tpurreg.prodcode,product.prodname,tpurreg.record,product.packing from tpurreg,product where tpurreg.balance > 0 and compcode = '$myCompany' and product.groupcode = '$myCat' and tpurreg.prodcode = product.prodcode  order by product.prodname") or die(mysqli_error());
	
	$query= "select distinct prodcode,prodname from product order by prodname ";
	$prodresult = mysqli_query($conn,$query) or die(mysqli_error());	
	
?>
      <td width="43" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Product 
        &nbsp;</b></font></td>
      <td colspan="5" > <select name='prodcode[]' multiple size="5"  >
          <?

	echo "<option selected value=\" 0\"> Product & Stock";
	while($prodrow = mysqli_fetch_row($prodresult))
	{

	
		$temp= $prodrow[1];
		
		echo "<option value=\"$prodrow[0]\">$temp";
	
	}
	?>
        </select> </td>
    </tr>

	
</table>




<center>
<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><form method="POST" name="regform" action="salesreg.php">
 <table width="675"><tr>
    <td ><font face="Arial, Helvetica, sans-serif" class="sbd">Starting Date</font></td>
    <td> <font face="Arial, Helvetica, sans-serif"> 
      <?
		$stdt = $mystartdt;
		//$stdt=strftime ("%d/%m/%Y", mktime(0,0,0,date("m"),date("d"),date("Y"))); ?>
      <input name="stdt" type="text" onKeyPress="return event.keyCode!=13" class="text_box_button" value="<?=$stdt?>" size="10"   >
      <a href="#" onClick="cal.select(document.regform.stdt,'anchor1','dd/MM/yyyy'); return false;"name="anchor1" id="anchor1"><img  src="../../images/cal.gif" border="0"></a> 
      </font></td>
  <tr>
    <td ><font face="Arial, Helvetica, sans-serif" class="sbd">Ending Date</font></td>
    <td> <font face="Arial, Helvetica, sans-serif"> 
      <?
		
		$edt=strftime ("%d/%m/%Y", mktime(0,0,0,date("m"),date("d"),date("Y"))); ?>
      <input name="edt" type="text" onKeyPress="return event.keyCode!=13" class="text_box_button" value="<?=$edt?>" size="10"   >
      <a href="#" onClick="cal.select(document.regform.edt,'anchor1','dd/MM/yyyy'); return false;"name="anchor1" id="anchor1"><img  src="../../images/cal.gif" border="0"></a> 
      </font></td>
  </tr>
  <table cellpading=0 cellspacing=10 width= 50>
    <tr> 
      <td> <blockquote> 
          <input type =submit name=submit value = "Submit">
        </blockquote>
  </table>
</table>
<br><br><font size=1><center><a href= "../../index.html">Return to index page</center></font>
                                                                             
</body>
</form>
