<?php
session_start();

include 'dbc.php';

$userid=$_SESSION['userid'];

$id=$_REQUEST["id"];

  $sqlcus = "select * from invoice_wherehouse where id='$id' and user_id='$userid'";
   $result=$conn->query($sqlcus);
$ppp = $result->fetch_assoc();
    $date=$ppp["date"];
	$ven_name=$ppp["cname"];
	
	 

 	    
		
echo "<table border=0 width=100% align=center bgcolor=white>";
echo "<tr>";
echo "<th bgcolor=white align=center colspan=7>  $userid </th>";
echo "</tr>";

echo "<tr>";
echo "<th bgcolor=white align=center colspan=7>  Wherehouse Invoice </th>";
echo "</tr>";

echo "<tr>";
  echo "<th bgcolor=white align=right>  Date </th>";
  echo "<td align=left>"  .$ppp["date"] . "</td>" ; 
  echo "<th bgcolor=white align=right> Invoice No </th>";
  echo "<td align=left>"  .$ppp["id"] . "</td>" ;
  
  echo "<th bgcolor=white align=right > Customer Name </th>";
  echo "<td align=left>"  .$ven_name . "</td>" ;
  echo "</tr>";

  echo "</table>";
  
 

$sql1 = "select * from invoice_details_wherehouse where inv_no='$id' and user_id='$userid'";
   $result1=$conn->query($sql1);
 echo "<table border=1 width=100% bgcolor=white>";
 echo "<tr>";
 
 echo "<th bgcolor=white align=left height=50> S.No </th>";

  echo "<th bgcolor=white align=left height=50> Item Name </th>";
 
 
 echo "</tr>";
  $sno=1;
  while($row = $result1->fetch_assoc())

  {
   echo "<tr>";
  
  
	 echo "<td height=10>" .$sno . "</td>";
	 echo "<td height=40>" .$row['item_name'] . "</td>";
	
	
		
		
  echo "</tr>";
 
  $sno=$sno + 1;
  $treceived=$treceived + $row['amount'];
  $tqty=$tqty + $row['qty'];
  
  }
  

 echo "<tr>";
 echo "<th align=right bgcolor=white height=50 colspan=2> Total    :      </th>";
 echo "<th align=center height=50>" .$tqty . "</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 />


