log.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!-- start log messages -->
  2. <table class="yiiLog" width="100%" cellpadding="2" style="border-spacing:1px;font:11px Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;color:#666666;">
  3. <tr>
  4. <th style="background:black;color:white;" colspan="5">Applicatie Logboek</th>
  5. </tr>
  6. <tr style="background-color: #ccc;">
  7. <th style="width:120px">Tijd</th>
  8. <th>Niveau</th>
  9. <th>Categorie</th>
  10. <th>Bericht</th>
  11. </tr>
  12. <?php
  13. $colors=array(
  14. CLogger::LEVEL_PROFILE=>'#DFFFE0',
  15. CLogger::LEVEL_INFO=>'#FFFFDF',
  16. CLogger::LEVEL_WARNING=>'#FFDFE5',
  17. CLogger::LEVEL_ERROR=>'#FFC0CB',
  18. );
  19. foreach($data as $index=>$log)
  20. {
  21. $color=($index%2)?'#F5F5F5':'#FFFFFF';
  22. if(isset($colors[$log[1]]))
  23. $color=$colors[$log[1]];
  24. $message='<pre>'.CHtml::encode(wordwrap($log[0])).'</pre>';
  25. $time=date('H:i:s.',$log[3]).(int)(($log[3]-(int)$log[3])*1000000);
  26. echo <<<EOD
  27. <tr style="background:{$color}">
  28. <td align="center">{$time}</td>
  29. <td>{$log[1]}</td>
  30. <td>{$log[2]}</td>
  31. <td>{$message}</td>
  32. </tr>
  33. EOD;
  34. }
  35. ?>
  36. </table>
  37. <!-- end of log messages -->