File: search_form_simple.php

package info (click to toggle)
phpldapadmin 1.1.0.5-6%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,008 kB
  • ctags: 3,949
  • sloc: php: 17,735; xml: 1,532; sh: 388; makefile: 46
file content (82 lines) | stat: -rw-r--r-- 2,679 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_simple.php,v 1.16.2.3 2008/01/13 05:37:02 wurley Exp $

/**
 * @package phpLDAPadmin
 */
?>

<script type="text/javascript" language="javascript">
	function focus_filter() {
		document.simple_search_form.filter.focus();
	}
</script>

<h3 class="title"><?php echo _('Simple Search Form'); ?></h3>
<br />
<form action="cmd.php" name="simple_search_form">
<input type="hidden" name="cmd" value="search" />
<input type="hidden" name="search" value="true" />
<input type="hidden" name="form" value="simple" />
<input type="hidden" name="scope" value="sub" />
<input type="hidden" name="format" value="<?php echo $entry['format']; ?>" />

<table class="forminput" border=0>

<?php
	$as = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'advanced_search');
	$ps = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'predefined_search');
	if ($as | $ps) {
		echo '<tr><td class="subtitle">(';
		if ($as) {
			echo '<a href="cmd.php?cmd=search&amp;server_id=';
			echo $ldapserver->server_id;
			echo '&amp;form=advanced">';
			echo _('Advanced Search Form');
			echo '</a>';
			if ($ps) echo '	| ';
		}
		if ($ps) {
			echo '<a href="cmd.php?cmd=search&amp;server_id=';
			echo $ldapserver->server_id;
			echo '&amp;form=predefined">';
			echo _('Predefined Searches');
			echo '</a>';
		}
		echo ')</td></tr>';
	}
?>

<tr><td>&nbsp;</td></tr>
<tr><td><small><b><?php echo _('Server'); ?></b></small><br /> <?php echo $server_menu_html; ?><br /></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td><small><b><?php echo _('Search for entries whose'); ?></b></small></td></tr>
<tr><td>
	<select name="attribute">
<?php foreach ($_SESSION[APPCONFIG]->GetValue('search','attributes') as $id => $attribute) { ?>
	<option value="<?php echo rawurlencode($attribute); ?>"<?php echo $attribute==$entry['attr']?' selected="true"':''; ?>>
<?php echo htmlspecialchars($_SESSION[APPCONFIG]->getFriendlyName($attribute)); ?>
	</option>
<?php } ?>
	</select>

	<select name="criterion">
<?php
foreach ($_SESSION[APPCONFIG]->GetValue('search','criteria_options') as $c) { ?>
	<option value="<?php echo $c; ?>"<?php echo $c==$entry['criterion']?' selected="true"':''; ?>>
	<?php echo htmlspecialchars(_($c)); ?>
	</option>
<?php } ?>
	</select>

	<input type="text" name="filter" id="filter" size="20" value="<?php echo htmlspecialchars($entry['filter']['clean']); ?>" />
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td><center><input type="submit" value="<?php echo _('Search'); ?>" /></center></td></tr>
</table>
</form>

<script type="text/javascript" language="javascript">
	// Move the cursor to the filter field
	focus_filter();
</script>