  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <form action="controllers/inputController.php" method="post" name="userform" id="userform">
  <input name="user_pkey" id="user_pkey" type="hidden" value="<?=$user_data['user_pkey'];?>">
  <input name="projectpkeys" id="projectpkeys" type="hidden" value="">
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Staff No</td>
  <td valign=top width=610 class=formvalue><?=$staff_data['staff_no'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Name</td>
  <td valign=top width=610 class=formvalue><?=$staff_data['staff_name'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Access Group</td>
  <td valign=top width=610 class=formvalue><?=$user_data['group_name'];?></td>
  </tr>
  <input name="job" id="job" type="hidden" value="">
  </form>
  </table>

  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">

  <tr valign=top>
  <td valign=top width=48 class=listheader>No.</td>
  <td valign=top width=712 class=listheader>Project ID / Name</td>
  </tr>

  <? foreach ($project_list as $myproject) { ?>

    <?
    $mychecked="";
    $mycolor="#ffffff";
    foreach ($access_list as $myaccess) {
      if ($myproject['projectpkey']==$myaccess['projectpkey']) {
        $mychecked="checked";
        $mycolor="#80ffff";
      }
    }
    ?>

    <tr valign=top>
    <td valign=top width=48 class=listnumber><?=$myproject['recordno'];?></td>
    <td valign=top width=712 class=listcontent>
    <label style="display: block; background: <?=$mycolor;?>;">
    <input name="check<?=$myproject['recordno'];?>" id="check<?=$myproject['recordno'];?>" type="checkbox" value="<?=$myproject['projectpkey'];?>" <?=$mychecked;?> onChange="hiliteProject(this);" onClick="hiliteProject(this);">
    <input name="sname<?=$myproject['recordno'];?>" id="sname<?=$myproject['recordno'];?>" type="hidden" value="<?=$myproject['projectid'];?>">
    &nbsp;&nbsp;<?=$myproject['projectid'];?> - <?=$myproject['projectname'];?>
    </label>
    </td>
    </tr>

  <? } ?>

  </table>

  <script type="text/javascript">

  function hiliteProject(cbox) {
    var lbox=cbox.parentNode;
    if (cbox.checked) {
      lbox.style.cssText="display: block; background: #80ffff;";
    } else {
      lbox.style.cssText="display: block; background: #ffffff;";
    }
  }

  function submitForm() {

    var pkeystr="";

    for (i=1;i<=5000;i++) {
      var subcheck=document.getElementById('check'+i);
      if (subcheck!=null) {
        if (subcheck.checked) {
          pkeystr=pkeystr+";"+subcheck.value;
        }
      }
    }
    pkeystr=pkeystr.substr(1);
    document.userform.projectpkeys.value = pkeystr;
    return true;
  }

  </script>
