diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 03:47:30 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 03:47:30 +0300 |
| commit | 059e0d95d0c28bc5060e87e146eaf7411f51bf90 (patch) | |
| tree | 7c21ac432f16dde2329a0d5954d70711eceb48e6 /public/app/views/error | |
| parent | 26cd8ee99659ef1926c96a049c93645ffc9b169d (diff) | |
| download | gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.gz gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.bz2 gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.zip | |
skeleton commit; based on an anom project
Diffstat (limited to 'public/app/views/error')
| -rw-r--r-- | public/app/views/error/404.php | 65 | ||||
| -rw-r--r-- | public/app/views/error/general.php | 64 |
2 files changed, 129 insertions, 0 deletions
diff --git a/public/app/views/error/404.php b/public/app/views/error/404.php new file mode 100644 index 0000000..a085830 --- /dev/null +++ b/public/app/views/error/404.php @@ -0,0 +1,65 @@ +<?php +/** general error page + * + * defaults to 404 error but can be used for any other error code + * + * imported variables: + * + * optional @var $error_code (int) : error code + * optional @var $moto (string) : super-mini description text + * optional @var $message (string) + * + */ + + if (!isset($error_code)) { // if error code not set + $error_code = 404; // set default (404) + } + + http_response_code(403); + +?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>404: Not Found</title> + + <style> + html,body{ + padding:0; margin:0; + font-size:1.25em; font-family: Arial, Helvetica, Ubuntu, sans-serif; + color: #037; background: #eee; + line-height:1.2em; + } + h3 { + font-size: 2em; font-style: normal; + font-weight: 400; + color: #05a; + margin: 0; padding: 5px; + opacity: 0.27; + border-bottom: 1px solid #05a; + } + .container { display: flex; height: 100vh; align-items:center; } + .content { position: relative; + max-width:320px; width: 100%; + margin: auto auto; padding: 1.5em 1.5em 3em 1.5em; + text-align: center; justify-center: center; + opacity: .33; + } + .btn { font-size: 18px; padding: 4px 12px; } + </style> + </head> + <body> + <div class='container'> + <div class='content'> + <h3><?=$error_code?></h3> + <?= $moto ?? 'Not found' ?><br /> + <!-- + — + <br /> + <span><?= $message ?? "and I still haven't found what I'm looking for." ?></span> + --> + </div> + </div> + </body> +</html> diff --git a/public/app/views/error/general.php b/public/app/views/error/general.php new file mode 100644 index 0000000..6ed984b --- /dev/null +++ b/public/app/views/error/general.php @@ -0,0 +1,64 @@ +<?php +/** general message template + * ----------------------------------------------------------------------------- + * renders an error with custom title and message + * + * passed values: + * + * optional @var $title (string): title + * optional @var $message (string): message + * + * NOTE: + * if title and/or message are not passed, then defaults are used + * + * ----------------------------------------------------------------------------- + */ + +?><!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title> + <?= isset($title) + ? (SITE_TITLE .": ". $title) + : PAGE_404_TITLE + ?> + </title> + + <style> + html,body{ + padding:0; margin:0; + font-size:1.25em; font-family: Arial, Helvetica, Ubuntu, sans-serif; + color: #037; background: #eee; + line-height:1.2em; + } + h3 { + font-size: 2em; font-style: normal; + font-weight: 400; + color: #05a; + margin: 0; padding: 5px; + opacity: 0.27; + border-bottom: 1px solid #05a; + } + .container { display: flex; height: 100vh; align-items:center; } + .content { position: relative; + max-width: 480px; width: 100%; + margin: auto auto; padding: 1.5em 1.5em 3em 1.5em; + text-align: center; justify-center: center; + opacity: .33; + font-size: .87em + } + .btn { font-size: 18px; padding: 4px 12px; } + </style> + </head> + <body> + <div class='container'> + <div class='content'> + <h3><?= isset($title) ? $title : PAGE_404_TITLE ?></h3> + <br /> + <br /> + <span><?= $message ?? "" ?></span> + </div> + </div> + </body> +</html> |
