| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- /**
- * Landing (login) page file.
- *
- * Provides a class with all the properties and methods to display the page.
- *
- * @category Page
- */
- /**
- * Require dependent files if not present.
- */
- require_once(PATH::PAGE . "Page.php");
- /**
- * Error page model.
- *
- * @category Page
- */
- class Error_Page extends Page{
- /**
- * @var int Error code.
- *
- * HTTP status code.
- */
- public $code = 500;
- /**
- * Constructor.
- *
- * Retrieves the data and initializes the variables.
- *
- * @param int code Error code. Optional.
- */
- public function __construct($code = null){
- $this->view = PATH::VIEW . "error.php";
- $this->title = "Error - SWDB";
-
- if (null == $code || intval($code) < 200 || intval($code) > 599){
- $code = 500;
- }
- switch(intval($code)){
- case 400:
- $this->description = "Invalid request";
- break;
- case 404:
- $this->description = "Not found";
- break;
- case 500:
- $this->description = "Server error";
- break;
- default:
- $this->description = "Unknown error";
- }
- $this->code = intval($code);
- }
- }
- ?>
|