<td>
<?php 
if ($count > 0) {
    $restext = $start + 1;
    $restext .= ' ' . TO . ' ';
    $restext .= $start + $final;
    $restext .= ' ' . OF . ' ';
    $restext .= $count . ' ' . RESULTS . ' ';
    $pages = ceil($count / 10);
    for ($i = 0; $i < $pages; $i++) {
        $j = $i * 10;
        $restext .= '|<a href="' . $pageref . '?start=' . $j;
        if (isset($mode)) {
            $restext .= '&mode=preview&initial=' . $initial . '&keyword=' . $keyword;
        }
        $restext .= '"> ';
        $restext .= $i + 1;
        $restext .= ' </a>';
    }
    $restext .= "|\n";
    echo $restext;
} else {
    echo '<span class="error">' . string::up(NO) . ' ' . RESULTS . '</span>';
}
?>
</td>
</tr>
<?php 
hr(0);
?>
</table>
    // it's an existing record so pull the details from the db
    $row = dbs::selrecord('*', $table, $key . '=' . ${$key}, '0', '1');
    //print_r($row);
}
?>

<table border="0" cellspacing="1" cellpadding="1" width="100%">
<tr>
	<td class="bodybold" colspan="2"><a href="<?php 
echo $pageref;
?>
">Groups</a>
	<?php 
if (${$key} != 'new') {
    // this is not a new record
    echo " ~ " . string::up($row[$identifier]);
}
?>

	</td>
</tr>

<?php 
hr(2);
if (isset($mesg)) {
    html_displaymesg($mesg, 2);
}
?>

</table>