<?php
require_once('functions.php');
require_once('face.php');
require_once('mysql.php');
  $rec=$_SESSION['SESS'];
$r=mysqli_query($dbc,("SELECT *,qty as  q,total_p as 
 total,sale_id FROM sales WHERE number='$rec'"));

 ?><BR /><table class="blue" border="1" style="background-color:#ffffff"
        frame="BOX" width="980" align="center" 
 cellpadding="5" cellspacing="0" style="font-family:Bell Gothic,Verdana,Arial">
<tr><td><b>Edit</td><td><b>DATE</b></td><td><b>TYPE</b> <td><b>RECEIPT</b></td><td><b>PRODUCT</b></td><td><b>QTY</b></td><td><b>PRICE</td><td><b>TOTAL</td></tr><?
 while($row=mysqli_fetch_array($r)){
 echo '<tr><td><a  rel="facebox" href=editt_price.php?id=' . $row["number"] .'&di='.$row["sale_id"].'>Edit Price</a></td><td>'.$row['date'].'</td><td>'.$row['type'].'</td><td>'.$row['number'].'</td><td>'.$row['p_name'].'</td><td>'.$row['q'].'</td><td>'.number_format($row['price']).'</td>
 <td>'.number_format($row['total']).'</td>

 </tr>';
 $total+=$row['total'];
 //$prof+=$row['prof'];
 }
 
 echo '<tr><td colspan="6"><center>TOTAL</td><td>'.number_format($total).'</td></tr>';
  echo '</table>';
 
 //ECHO $_SESSION['SESS'];