-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselection.php
129 lines (113 loc) · 5.26 KB
/
selection.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
<?php
global $user;
global $node;
$uid = $user->uid;
$mysql_user = $_SERVER['SQL_USER'];
$mysql_pass = $_SERVER['SQL_PASS'];
?>
<!-- REMEMBER TO CHANGE THE VID BELOW! --><?php
$vid = 'xxxx';
$vote1 = 'xxxxx';
$vote2 = 'xxxxx';
$vote3 = 'xxxxx';
$vote4 = 'xxxxx';
$vote5 = 'xxxxx';
$vote6 = 'xxxxx';
$vote7 = 'xxxxx';
$vote8 = 'xxxxx';
$vote9 = 'xxxxx';
$vote10 = 'xxxxx';
$vote11 = 'xxxxx';
$vote12 = 'xxxxx';
$token = md5(uniqid(rand(), TRUE));
$_SESSION['token'] = $token;
$_SESSION['token_time'] = time();
if (!isset($_SESSION['token']))
{
$_SESSION['token'] = md5(uniqid(rand(), TRUE));
}
mysql_connect("localhost", $mysql_user, $mysql_pass) or die(mysql_error());
mysql_select_db("ppca2") or die(mysql_error());
$result = mysql_query("select voted from ppca2.approval_voters where voter = '$uid' AND vid = '$vid'") or die(mysql_error());
$row = mysql_fetch_array($result);
$voted = $row['voted'];
if ($uid!="0")
{
// Check to see if $user has the administrator role.
if (in_array('Member', array_values($user->roles))) {
// Do something.
if ($voted != '0'){
if ($voted != '1'){
?>
Please vote for your candidates below by selecting either a Yes, No, or Abstain option. Abstain is marked by default.
<br><br>
Visit the forums <a href="https://www.pirateparty.ca/xxxxxxxxxxxxxxx">here</a> to look over each candidate's nomination/campaign posts before making your decision.
<br><br>
Thank you for participating.<br><br><br>
<form name="submitvote" action="/validate_approval" method="post">
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<div class="vote">
<label for="vote"><strong class="vote-label"><?php echo $vote1;?></strong></label>
<input type="radio" name="vote1" value="yes"> Yes<br>
<input type="radio" name="vote1" value="no" checked=""> No<br>
<input type="radio" name="vote1" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote2;?></strong></label>
<input type="radio" name="vote2" value="Yes"> Yes<br>
<input type="radio" name="vote2" value="No"> No<br>
<input type="radio" name="vote2" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote3;?></strong></label>
<input type="radio" name="vote3" value="Yes"> Yes<br>
<input type="radio" name="vote3" value="No" checked=""> No<br>
<input type="radio" name="vote3" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote4;?></strong></label>
<input type="radio" name="vote4" value="Yes"> Yes<br>
<input type="radio" name="vote4" value="No"> No<br>
<input type="radio" name="vote4" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote5;?></strong></label>
<input type="radio" name="vote5" value="Yes"> Yes<br>
<input type="radio" name="vote5" value="No" checked=""> No<br>
<input type="radio" name="vote5" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote6;?></strong></label>
<input type="radio" name="vote6" value="Yes"> Yes<br>
<input type="radio" name="vote6" value="No"> No<br>
<input type="radio" name="vote6" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote7;?></strong></label>
<input type="radio" name="vote7" value="Yes"> Yes<br>
<input type="radio" name="vote7" value="No" checked=""> No<br>
<input type="radio" name="vote7" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote8;?></strong></label>
<input type="radio" name="vote8" value="Yes"> Yes<br>
<input type="radio" name="vote8" value="No"> No<br>
<input type="radio" name="vote8" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote9;?></strong></label>
<input type="radio" name="vote9" value="Yes"> Yes<br>
<input type="radio" name="vote9" value="No" checked=""> No<br>
<input type="radio" name="vote9" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote10;?></strong></label>
<input type="radio" name="vote10" value="Yes"> Yes<br>
<input type="radio" name="vote10" value="No"> No<br>
<input type="radio" name="vote10" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote11;?></strong></label>
<input type="radio" name="vote11" value="Yes"> Yes<br>
<input type="radio" name="vote11" value="No"> No<br>
<input type="radio" name="vote11" value="Abstain" checked=""> Abstain<br>
<label for="vote"><strong class="vote-label"><?php echo $vote12;?></strong></label>
<input type="radio" name="vote12" value="Yes"> Yes<br>
<input type="radio" name="vote12" value="No"> No<br>
<input type="radio" name="vote12" value="Abstain" checked=""> Abstain<br>
<input type="hidden" spellcheck="false" name="vid" id="vid" value="<?php echo $vid; ?>">
</div><br>
<input type="submit" name="submit" id="submit" value="submit">
</form>
<?php
}
else if ($voted == '1'){
echo ("You have already voted!");
}
} }
}
else
{
echo "Sign-in to vote!";
}
?>