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

  foreach($_POST as $p=>$t)
  {
     $_POST[$p] = trim($t);
  }

  $myCompany = $_POST['Company'];
  




//	$query= "truncate table $filename";
//	mysqli_query($conn,$query) or die(mysqli_error());
?>
<SCRIPT LANGUAGE="JavaScript" src="../../include/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>
<title>Receipt</title>

<body topmargin="0" style=" background:url(../../images/body_bg.jpg) repeat-x; font-family:Arial, Helvetica, sans-serif; font-size:12px;">
<center> 
<table border=0 cellpadding=3 cellspacing=4 width="640" bgcolor="#E6E6FF">
  <tr> 
    <td  colspan="100%" style="background:#BDE09E"><b><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">Journal Entry</font></b></td>


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


<tr>
<td width="105" align="left" height="31" style="color:#477550"><b>Company</b></td>
<td width="41" >
  
  <SELECT name='Company'   onChange="javascript:submit();">
    <?
	// Pull all the data from Catcode master & populate it
	
	$stQuery = mysqli_query($conn,"select distinct compcode,name from company order by name");


	
	
     echo "<option selected value=\" 0\"> Select Company ";
    while($row = mysqli_fetch_row($stQuery))
    {

		$temp = $row[1];
        if(isset($myCompany) && preg_match("/" . preg_quote($myCompany, '/') . "/", $row[0]))
	    {
            echo "<option selected value=\"$row[0]\">$temp";
        }
        else{
            echo "<option value=\"$row[0]\">$temp";
        }
    }
?>
  </SELECT></td>
</tr></table>
</form>
<form name='myform2' method='POST' action='input2.php?status=NEW&myHead=0' >
  <?
// Pull all the data from Cat master & populate it




?>
<input type="hidden" name="compcode" value="<?=$myCompany?>" > 






  <table cellpading=0 cellspacing=10 width= 50>
    <tr> 
      <td> <blockquote> <input type =submit name="submit" value = "Submit"></blockquote></td>
  </table>
</table>
</form>
<font size=1> 
<br><br><font size=1><center><a href= "javascript:window.close();">Close Window</a></center></font>
</font> 
