summaryrefslogtreecommitdiffstats
path: root/web/html/voters.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/html/voters.php')
-rw-r--r--web/html/voters.php43
1 files changed, 17 insertions, 26 deletions
diff --git a/web/html/voters.php b/web/html/voters.php
index 02abe29..231e323 100644
--- a/web/html/voters.php
+++ b/web/html/voters.php
@@ -3,38 +3,29 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
include('aur.inc.php');
include('pkgfuncs.inc.php');
-function getvotes($pkgid) {
- $dbh = db_connect();
- $pkgid = db_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 = intval($_GET['ID']);
$votes = getvotes($pkgid);
-$account = account_from_sid($SID);
+$atype = 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'];
+html_header(__("Voters"));
+
+if ($atype == 'Trusted User' || $atype== 'Developer'):
?>
-<a href="account.php?Action=AccountInfo&amp;ID=<?php echo $uid ?>">
-<?php echo htmlspecialchars($username) ?></a><br />
+
+<div class="box">
+ <h2>Votes for <a href="packages.php?ID=<?php echo $pkgid ?>"><?php echo pkgname_from_id($pkgid) ?></a></h2>
+ <div class="boxbody">
+
<?php
- }
-?>
-</body>
-</html>
+ while (list($indx, $row) = each($votes)): ?>
+ <a href="account.php?Action=AccountInfo&amp;ID=<?php echo $row['UsersID'] ?>"><?php echo htmlspecialchars($row['Username']) ?></a><br />
+ <?php endwhile; ?>
+ </div>
+</div>
+
<?php
-}
+endif;
+html_footer(AUR_VERSION);