<!-- FOOTER -->
<footer class="Footer">
   <div class="center">
      <nav class="nav DESKTOP">
         <a class="link" href="legal">Legal Documents</a>
      </nav>
      <nav class="nav MOBILE" id="FooterButton"><img src="images/nav.png" width="100%" height="100%"></nav>
      <a class="logo" href=""><?php echo $set['website_name']; ?></a>
   </div>
</footer>
<!-- FOOTER -->

<div class="Menu b MOBILE" id="FooterMenu">
   <a class="link" href="legal">Legal Documents</a>
</div>

<?php 

$last_hour = strtotime('1 hour ago', time());

if(fetch_rows("SELECT id FROM pageviews WHERE ip = '{$ip}' AND page = '{$uri}' AND date_created > $last_hour LIMIT 1") < 1){

   query("INSERT INTO pageviews (ip, page, date_created) VALUES ('{$ip}', '{$uri}', '{$t}')");

   switch(basename($_SERVER['PHP_SELF'])){

      case 'listing.php':
      query("UPDATE listings SET pageviews = pageviews + 1 WHERE id = '{$id}' LIMIT 1");
      query("UPDATE stats SET pageviews = pageviews + 1 WHERE user_id = '{$x['user_id']}' ORDER BY id DESC LIMIT 1");
      break;

      case 'category.php':
      query("UPDATE categories SET pageviews = pageviews + 1 WHERE id = '{$id}' LIMIT 1");
      break;


   }
   
   query("UPDATE _stats SET pageviews = pageviews + 1 ORDER BY id DESC LIMIT 1");

}

?>

<?php echo $set['tracking_code']; ?>

<script src="scripts/functions.js"></script>
<script src="scripts/main.js"></script>