<?
require_once('functions.php');
require_once('print.php');
 require_once('mysql.php');

 $id=$_GET['id'];
 $idd=$_GET['idd'];
 
//echo $id;
$s="select p_name,qty,total_p,number,price from sales where session='$id'
";
$sql=mysqli_query($dbc,$s);

$sb="select number from sales where session='$id'
";
$sq=mysqli_query($dbc,$sb);

$ne=mysqli_fetch_array($sq);
    $nu=$ne['number'];

?>

<div align="center"><h3> DETAILS FOR TRANSACTION NUMBER :&nbsp;<? echo $nu;?></div>


<table width="700" align="center" cellpadding="0" cellspacing="0" style="font-size:14px; border-color:#000000; background-color:#ffffff; border-style:solid; border-width:1px;">
  <tr>
   
    <td width="200" style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center"><strong>Product Name</strong></div></td>
    <td width="44" style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center"><strong>Qty</strong></div></td>
        <td width="94" style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center"><strong>Price </strong></div></td>
  <td width="94" style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center"><strong>Total</strong></div></td>
   <td width="94" style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center"><strong>Customer</strong></div></td>
   
  </tr>
  <?
  require_once('mysql.php');


while($row = mysqli_fetch_array($sql))
{
  echo '<tr>';

  
    echo '<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="left">'.$row['p_name'].'</div></td>';
  echo '<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="left">'.$row['qty'].'</div></td>';
    echo '<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="left">'.round($row['price']).'</div></td>';
	 echo '<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="left">'.round($row['total_p']).'</div></td>';
	  echo '<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="left">'.($row['name']).'</div></td>';

$total+=$row['total_p'];
	
	  echo '</tr>';
 }
   echo '<tr>';

  
    echo '<td colspan="3" style="border-color:#000000; border-style:solid; border-width:1px;"><div align="left"><b>TOTAL</div></td>
	<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="left"><b>'.number_format($total).'</div></td>';
 echo '</table>';
 
 ?>


