
<form id="subscriberform" method="post" action="subscribers.php">
<input type="hidden" name="previoussearch" value="<?php p($previoussearch) ?>" />
<input type="hidden" name="id" value="<?php echo $id?>" />
  <table align="center" border="0" cellpadding="5" cellspacing="0">
    <tr>
      <td valign="top">
          <?php echo count($subscribers) . " ". $strexistingsubscribers ?>
      </td>
      <td></td>
      <td valign="top">
          <?php echo $strpotentialsubscribers ?>
      </td>
    </tr>
    <tr>
      <td valign="top">
          <select name="removeselect[]" size="20" id="removeselect" multiple
                  onFocus="getElementById('subscriberform').add.disabled=true;
                           getElementById('subscriberform').remove.disabled=false;
                           getElementById('subscriberform').addselect.selectedIndex=-1;">
          <?php 
              foreach ($subscribers as $subscriber) {
                  $fullname = fullname($subscriber, true);
                  echo "<option value=\"$subscriber->id\">".$fullname.", ".$subscriber->email."</option>\n";
              }
          ?>
          
          </select></td>
      <td valign="top">
        <br />
        <input name="add" type="submit" id="add" value="&larr;" />
        <br />
        <input name="remove" type="submit" id="remove" value="&rarr;" />
        <br />
      </td>
      <td valign="top">
          <select name="addselect[]" size="20" id="addselect" multiple
                  onFocus="getElementById('subscriberform').add.disabled=false;
                           getElementById('subscriberform').remove.disabled=true;
                           getElementById('subscriberform').removeselect.selectedIndex=-1;">
          <?php
              if (!empty($searchusers)) {
                  echo "<optgroup label=\"$strsearchresults (" . count($searchusers) . ")\">\n";
                  foreach ($searchusers as $user) {
                      $fullname = fullname($user, true);
                      echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
                  }
                  echo "</optgroup>\n";
              }
              if (!empty($users)) {
                  foreach ($users as $user) {
                      $fullname = fullname($user, true);
                      echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
                  }
              }
          ?>
         </select>
         <br />
         <input type="text" name="searchtext" size="30" value="<?php p($searchtext, true) ?>" 
                  onFocus ="getElementById('subscriberform').add.disabled=true;
                            getElementById('subscriberform').remove.disabled=true;
                            getElementById('subscriberform').removeselect.selectedIndex=-1;
                            getElementById('subscriberform').addselect.selectedIndex=-1;"
                  onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
                               if (keyCode == 13) {
                                    getElementById('subscriberform').previoussearch.value=1;
                                    getElementById('subscriberform').submit();
                               } " />
         <input name="search" id="search" type="submit" value="<?php p($strsearch) ?>" />
         <?php
              if (!empty($searchusers)) {
                  echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
              }
         ?>
       </td>
    </tr>
  </table>
</form>


