ErrorController.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * ErrorController
  4. * Feel free to change this and customize your own error message
  5. *
  6. * @author darkredz
  7. */
  8. class ErrorController extends DooController{
  9. function emailtext(){
  10. $trainStatus = $this->get_args ( 'substitution_vars' ) ? $this->get_args ( 'substitution_vars' ) : "";
  11. file_put_contents(DOO::conf ()->SITE_PATH . "upload/invoice/email.json", $trainStatus.PHP_EOL,FILE_APPEND);
  12. }
  13. public function index(){
  14. echo '<h1>ERROR 404 not found</h1>';
  15. echo '<p>This is handler by an internal Route as defined in common.conf.php $config[\'ERROR_404_ROUTE\']</p>
  16. <p>Your error document needs to be more than 512 bytes in length. If not IE will display its default error page.</p>
  17. <p>Give some helpful comments other than 404 :(
  18. Also check out the links page for a list of URLs available in this demo.</p>';
  19. }
  20. function get_args($name) {
  21. if (isset ( $_GET [$name] )) {
  22. if (is_array ( $_GET [$name] ))
  23. return $_GET [$name];
  24. else
  25. return addslashes ( $_GET [$name] );
  26. } elseif (isset ( $_POST [$name] )) {
  27. if (is_array ( $_POST [$name] ))
  28. return $_POST [$name];
  29. else
  30. return addslashes ( $_POST [$name] );
  31. } else
  32. return false;
  33. }
  34. }
  35. ?>