  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <tr valign=top>
  <td valign=top width=30 class=listheader>No.</td>
  <td valign=top width=250 class=listheader>Name</td>
  <td valign=top width=250 class=listheader>Designation</td>
  <td valign=top width=150 class=listheader>Phone</td>
  <td valign=top width=80 class=listheader>Options</td>
  </tr>

  <? $currdiv=""; ?>
  <? $currdept=""; ?>

  <? foreach ($staff_list as $mystaff) { ?>

    <? if ($currdiv!=$mystaff['div_name']) { ?>

      <tr valign=top>
      <td valign=top width=760 colspan=5 class=listcontent><b><?=$mystaff['div_name'];?></b></td>
      </tr>

      <? $currdiv=$mystaff['div_name']; ?>

    <? } ?>

    <? if ($currdept!=$mystaff['dept_name']) { ?>

      <tr valign=top>
      <td valign=top width=760 colspan=5 class=listcontent>&nbsp;->&nbsp;<?=$mystaff['dept_name'];?></td>
      </tr>

      <? $currdept=$mystaff['dept_name']; ?>

    <? } ?>

    <tr valign=top>
    <td valign=top width=30 class=listnumber><?=$mystaff['recordno'];?></td>
    <td valign=top width=250 class=listcontent><?=$mystaff['staff_name'];?></td>
    <td valign=top width=250 class=listcontent><?=$mystaff['staff_designation'];?>&nbsp;</td>
    <td valign=top width=150 class=listcontent><?=$mystaff['staff_phone'];?>&nbsp;</td>
    <td valign=top width=80 class=listcontent>
    <a href="index.php?module=user&task=staffview&itemid=<?=$mystaff['staff_pkey'];?>"><img src="gfx/options/b_view.png" border=0 alt="View"></a>
    <a href="index.php?module=user&task=staffedit&itemid=<?=$mystaff['staff_pkey'];?>"><img src="gfx/options/b_edit.png" border=0 alt="Edit"></a>
    <a href="index.php?module=user&task=staffdelete&itemid=<?=$mystaff['staff_pkey'];?>"><img src="gfx/options/b_drop.png" border=0 alt="Delete"></a>
    </td>
    </tr>

  <? } ?>

  </table>
