
<form name="subscriberform" id="subscriberform" method="post" action="subscribers.php">
<input type="hidden" name="previoussearch" value="<?php echo $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="document.subscriberform.add.disabled=true;
                           document.subscriberform.remove.disabled=false;
                           document.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="document.subscriberform.add.disabled=false;
                           document.subscriberform.remove.disabled=true;
                           document.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 echo $searchtext ?>" 
                  onFocus ="document.subscriberform.add.disabled=true;
                            document.subscriberform.remove.disabled=true;
                            document.subscriberform.removeselect.selectedIndex=-1;
                            document.subscriberform.addselect.selectedIndex=-1;"
                  onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
                               if (keyCode == 13) {
                                    document.subscriberform.previoussearch.value=1;
                                    document.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>


