<?php
session_start();

include 'dbc.php';

$userid=$_SESSION['userid'];

$tr_no=$_REQUEST["tr_no"];

  $sqlcus = "select * from expense_voucher where tr_no='$tr_no' and user_id='$userid'";
   $result=$conn->query($sqlcus);
$ppp = $result->fetch_assoc();
    $v_type=$ppp["v_type"];
	


 	    
		
echo "<table border=0 width=100% align=center bgcolor=white>";
echo "<tr>";
echo "<th bgcolor=white align=center>  $userid </th>";
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=center>  $v_type </th>";
echo "</tr>";
echo "<tr>";
  echo "<th bgcolor=white align=left>  Date </th>";
  echo "<td>"  .$ppp["date"] . "</td>" ; 
  echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left> Invoice No </th>";
  echo "<td>"  .$ppp["tr_no"] . "</td>" ;
  echo "</tr>";
  echo "</table>";
  
 

$sql1 = "select * from expense_voucher where tr_no='$tr_no' and user_id='$userid'";
   $result1=$conn->query($sql1);
 echo "<table border=1 width=100% align=center bgcolor=white>";
 echo "<tr>";
 echo "<th bgcolor=white align=left height=50> Description </th>";
 echo "<th bgcolor=white align=left height=50> Amount </th>";
 
 echo "</tr>";
  $sno=1;
  while($row = $result1->fetch_assoc())

  {
   echo "<tr>";
  
   echo "<th width=80% height=50>"   .$row['acc_name_dr'] . "</th>";
   
	 echo "<td height=50>" .$row['amount'] . "</td>";
		
		
  echo "</tr>";
 
  $sno=$sno + 1;
  $treceived=$treceived + $row['amount'];
   $disc= $row['discription'];

  }
  $bal=$treceived;
 echo "<tr>";
  
 echo "<th align=left height=50>" .$disc . "</th>" ;
 echo "</tr>";
 echo "<tr>";
  
 echo "<th align=right bgcolor=white height=50> Total    :      </th>";
 echo "<th align=right height=50>" .$bal . "</th>" ;
 echo "</tr>";
 
 
 echo "</table>";
	 
 
?>

<br />
<h3><br />
  <br />
  <br />
  <br />
Director:________ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Acounts Manager:________&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Customer:________
<br />

<br />

<br />

<br />

<br />


