Location: PHPKode > projects > PHP-Comics > php-comics/statistics.php
<?php
    include('inc/inc.php');
	$time = time();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<title>PHP Comics: Statistics</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<link rel="stylesheet" type="text/css" href="css/statistics.css" />
</head>
<body>
	<?=site::showsidemenu();?>
<h1>Statistics</h1>
	<table class="Stats">
		<tr>
			<td class="heading" colspan="2">Your Stats</td>
		</tr>
		<tr>
			<td>Books Read Today</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time > ($time - 86400) AND UID = $_SESSION[UID]",'count')?></td>
		</tr>
		<tr>
			<td>Books Read Yesterday</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time < ($time - 86400) AND Time > ($time - 172800) AND UID = $_SESSION[UID]",'count')?></td>
		</tr>
			<td>Books Read This Week</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time > ($time - 604800) AND UID = $_SESSION[UID]",'count')?></td>
		</tr>
		<tr>
			<td>Books Read Last Week</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time < ($time - 604800) AND Time > ($time - 1209600)  AND UID = $_SESSION[UID]",'count')?></td>
		</tr>
		<tr>
			<td>Books Read This Month</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time > ($time - 2592000) AND UID = $_SESSION[UID]",'count')?></td>
		</tr>
		<tr>
			<td>Books Read Last Month</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time < ($time - 2592000) AND Time > ($time - 5184000) AND UID = $_SESSION[UID]",'count')?></td>
		</tr>
		<tr>
			<td>Books Read Ever</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE UID = $_SESSION[UID]",'count')?></td>
		</tr>
			<td class="heading" colspan="2">Global Stats</td>
		</tr>
		<tr>
			<td>Books Read Today</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time > ($time - 86400)",'count')?></td>
		</tr>
		<tr>
			<td>Books Read Yesterday</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time < ($time - 86400) AND Time > ($time - 172800)",'count')?></td>
		</tr>
			<td>Books Read This Week</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time > ($time - 604800) ",'count')?></td>
		</tr>
		<tr>
			<td>Books Read Last Week</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time < ($time - 604800) AND Time > ($time - 1209600) ",'count')?></td>
		</tr>
		<tr>
			<td>Books Read This Month</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time > ($time - 2592000) ",'count')?></td>
		</tr>
		<tr>
			<td>Books Read Last Month</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark WHERE Time < ($time - 2592000) AND Time > ($time - 5184000)",'count')?></td>
		</tr>
		<tr>
			<td>Books Read Ever</td>
			<td><?=DB::QueryResult("SELECT COUNT(Time) as count From Bookmark",'count')?></td>
		</tr>
		<tr>
		</tr>
	</table>
</body>
</html>
Return current item: PHP-Comics