<? 
session_start();
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 profinv.*,profreceipt.* from profinv join profreceipt on profinv.invno=profreceipt.profno where brcode='$brcode' order by invno desc");
print "<table bgcolor='gray' cellspacing=1 cellpadding=1>";
print "<th>Recno<th>Customer <th>Proforma No <th>Order No<th>Receipt Date<th>Receipt Amount <th>Type<th>Chq No<th>Chq Date<th>Bank<th>Edit";
while($row=mysqli_fetch_array($res))
{
print "\n\n<tr bgcolor='white'><td>$row[recno]</td><td>$row[cust]</td><td>$row[profno]</td><td>$row[order_no]</td><td>".datetohtml($row[recdt])."</td><td>$row[recamt]</td><td>$row[rectype]</td><td>$row[chqno]</td><td>".datetohtml($row[chqdt])."</td><td>$row[bank]</td><td><input type= button value='Edit' onclick=edtrec('$row[recno]','$row[profno]'); ></td>";
}
?>
</table>
<br>&nbsp;
<script>
function edtrec(recno,profno)
{
document.location='edtprofrec.php?no='+profno+'&recptno='+recno;
}
</script>
