Implement motion editing
[cacert-boardvoting.git] / remind.php
1 #!/usr/bin/php
2 <?
3 require_once("database.php");
4 $db = new DB();
5
6 $id = 0;
7 $page = 1;
8
9 $voters = $db->getStatement('get reminder voters');
10 $voters->execute();
11
12 $outstanding = $db->getStatement('list my unvoted decisions');
13 $outstanding->bindParam(':id',$id);
14 $outstanding->bindParam(':page',$page);
15
16 while ($v = $voters->fetch()) {
17 $id = $v['id'];
18 $outstanding->execute();
19 $msg ='';
20 while ($row=$outstanding->fetch()) {
21 $msg .= ($row['votetype'] ? 'vote ' : 'motion ') . $row['tag'] . ' ' . $row['title'] . "\nDue: " . $row['due'] . "\nhttps://community.cacert.org/board/motions.php?motion=" . $row['tag'] . "\n\n";
22 }
23 if ($msg) {
24 // form email
25 $name = $v['name'];
26 $body = <<<BODY
27 Dear $name,
28
29 You have not voted in the following CAcert Board vote(s)/motion(s):
30
31 $msg
32
33
34 To view all your outstanding motions: https://community.cacert.org/board/motions.php?unvoted=1
35
36 Kind regards,
37 the vote system
38
39 BODY;
40 $db->remind_notify($v['email'],"Outstanding CAcert board votes",$body);
41 }
42 }
43 ?>