<?
session_start();
$brcode = $_SESSION['brcode'];
include("opendb.php");
//include("../test.php");
include("includes/top.php");

$sql="select * from veh_trans where brcode='$brcode' group by invno desc";
//print $sql;
$re=mysqli_query($db,"select * from veh_trans where brcode='$brcode' group by invno order by invno desc")or die(mysqli_error($db));

?>
<br><br>
<html>
    <head>
        </head>
        <form method='post' action='ter_printinv_delchln.php' target='blank'>
        <body><center>
        <table>
            
            <tr><td>Select Invoice No :
        <select name='invno'>
            <option>-select-</option>
        <?
        while($row=mysqli_fetch_array($re))
        {
            print "<option>$row[invno]</option>";
        }
        ?>
        </select></td></tr>
            
            <tr id='invtr'></tr>
        
        <tr><td align=right><input type=submit value=Show></td></tr>
        </table>
        </body>
        </form>
</html>  
<script>
    
    

/*
function getinvno(str)
{
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {

            document.getElementById("invtr").innerHTML=xmlhttp.responseText;
           
        }
    }
    xmlhttp.open("GET","getinvno.php?reg="+str,true);
    xmlhttp.send();
}

*/
</script>