pkg_search_form.php 4.42 KB
Newer Older
1
<?php include_once('pkgfuncs.inc.php') ?>
2

Loui Chang's avatar
Loui Chang committed
3
<div class='pgbox'>
4
<form action='packages.php' method='get'>
5
<div class='pgboxtitle'>
Loui Chang's avatar
Loui Chang committed
6
	<span class='f3'><?php print __("Search Criteria"); ?></span>
Loui Chang's avatar
Loui Chang committed
7
	<input type='hidden' name='O' value='0' />
Dan McGee's avatar
Dan McGee committed
8
	<input type='text' name='K' size='30' value="<?php if (isset($_REQUEST["K"])) { print stripslashes(trim(htmlspecialchars($_REQUEST["K"], ENT_QUOTES))); } ?>" maxlength='35' />
9
	<input type='submit' style='min-width:80px' class='button' name='do_Search' value='<?php print __("Go"); ?>' />
Loui Chang's avatar
Loui Chang committed
10
	<?php if (!empty($_GET['detail'])): ?>
11
	<input type='submit' style='min-width:80px'  class='button' name='do_Orphans' value='<?php print __("Orphans"); ?>' />
Dan McGee's avatar
Dan McGee committed
12
	<?php endif; ?>
Sergej Pupykin's avatar
Sergej Pupykin committed
13
	<a href="?<?php print mkurl('detail=' . ((!empty($_GET['detail'])) ? 0 : 1) ) ?>"><?php print __("Advanced"); ?></a>
Loui Chang's avatar
Loui Chang committed
14
15
16
17
</div>

			<?php if (!empty($_GET['detail'])): ?>
			<div id="advanced-search" class="blue">
18
19
20
21
22
23
24
				<input type="hidden" name="detail" value="1" />
				<ul>
					<li>
						<label><?php print __("Category"); ?></label>
						<select name='C'>
							<option value='0'><?php print __("Any"); ?></option>
							<?php
25
							foreach (pkgCategories() as $id => $cat):
Dan McGee's avatar
Dan McGee committed
26
								if (isset($_REQUEST['C']) && $_REQUEST['C'] == $id):
27
28
29
30
31
32
							?>
							<option value="<?php print $id ?>" selected="selected"><?php print $cat; ?></option>
							<?php else: ?>
							<option value="<?php print $id ?>"><?php print $cat; ?></option>
							<?php
								endif;
33
							endforeach;
34
35
36
37
38
39
40
							?>
						</select>
					</li>
					<li>
					<label><?php print __("Search by"); ?></label>
						<select name='SeB'>
							<?php
41
							$searchby = array('nd' => __('Name, Description'), 'n' => __('Name Only'), 'x' => __('Exact name'), 'm'  => __('Maintainer'), 's'  => __('Submitter'));
42
							foreach ($searchby as $k => $v):
Dan McGee's avatar
Dan McGee committed
43
								if (isset($_REQUEST['SeB']) && $_REQUEST['SeB'] == $k):
44
							?>
45
							<option value="<?php print $k; ?>" selected="selected"><?php print $v; ?></option>
46
							<?php else: ?>
47
							<option value="<?php print $k; ?>"><?php print $v; ?></option>
48
49
50
51
52
53
54
55
56
57
							<?php
								endif;
							endforeach;
							?>
						</select>
					</li>
					<li>
						<label><?php print __("Sort by"); ?></label>
						<select name='SB'>
							<?php
58
							$sortby = array('n' => __('Name'), 'c' => __('Category'), 'v' => __('Votes'), 'w' => __('Voted'), 'o' => __('Notify'), 'm' => __('Maintainer'), 'a' => __('Age'));
59
							foreach ($sortby as $k => $v):
Dan McGee's avatar
Dan McGee committed
60
								if (isset($_REQUEST['SB']) && $_REQUEST['SB'] == $k):
61
							?>
62
							<option value='<?php print $k; ?>' selected="selected"><?php print $v; ?></option>
63
							<?php else: ?>
64
							<option value='<?php print $k; ?>'><?php print $v; ?></option>
65
66
67
68
69
70
71
72
73
74
							<?php
								endif;
							endforeach;
							?>
						</select>
					</li>
					<li>
						<label><?php print __("Sort order"); ?></label>
						<select name='SO'>
							<?php
75
							$orderby = array('a' => __('Ascending'), 'd' => __('Descending'));
76
							foreach ($orderby as $k => $v):
Dan McGee's avatar
Dan McGee committed
77
								if (isset($_REQUEST['SO']) && $_REQUEST['SO'] == $k):
78
							?>
79
							<option value='<?php print $k; ?>' selected="selected"><?php print $v; ?></option>
80
							<?php else: ?>
81
							<option value='<?php print $k; ?>'><?php print $v; ?></option>
82
83
84
85
86
87
88
89
90
91
							<?php
								endif;
							endforeach;
							?>
						</select>
					</li>
					<li>
						<label><?php print __("Per page"); ?></label>
						<select name='PP'>
							<?php
92
							$pages = array(50, 100, 250);
93
							foreach ($pages as $i):
Dan McGee's avatar
Dan McGee committed
94
								if (isset($_REQUEST['PP']) && $_REQUEST['PP'] == $i):
95
96
97
98
99
100
101
102
103
104
							?>
							<option value="<?php print $i; ?>" selected="selected"><?php print $i; ?></option>
							<?php else: ?>
							<option value="<?php print $i; ?>"><?php print $i; ?></option>
							<?php
								endif;
							endforeach;
							?>
						</select>
					</li>
105
106
					<li>
						<label><?php echo __('Out of Date'); ?></label>
107
108
109
110
						<select name='outdated'>
							<?php
							$outdated_flags = array('' => __('All'), 'on' => __('Flagged'), 'off' => __('Not Flagged'));
							foreach ($outdated_flags as $k => $v):
Dan McGee's avatar
Dan McGee committed
111
								if (isset($_REQUEST['outdated']) && $_REQUEST['outdated'] == $k):
112
113
114
115
116
117
118
119
120
							?>
							<option value='<?php print $k; ?>' selected="selected"><?php print $v; ?></option>
							<?php else: ?>
							<option value='<?php print $k; ?>'><?php print $v; ?></option>
							<?php
								endif;
							endforeach;
							?>
						</select>
121
					</li>
122
123
124
				</ul>
			</div>
			<?php endif; ?>
Callan Barrett's avatar
Callan Barrett committed
125
</form>
Loui Chang's avatar
Loui Chang committed
126
</div>