<?php require_once 'includes/main.php'; ?>
<?php require_once 'elements/head.php'; ?>

<!-- META: TITLE -->
<title><?php echo $set['stats_title']; ?> - <?php echo $set['website_name']; ?></title>

</head>

<body>

<?php include_once 'elements/header.php'; ?>

<?php $today = strtotime('today', time()); ?>
<?php $this_week = strtotime('last week', time()); ?>
<?php $this_month = strtotime('first day of this month', time()); ?>

<!-- CONTENT -->
<section class="Content">

   <!-- USERS -->
   <h2 class="GLOB-Title">Users: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM users")); ?></span></h2>
   <h3 class="GLOB-SubTitle">Today: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM users WHERE date_created > $today")); ?></span></h3>
   <h3 class="GLOB-SubTitle">This Week: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM users WHERE date_created > $this_week")); ?></span></h3>
   <h3 class="GLOB-SubTitle">This Month: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM users WHERE date_created > $this_month")); ?></span></h3>
   <!-- USERS -->

   <!-- LISTINGS -->
   <h2 class="GLOB-Title">Listings: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM listings")); ?></span></h2>
   <h3 class="GLOB-SubTitle">Today: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM listings WHERE date_created > $today")); ?></span></h3>
   <h3 class="GLOB-SubTitle">This Week: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM listings WHERE date_created > $this_week")); ?></span></h3>
   <h3 class="GLOB-SubTitle">This Month: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM listings WHERE date_created > $this_month")); ?></span></h3>
   <!-- LISTINGS -->

   <!-- PAGEVIEWS -->
   <h2 class="GLOB-Title">Pageviews: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM pageviews")); ?></span></h2>
   <h3 class="GLOB-SubTitle">Today: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM pageviews WHERE date_created > $today")); ?></span></h3>
   <h3 class="GLOB-SubTitle">This Week: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM pageviews WHERE date_created > $this_week")); ?></span></h3>
   <h3 class="GLOB-SubTitle">This Month: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM pageviews WHERE date_created > $this_month")); ?></span></h3>
   <!-- PAGEVIEWS -->

   <!-- CLICKS -->
   <h2 class="GLOB-Title">Clicks: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM clicks")); ?></span></h2>
   <h3 class="GLOB-SubTitle">Today: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM clicks WHERE date_created > $today")); ?></span></h3>
   <h3 class="GLOB-SubTitle">This Week: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM clicks WHERE date_created > $this_week")); ?></span></h3>
   <h3 class="GLOB-SubTitle">This Month: <span class="FR"><?php echo comma_number(fetch_record("SELECT COUNT(id) FROM clicks WHERE date_created > $this_month")); ?></span></h3>
   <!-- CLICKS -->

</section>
<!-- CONTENT -->

<?php include_once 'elements/sidebar/main.php'; ?>

<?php include_once 'elements/footer.php'; ?>

</body>
</html>
