<?
session_start();
?>

<script>
resizeTo(300,500)
</script>
<form name=f1>
<select name='da' size=10>
<?
include("../opendb.php");
$result=mysqli_query($db,"select da from veh_invoice where brcode='$brcode'");
while($row=mysqli_fetch_row($result))
{
 print "<option value='$row[0]'>$row[0]</option>";
}
?>
</select>
<input type=button value='OK' onclick=x('<?print $no?>','<?print $drcr ?>')>
</form>
<script>
function x(a,drcr)
{
a--; 
if(drcr=='cr')
{
if(a==0)
 opener.document.f1.cragval0.value=document.f1.da.value;
else if(a==1)
 opener.document.f1.cragval1.value=document.f1.da.value;
else if(a==2)
 opener.document.f1.cragval2.value=document.f1.da.value;
else if(a==3)
 opener.document.f1.cragval3.value=document.f1.da.value;
else if(a==4)
 opener.document.f1.cragval4.value=document.f1.da.value;
else if(a==5)
 opener.document.f1.cragval5.value=document.f1.da.value;
else if(a==6)
 opener.document.f1.cragval6.value=document.f1.da.value;
else if(a==7)
 opener.document.f1.cragval7.value=document.f1.da.value;
}
else
{
if(a==1)
 opener.document.f1.dragval1.value=document.f1.da.value;
else if(a==2)
 opener.document.f1.dragval2.value=document.f1.da.value;
else if(a==3)
 opener.document.f1.dragval3.value=document.f1.da.value;
else if(a==4)
 opener.document.f1.dragval4.value=document.f1.da.value;
else if(a==5)
 opener.document.f1.dragval5.value=document.f1.da.value;
else if(a==6)
 opener.document.f1.dragval6.value=document.f1.da.value;
else if(a==7)
 opener.document.f1.dragval7.value=document.f1.da.value;
}

window.close();
}
</script>
