 
<form action="" method="post">
<h1>Journal Vocuher Details </h1>
<br />
 
 

 <table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
    <th scope="col"><strong>  VoucherId</strong></th>
	  <th scope="col"><strong>Branch</strong></th>
	  <th scope="col"><strong> Dr./Cr.</strong></th>
	    
		   <th scope="col"><strong>Ledger</strong></th>
		 <th scope="col"><strong>SubLedger</strong></th>
		  <th scope="col"><strong>Currency</strong></th>
		   <th scope="col"><strong>Current Amount</strong></th>
		 <th scope="col"><strong>Credit</strong></th>
		 
		 <th scope="col"><strong>Debit</strong></th>
		   <th scope="col"><strong>Created Date</strong></th>
		   
    </tr>
 
  
   <?php if(isset($_REQUEST['LedgId']))
   {
    echo     $GetRecord = "Select * from journal_voucher_master A,journalvoucher B where B.TransId=A.voucherId and B.ledger_id='".$_REQUEST['LedgId']."'   ";
   
   }
   elseif(isset($_REQUEST['id'])){
       echo    $GetRecord = "Select * from journal_voucher_master A,journalvoucher B where B.TransId=A.voucherId ";
	}
   $ResultData = DB_query($GetRecord,$db);
   $j=0;
   if(DB_num_rows($ResultData)==0)
   echo "<td colspan='3'>--No Record--</td>";
   while($RowData = DB_fetch_array($ResultData))
   {  if($j++%2==0)
     $bgcolor="#CCCCCC";
	 else{
	 $bgcolor="#FFFFFF";
	 }
    ?><tr bgcolor="<?php echo $bgcolor;?>" >
   <td><div align="left"><?php 
   
    echo $RowData['voucherId']; ?></div></td>
	  <td><?php  
	  
	  echo $s->getField('locations','loccode', $RowData['branch'] ,'locationname');
	 
	 ?>	  </td>
	   <td><div align="left"><?php 
   
    echo $RowData['dr_cr']; ?></div></td>
    
	    
		<td>
		<?php    
     
	  echo $s->getField('accountledger','AccountsID', $RowData['ledger_id'] ,'AccountName');
	?>
		</td>
	
	
	
	
	<td><div align="left"><?php    
     
	  echo $s->getField('mastersubledger','LedgerId', $RowData['sub_ledger_id'] ,'SubLedgerName');
	?></div></td>
	
	    <td>INR	  </td>
		<td><?php 
	 
		 echo $RowData['current_amount'];
	 
		 ?>	  </td>
		 <td><?php echo    $RowData['credit']; ?>	  </td>
		  <td><?php echo $RowData['debit']; ?>	  </td>
	    
   <td><?php echo $RowData['created_date']; ?>	  </td>
	</tr>
	<?php }   
   ?> 
</table>
</form>

 