Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/members/saaceadmin/
Upload File :
Current File : /var/www/cesa.co.za/members/saaceadmin/documents.php

<html>
<head>
<title>Downloadable Document Information</title>
</head>
<body>
<h3>
Most downloaded documents:
</h3>
<p>Top 20 most downloaded documents:</p>
<?php
include('../inc/conf.inc');
$connection = mysql_connect($server, $user, $pass);
mysql_select_db($db,$connection);

$sql = "SELECT DISTINCT(document) AS dd, COUNT(document) AS count FROM log_documents GROUP BY document ORDER BY count DESC";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);

//Has documents been downloaded?

if ($num_rows > 0) {
?>
<p>
<table width="500" cellspacing="0" cellpadding="0" border="1">
<tr><td valign="top">Document Name:</td><td valign="top" width="90"># downloads:</td></tr>

<?php	
	while ($row=mysql_fetch_array($result)) {
		echo "<tr><td valign=\"top\">".$row["dd"]."</td><td valign=\"top\" align=\"center\">".$row["count"]."</td></tr>";
	}
	echo "</table></p>";
	echo "<p>Please note that documents are ordered from most downloaded, to least</p>";
} else {
	echo "No documents have been downloaded thus far";	
}



mysql_close($connection);
echo "<a href=\"/members/saaceadmin/\">Back to SAACE Admin</a>";
?>
</body>
</html>