This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
allpuzzles.php
133 lines (125 loc) · 4.26 KB
/
allpuzzles.php
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php // vim:set ts=4 sw=4 sts=4 et:
require_once "config.php";
require_once "html.php";
require_once "db-func.php";
require_once "utils.php";
// Redirect to the login page, if not logged in
$uid = isLoggedIn();
// Start HTML
head("allpuzzles", "All Puzzles");
echo '<style type="text/css">.puzzideasummary {background-color: #000000;}</style>';
if (!canSeeAllPuzzles($uid) && !hasApproverPermission($uid)) {
echo "<div class='errormsg'>You do not have permissions for this page.</div>";
foot();
exit(1);
}
$filt = isValidPuzzleFilter();
function selected($key, $value) {
global $filt;
if (count($filt) == 2 && $filt[0] == $key && $filt[1] == $value) {
return "selected";
}
return "";
}
displayPuzzleStats($uid);
?>
<div class="inlbox">
<form method="get" action="allpuzzles.php" class="inlform">
<input type="hidden" name="filterkey" value="status">
<select name="filtervalue">
<option value='-'>-</option>
<?php
$statuses = getPuzzleStatuses();
foreach ($statuses as $sid => $sname) {
$slct = selected('status', $sid);
echo "<option value='$sid' $slct>$sname</option>";
}
?>
</select>
<input type="submit" value="Filter status">
</form>
<form method="get" action="allpuzzles.php" class="inlform">
<input type="hidden" name="filterkey" value="editor">
<select name="filtervalue">
<option value='-'>-</option>
<?php
$editors = getAllEditors();
asort($editors);
foreach ($editors as $uid => $fullname) {
$slct = selected('editor', $uid);
echo "<option value='$uid' $slct>$fullname</option>";
}
?>
</select>
<input type="submit" value="Filter approver">
</form>
<?php if (USING_APPROVERS) { ?>
<form method="get" action="allpuzzles.php" class="inlform">
<input type="hidden" name="filterkey" value="approver">
<select name="filtervalue">
<option value='-'>-</option>
<?php
$editors = getAllApprovalEditors();
asort($editors);
foreach ($editors as $uid => $fullname) {
$slct = selected('approver', $uid);
echo "<option value='$uid' $slct>$fullname</option>";
}
?>
</select>
<input type="submit" value="Filter editor">
</form>
<?php } ?>
<form method="get" action="allpuzzles.php" class="inlform">
<input type="hidden" name="filterkey" value="author">
<select name="filtervalue">
<option value='-'>-</option>
<?php
$authors = getAllAuthors();
asort($authors);
foreach ($authors as $uid => $fullname) {
$slct = selected('author', $uid);
echo "<option value='$uid' $slct>$fullname</option>";
}
?>
</select>
<input type="submit" value="Filter author">
</form>
<form method="get" action="allpuzzles.php" class="inlform">
<input type="hidden" name="filterkey" value="tag">
<select name="filtervalue">
<option value='-'>-</option>
<?php
$tags = getAllTags();
asort($tags);
foreach ($tags as $tid => $name) {
$slct = selected('tag', $tid);
echo "<option value='$tid' $slct>$name</option>";
}
?>
</select>
<input type="submit" value="Filter tag">
</form>
<form method="get" action="allpuzzles.php" class="inlform">
<input type="hidden" name="filterkey" value="round">
<select name="filtervalue">
<option value='-'>-</option>
<?php
$rounds = getRounds();
asort($rounds);
foreach ($rounds as $round) {
$slct = selected('round', $round['rid']);
echo "<option value='".$round['rid']."' $slct>".$round['name']."</option>";
}
?>
</select>
<input type="submit" value="Filter round">
</form>
</div>
<?php
$puzzles = getAllPuzzles();
$uid = isLoggedIn();
echo "(Hiding dead puzzles by default)<br><br>";
displayQueue($uid, $puzzles, "notes answer summary editornotes tags authorsandeditors currentpuzzletestercount", FALSE, $filt);
// End HTML
foot();