/halogy/application/modules/halogy/views/tracking_ajax.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 39 lines · 36 code · 2 blank · 1 comment · 3 complexity · 919e2b23abdf8ecc35f909255ea02dc3 MD5 · raw file

  1. <?php if ($tracking): ?>
  2. <table class="default">
  3. <tr>
  4. <th width="120">Date</th>
  5. <th>Name</th>
  6. <th>Referer</th>
  7. <th>Last Page</th>
  8. <th>Hits</th>
  9. </tr>
  10. <?php
  11. $i=0;
  12. foreach($tracking as $visit):
  13. $style = '';
  14. $class = ($i % 2) ? 'alt' : ''; $i++;
  15. if (strtotime($visit['date']) >= strtotime('-2 minutes')) $style = 'background: #FFFCDF;';
  16. ?>
  17. <?php
  18. // get userdata
  19. $userdata = @unserialize($visit['userdata']);
  20. ?>
  21. <tr class="<?php echo $class; ?>" style="<?php echo $style; ?>">
  22. <td><small><?php echo dateFmt($visit['date'], '', '', TRUE); ?></small></td>
  23. <td>
  24. <?php if ($visit['userdata']): ?>
  25. <?php echo anchor('/admin/users/edit/'.$userdata['userID'], $userdata['firstName'].' '.$userdata['lastName']); ?>
  26. <?php else: ?>
  27. Guest
  28. <?php endif; ?>
  29. </td>
  30. <td><?php echo ($visit['referer']) ? anchor($visit['referer'], htmlentities($visit['referer'])) : 'Direct (no referrer)'; ?></td>
  31. <td><?php echo $visit['lastPage']; ?></td>
  32. <td><?php echo $visit['views']+1; ?></td>
  33. </tr>
  34. <?php endforeach; ?>
  35. <?php else: ?>
  36. <p>Nothing has happened yet!</p>
  37. <?php endif; ?>