phpldapadmin/lib/search_form_predefined.php

61 lines
1.7 KiB
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 10:40:03 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_predefined.php,v 1.9 2005/12/10 10:34:55 wurley Exp $
2009-06-30 09:29:51 +00:00
/**
* @package phpLDAPadmin
*/
2009-06-30 10:26:08 +00:00
echo '<form action="search.php" method="get" class="search">';
echo '<input type="hidden" name="search" value="true" />';
echo '<input type="hidden" name="form" value="predefined" />';
printf('<input type="hidden" name="format" value="%s" />',$format);
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
echo '<table><tr><td>';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
if (isset($_GET['predefined']))
$selected_q_number = intval($_GET['predefined']);
2009-06-30 09:22:30 +00:00
else
2009-06-30 10:26:08 +00:00
$selected_q_number = null;
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
printf('<center><b>%s</b><br />',_('Predefined Searches'));
printf('<small>(<a href="search.php?server_id=%s&amp;form=simple">%s</a> | <a href="search.php?server_id=%s&amp;form=advanced">%s</a>)</small>',
$ldapserver->server_id,_('Simple Search Form'),
$ldapserver->server_id,_('Advanced Search Form'));
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
echo '<br /><br />';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
if (! isset($queries) || ! is_array($queries) || count($queries) == 0) {
echo '<br />';
echo _('No queries have been defined in config.php.');
echo '<br /><br /><br />';
echo '</center>';
echo '</td></tr></table>';
echo '</body></html>';
die();
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
} else {
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
printf('<small>%s: </small>',_('Select a predefined search'));
echo '<select name="predefined">';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
foreach ($queries as $q_number => $q) {
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
if ($selected_q_number === $q_number)
$selected = ' selected';
else
$selected = '';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
printf('<option value="%s"%s>%s</option>',$q_number,$selected,htmlspecialchars($q['name']));
}
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
echo '</select>';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
}
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
echo '<br /><br />';
printf('<center><input type="hidden" name="server_id" value="%s" /></center>',$ldapserver->server_id);
printf('<center><input type="submit" value="%s" /></center>',_('Search'));
echo '</center>';
echo '</td></tr></table></form>';
?>