Unfinished activity ('quantified self') tracker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

content.php 791B

123456789101112131415161718192021222324252627282930313233343536
  1. <?PHP
  2. $period = isset($_POST['period']) ? $_POST['period'] : 'week';
  3. define('MIN_TIME', strtotime('-1 ' . $period));
  4. define('MAX_TIME', time());
  5. if (!empty($_POST)) {
  6. $_FILTER = $_POST;
  7. }
  8. require_once('tracker.php');
  9. $lastdate = '';
  10. foreach ($_EVENTS as $event) {
  11. $date = date('l, F \t\h\e j<\s\u\p>S</\s\u\p>, Y', $event['event']->getTime());
  12. if ($date != $lastdate) {
  13. if ($lastdate != '') {
  14. echo '</ul>';
  15. }
  16. echo '<h2>', $date, '</h2><ul>';
  17. $lastdate = $date;
  18. }
  19. echo '<li class="', get_class($event['source']), '">', $event['event']->getData();
  20. }
  21. if ($lastdate == '') {
  22. echo '<h2>Error</h2>';
  23. echo '<p>No events matching that filter/time period</p>';
  24. }
  25. ?>