<?php include "configuration.inc.php"; ?>
<?php

if ( !isset($_REQUEST['term']) )
    exit;
	$pur='Pur';
$rs = mysql_query('select * from  tbl_item where   (item_name like "'. mysql_real_escape_string($_REQUEST['term']) .'%" ) order by item_name asc');

$data = array();
//$data1 = array1();
if ( $rs && mysql_num_rows($rs) )
{

$data[] = array(
            'label' =>'<table border=0 cellpadding="2" cellspacing="1"><tr style="color:#FFFFFF; background:#336666"><td  width="400px" nowrap="nowrap">Item Name</td></tr></table> ' ,'value' => ''
           
        ); 
			
			
    while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) )
    {
	$index=$row['id'];
	
	
        $data[] = array(
            'label' =>'<table border=0 cellpadding="2" cellspacing="1"><tr><td  width="210px" nowrap="nowrap">'. $row['item_name'] .'</td></tr></table> ',
            'value' => $row['item_name'],
			'id' => $index,
			
        );
		
	 
    }
	
}

echo json_encode($data);
flush();

?>