';
$prevattempts.='History | ';
foreach (sort(keys %lasthash)) {
my ($ign,@parts) = split(/\./,$_);
if ($#parts > 0) {
my $data=$parts[-1];
pop(@parts);
$prevattempts.='Part '.join('.',@parts).' '.$data.' | ';
} else {
if ($#parts == 0) {
$prevattempts.=''.$parts[0].' | ';
} else {
$prevattempts.=''.$ign.' | ';
}
}
}
if ($getattempt eq '') {
for ($version=1;$version<=$returnhash{'version'};$version++) {
$prevattempts.='
---|
Transaction '.$version.' | ';
foreach (sort(keys %lasthash)) {
my $value;
if ($_ =~ /timestamp/) {
$value=scalar(localtime($returnhash{$version.':'.$_}));
} else {
$value=$returnhash{$version.':'.$_};
}
$prevattempts.=''.$value.' | ';
}
}
}
$prevattempts.=' Current | ';
foreach (sort(keys %lasthash)) {
my $value;
if ($_ =~ /timestamp/) {
$value=scalar(localtime($lasthash{$_}));
} else {
$value=$lasthash{$_};
}
if ($_ =~/$regexp$/) {$value = &$gradesub($value)}
$prevattempts.=''.$value.' | ';
}
$prevattempts.='
|