pkg_search_results.php 5.52 KB
Newer Older
Loui Chang's avatar
Loui Chang committed
1
<form action='packages.php?<?php echo htmlentities($_SERVER['QUERY_STRING']) ?>' method='post'>
2
<div class="pgbox">
3
4
5
6
7
<?php if (!$result) { ?>
<div class='pgboxbody'><?php print __("Error retrieving package list.") ?></div>
<?php } elseif ($total == 0) { ?>
<div class='pgboxbody'><?php print __("No packages matched your search criteria.") ?></div>
<?php } else { ?>
8
9
10
	<div class="pgboxtitle">
		<span class='f3'><?php print __("Package Listing") ?></span>
	</div>
11

12
<table width='100%' cellspacing='0' cellpadding='2'>
13
14
15
16
<tr>
	<?php if ($SID): ?>
	<th style='border-bottom: #666 1px solid; vertical-align: bottom'>&nbsp;</th>
	<?php endif; ?>
17

18
	<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
19
		<a href='?<?php print mkurl('SB=c&SO=' . $SO_next) ?>'><?php print __("Category") ?></a>
20
	</span></th>
21
	<th style='border-bottom: #666 1px solid; vertical-align: bottom; text-align: center;'><span class='f2'>
22
		<a href='?<?php print mkurl('SB=n&SO=' . $SO_next) ?>'><?php print __("Name") ?></a>
23
24
	</span></th>
	<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
25
		<a href='?<?php print mkurl('SB=v&SO=' . $SO_next) ?>'><?php print __("Votes") ?></a>
26
	</span></th>
27

28
	<?php if ($SID): ?>
29
30
31
32
33
34
	<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
		<a href='?<?php print mkurl('SB=w&SO=' . $SO_next) ?>'><?php print __("Voted") ?></a>
	</span></th>
	<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
		<a href='?<?php print mkurl('SB=o&SO=' . $SO_next) ?>'><?php print __("Notify") ?></a>
	</span></th>
35
	<?php endif; ?>
36
	<th style='border-bottom: #666 1px solid; vertical-align: bottom; text-align: center;'><span class='f2'><?php print __("Description") ?></span></th>
37
	<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
38
		<a href='?<?php print mkurl('SB=m&SO=' . $SO_next) ?>'><?php print __("Maintainer") ?></a>
39
40
41
	</span></th>
</tr>

42
<?php
43
$atype = account_from_sid($_COOKIE['AURSID']);
44
45
for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
	(($i % 2) == 0) ? $c = "data1" : $c = "data2";
46
	if ($row["OutOfDateTS"] !== NULL): $c = "outofdate"; endif;
47
?>
48
<tr>
49
	<?php if ($SID): ?>
50
51
52
53
	<td class='<?php print $c ?>'><input type='checkbox' name='IDs[<?php print $row["ID"] ?>]' value='1'></td>
	<?php endif; ?>
	<td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print $row["Category"] ?></span></span></td>
	<td class='<?php print $c ?>'><span class='f4'><a href='packages.php?ID=<?php print $row["ID"] ?>'><span class='black'><?php print $row["Name"] ?> <?php print $row["Version"] ?></span></a></span></td>
54
	<td class='<?php print $c ?>' style="text-align: right"><span class='f5'><span class='blue'><?php print $row["NumVotes"] ?></span></span></td>
55
56
57
	<?php if ($SID): ?>
	<td class='<?php print $c ?>'><span class='f5'><span class='blue'>
	<?php if (isset($row["Voted"])): ?>
58
	<?php print __("Yes") ?></span></td>
59
	<?php else: ?>
60
	</span></td>
61
62
63
	<?php endif; ?>
	<td class='<?php print $c ?>'><span class='f5'><span class='blue'>
	<?php if (isset($row["Notify"])): ?>
64
	<?php print __("Yes") ?></span></td>
65
	<?php else: ?>
66
	</span></td>
67
68
69
	<?php endif; ?>
	<?php endif; ?>
	<td class='<?php print $c ?>'><span class='f4'><span class='blue'>
70
	<?php print htmlspecialchars($row['Description'], ENT_QUOTES); ?></span></span></td>
71
72
73
74
75
76
77
78
79
80
	<td class='<?php print $c ?>'><span class='f5'><span class='blue'>
	<?php if (isset($row["Maintainer"])): ?>
	<a href='packages.php?K=<?php print $row['Maintainer'] ?>&amp;SeB=m'><?php print $row['Maintainer'] ?></a>
	<?php else: ?>
	<span style='color: blue; font-style: italic;'><?php print __("orphan") ?></span>
	<?php endif; ?>
	</span></span></td>
</tr>
<?php } ?>

81
	</table>
82
83
</div>

84
85
86

<div class="pgbox">
	<table width='100%'>
87
	<tr>
88
		<td align='left'>
89
90
	<div id="legend">
		<span class='f3'><?php echo __('Legend') ?></span>
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
		<span class="outofdate"><?php print __('Out of Date') ?></span>
	</div>
	<?php if ($SID): ?>
	<div>
		<select name='action'>
			<option><?php print __("Actions") ?></option>
			<option value='do_Flag'><?php print __("Flag Out-of-date") ?></option>
			<option value='do_UnFlag'><?php print __("Unflag Out-of-date") ?></option>
			<option value='do_Adopt'><?php print __("Adopt Packages") ?></option>
			<option value='do_Disown'><?php print __("Disown Packages") ?></option>
			<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
			<option value='do_Delete'><?php print __("Delete Packages") ?></option>
			<?php endif; ?>
			<option value='do_Notify'><?php print __("Notify") ?></option>
			<option value='do_UnNotify'><?php print __("UnNotify") ?></option>
		</select>
107
108
109
		<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
		<input type='checkbox' name='confirm_Delete' value='1' /> <?php print __("Confirm") ?>
		<?php endif; ?>
110
111
112
113
114
		<input type='submit' class='button' style='width: 80px' value='<?php print __("Go") ?>' />
	</div>
	<?php endif; ?>
		</td>

115
		<td align='right'>
116
117
118
119
120
121
122
123
124
125
126
127
128
			<div class="f4 blue">
				<?php print __("Showing results %s - %s of %s", $first, $last, $total) ?>
			</div>
			<div class="page_nav">
				<?php foreach($templ_pages as $pagenr => $pagestart) { ?>
					<?php if ($pagestart === false) { ?>
						<?php echo $pagenr ?>
					<?php } else if ($pagestart + 1 == $first) { ?>
						<span class="page_sel"><?php echo $pagenr ?></span>
					<?php } else { ?>
						<a class="page_num" href="packages.php?<?php print mkurl('O=' . (	$pagestart)) ?>"><?php echo $pagenr ?></a>
					<?php } ?>
				<?php } ?>
Callan Barrett's avatar
Callan Barrett committed
129
			</div>
130
131
		</td>
	</tr>
132

133
<?php } ?>
134
135
	</table>
</div>
136
</form>
137