This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/votestats.php
Jeremy Newman e6b58e6b01 borked link
2004-03-15 20:50:34 +00:00

46 lines
1.1 KiB
PHP

<?
include("path.php");
include(BASE."include/"."incl.php");
apidb_header("Vote Stats - Top 25 Applications");
$voteQuery = "SELECT appVotes.appId, appName, count(userId) as count ".
"FROM appVotes, appFamily ".
"WHERE appVotes.appId = appFamily.appId ".
"GROUP BY appId ORDER BY count DESC LIMIT 25";
$result = mysql_query($voteQuery);
if($result)
{
echo html_frame_start("", "90%", '', 0);
echo html_table_begin("width='100%' align=center");
echo "<tr class=color4><td><font color=white>Application Name</font></td>\n";
echo "<td><font color=white>Votes</font></td></tr>\n";
$c = 1;
while($row = mysql_fetch_object($result))
{
if ($c % 2 == 1) { $bgcolor = "color0"; } else { $bgcolor = "color1"; }
$link = "<a href='appview.php?appId=$row->appId'>$row->appName</a>";
echo "<tr class='".$bgcolor."'><td width='90%'>$c. $link </td> <td> $row->count </td></tr>\n";
$c++;
}
echo html_table_end();
echo html_frame_end();
echo "<center><a href='help/?topic=voting'>What does this screen mean?</a></center>\n";
}
else
{
echo "Error: " . mysql_error();
}
apidb_footer();
?>