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