";
$item=get_item_by_itemid($HTTP_GET_VARS["itemid"]);
if($item["value_type"]==0)
{
$sql="select clock,value from history where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$time and clock<$till order by clock desc";
}
else
{
$sql="select clock,value from history_str where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$time and clock<$till order by clock desc";
}
$result=DBselect($sql);
$col=0;
for($i=0;$i";
$col=0;
} else
{
echo "