66 lines
1.7 KiB
PHP
66 lines
1.7 KiB
PHP
<?php
|
|
require("header.php");
|
|
|
|
$limit = isset($_GET['limit']) ? $_GET['limit'] : "50";
|
|
if($limit == ""){ $limit = 50; }
|
|
|
|
$query = "SELECT project.name AS pname, file.name AS fname, download.time, download.ip FROM download, file, project WHERE download.`file-id` = file.id AND file.`project-id` = project.id ORDER BY download.time DESC LIMIT 0, $limit";
|
|
$result = ExecQuery($query);
|
|
|
|
$limit = $result->num_rows;
|
|
|
|
$table = "";
|
|
|
|
while($row = $result->fetch_assoc())
|
|
{
|
|
$time = date("c", strtotime($row['time']));
|
|
$time_display = date("l jS \of F Y H:i:s", strtotime($row['time']));
|
|
|
|
$table .= "<tr>\n";
|
|
$table .= "<td>" . $row['pname'] . "</td>\n";
|
|
$table .= "<td>" . $row['fname'] . "</td>\n";
|
|
$table .= "<td><time class='timeago' datetime='" . $time . "'>" . $time_display . "</time></td>\n";
|
|
$table .= "<td>" . $row['ip'] . "</td>\n";
|
|
$table .= "</tr>\n";
|
|
}
|
|
?>
|
|
|
|
|
|
<!-- Portfolio Item Heading -->
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<h1 class="page-header">Downloads <small><?php echo $limit; ?></small></h1>
|
|
</div>
|
|
</div>
|
|
<!-- /.row -->
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Project</th>
|
|
<th>File</th>
|
|
<th>Time</th>
|
|
<th>IP Address</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php echo $table; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/inc/js/jquery.timeago.js"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$("time.timeago").timeago();
|
|
});
|
|
</script>
|
|
|
|
<?php
|
|
require("footer.php");
|
|
?>
|