<?php include('fun-Trial.php'); ?>
<form name="form1" method="post" action=""> 

<table width="70%" border="0">
  <tr>
    <td width="60%"> Select Group Summary:
	<?php    $pcode=$_REQUEST['GroupSummaryLedger'];?>
 	<select name="GroupSummaryLedger" id="GroupSummaryLedger" style="width:auto">	  
  <option value="000">----</option>
  <?php 
	$dashVal = "&nbsp;&nbsp;&nbsp;";
	$sqlCate = "select * from  accountgroupmaster  where    MainGroupId   = 0";
	$rsCate  = DB_query($sqlCate,$db);
	if(DB_num_rows($rsCate)>0)
	{
		while($rowCate =DB_fetch_array($rsCate))
		{
 				$sqlCateSel = "select * from accountgroupmaster where MainGroupId   =".$rowCate['GroupId']." ";
				$rsCateSel	= DB_query($sqlCateSel,$db);
				$px='';
				 if($rowCate['GroupId']==$_REQUEST['GroupSummaryLedger'])
				 $px="selected";
			echo $dashVal;	
		  ?>
		<option value="<?php echo $rowCate['GroupId'];?>"<?php echo $px ?>> 
		<?php echo  $rowCate['GroupName'] ;?></option>
 		<?php			
			 CategoryShow($pcode, $rowCate['GroupId'], $dashVal);
		}
	}
?></select>


	 </td>
    <td  width="40%">
      <input type="submit" name="Go" value="Go">
    
    </td>
  </tr>
</table>
</form>

<?php 
  if($_REQUEST['Go'])
  {
	 // echo "<pre>";
	 // print_r($_REQUEST);
  
	 $AccountsID=$_REQUEST['GroupSummaryLedger'];
	 $r=GetAll_GroupmasterID($_REQUEST['GroupSummaryLedger']);	
	 if(count($r)>0){
	 $ids= SeperateByCommes($r);
	 }
	 else
	 $ids= $AccountsID;
	 
	 
  ?>
  <table width="100%" border="1">
  <tr>
    <th>Particulars</th>
     <th>Opening Balance</th>
    <th>Debit Amount</th>
    <th>Credit Amount</th>
    <th>Closing Amount</th>
  </tr>
  
    <?php 
		$dashVal = "&nbsp;&nbsp;&nbsp;";
	$sqlCate = "select * from  accountgroupmaster  where    MainGroupId   = '".$_REQUEST['GroupSummaryLedger']."'";
	$rsCate  = DB_query($sqlCate,$db);
	if(DB_num_rows($rsCate)>0)
	{
		while($rowCate =DB_fetch_array($rsCate))
		{
 				//$sqlCateSel = "select * from accountgroupmaster where MainGroupId   =".$rowCate['GroupId']." ";
				//$rsCateSel	= DB_query($sqlCateSel,$db);
				//$px='';
				// if($rowCate['GroupId']==$_REQUEST['GroupSummaryLedger'])
				// $px="selected";
				 echo $dashVal;	
			
				?>
				  <tr>
					<th><?php    	 echo  $rowCate['GroupName'] ;
						 CategoryShow($pcode, $rowCate['GroupId'], $dashVal);
 					?></th>
					 <th> </th>
					 <th> </th>
					 <th> </th>
					 <th> </th>
				  </tr>

				<?php 
				

		}
		  ?>
  <?php
  }
?> 

</table>

  <?php
  }
?> 
