<?php $PageSecurity = 2;
error_reporting(0);
include('includes/SQL_CommonFunctions.inc');
include('includes/session.inc');
include('includes/function_lib.php');
$sql=DB_query("Select mst_unitid, conv_unit from item_master where id=".$_REQUEST['item'],$db);
$row=DB_fetch_array($sql);

$unit_id1=$row['mst_unitid'];
$unit_name1=$s->GetFieldValue('unitsofmeasure',"unitid='".$unit_id1."'",'unitname');
$unit_id2=$row['conv_unit'];
$unit_name2=$s->GetFieldValue('unitsofmeasure',"unitid='".$unit_id2."'",'unitname');

$unit_array[$unit_id1]=$unit_name1;
$unit_array[$unit_id2]=$unit_name2;

$data1="";
$data1.="<option value=''>--Select--</option>";
foreach($unit_array as $key=>$val)
{
	if($_REQUEST['uom']==$key){
	$data1.="<option value='".$key."' selected>".$val."</option>";	
	}else{
	$data1.="<option value='".$key."'>".$val."</option>";	
	}
}
		
echo $data1;
?>