<tr>
  <td>&nbsp;</td>
  <td>
    <input type="submit" class="button" name="search" value="<?php echo _("Search") ?>" />
    <input type="reset" class="button" name="reset" value="<?php echo _("Reset") ?>" />
  </td>
</tr>
</table>
</form>

<br />

<form method="post" name="contacts" action="<?php echo Horde::selfURL() ?>">
<?php echo Horde::formInput() ?>

<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr class="header">
  <td class="header">
    <b><?php echo _("Search Results") ?></b>
  </td>
  <td align="right" class="header">
    <a class="menuitem" href="<?php Horde::purl('advanced.php?clear=1') ?>"><?php echo _("Clear Search") ?></a>
  </td>
</tr>
</table>

<table border="0" cellpadding="1" cellspacing="1" width="100%">
<tr>
  <th align="left" class="item" nowrap="nowrap" width="1%"><?php echo Horde::img('checkbox.gif', _("Checkbox")) ?></th>
  <th align="left" class="item" nowrap="nowrap" width="1%"><?php echo Horde::img('edit.gif', _("Edit")) ?></th>
  <th align="left" class="item" nowrap="nowrap" width="1%"><?php echo Horde::img('delete.gif', _("Delete")) ?></th>
  <th align="left" class="item" nowrap="nowrap" width="1%"><?php echo Horde::img('group.gif', _("Group")) ?></th>
  <th class="<?php echo ($prefs->getValue('sortby') == 0) ? 'selected' : 'item' ?>" width="<?php echo $width ?>%" align="left" nowrap="nowrap">
    <a class="widget" href="" onclick="Sort(0, <?php echo abs(1 - $prefs->getValue('sortdir')) ?>); return false; "><?php echo Horde::img($prefs->getValue('sortdir') ? 'za.gif' : 'az.gif', _("Sort Direction"), null, $registry->getParam('graphics', 'horde')) ?></a>
    <a class="widget" href="" onclick="Sort(0, <?php echo $prefs->getValue('sortdir') ?>); return false;"><?php echo $attributes['name']['label'] ?></a>
  </th>
  <?php for ($i = 1; $i <= count($columns); $i++): ?>
  <th class="<?php echo ($prefs->getValue('sortby') == $i) ? 'selected' : 'item' ?>" width="<?php echo $width ?>%" align="left" nowrap="nowrap">
    <a class="widget" href="" onclick="Sort(<?php echo $i ?>, <?php echo abs(1 - $prefs->getValue('sortdir')) ?>); return false; "><?php echo Horde::img($prefs->getValue('sortdir') ? 'za.gif' : 'az.gif', _("Sort Direction"), null, $registry->getParam('graphics', 'horde')) ?></a>
    <a class="widget" href="" onclick="Sort(<?php echo $i ?>, <?php echo $prefs->getValue('sortdir') ?>); return false;"><?php echo $attributes[$columns[$i-1]]['label'] ?></a>
  </th>
  <?php endfor; ?>
</tr>
