<?
session_start();
$brcode = $_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
include("opendb.php");
include("test.php");


$sql="select led,op from psn_ampleicher1819.ledger where brcode='$brcode' and op>0";
$re=mysqli_query($db,$sql)or die(mysqli_error($db));
print"Ledger List";
print "<table border=1>";
while($row=mysqli_fetch_array($re))
{
$sql1="select led,op from ledger where brcode='$brcode' and op='$row[1]' and led='$row[0]'";
$re1=mysqli_query($db,$sql1)or die(mysqli_error($db));
$row11=mysqli_fetch_row($re1);
 if($row11[1]!=0)
 {
    print "<tr><td>$row11[0]</td><td>$row11[1]</td></tr>";
 }
}
print "</table>";
?>