<form id="assignform" method="post" action="<?php echo "{$CFG->wwwroot}/mod/facetoface/editrecipients.php?s={$s}"; ?>">
<div>
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<input type="hidden" name="add" value="" />
<input type="hidden" name="remove" value="" />
<input type="hidden" name="recipients" value="<?php echo implode(',', $recipients) ?>" />
  <table summary="" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
    <tr>
      <td valign="top" width="40%">
          <label for="removeselect"><?php print_string('existingrecipients', 'facetoface', $existingcount); ?></label>
          <br />
          <select name="removeselect[]" size="22" style="width: 100%;" id="removeselect" multiple="multiple"
                  onfocus="getElementById('assignform').add.disabled=true;
                           getElementById('assignform').remove.disabled=false;
                           getElementById('assignform').addselect.selectedIndex=-1;">

          <?php
            $i = 0;
            if ($existingcount > 0) {
                foreach ($existingusers as $existinguser) {
                    $fullname = fullname($existinguser, true);
                    echo "<option value=\"{$existinguser->id}\">{$fullname}, {$existinguser->email}</option>\n";
                    $i++;
                }
            }
            if ($i==0) {
                echo '<option/>'; // empty select breaks xhtml strict
            }
          ?>

          </select>
      </td>
      <td valign="middle" style="width: 20%; text-align: center;">
        <p class="arrow_button">
        <input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" style="width: 75%; text-align: center; margin-bottom: 10px;" onClick="$('form#assignform input[name=add]').val(1);" />
            <br />
            <input name="remove" id="remove" type="submit" value="<?php echo $OUTPUT->rarrow().'&nbsp;'.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" style="width: 75%; text-align: center;" onCLick="$('form#assignform input[name=remove]').val(1);" />
        </p>
      </td>
      <td valign="top" width="40%">
          <label for="addselect"><?php print_string('potentialrecipients', 'facetoface', $usercount); ?></label>
          <br />
          <select name="addselect[]" size="22" style="width: 100%;" id="addselect" multiple="multiple"
                  onfocus="getElementById('assignform').add.disabled=false;
                           getElementById('assignform').remove.disabled=true;
                           getElementById('assignform').removeselect.selectedIndex=-1;">
          <?php
            $i=0;
            if ($usercount) {
                foreach ($availableusers as $user) {
                    $fullname = fullname($user, true);
                    echo "<option value=\"{$user->id}\">{$fullname}, {$user->email}</option>\n";
                    $i++;
                }
            }
            if ($i==0) {
                echo '<option/>'; // empty select breaks xhtml strict
            }
          ?>
         </select>
       </td>
    </tr>
    </table>

</div>
</form>
