-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers.php
66 lines (61 loc) · 3.05 KB
/
users.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
require_once('init.php');
$activePage = 1;
?>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Setlist Scrobbler | Users</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/main.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<?php include_once("analyticstracking.php") ?>
<?php require_once('header.php') ?>
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">Users of Fame (<b><?=$oDatabase->getActiveUserCount()?></b> active users have scrobbled <b><?=$oDatabase->getEventCount()?></b> events)</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>User</th>
<th>Events Scrobbled</th>
</tr>
</thead>
<tbody>
<?php
$aUsers = $oDatabase->getUserEventCounts($page, $limit);
$position = 1 + ($page * $limit);
foreach ($aUsers as $aUser) {
$username = $aUser['user_name'];
$session = $aUser['user_session'];
if ($session == "") {
print('<tr class="danger">');
} else {
print('<tr>');
}
print('<td>' . $position++ . '</td>' );
print('<td><a target="_blank" href="http://www.last.fm/user/' . $username . '">' . $username . '</a></td>' );
print('<td>' . $aUser['event_count'] . '</td>');
print('</tr>');
}
$nextDisabled = count($aUsers) < $limit;
if (!$nextDisabled) {
# the results fill the page, check if there's another page
$nextDisabled = (count($oDatabase->getUserEventCounts($page + 1, $limit)) == 0);
}
?>
</tbody>
</table>
</div>
</div>
<?php require_once('pager.php') ?>
</div>
<?php require_once('footer.php') ?>
</body>
</html>