<?php extract($_POST);
echo "manvi";
?>

<form action="" method="post" onsubmit="return validation()">
<table width="60%" border="0" style="border: solid 1px #666666; background:#FFFFFF">
<tr>
<td><select name="site">
  <option value="0">All</option>
  <?php 
 	   $ss="Select loccode,locationname from locations"; 
$site_sql=DB_query($ss,$db);
while($site_row=DB_fetch_array($site_sql))
{?>
  <option value="<?php echo $site_row['loccode'];?>"<?php echo($_REQUEST['site']==$site_row['loccode']?'selected':'')?>><?php echo $site_row['locationname'];?></option>
  <?php 	
}
?>
</select></td>
<td> 
<select name="ledgerentry" id="ledgerentry">
<option value="1" <?php if($_SESSION['ledgerentry']==1) { ?> selected="selected" <?php } ?>>Single Entry With Narrations</option>
<option value="2" <?php if($_SESSION['ledgerentry']==2) { ?> selected="selected" <?php } ?>>Double Entry With Narrations </option>
<option value="3" <?php if($_SESSION['ledgerentry']==3) { ?> selected="selected" <?php } ?>>Double Entry </option>	
<option value="4" <?php if($_SESSION['ledgerentry']==4) { ?> selected="selected" <?php } ?>>Single Entry </option>	
</select>		
</td>
<?php if($_REQUEST['AcType']!='Day' ){ ?><td><?php
 	if($LDR!=''){
	$LRX=implode("|",$LDR);		
	  $sqlCate = "select * from  accountgroupmaster  where    GroupName REGEXP '^$LRX' ";
		$rsCate  = DB_query($sqlCate,$db);
		if(DB_num_rows($rsCate)>0)
		{
			while($rowCate =DB_fetch_array($rsCate))
			{
 			$arr1[]=$rowCate['GroupId'];
  			//$arr1[]= CategoryShow($pcode, $rowCate['GroupId'], $dashVal );
 			}
		}
		$rx=array();
		for($l=0;$l<count($arr1);$l++)
		{
		// echo $arr1[$l].'<br>';
		 if(is_array($arr1[$l]))
		 $rx[]=implode(',',$arr1[$l]);
		 else
		  $rx[]=$arr1[$l];
			 
		}
		$undergroup= implode(',',$rx );
		}else{
		$undergroup='';	
		}
		
	// if($_REQUEST['AcType']!='Day'&&  $_REQUEST['AcType']!='Ledger')
	?>
	<select name="ledgerid">
	<?php 
 	   $AccountMaster-> AccountLeger($_REQUEST['ledgerid'],'ledgerid','ledgerid',$undergroup);	   
    ?></select></td><?php } ?>	
	<td><input name="todate"  id="todate" type="text" class="datepicker"  value="<?php  echo $_SESSION['todate']?>"/></td>	
<td><input name="fromdate" id="fromdate" type="text" class="datepicker"value="<?php  echo $_SESSION['fromdate']?>" /></td>
<?php 
	 if($_REQUEST['AcType']=='Day'){
	?>
	<td>
	<select name="Viewtype">
	<option value="ALL" <?php echo ($_REQUEST['Viewtype']=='ALL'?'selected':'')?>>ALL</option>
		<option value="CR"  <?php echo ($_REQUEST['Viewtype']=='CR'?'selected':'')?>>CR</option>
			<option value="DR"  <?php echo ($_REQUEST['Viewtype']=='DR'?'selected':'')?>>DR</option>
	</select>	</td><?php } ?>
<td><input name="Search" type="submit"  value="Search"/></td>
</tr>
</table>
</form>
<br />
<form name="" method="post">
<table width="100%" border="0" cellspacing="1" cellpadding="2" style="border: solid 1px #666666; background:#FFFFFF">
  <tr>
    <td>Type of info</td>
    <td><select name="Type_of_info" style="width:100%;">
		<option value="0">Select</option>
		<option value="voucher"<?php echo($_REQUEST['Type_of_info']=='voucher'?'selected':'')?>>voucher</option>
	</select>
	</td>
    <td>Having</td>
    <td><select name="having" style="width:100%;">
		<option value="0">Select</option>
		<option value="voucherno" <?php echo($_REQUEST['having']=='voucherno'?'selected':'')?>>Voucher no</option>
		<option value="vouchertype"<?php echo($_REQUEST['having']=='vouchertype'?'selected':'')?>>Voucher type</option>
		<option value="narration"<?php echo($_REQUEST['having']=='narration'?'selected':'')?>>Narration</option>
		<option value="instrumentno"<?php echo($_REQUEST['having']=='instrumentno'?'selected':'')?>>Instrument no</option>
		<option value="searchledger"<?php echo($_REQUEST['having']=='ledger'?'selected':'')?>>Ledger</option>
		<option value="amount"<?php echo($_REQUEST['having']=='amount'?'selected':'')?>>Amount</option>
	</select>
	</td>
    <td>Range of info</td>
    <td><select name="range_of_info" style="width:100%;">
		<option  value="0">Select</option>
		<option value="containing"<?php echo($_REQUEST['range_of_info']=='containing'?'selected':'')?>>Containing</option>
		<option value="equalto"<?php echo($_REQUEST['range_of_info']=='equalto'?'selected':'')?>>Equal to</option>
		<option value="startingwith"<?php echo($_REQUEST['range_of_info']=='startingwith'?'selected':'')?>>starting with</option>
	</select>
	</td>
    <td>Text</td>
    <td><input type="text" value="<?php echo $_REQUEST['searchtext']; ?>" name="searchtext" style="width:100%;"/></td>
	<td colspan="2"><center><input type="submit" name="filter" value="Go" /></center></td>
  </tr>
</table>
</form>