-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules.php
38 lines (37 loc) · 1.18 KB
/
rules.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
<html>
<head>
<title>The Tech -- Email List Rules</title>
<?php
require_once dirname(__FILE__).'/common.php';
?>
</head>
<body>
<h1>Email Rules</h1>
<table border="5">
<ul>
<li>
<a href="./">Return to 3m</a>
</li>
<li>
<a href="./createrule.php">New Rule</a>
</li>
</ul>
<tr style="font-weight:bold;"><td>Department</td><td>Position</td><td>Add-list</td><td>Notification List</td><td></td></tr>
<?php
$fields = array("ruleid", "dept", "position", "addlist", "notificationlist");
$sql = "SELECT " . join(", ", $fields) . " FROM emailrules ORDER BY dept, position, notificationlist";
$res = $mdb2->query($sql);
foreach($fields as $field) {
$res->bindColumn($field, $$field);
}
if(PEAR::isError($res)) {
error_log($res->getDebugInfo());
fatal("Could not get information for $ruleid: " . $res->getMessage());
}
while ($row = $res->fetchRow()) {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td><a href='./createrule.php?ruleid=%s'>Edit</a></td></tr>", $dept, $position, $addlist, $notificationlist, $ruleid);
}
?>
</table>
</body>
</html>