diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index 11ad5a56..d48917c4 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -210,3 +210,24 @@ CREATE TABLE CommentNotify ( FOREIGN KEY (UserID) REFERENCES Users(ID) ON DELETE CASCADE ); +-- Vote information +-- +CREATE TABLE IF NOT EXISTS TU_VoteInfo ( + ID int(10) unsigned NOT NULL auto_increment, + Agenda text collate latin1_general_ci NOT NULL, + User char(32) collate latin1_general_ci NOT NULL, + Submitted bigint(20) unsigned NOT NULL, + SubmitterID int(10) unsigned NOT NULL, + Yes tinyint(3) unsigned NOT NULL default '0', + No tinyint(3) unsigned NOT NULL default '0', + Abstain tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (ID) +) + +-- Individual vote records +-- +CREATE TABLE IF NOT EXISTS TU_Votes ( + VoteID int(10) unsigned NOT NULL, + UserID int(10) unsigned NOT NULL +) + diff --git a/web/html/addvote.php b/web/html/addvote.php new file mode 100644 index 00000000..91a06583 --- /dev/null +++ b/web/html/addvote.php @@ -0,0 +1,79 @@ +Username does not exist."; + } else { + $qcheck = "SELECT * FROM TU_VoteInfo WHERE User = '" . mysql_real_escape_string($_REQUEST['user']) . "'"; + $qcheck.= " AND Submitted + " . $aweek . " > UNIX_TIMESTAMP()"; + $check = mysql_num_rows(db_query($qcheck, $dbh)); + + if ($check != 0) { + $error.= "
New proposal submitted.
\n"; + } else { +?> +Submit a proposal to vote on.
+"; } ?> + +because it still maintains word wrapping + print str_replace("\n", "
\n", $row['Agenda']); + + print "
\n"; + print "
\n"; + + print "\n"; + print " \n"; + print "\n"; + print "
\n"; + + echo "\n"; + print " \n"; + print " \n"; + + print "
\n"; + print "\n"; + print " \n"; + + $c = "data1"; + + print ""; + print "Yes"; + print " \n"; + print ""; + print "No"; + print " \n"; + print ""; + print "Abstain"; + print " \n"; + print ""; + print "Total"; + print " \n"; + print ""; + print "Voted?"; + print " \n"; + print "\n"; + print " \n"; + + print ""; + print $row['Yes']; + print " \n"; + print ""; + print $row['No']; + print " \n"; + print ""; + print $row['Abstain']; + print " \n"; + print ""; + print ($row['Yes'] + $row['No'] + $row['Abstain']); + print " \n"; + print ""; + + if ($hasvoted == 0) { + print "No"; + } else { + print "Yes"; + } + + print " \n"; + print "
\n"; + print " $application\n"; + print " | \n"; + print "||||||||||||||
\n";
+ print "
|
\n"; + if ($off != 0) { + $back = (($off - $limit) <= 0) ? 0 : $off - $limit; + print "Back"; + } + print " | \n"; + + print "\n"; + if (($off + $limit) < mysql_num_rows($nextresult)) { + $forw = $off + $limit; + print "Next"; + } + print " | \n"; + print "