<?php
$PageSecurity = 1;
include('includes/DefinePaymentClass.php');
include('includes/session.inc');
$title = _('Invoice');
 include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
echo '<a href="' . $rootpath . '/ViewClientMaster.php?Cid=' .$_REQUEST['Cid'] . '">' . _('Back>>') . '</a><br>' . "\n";
	echo '<link href="'.$rootpath. '/css/'. $_SESSION['Theme'] .'/default.css" rel="stylesheet" type="text/css" />';
?>
<p>
<h2 align="center">View Invoice </h2>
</p>
 
<?php 
  
   
   $cond="client_id='".$_REQUEST['CompanyId']."'";
   $GetRecord=$s->GetRecord("invoice",$cond);
   $result=DB_query($GetRecord,$db);
    
  ?>
 
 <table width="100%" border="0" cellspacing="0" cellpadding="10"    >
  <tr  >
    <th><strong>SNo.</strong></th>
    <th><strong>Invoice Date</strong></th>
   <th><strong>Client Id</strong></th><th><strong>Branch Name</strong></th>
   <th><strong>Debit</strong></th><th><strong>Credit</strong></th>
    <th><strong>View </strong></th> 
  </tr>
  <?php $i=1;
 while( $row=DB_fetch_array($result))
 {
   ?>
  <tr>
    <td><div align="center"><?php echo $i++;?></div></td>
    <td><?php echo  $row['invoice_date']; ?></td>
    <td><?php 
	echo $s->getField('clientmaster','id', $row['client_id'],'c_name')
	 ?></td>
	<td><?php echo  $s->getField('locations','loccode', $row['branch_name'],'locationname');
	 ?></td>
	 <td><?php echo  $row['grand_total']; ?></td>
	 <td>&nbsp;</td>
     <td><a href="InvoiceDetails.php?Cid=<?php echo $_REQUEST['Cid'];  ?>&CompanyId=<?php echo $_REQUEST['CompanyId'];  ?>&InvoiceId=<?php echo $row['invoice_id']?>" /><div align="center"><img src="images/search.gif" width="15" height="15" /></div></a> </td>
	 
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
 <?php } ?> 
</table>

<?php
include('includes/footer.inc');
?>
