summaryrefslogtreecommitdiffstats
path: root/web/html/voters.php
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2009-07-20 05:20:36 +0200
committerLoui Chang <louipc.ist@gmail.com>2009-07-20 05:20:36 +0200
commit57972532a75f7dd770f96b54edb4f0a4213e2764 (patch)
tree5a288aa09609bbf4c607674c8f527552449413c9 /web/html/voters.php
parent316f4b990c34f95417f63abb75e9ebf0f13b59ea (diff)
downloadaur-57972532a75f7dd770f96b54edb4f0a4213e2764.tar.gz
aur-57972532a75f7dd770f96b54edb4f0a4213e2764.tar.xz
Add voter list on packages for TUs and devs.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/html/voters.php')
-rw-r--r--web/html/voters.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/web/html/voters.php b/web/html/voters.php
new file mode 100644
index 00000000..a3b24690
--- /dev/null
+++ b/web/html/voters.php
@@ -0,0 +1,40 @@
+<?php
+set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
+include('aur.inc');
+include('pkgfuncs.inc');
+
+function getvotes($pkgid) {
+ $dbh = db_connect();
+ $pkgid = mysql_real_escape_string($pkgid);
+
+ $result = db_query("SELECT UsersID,Username FROM PackageVotes LEFT JOIN Users on (UsersID = ID) WHERE PackageID = $pkgid ORDER BY Username", $dbh);
+ return $result;
+}
+
+$SID = $_COOKIE['AURSID'];
+
+$pkgid = $_GET['ID'];
+$votes = getvotes($pkgid);
+$account = account_from_sid($SID);
+
+if ($account == 'Trusted User' || $account == 'Developer') {
+?>
+<html>
+<body>
+<h3><?php echo account_from_sid($SID) ?></h3>
+<h2>Votes for <a href="packages.php?ID=<?php echo $pkgid ?>"><?php echo pkgname_from_id($pkgid) ?></a></h2>
+<?php
+ while ($row = mysql_fetch_assoc($votes)) {
+ $uid = $row['UsersID'];
+ $username = $row['Username'];
+?>
+<a href="account.php?Action=AccountInfo&ID=<?php echo $uid ?>">
+<?php echo $username ?></a><br />
+<?php
+ }
+?>
+</body>
+</html>
+<?php
+}
+