<link href="../css/form.css" type="text/css" rel="stylesheet" media="screen"  />
<html>

<?
 session_start();
if(strlen($brcode)<=0)
{
  print "<script> alert('Invalid User'); parent.document.location='ind.php' </script>";
  return;
}

include("../opendb.php");
include("../test.php");

?>

<center>


<font face=arial narrow size=3>
<?print $branch?><br>

<table width="100%" border="0" cellspacing="0" cellpadding="0" >


<tr bgcolor='silver'><td ><center>INVNO</td> <td ><center>DATE </td> <td ><center> DANO</td> 
 <td ><center>NETAMOUNT </td> <td><center>FERTCODE</td> 
<td ><center>CONFIGURATION</td><td ><center> CHASSIS_NO</td> <td><center>ENGINE_no</td>
<td ><center> ENTRYDATE</td> <td><center>STATUS</td>

</tr>


		<link type="text/css" href="../css/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" />	
		<script type="text/javascript" src="../js/jquery-1.6.2.min.js"></script>
		<script type="text/javascript" src="../js/jquery-ui-1.8.16.custom.min.js"></script>
			<script type="text/javascript">
			$(function(){
					$("#partcode").autocomplete({
						source: function( request, response ) {
							//alert($(this).attr("id"));
						$.ajax({
							url: "../search1.php",
							dataType: "json",
							data: "key="+$("#partcode").val(),
							success: function( data ) {
								response( $.map( data, function( item ) {
									return {
										label: item.id+' | '+  item.value     ,
										value: item.id,
										name:item.value

									}
								}));
							}
						});
					}
					
				,
					minLength: 2,
					select: function( event, ui ) {

					$("#partname").val(ui.item.name);
					/*log( ui.item ?
					"Selected: " + ui.item.label :
					"Nothing selected, input was " + this.value);
					*/
					 }
					
					});
		
			});
		</script>



<body bgcolor='ivory'>




<?

print $sq="select * from eichersap where brcode='$brcode' and invno not in (select invno from veh_purchase where brcode='$brcode') ";

$result1=mysqli_query($db,$sq)or die(mysqli_error());


while($row1=mysqli_fetch_array($result1))


{
print "\n<tr>";
print "\n<form action='veh/veh_purch.php' method='post'>";
 print "\n<input type=hidden name='invno' value='$row1[0]'>";
 print "\n<input type=hidden name='eng' value='$row1[10]'>";

                 print "<tr bgcolor=white align=right><td>$row1[0]</td><td>".datetohtml($row1[1])."</td><td align=left>$row1[4]</td>";
            	print "<td align=right>$row1[7]</td><td align=left>$row1[8]</td><td align=left>$row1[9]</td><td align=left>$row1[10]</td>";
			
	print "<td align=left>$row1[11]</td><td align=left>$row1[13]</td><td align=left>$row1[14]</td>";

print "<td><input type=text name='partcode' id='partcode' ></td>"; 

print "<td><input type=submit value='Upd' name='upd'></td> ";

	
?>
</form>
</tr>
<?
    }


//


?>

<script>


 function prnfun(x,b,c,d,e,f)
 {
  if(confirm('Do you want to insert into purchase '+f))
   document.location='veh/veh_purch.php?invno='+x+'&cha='+b+'&eng='+c+'&dan='+d+'&amt='+e+'&con='+f;

 }

</script>


