<? 
session_start();
$brcode = $_SESSION['brcode'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
?>
<style>
input,body,td{font-family:'arial narrow';letter-spacing:1;font-size:13}
th{background-color:green;color:white}
.mnu{margin-left:5}
</style>
<?
include("../opendb.php");
include("../test.php");
$res=mysqli_query($db,"select * from profinv where brcode='$brcode' order by invno desc");

print "<table bgcolor='gray' cellspacing=1 cellpadding=1>";
print "<th>Inv<th>Customer <th>Model/config<th>Fin<th>Date <th>Unit<br>Price";
print "<th>Disc <th>Before <br>Tax <th>Tax<th>Net<th>Edit";
while($row=mysqli_fetch_array($res))
{
    print "\n\n<tr bgcolor='white'><td>$row[invno]</td><td>$row[cust]-$row[addr]</td><td>$row[model_code]-$row[config]</td>";
    print "<td>$row[fin]</td><td>".implode('-', array_reverse(explode('-', $row['invdate'])))."</td>";
    print "<td align=right>$row[unit]</td><td align=right>$row[disc]</td>";
    print "\n<td align=right>$row[amt2]</td><td align=right>$row[tax]</td><td align=right>$row[netamt]</td><td><input type= button value='Edit'onclick=edtprof($row[invno])></td></tr>";
}
?>
</table>
<br>&nbsp;

<script>
function edtprof(inv)
{
    document.location='edtprofinvnew_cess.php?edtinv='+inv;
}
</script>

