<table border="0" cellpadding="0" cellspacing="0" width="95%" align=center>
<form name="ldap_form" ACTION="ldap.search.php3" target="ldap_result" METHOD=POST>
<tr>
<?php
if ($default->use_db):
  if ($default->user_use_addressbook):
    echo "<td colspan=\"2\" bgcolor=\"" .$default->dark_bg. "\" align=\"left\">";
    echo "" .$default->text_on_dark->start().  "<b>" .$lang->ldapsearch. "</b></font></td>";
  else:
  echo "<td bgcolor=\"" .$default->dark_bg. "\" align=\"left\">";
  echo "" .$default->text_on_dark->start().  "<b>" .$lang->ldapsearch. "</b></font></td>";
  echo "<td bgcolor=\"" .$default->dark_bg. "\" align=\"right\"><a href=\"javascript:parent.close()\">";
  echo "" .$default->text_on_dark->start(). "<b>" .$lang->close_window. "</b></font></a></td>";
  endif;
else:
  echo "<td bgcolor=\"" .$default->dark_bg. "\" align=\"left\">";
  echo "" .$default->text_on_dark->start().  "<b>" .$lang->ldapsearch. "</b></font></td>";
  echo "<td bgcolor=\"" .$default->dark_bg. "\" align=\"right\"><a href=\"javascript:parent.close()\">";
  echo "" .$default->text_on_dark->start(). "<b>" .$lang->close_window. "</b></font></a></td>";
endif;
?>
</tr>

<tr>
<td colspan="2" align=center bgcolor="<?php echo $default->item_bg ?>">
<FONT SIZE="-1"><?php echo $lang->search; ?> &nbsp;

<select name="ldap_serv" onChange=UpdateSelect()>
<?php

reset($LDAPServers);
$i = 1;
while (list($key, $lserver) = each($LDAPServers)) {
   if ($i) {
      echo '<option value="' . $lserver->tag . '" selected>' . $lserver->name . "\n";
      $i = 0;
   } else echo '<option value="' . $lserver->tag . '">' . $lserver->name . "\n";
}

?>
</select>

<font size="-1"> <?php echo $lang->directory . " " . $lang->where; ?>&nbsp;</font>

<select name="attr_type" onChange=UpdateOptions() onLoad=UpdateSelect()>
<?php

reset($LDAPServers);
list($key, $lserver) = each($LDAPServers);
$options = explode(',', $lserver->attribs);

for ($i = 0; $i < count($options); $i++) {
   echo "<option value=\"$options[$i]\">" . $lang->$options[$i] . "\n";
}

?>
</select>

<select name="ldap_options">
<?php

reset($LDAPServers);
list($key, $lserver) = each($LDAPServers);
echo "<br>";

$options = explode(',', $lserver->options);

for ($i = 0; $i < count($options); $i++) {
   echo "<option value=\"$options[$i]\">" . $lang->$options[$i] . "\n";
}

?>
</select>

<input type="text" name="s_text">
<input type="submit" name="submit_button" value="<?php echo $lang->submit_button; ?>">
</center>
</font></td></tr>
</form>
</table>

