PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/application/view/error/fatal.php

https://github.com/adampatterson/Spoke-Calculator
PHP | 168 lines | 155 code | 10 blank | 3 comment | 17 complexity | 6cd50ec458a2e8473b5dadf7526e2ea7 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-ca">
  3. <head>
  4. <title><?php echo $error['prefix']; ?> Error</title>
  5. <style type="text/css" media="screen">
  6. body {
  7. background: #e7e7de;
  8. font-family: arial, tahoma, trebuchet ms, sans-serif;
  9. margin: 0px;
  10. padding: 0px;
  11. text-align: center;
  12. font-size: small;
  13. }
  14. #Frame {
  15. width: 980px;
  16. text-align: left;
  17. margin-left: auto;
  18. margin-right: auto;
  19. }
  20. #Content {
  21. background: #fff;
  22. padding: 0px 20px 20px 20px;
  23. border-top-left-radius: 10px;
  24. border-top-right-radius: 10px;
  25. -moz-border-radius-topleft: 10px;
  26. -moz-border-radius-topright: 10px;
  27. -webkit-border-top-left-radius: 10px;
  28. -webkit-border-top-right-radius: 10px;
  29. }
  30. code {
  31. display: block;
  32. padding: 4px 0px 0px 4px;
  33. color: #ff0084;
  34. overflow: auto;
  35. white-space: pre;
  36. }
  37. .PreContainer {
  38. overflow: auto;
  39. }
  40. pre {
  41. margin: 0px;
  42. padding: 2px;
  43. background: #ffffd3;
  44. }
  45. pre.Odd {
  46. background: #ffffb9;
  47. }
  48. pre.Highlight {
  49. color: #ff0000;
  50. background: #ffff7f;
  51. }
  52. a,
  53. a:link,
  54. a:active {
  55. color: #0063dc;
  56. text-decoration: none;
  57. }
  58. a:visited {
  59. color: #ff0084;
  60. }
  61. a:hover {
  62. color: #ffffff !important;
  63. background: #0063dc !important;
  64. }
  65. p {
  66. padding: 4px 0px;
  67. margin: 0px;
  68. }
  69. h2 {
  70. margin: 0px;
  71. padding: 20px 0px 0px 0px;
  72. }
  73. #MoreInformation {
  74. background: #f3f3f3;
  75. padding: 0px 20px 20px 20px;
  76. border-bottom-left-radius: 10px;
  77. border-bottom-right-radius: 10px;
  78. -moz-border-radius-bottomleft: 10px;
  79. -moz-border-radius-bottomright: 10px;
  80. -webkit-border-bottom-left-radius: 10px;
  81. -webkit-border-bottom-right-radius: 10px;
  82. margin-bottom: 20px;
  83. }
  84. h3 {
  85. margin: 0px;
  86. padding: 20px 0px 8px 0px;
  87. font-weight: normal;
  88. font-size: small;
  89. }
  90. h4 {
  91. margin: 0px;
  92. padding: 0px;
  93. font-weight: normal;
  94. }
  95. ul {
  96. margin: 0px;
  97. padding: 10px 20px 0px 20px;
  98. }
  99. ul li {
  100. line-height: 160%;
  101. }
  102. </style>
  103. </head>
  104. <body>
  105. <div id="Frame">
  106. <h1><?php echo $error['prefix']; ?> Error in <?php echo route::controller(),'.',route::method() ?>();</h1>
  107. <div id="Content">
  108. <h2><?php echo $error['prefix']; ?>: <strong><?php echo $error['message']; ?></strong> In <?php echo $error['file']; ?> At Line <?php echo $error['line']; ?></h2>
  109. <?
  110. if ($error['code'] != '')
  111. echo '<code>',htmlentities($error['code'], ENT_COMPAT, 'UTF-8'),"</code>\n";
  112. if (is_array($error['line']) && $Line > -1) {
  113. echo '<h3>The error occurred on or near: <strong>',$error['file'],'</strong></h3>
  114. <div class="PreContainer">';
  115. $LineCount = count($ErrorLines);
  116. $Padding = strlen($Line+5);
  117. $Odd = FALSE;
  118. $Class = '';
  119. for ($i = 0; $i < $LineCount; ++$i) {
  120. if ($i > $Line-6 && $i < $Line+4) {
  121. $Class = $Odd === TRUE ? 'Odd' : '';
  122. if ($i == $Line - 1) {
  123. if ($Class != '')
  124. $Class .= ' ';
  125. $Class .= 'Highlight';
  126. }
  127. echo '<pre',($Class == '' ? '' : ' class="'.$Class.'"'),'>',str_pad($i+1, $Padding, " ", STR_PAD_LEFT),': ',htmlentities(str_replace("\n", '', $ErrorLines[$i]), ENT_COMPAT, 'UTF-8'),"</pre>\n";
  128. $Odd = $Odd == TRUE ? FALSE : TRUE;
  129. }
  130. }
  131. echo "</div>\n";
  132. }
  133. if (is_array($error['backtrace'])) {
  134. $backtrace = $error['backtrace'];
  135. echo '<h3><strong>Backtrace:</strong></h3>
  136. <div class="PreContainer">';
  137. $back_trace_count = count($backtrace);
  138. $odd = FALSE;
  139. for ($i = 0; $i < $back_trace_count; ++$i) {
  140. echo '<pre'.($odd === FALSE ? '' : ' class="Odd"').'>';
  141. if (array_key_exists('file', $backtrace[$i])) {
  142. $file = '['.$backtrace[$i]['file'].':'
  143. .$backtrace[$i]['line'].'] ';
  144. }
  145. echo $file , '<strong>'
  146. ,array_key_exists('class', $backtrace[$i]) ? $backtrace[$i]['class'] : 'PHP'
  147. ,array_key_exists('type', $backtrace[$i]) ? $backtrace[$i]['type'] : '::'
  148. ,$backtrace[$i]['function'],'();</strong>'
  149. ,"</pre>\n";
  150. $odd = $odd == TRUE ? FALSE : TRUE;
  151. }
  152. echo "</div>\n";
  153. }
  154. require_once( APPLICATION.'/'.config::get('folder_helpers').'/exception.php' );
  155. ?>
  156. </div>
  157. </body>
  158. </html>