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

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

$data = array();

if ( $rs && mysql_num_rows($rs) )
{

$data[] = array(
            'label' =>'<table border="0" cellpadding="2" cellspacing="1" style="width:100%" >
			<tr style="color:#fff;"><td style="background:#336666">Empolyee Code</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"  style="width:100%"><tr><td >'. $row['emp_code'] .'</td></tr></table> ' ,
            'value' => $row['emp_code'],
			'id' => $index
        );
    }
	
}

echo json_encode($data);
flush();

?>