فهرست منبع

Initial commit

Alan Lam 4 سال پیش
کامیت
046de01ff0
97فایلهای تغییر یافته به همراه7683 افزوده شده و 0 حذف شده
  1. 19 0
      .env.example
  2. 3 0
      .gitignore
  3. 35 0
      boot.php
  4. 35 0
      composer.json
  5. 2858 0
      composer.lock
  6. 9 0
      controllers/404.php
  7. 13 0
      controllers/500.php
  8. 12 0
      controllers/companies.php
  9. 108 0
      controllers/company_form.php
  10. 25 0
      controllers/customer.php
  11. 86 0
      controllers/customer_form.php
  12. 12 0
      controllers/customers.php
  13. 10 0
      controllers/dashboard.php
  14. 44 0
      controllers/home.php
  15. 25 0
      controllers/location.php
  16. 94 0
      controllers/location_form.php
  17. 16 0
      controllers/locations.php
  18. 9 0
      controllers/log_out.php
  19. 25 0
      controllers/product.php
  20. 77 0
      controllers/product_form.php
  21. 12 0
      controllers/products.php
  22. 10 0
      controllers/reset_password.php
  23. 16 0
      controllers/sales.php
  24. 41 0
      controllers/settings.php
  25. 52 0
      controllers/setup.php
  26. 25 0
      controllers/supplier.php
  27. 85 0
      controllers/supplier_form.php
  28. 12 0
      controllers/suppliers.php
  29. 10 0
      controllers/tickets.php
  30. 69 0
      controllers/user_form.php
  31. 13 0
      controllers/users.php
  32. 22 0
      db/migrations/20220625101544_add_user_table.php
  33. 20 0
      db/migrations/20220625113254_add_address_table.php
  34. 20 0
      db/migrations/20220625114247_add_customer_table.php
  35. 22 0
      db/migrations/20220625173026_add_location_table.php
  36. 20 0
      db/migrations/20220625174431_add_supplier_table.php
  37. 20 0
      db/migrations/20220625181248_add_product_table.php
  38. 22 0
      db/migrations/20220626135804_add_company_table.php
  39. 23 0
      db/migrations/20220626141033_add_company_bank_details_table.php
  40. 43 0
      engine/Address.php
  41. 32 0
      engine/Breadcrumb.php
  42. 69 0
      engine/Company.php
  43. 31 0
      engine/CompanyBankDetails.php
  44. 17 0
      engine/Constraint/BetweenConstraint.php
  45. 15 0
      engine/Constraint/Constraint.php
  46. 11 0
      engine/Constraint/LessThanConstraint.php
  47. 11 0
      engine/Constraint/MoreThanOrEqualsConstraint.php
  48. 11 0
      engine/Constraint/NotEqualsConstraint.php
  49. 254 0
      engine/Core.php
  50. 14 0
      engine/Currency.php
  51. 59 0
      engine/Customer.php
  52. 228 0
      engine/Database.php
  53. 17 0
      engine/Html.php
  54. 17 0
      engine/Http.php
  55. 56 0
      engine/Location.php
  56. 658 0
      engine/Model.php
  57. 65 0
      engine/Product.php
  58. 143 0
      engine/Request.php
  59. 21 0
      engine/Role.php
  60. 48 0
      engine/Router.php
  61. 27 0
      engine/Session.php
  62. 62 0
      engine/Supplier.php
  63. 126 0
      engine/User.php
  64. 12 0
      engine/Util.php
  65. 32 0
      engine/View.php
  66. 1 0
      phinx.bat
  67. 6 0
      public/.htaccess
  68. 4 0
      public/index.php
  69. 79 0
      public/js/app.js
  70. 56 0
      router.php
  71. 51 0
      routes/default.php
  72. 63 0
      views/companies.php
  73. 78 0
      views/components/address_fields.php
  74. 37 0
      views/components/alerts.php
  75. 38 0
      views/components/breadcrumbs.php
  76. 98 0
      views/customer.php
  77. 66 0
      views/customers.php
  78. 6 0
      views/dashboard.php
  79. 170 0
      views/entity_form.php
  80. 9 0
      views/error.php
  81. 13 0
      views/footer.php
  82. 108 0
      views/header.php
  83. 25 0
      views/home.php
  84. 33 0
      views/locations.php
  85. 44 0
      views/locations_table.php
  86. 43 0
      views/product.php
  87. 76 0
      views/product_form.php
  88. 79 0
      views/products.php
  89. 9 0
      views/reset_password.php
  90. 9 0
      views/sales.php
  91. 63 0
      views/settings.php
  92. 68 0
      views/setup.php
  93. 35 0
      views/supplier.php
  94. 66 0
      views/suppliers.php
  95. 9 0
      views/tickets.php
  96. 69 0
      views/user_form.php
  97. 64 0
      views/users.php

+ 19 - 0
.env.example

@@ -0,0 +1,19 @@
+DB_HOST=192.168.1.71
+DB_USERNAME=
+DB_PASSWORD=
+DB_NAME=database
+
+DIR_ROOT="/var/www/electrocoin-crm"
+
+SITE_NAME="Electrocoin CRM"
+TIMEZONE=Europe/London
+LOCALE=en_GB
+SESSION_NAME=electrocoin
+
+ENV=development
+
+GOOGLE_ANALYTICS_ID=
+GOOGLE_API_KEY=
+
+RECAPTCHA_PUBLIC_KEY=
+RECAPTCHA_SECRET_KEY=

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/.env
+/phinx.php
+/vendor/

+ 35 - 0
boot.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace App;
+
+use Dotenv\Dotenv;
+use Dotenv\Exception\ValidationException;
+use Exception;
+
+require "vendor/autoload.php";
+
+try {
+	$dotenv = Dotenv::createImmutable(__DIR__);
+	$dotenv->load();
+	$dotenv->required(["DB_HOST", "DB_USERNAME", "DB_PASSWORD", "DB_NAME"]);
+	$dotenv->required(["DIR_ROOT", "TIMEZONE", "LOCALE", "SESSION_NAME", "ENV"])->notEmpty();
+}
+catch(ValidationException $e) {
+	echo $e->getMessage();
+	exit();
+}
+
+try {
+	Database::connect(
+		$_ENV["DB_HOST"],
+		$_ENV["DB_USERNAME"],
+		$_ENV["DB_PASSWORD"],
+		$_ENV["DB_NAME"]
+	);
+}
+catch(Exception $e) {
+	View::include("header");
+	View::include("error", ["message" => "Unable to establish connection to the database. Please try again later."]);
+	View::include("footer");
+	exit();
+}

+ 35 - 0
composer.json

@@ -0,0 +1,35 @@
+{
+    "name": "al2k4/electrocoin-crm",
+    "description": "Electrocoin CRM",
+    "type": "project",
+    "authors": [
+        {
+            "name": "Alan Lam",
+            "email": "me@al2k4.uk"
+        }
+    ],
+	"autoload": {
+		"psr-4": {
+			"App\\": "engine/"
+		}
+	},
+	"require": {
+        "php": ">=7.4.0",
+		"ext-mysqli": "*",
+		"ext-gd": "*",
+		"ext-mbstring": "*",
+		"ext-intl": "*",
+		"ext-json": "*",
+        "gettext/gettext": "^5.2",
+        "gettext/translator": "^1.0",
+		"ext-curl": "*",
+		"ext-simplexml": "*",
+        "nesbot/carbon": "^2.58",
+        "paragonie/anti-csrf": "^2.3",
+        "robmorgan/phinx": "^0.12.10",
+        "vlucas/phpdotenv": "^5.4"
+	},
+	"require-dev": {
+		"roave/security-advisories": "dev-latest"
+	}
+}

+ 2858 - 0
composer.lock

@@ -0,0 +1,2858 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "e0800ed0a0c20006a21217617050785c",
+    "packages": [
+        {
+            "name": "cakephp/core",
+            "version": "4.4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cakephp/core.git",
+                "reference": "884555efcf573ea23597f9c88a12ed6d58af00f3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cakephp/core/zipball/884555efcf573ea23597f9c88a12ed6d58af00f3",
+                "reference": "884555efcf573ea23597f9c88a12ed6d58af00f3",
+                "shasum": ""
+            },
+            "require": {
+                "cakephp/utility": "^4.0",
+                "php": ">=7.4.0"
+            },
+            "suggest": {
+                "cakephp/cache": "To use Configure::store() and restore().",
+                "cakephp/event": "To use PluginApplicationInterface or plugin applications.",
+                "league/container": "To use Container and ServiceProvider classes"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "functions.php"
+                ],
+                "psr-4": {
+                    "Cake\\Core\\": "."
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "CakePHP Community",
+                    "homepage": "https://github.com/cakephp/core/graphs/contributors"
+                }
+            ],
+            "description": "CakePHP Framework Core classes",
+            "homepage": "https://cakephp.org",
+            "keywords": [
+                "cakephp",
+                "core",
+                "framework"
+            ],
+            "support": {
+                "forum": "https://stackoverflow.com/tags/cakephp",
+                "irc": "irc://irc.freenode.org/cakephp",
+                "issues": "https://github.com/cakephp/cakephp/issues",
+                "source": "https://github.com/cakephp/core"
+            },
+            "time": "2022-05-31T20:57:08+00:00"
+        },
+        {
+            "name": "cakephp/database",
+            "version": "4.4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cakephp/database.git",
+                "reference": "9bb8b691f36729fd630118a1cc7b52f9ae13d126"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cakephp/database/zipball/9bb8b691f36729fd630118a1cc7b52f9ae13d126",
+                "reference": "9bb8b691f36729fd630118a1cc7b52f9ae13d126",
+                "shasum": ""
+            },
+            "require": {
+                "cakephp/core": "^4.0",
+                "cakephp/datasource": "^4.0",
+                "php": ">=7.4.0"
+            },
+            "suggest": {
+                "cakephp/i18n": "If you are using locale-aware datetime formats or Chronos types."
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Cake\\Database\\": "."
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "CakePHP Community",
+                    "homepage": "https://github.com/cakephp/database/graphs/contributors"
+                }
+            ],
+            "description": "Flexible and powerful Database abstraction library with a familiar PDO-like API",
+            "homepage": "https://cakephp.org",
+            "keywords": [
+                "abstraction",
+                "cakephp",
+                "database",
+                "database abstraction",
+                "pdo"
+            ],
+            "support": {
+                "forum": "https://stackoverflow.com/tags/cakephp",
+                "irc": "irc://irc.freenode.org/cakephp",
+                "issues": "https://github.com/cakephp/cakephp/issues",
+                "source": "https://github.com/cakephp/database"
+            },
+            "time": "2022-04-12T01:11:53+00:00"
+        },
+        {
+            "name": "cakephp/datasource",
+            "version": "4.4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cakephp/datasource.git",
+                "reference": "3a3e3fcd171f8b90fee8a614b53d913114e4fc09"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cakephp/datasource/zipball/3a3e3fcd171f8b90fee8a614b53d913114e4fc09",
+                "reference": "3a3e3fcd171f8b90fee8a614b53d913114e4fc09",
+                "shasum": ""
+            },
+            "require": {
+                "cakephp/core": "^4.0",
+                "php": ">=7.4.0",
+                "psr/log": "^1.0 || ^2.0",
+                "psr/simple-cache": "^1.0 || ^2.0"
+            },
+            "suggest": {
+                "cakephp/cache": "If you decide to use Query caching.",
+                "cakephp/collection": "If you decide to use ResultSetInterface.",
+                "cakephp/utility": "If you decide to use EntityTrait."
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Cake\\Datasource\\": "."
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "CakePHP Community",
+                    "homepage": "https://github.com/cakephp/datasource/graphs/contributors"
+                }
+            ],
+            "description": "Provides connection managing and traits for Entities and Queries that can be reused for different datastores",
+            "homepage": "https://cakephp.org",
+            "keywords": [
+                "cakephp",
+                "connection management",
+                "datasource",
+                "entity",
+                "query"
+            ],
+            "support": {
+                "forum": "https://stackoverflow.com/tags/cakephp",
+                "irc": "irc://irc.freenode.org/cakephp",
+                "issues": "https://github.com/cakephp/cakephp/issues",
+                "source": "https://github.com/cakephp/datasource"
+            },
+            "time": "2022-06-10T21:39:25+00:00"
+        },
+        {
+            "name": "cakephp/utility",
+            "version": "4.4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cakephp/utility.git",
+                "reference": "b2a47e038954432b2e09d3406559a75656ebe131"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cakephp/utility/zipball/b2a47e038954432b2e09d3406559a75656ebe131",
+                "reference": "b2a47e038954432b2e09d3406559a75656ebe131",
+                "shasum": ""
+            },
+            "require": {
+                "cakephp/core": "^4.0",
+                "php": ">=7.4.0"
+            },
+            "suggest": {
+                "ext-intl": "To use Text::transliterate() or Text::slug()",
+                "lib-ICU": "To use Text::transliterate() or Text::slug()"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Cake\\Utility\\": "."
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "CakePHP Community",
+                    "homepage": "https://github.com/cakephp/utility/graphs/contributors"
+                }
+            ],
+            "description": "CakePHP Utility classes such as Inflector, String, Hash, and Security",
+            "homepage": "https://cakephp.org",
+            "keywords": [
+                "cakephp",
+                "hash",
+                "inflector",
+                "security",
+                "string",
+                "utility"
+            ],
+            "support": {
+                "forum": "https://stackoverflow.com/tags/cakephp",
+                "irc": "irc://irc.freenode.org/cakephp",
+                "issues": "https://github.com/cakephp/cakephp/issues",
+                "source": "https://github.com/cakephp/utility"
+            },
+            "time": "2022-05-20T04:16:49+00:00"
+        },
+        {
+            "name": "gettext/gettext",
+            "version": "v5.6.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-gettext/Gettext.git",
+                "reference": "017e249601d32b9a88c2eb4c10eac89bf582a7d3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/017e249601d32b9a88c2eb4c10eac89bf582a7d3",
+                "reference": "017e249601d32b9a88c2eb4c10eac89bf582a7d3",
+                "shasum": ""
+            },
+            "require": {
+                "gettext/languages": "^2.3",
+                "php": "^7.2|^8.0"
+            },
+            "require-dev": {
+                "brick/varexporter": "^0.3.5",
+                "friendsofphp/php-cs-fixer": "^3.2",
+                "oscarotero/php-cs-fixer-config": "^2.0",
+                "phpunit/phpunit": "^8.0|^9.0",
+                "squizlabs/php_codesniffer": "^3.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Gettext\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Oscar Otero",
+                    "email": "oom@oscarotero.com",
+                    "homepage": "http://oscarotero.com",
+                    "role": "Developer"
+                }
+            ],
+            "description": "PHP gettext manager",
+            "homepage": "https://github.com/php-gettext/Gettext",
+            "keywords": [
+                "JS",
+                "gettext",
+                "i18n",
+                "mo",
+                "po",
+                "translation"
+            ],
+            "support": {
+                "email": "oom@oscarotero.com",
+                "issues": "https://github.com/php-gettext/Gettext/issues",
+                "source": "https://github.com/php-gettext/Gettext/tree/v5.6.1"
+            },
+            "funding": [
+                {
+                    "url": "https://paypal.me/oscarotero",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/oscarotero",
+                    "type": "github"
+                },
+                {
+                    "url": "https://www.patreon.com/misteroom",
+                    "type": "patreon"
+                }
+            ],
+            "time": "2021-12-04T11:33:21+00:00"
+        },
+        {
+            "name": "gettext/languages",
+            "version": "2.9.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-gettext/Languages.git",
+                "reference": "ed56dd2c7f4024cc953ed180d25f02f2640e3ffa"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-gettext/Languages/zipball/ed56dd2c7f4024cc953ed180d25f02f2640e3ffa",
+                "reference": "ed56dd2c7f4024cc953ed180d25f02f2640e3ffa",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4"
+            },
+            "bin": [
+                "bin/export-plural-rules"
+            ],
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Gettext\\Languages\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michele Locati",
+                    "email": "mlocati@gmail.com",
+                    "role": "Developer"
+                }
+            ],
+            "description": "gettext languages with plural rules",
+            "homepage": "https://github.com/php-gettext/Languages",
+            "keywords": [
+                "cldr",
+                "i18n",
+                "internationalization",
+                "l10n",
+                "language",
+                "languages",
+                "localization",
+                "php",
+                "plural",
+                "plural rules",
+                "plurals",
+                "translate",
+                "translations",
+                "unicode"
+            ],
+            "support": {
+                "issues": "https://github.com/php-gettext/Languages/issues",
+                "source": "https://github.com/php-gettext/Languages/tree/2.9.0"
+            },
+            "funding": [
+                {
+                    "url": "https://paypal.me/mlocati",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/mlocati",
+                    "type": "github"
+                }
+            ],
+            "time": "2021-11-11T17:30:39+00:00"
+        },
+        {
+            "name": "gettext/translator",
+            "version": "v1.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-gettext/Translator.git",
+                "reference": "b18ff33e8203de623854561f5e47e992fc5c50bb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-gettext/Translator/zipball/b18ff33e8203de623854561f5e47e992fc5c50bb",
+                "reference": "b18ff33e8203de623854561f5e47e992fc5c50bb",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.2|^8.0"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "^2.15",
+                "gettext/gettext": "^5.0.0",
+                "oscarotero/php-cs-fixer-config": "^1.0",
+                "phpunit/phpunit": "^8.0",
+                "squizlabs/php_codesniffer": "^3.0"
+            },
+            "suggest": {
+                "gettext/gettext": "Is necessary to load and generate array files used by the translator"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Gettext\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Oscar Otero",
+                    "email": "oom@oscarotero.com",
+                    "homepage": "http://oscarotero.com",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Gettext translator functions",
+            "homepage": "https://github.com/php-gettext/Translator",
+            "keywords": [
+                "gettext",
+                "i18n",
+                "php",
+                "translator"
+            ],
+            "support": {
+                "email": "oom@oscarotero.com",
+                "issues": "https://github.com/php-gettext/Translator/issues",
+                "source": "https://github.com/php-gettext/Translator/tree/v1.1.1"
+            },
+            "funding": [
+                {
+                    "url": "https://paypal.me/oscarotero",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/oscarotero",
+                    "type": "github"
+                },
+                {
+                    "url": "https://www.patreon.com/misteroom",
+                    "type": "patreon"
+                }
+            ],
+            "time": "2022-02-23T20:29:40+00:00"
+        },
+        {
+            "name": "graham-campbell/result-type",
+            "version": "v1.0.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/GrahamCampbell/Result-Type.git",
+                "reference": "0690bde05318336c7221785f2a932467f98b64ca"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/0690bde05318336c7221785f2a932467f98b64ca",
+                "reference": "0690bde05318336c7221785f2a932467f98b64ca",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.0 || ^8.0",
+                "phpoption/phpoption": "^1.8"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "GrahamCampbell\\ResultType\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                }
+            ],
+            "description": "An Implementation Of The Result Type",
+            "keywords": [
+                "Graham Campbell",
+                "GrahamCampbell",
+                "Result Type",
+                "Result-Type",
+                "result"
+            ],
+            "support": {
+                "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
+                "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.4"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-11-21T21:41:47+00:00"
+        },
+        {
+            "name": "nesbot/carbon",
+            "version": "2.58.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/briannesbitt/Carbon.git",
+                "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a34af22bde8d0ac20ab34b29d7bfe360902055",
+                "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "php": "^7.1.8 || ^8.0",
+                "symfony/polyfill-mbstring": "^1.0",
+                "symfony/polyfill-php80": "^1.16",
+                "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0"
+            },
+            "require-dev": {
+                "doctrine/dbal": "^2.0 || ^3.0",
+                "doctrine/orm": "^2.7",
+                "friendsofphp/php-cs-fixer": "^3.0",
+                "kylekatarnls/multi-tester": "^2.0",
+                "phpmd/phpmd": "^2.9",
+                "phpstan/extension-installer": "^1.0",
+                "phpstan/phpstan": "^0.12.54 || ^1.0",
+                "phpunit/php-file-iterator": "^2.0.5",
+                "phpunit/phpunit": "^7.5.20 || ^8.5.23",
+                "squizlabs/php_codesniffer": "^3.4"
+            },
+            "bin": [
+                "bin/carbon"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-3.x": "3.x-dev",
+                    "dev-master": "2.x-dev"
+                },
+                "laravel": {
+                    "providers": [
+                        "Carbon\\Laravel\\ServiceProvider"
+                    ]
+                },
+                "phpstan": {
+                    "includes": [
+                        "extension.neon"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Carbon\\": "src/Carbon/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Brian Nesbitt",
+                    "email": "brian@nesbot.com",
+                    "homepage": "https://markido.com"
+                },
+                {
+                    "name": "kylekatarnls",
+                    "homepage": "https://github.com/kylekatarnls"
+                }
+            ],
+            "description": "An API extension for DateTime that supports 281 different languages.",
+            "homepage": "https://carbon.nesbot.com",
+            "keywords": [
+                "date",
+                "datetime",
+                "time"
+            ],
+            "support": {
+                "docs": "https://carbon.nesbot.com/docs",
+                "issues": "https://github.com/briannesbitt/Carbon/issues",
+                "source": "https://github.com/briannesbitt/Carbon"
+            },
+            "funding": [
+                {
+                    "url": "https://opencollective.com/Carbon",
+                    "type": "open_collective"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-04-25T19:31:17+00:00"
+        },
+        {
+            "name": "paragonie/anti-csrf",
+            "version": "v2.3.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/paragonie/anti-csrf.git",
+                "reference": "2b2579108d35e569ff8b312fb87728db12bfd90d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/paragonie/anti-csrf/zipball/2b2579108d35e569ff8b312fb87728db12bfd90d",
+                "reference": "2b2579108d35e569ff8b312fb87728db12bfd90d",
+                "shasum": ""
+            },
+            "require": {
+                "paragonie/constant_time_encoding": "^2",
+                "php": "^7|^8"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^7|^8|^9",
+                "vimeo/psalm": "^1|^3|^4"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "ParagonIE\\AntiCSRF\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "(MIT or AGPL-3.0)"
+            ],
+            "authors": [
+                {
+                    "name": "Scott Arciszewski",
+                    "email": "scott@paragonie.com",
+                    "homepage": "https://paragonie.com",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Paragon Initiative's Anti-CSRF Security Library",
+            "keywords": [
+                "appsec",
+                "csrf",
+                "security",
+                "session"
+            ],
+            "support": {
+                "email": "info@paragonie.com",
+                "issues": "https://github.com/paragonie/anti-csrf/issues",
+                "source": "https://github.com/paragonie/anti-csrf"
+            },
+            "time": "2020-12-03T14:37:16+00:00"
+        },
+        {
+            "name": "paragonie/constant_time_encoding",
+            "version": "v2.6.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/paragonie/constant_time_encoding.git",
+                "reference": "58c3f47f650c94ec05a151692652a868995d2938"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938",
+                "reference": "58c3f47f650c94ec05a151692652a868995d2938",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7|^8"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^6|^7|^8|^9",
+                "vimeo/psalm": "^1|^2|^3|^4"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "ParagonIE\\ConstantTime\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Paragon Initiative Enterprises",
+                    "email": "security@paragonie.com",
+                    "homepage": "https://paragonie.com",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "Steve 'Sc00bz' Thomas",
+                    "email": "steve@tobtu.com",
+                    "homepage": "https://www.tobtu.com",
+                    "role": "Original Developer"
+                }
+            ],
+            "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
+            "keywords": [
+                "base16",
+                "base32",
+                "base32_decode",
+                "base32_encode",
+                "base64",
+                "base64_decode",
+                "base64_encode",
+                "bin2hex",
+                "encoding",
+                "hex",
+                "hex2bin",
+                "rfc4648"
+            ],
+            "support": {
+                "email": "info@paragonie.com",
+                "issues": "https://github.com/paragonie/constant_time_encoding/issues",
+                "source": "https://github.com/paragonie/constant_time_encoding"
+            },
+            "time": "2022-06-14T06:56:20+00:00"
+        },
+        {
+            "name": "phpoption/phpoption",
+            "version": "1.8.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/schmittjoh/php-option.git",
+                "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15",
+                "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.0 || ^8.0"
+            },
+            "require-dev": {
+                "bamarni/composer-bin-plugin": "^1.4.1",
+                "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.8-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "PhpOption\\": "src/PhpOption/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "Johannes M. Schmitt",
+                    "email": "schmittjoh@gmail.com",
+                    "homepage": "https://github.com/schmittjoh"
+                },
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                }
+            ],
+            "description": "Option Type for PHP",
+            "keywords": [
+                "language",
+                "option",
+                "php",
+                "type"
+            ],
+            "support": {
+                "issues": "https://github.com/schmittjoh/php-option/issues",
+                "source": "https://github.com/schmittjoh/php-option/tree/1.8.1"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-12-04T23:24:31+00:00"
+        },
+        {
+            "name": "psr/container",
+            "version": "2.0.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/container.git",
+                "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+                "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.4.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Container\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "https://www.php-fig.org/"
+                }
+            ],
+            "description": "Common Container Interface (PHP FIG PSR-11)",
+            "homepage": "https://github.com/php-fig/container",
+            "keywords": [
+                "PSR-11",
+                "container",
+                "container-interface",
+                "container-interop",
+                "psr"
+            ],
+            "support": {
+                "issues": "https://github.com/php-fig/container/issues",
+                "source": "https://github.com/php-fig/container/tree/2.0.2"
+            },
+            "time": "2021-11-05T16:47:00+00:00"
+        },
+        {
+            "name": "psr/log",
+            "version": "1.1.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/log.git",
+                "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
+                "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Log\\": "Psr/Log/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "https://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for logging libraries",
+            "homepage": "https://github.com/php-fig/log",
+            "keywords": [
+                "log",
+                "psr",
+                "psr-3"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/log/tree/1.1.4"
+            },
+            "time": "2021-05-03T11:20:27+00:00"
+        },
+        {
+            "name": "psr/simple-cache",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/simple-cache.git",
+                "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+                "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\SimpleCache\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interfaces for simple caching",
+            "keywords": [
+                "cache",
+                "caching",
+                "psr",
+                "psr-16",
+                "simple-cache"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/simple-cache/tree/master"
+            },
+            "time": "2017-10-23T01:57:42+00:00"
+        },
+        {
+            "name": "robmorgan/phinx",
+            "version": "0.12.10",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cakephp/phinx.git",
+                "reference": "ad056cff354fc67fedf9bf96c441c2b428afad0c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cakephp/phinx/zipball/ad056cff354fc67fedf9bf96c441c2b428afad0c",
+                "reference": "ad056cff354fc67fedf9bf96c441c2b428afad0c",
+                "shasum": ""
+            },
+            "require": {
+                "cakephp/database": "^4.0",
+                "php": ">=7.2",
+                "psr/container": "^1.0 || ^2.0",
+                "symfony/config": "^3.4|^4.0|^5.0|^6.0",
+                "symfony/console": "^3.4|^4.0|^5.0|^6.0"
+            },
+            "require-dev": {
+                "cakephp/cakephp-codesniffer": "^4.0",
+                "ext-json": "*",
+                "ext-pdo": "*",
+                "phpunit/phpunit": "^8.5|^9.3",
+                "sebastian/comparator": ">=1.2.3",
+                "symfony/yaml": "^3.4|^4.0|^5.0"
+            },
+            "suggest": {
+                "ext-json": "Install if using JSON configuration format",
+                "ext-pdo": "PDO extension is needed",
+                "symfony/yaml": "Install if using YAML configuration format"
+            },
+            "bin": [
+                "bin/phinx"
+            ],
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Phinx\\": "src/Phinx/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Rob Morgan",
+                    "email": "robbym@gmail.com",
+                    "homepage": "https://robmorgan.id.au",
+                    "role": "Lead Developer"
+                },
+                {
+                    "name": "Woody Gilk",
+                    "email": "woody.gilk@gmail.com",
+                    "homepage": "https://shadowhand.me",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Richard Quadling",
+                    "email": "rquadling@gmail.com",
+                    "role": "Developer"
+                },
+                {
+                    "name": "CakePHP Community",
+                    "homepage": "https://github.com/cakephp/phinx/graphs/contributors",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Phinx makes it ridiculously easy to manage the database migrations for your PHP app.",
+            "homepage": "https://phinx.org",
+            "keywords": [
+                "database",
+                "database migrations",
+                "db",
+                "migrations",
+                "phinx"
+            ],
+            "support": {
+                "issues": "https://github.com/cakephp/phinx/issues",
+                "source": "https://github.com/cakephp/phinx/tree/0.12.10"
+            },
+            "time": "2022-01-21T19:53:14+00:00"
+        },
+        {
+            "name": "symfony/config",
+            "version": "v5.4.9",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/config.git",
+                "reference": "8f551fe22672ac7ab2c95fe46d899f960ed4d979"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/config/zipball/8f551fe22672ac7ab2c95fe46d899f960ed4d979",
+                "reference": "8f551fe22672ac7ab2c95fe46d899f960ed4d979",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/deprecation-contracts": "^2.1|^3",
+                "symfony/filesystem": "^4.4|^5.0|^6.0",
+                "symfony/polyfill-ctype": "~1.8",
+                "symfony/polyfill-php80": "^1.16",
+                "symfony/polyfill-php81": "^1.22"
+            },
+            "conflict": {
+                "symfony/finder": "<4.4"
+            },
+            "require-dev": {
+                "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+                "symfony/finder": "^4.4|^5.0|^6.0",
+                "symfony/messenger": "^4.4|^5.0|^6.0",
+                "symfony/service-contracts": "^1.1|^2|^3",
+                "symfony/yaml": "^4.4|^5.0|^6.0"
+            },
+            "suggest": {
+                "symfony/yaml": "To use the yaml reference dumper"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Config\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/config/tree/v5.4.9"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-17T10:39:36+00:00"
+        },
+        {
+            "name": "symfony/console",
+            "version": "v5.4.9",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/console.git",
+                "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb",
+                "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/deprecation-contracts": "^2.1|^3",
+                "symfony/polyfill-mbstring": "~1.0",
+                "symfony/polyfill-php73": "^1.9",
+                "symfony/polyfill-php80": "^1.16",
+                "symfony/service-contracts": "^1.1|^2|^3",
+                "symfony/string": "^5.1|^6.0"
+            },
+            "conflict": {
+                "psr/log": ">=3",
+                "symfony/dependency-injection": "<4.4",
+                "symfony/dotenv": "<5.1",
+                "symfony/event-dispatcher": "<4.4",
+                "symfony/lock": "<4.4",
+                "symfony/process": "<4.4"
+            },
+            "provide": {
+                "psr/log-implementation": "1.0|2.0"
+            },
+            "require-dev": {
+                "psr/log": "^1|^2",
+                "symfony/config": "^4.4|^5.0|^6.0",
+                "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+                "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+                "symfony/lock": "^4.4|^5.0|^6.0",
+                "symfony/process": "^4.4|^5.0|^6.0",
+                "symfony/var-dumper": "^4.4|^5.0|^6.0"
+            },
+            "suggest": {
+                "psr/log": "For using the console logger",
+                "symfony/event-dispatcher": "",
+                "symfony/lock": "",
+                "symfony/process": ""
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Console\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Eases the creation of beautiful and testable command line interfaces",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "cli",
+                "command line",
+                "console",
+                "terminal"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/console/tree/v5.4.9"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-18T06:17:34+00:00"
+        },
+        {
+            "name": "symfony/deprecation-contracts",
+            "version": "v2.5.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/deprecation-contracts.git",
+                "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+                "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "2.5-dev"
+                },
+                "thanks": {
+                    "name": "symfony/contracts",
+                    "url": "https://github.com/symfony/contracts"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "function.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "A generic function and convention to trigger deprecation notices",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-01-02T09:53:40+00:00"
+        },
+        {
+            "name": "symfony/filesystem",
+            "version": "v5.4.9",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/filesystem.git",
+                "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/filesystem/zipball/36a017fa4cce1eff1b8e8129ff53513abcef05ba",
+                "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/polyfill-ctype": "~1.8",
+                "symfony/polyfill-mbstring": "~1.8",
+                "symfony/polyfill-php80": "^1.16"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Filesystem\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Provides basic utilities for the filesystem",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/filesystem/tree/v5.4.9"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-20T13:55:35+00:00"
+        },
+        {
+            "name": "symfony/polyfill-ctype",
+            "version": "v1.26.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-ctype.git",
+                "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
+                "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "provide": {
+                "ext-ctype": "*"
+            },
+            "suggest": {
+                "ext-ctype": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.26-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Ctype\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Gert de Pagter",
+                    "email": "BackEndTea@gmail.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for ctype functions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "ctype",
+                "polyfill",
+                "portable"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-24T11:49:31+00:00"
+        },
+        {
+            "name": "symfony/polyfill-intl-grapheme",
+            "version": "v1.26.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
+                "reference": "433d05519ce6990bf3530fba6957499d327395c2"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2",
+                "reference": "433d05519ce6990bf3530fba6957499d327395c2",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "suggest": {
+                "ext-intl": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.26-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for intl's grapheme_* functions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "grapheme",
+                "intl",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-24T11:49:31+00:00"
+        },
+        {
+            "name": "symfony/polyfill-intl-normalizer",
+            "version": "v1.26.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
+                "reference": "219aa369ceff116e673852dce47c3a41794c14bd"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd",
+                "reference": "219aa369ceff116e673852dce47c3a41794c14bd",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "suggest": {
+                "ext-intl": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.26-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+                },
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for intl's Normalizer class and related functions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "intl",
+                "normalizer",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-24T11:49:31+00:00"
+        },
+        {
+            "name": "symfony/polyfill-mbstring",
+            "version": "v1.26.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-mbstring.git",
+                "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+                "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "provide": {
+                "ext-mbstring": "*"
+            },
+            "suggest": {
+                "ext-mbstring": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.26-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Mbstring\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for the Mbstring extension",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "mbstring",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-24T11:49:31+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php73",
+            "version": "v1.26.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php73.git",
+                "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85",
+                "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.26-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Php73\\": ""
+                },
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-24T11:49:31+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php80",
+            "version": "v1.26.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php80.git",
+                "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+                "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.26-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Php80\\": ""
+                },
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Ion Bazan",
+                    "email": "ion.bazan@gmail.com"
+                },
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-10T07:21:04+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php81",
+            "version": "v1.26.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php81.git",
+                "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1",
+                "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.26-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Php81\\": ""
+                },
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-24T11:49:31+00:00"
+        },
+        {
+            "name": "symfony/service-contracts",
+            "version": "v1.1.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/service-contracts.git",
+                "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0",
+                "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1.3"
+            },
+            "suggest": {
+                "psr/container": "",
+                "symfony/service-implementation": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Contracts\\Service\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Generic abstractions related to writing services",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "abstractions",
+                "contracts",
+                "decoupling",
+                "interfaces",
+                "interoperability",
+                "standards"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/service-contracts/tree/v1.1.2"
+            },
+            "time": "2019-05-28T07:50:59+00:00"
+        },
+        {
+            "name": "symfony/string",
+            "version": "v5.4.9",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/string.git",
+                "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99",
+                "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/polyfill-ctype": "~1.8",
+                "symfony/polyfill-intl-grapheme": "~1.0",
+                "symfony/polyfill-intl-normalizer": "~1.0",
+                "symfony/polyfill-mbstring": "~1.0",
+                "symfony/polyfill-php80": "~1.15"
+            },
+            "conflict": {
+                "symfony/translation-contracts": ">=3.0"
+            },
+            "require-dev": {
+                "symfony/error-handler": "^4.4|^5.0|^6.0",
+                "symfony/http-client": "^4.4|^5.0|^6.0",
+                "symfony/translation-contracts": "^1.1|^2",
+                "symfony/var-exporter": "^4.4|^5.0|^6.0"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "Resources/functions.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Component\\String\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "grapheme",
+                "i18n",
+                "string",
+                "unicode",
+                "utf-8",
+                "utf8"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/string/tree/v5.4.9"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-04-19T10:40:37+00:00"
+        },
+        {
+            "name": "symfony/translation",
+            "version": "v5.4.9",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/translation.git",
+                "reference": "1639abc1177d26bcd4320e535e664cef067ab0ca"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/translation/zipball/1639abc1177d26bcd4320e535e664cef067ab0ca",
+                "reference": "1639abc1177d26bcd4320e535e664cef067ab0ca",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/deprecation-contracts": "^2.1|^3",
+                "symfony/polyfill-mbstring": "~1.0",
+                "symfony/polyfill-php80": "^1.16",
+                "symfony/translation-contracts": "^2.3"
+            },
+            "conflict": {
+                "symfony/config": "<4.4",
+                "symfony/console": "<5.3",
+                "symfony/dependency-injection": "<5.0",
+                "symfony/http-kernel": "<5.0",
+                "symfony/twig-bundle": "<5.0",
+                "symfony/yaml": "<4.4"
+            },
+            "provide": {
+                "symfony/translation-implementation": "2.3"
+            },
+            "require-dev": {
+                "psr/log": "^1|^2|^3",
+                "symfony/config": "^4.4|^5.0|^6.0",
+                "symfony/console": "^5.4|^6.0",
+                "symfony/dependency-injection": "^5.0|^6.0",
+                "symfony/finder": "^4.4|^5.0|^6.0",
+                "symfony/http-client-contracts": "^1.1|^2.0|^3.0",
+                "symfony/http-kernel": "^5.0|^6.0",
+                "symfony/intl": "^4.4|^5.0|^6.0",
+                "symfony/polyfill-intl-icu": "^1.21",
+                "symfony/service-contracts": "^1.1.2|^2|^3",
+                "symfony/yaml": "^4.4|^5.0|^6.0"
+            },
+            "suggest": {
+                "psr/log-implementation": "To use logging capability in translator",
+                "symfony/config": "",
+                "symfony/yaml": ""
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "Resources/functions.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Component\\Translation\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Provides tools to internationalize your application",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/translation/tree/v5.4.9"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-05-06T12:33:37+00:00"
+        },
+        {
+            "name": "symfony/translation-contracts",
+            "version": "v2.5.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/translation-contracts.git",
+                "reference": "1211df0afa701e45a04253110e959d4af4ef0f07"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1211df0afa701e45a04253110e959d4af4ef0f07",
+                "reference": "1211df0afa701e45a04253110e959d4af4ef0f07",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5"
+            },
+            "suggest": {
+                "symfony/translation-implementation": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "2.5-dev"
+                },
+                "thanks": {
+                    "name": "symfony/contracts",
+                    "url": "https://github.com/symfony/contracts"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Contracts\\Translation\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Generic abstractions related to translation",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "abstractions",
+                "contracts",
+                "decoupling",
+                "interfaces",
+                "interoperability",
+                "standards"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/translation-contracts/tree/v2.5.1"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-01-02T09:53:40+00:00"
+        },
+        {
+            "name": "vlucas/phpdotenv",
+            "version": "v5.4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/vlucas/phpdotenv.git",
+                "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/264dce589e7ce37a7ba99cb901eed8249fbec92f",
+                "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f",
+                "shasum": ""
+            },
+            "require": {
+                "ext-pcre": "*",
+                "graham-campbell/result-type": "^1.0.2",
+                "php": "^7.1.3 || ^8.0",
+                "phpoption/phpoption": "^1.8",
+                "symfony/polyfill-ctype": "^1.23",
+                "symfony/polyfill-mbstring": "^1.23.1",
+                "symfony/polyfill-php80": "^1.23.1"
+            },
+            "require-dev": {
+                "bamarni/composer-bin-plugin": "^1.4.1",
+                "ext-filter": "*",
+                "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10"
+            },
+            "suggest": {
+                "ext-filter": "Required to use the boolean validator."
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "5.4-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Dotenv\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
+                    "name": "Vance Lucas",
+                    "email": "vance@vancelucas.com",
+                    "homepage": "https://github.com/vlucas"
+                }
+            ],
+            "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
+            "keywords": [
+                "dotenv",
+                "env",
+                "environment"
+            ],
+            "support": {
+                "issues": "https://github.com/vlucas/phpdotenv/issues",
+                "source": "https://github.com/vlucas/phpdotenv/tree/v5.4.1"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-12-12T23:22:04+00:00"
+        }
+    ],
+    "packages-dev": [
+        {
+            "name": "roave/security-advisories",
+            "version": "dev-latest",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/Roave/SecurityAdvisories.git",
+                "reference": "880f953435f266cf634bb81fa8888e66fa7814f6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/880f953435f266cf634bb81fa8888e66fa7814f6",
+                "reference": "880f953435f266cf634bb81fa8888e66fa7814f6",
+                "shasum": ""
+            },
+            "conflict": {
+                "3f/pygmentize": "<1.2",
+                "admidio/admidio": "<4.1.9",
+                "adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3",
+                "akaunting/akaunting": "<2.1.13",
+                "alextselegidis/easyappointments": "<=1.4.3",
+                "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1",
+                "amazing/media2click": ">=1,<1.3.3",
+                "amphp/artax": "<1.0.6|>=2,<2.0.6",
+                "amphp/http": "<1.0.1",
+                "amphp/http-client": ">=4,<4.4",
+                "anchorcms/anchor-cms": "<=0.12.7",
+                "andreapollastri/cipi": "<=3.1.15",
+                "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6",
+                "appwrite/server-ce": "<0.11.1|>=0.12,<0.12.2",
+                "area17/twill": "<1.2.5|>=2,<2.5.3",
+                "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99",
+                "aws/aws-sdk-php": ">=3,<3.2.1",
+                "bagisto/bagisto": "<0.1.5",
+                "barrelstrength/sprout-base-email": "<1.2.7",
+                "barrelstrength/sprout-forms": "<3.9",
+                "barryvdh/laravel-translation-manager": "<0.6.2",
+                "baserproject/basercms": "<4.5.4",
+                "billz/raspap-webgui": "<=2.6.6",
+                "bk2k/bootstrap-package": ">=7.1,<7.1.2|>=8,<8.0.8|>=9,<9.0.4|>=9.1,<9.1.3|>=10,<10.0.10|>=11,<11.0.3",
+                "bmarshall511/wordpress_zero_spam": "<5.2.13",
+                "bolt/bolt": "<3.7.2",
+                "bolt/core": "<=4.2",
+                "bottelet/flarepoint": "<2.2.1",
+                "brightlocal/phpwhois": "<=4.2.5",
+                "brotkrueml/codehighlight": "<2.7",
+                "brotkrueml/schema": "<1.13.1|>=2,<2.5.1",
+                "brotkrueml/typo3-matomo-integration": "<1.3.2",
+                "buddypress/buddypress": "<7.2.1",
+                "bugsnag/bugsnag-laravel": ">=2,<2.0.2",
+                "bytefury/crater": "<6.0.2",
+                "cachethq/cachet": "<2.5.1",
+                "cakephp/cakephp": "<3.10.3|>=4,<4.0.6",
+                "cardgate/magento2": "<2.0.33",
+                "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4",
+                "cartalyst/sentry": "<=2.1.6",
+                "catfan/medoo": "<1.7.5",
+                "centreon/centreon": "<20.10.7",
+                "cesnet/simplesamlphp-module-proxystatistics": "<3.1",
+                "codeception/codeception": "<3.1.3|>=4,<4.1.22",
+                "codeigniter/framework": "<=3.0.6",
+                "codeigniter4/framework": "<4.1.9",
+                "codiad/codiad": "<=2.8.4",
+                "composer/composer": "<1.10.26|>=2-alpha.1,<2.2.12|>=2.3,<2.3.5",
+                "concrete5/concrete5": "<9",
+                "concrete5/core": "<8.5.7",
+                "contao-components/mediaelement": ">=2.14.2,<2.21.1",
+                "contao/contao": ">=4,<4.4.56|>=4.5,<4.9.18|>=4.10,<4.11.7|>=4.13,<4.13.3",
+                "contao/core": ">=2,<3.5.39",
+                "contao/core-bundle": "<4.9.18|>=4.10,<4.11.7|>=4.13,<4.13.3|= 4.10.0",
+                "contao/listing-bundle": ">=4,<4.4.8",
+                "contao/managed-edition": "<=1.5",
+                "craftcms/cms": "<3.7.36",
+                "croogo/croogo": "<3.0.7",
+                "cuyz/valinor": ">=0.5,<0.7",
+                "czproject/git-php": "<4.0.3",
+                "darylldoyle/safe-svg": "<1.9.10",
+                "datadog/dd-trace": ">=0.30,<0.30.2",
+                "david-garcia/phpwhois": "<=4.3.1",
+                "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1",
+                "directmailteam/direct-mail": "<5.2.4",
+                "doctrine/annotations": ">=1,<1.2.7",
+                "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2",
+                "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1",
+                "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2|>=3,<3.1.4",
+                "doctrine/doctrine-bundle": "<1.5.2",
+                "doctrine/doctrine-module": "<=0.7.1",
+                "doctrine/mongodb-odm": ">=1,<1.0.2",
+                "doctrine/mongodb-odm-bundle": ">=2,<3.0.1",
+                "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4",
+                "dolibarr/dolibarr": "<16|= 12.0.5|>= 3.3.beta1, < 13.0.2",
+                "dompdf/dompdf": "<1.2.1",
+                "drupal/core": ">=7,<7.88|>=8,<9.2.13|>=9.3,<9.3.6",
+                "drupal/drupal": ">=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4",
+                "dweeves/magmi": "<=0.7.24",
+                "ecodev/newsletter": "<=4",
+                "ectouch/ectouch": "<=2.7.2",
+                "elgg/elgg": "<3.3.24|>=4,<4.0.5",
+                "endroid/qr-code-bundle": "<3.4.2",
+                "enshrined/svg-sanitize": "<0.15",
+                "erusev/parsedown": "<1.7.2",
+                "ether/logs": "<3.0.4",
+                "ezsystems/demobundle": ">=5.4,<5.4.6.1",
+                "ezsystems/ez-support-tools": ">=2.2,<2.2.3",
+                "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1",
+                "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1",
+                "ezsystems/ezplatform": "<=1.13.6|>=2,<=2.5.24",
+                "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.27",
+                "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1",
+                "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<1.3.19",
+                "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8",
+                "ezsystems/ezplatform-richtext": ">=2.3,<=2.3.7",
+                "ezsystems/ezplatform-user": ">=1,<1.0.1",
+                "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<7.5.29",
+                "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.3.5.1",
+                "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3",
+                "ezsystems/repository-forms": ">=2.3,<2.3.2.1",
+                "ezyang/htmlpurifier": "<4.1.1",
+                "facade/ignition": "<1.16.15|>=2,<2.4.2|>=2.5,<2.5.2",
+                "facturascripts/facturascripts": "<=2022.8",
+                "feehi/cms": "<=2.1.1",
+                "feehi/feehicms": "<=0.1.3",
+                "fenom/fenom": "<=2.12.1",
+                "filegator/filegator": "<7.8",
+                "firebase/php-jwt": "<2",
+                "flarum/core": ">=1,<=1.0.1",
+                "flarum/sticky": ">=0.1-beta.14,<=0.1-beta.15",
+                "flarum/tags": "<=0.1-beta.13",
+                "fluidtypo3/vhs": "<5.1.1",
+                "fof/upload": "<1.2.3",
+                "fooman/tcpdf": "<6.2.22",
+                "forkcms/forkcms": "<5.11.1",
+                "fossar/tcpdf-parser": "<6.2.22",
+                "francoisjacquet/rosariosis": "<9.1",
+                "friendsofsymfony/oauth2-php": "<1.3",
+                "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2",
+                "friendsofsymfony/user-bundle": ">=1.2,<1.3.5",
+                "friendsoftypo3/mediace": ">=7.6.2,<7.6.5",
+                "froala/wysiwyg-editor": "<3.2.7",
+                "froxlor/froxlor": "<=0.10.22",
+                "fuel/core": "<1.8.1",
+                "gaoming13/wechat-php-sdk": "<=1.10.2",
+                "genix/cms": "<=1.1.11",
+                "getgrav/grav": "<1.7.33",
+                "getkirby/cms": "<3.5.8",
+                "getkirby/panel": "<2.5.14",
+                "gilacms/gila": "<=1.11.4",
+                "globalpayments/php-sdk": "<2",
+                "google/protobuf": "<3.15",
+                "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3",
+                "gree/jose": "<=2.2",
+                "gregwar/rst": "<1.0.3",
+                "grumpydictator/firefly-iii": "<5.6.5",
+                "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5",
+                "guzzlehttp/psr7": "<1.8.4|>=2,<2.1.1",
+                "helloxz/imgurl": "= 2.31|<=2.31",
+                "hillelcoren/invoice-ninja": "<5.3.35",
+                "hjue/justwriting": "<=1",
+                "hov/jobfair": "<1.0.13|>=2,<2.0.2",
+                "hyn/multi-tenant": ">=5.6,<5.7.2",
+                "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4",
+                "ibexa/post-install": "<=1.0.4",
+                "icecoder/icecoder": "<=8.1",
+                "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10",
+                "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4",
+                "illuminate/database": "<6.20.26|>=7,<7.30.5|>=8,<8.40",
+                "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15",
+                "illuminate/view": "<6.20.42|>=7,<7.30.6|>=8,<8.75",
+                "impresscms/impresscms": "<=1.4.3",
+                "in2code/femanager": "<5.5.1|>=6,<6.3.1",
+                "intelliants/subrion": "<=4.2.1",
+                "ivankristianto/phpwhois": "<=4.3",
+                "jackalope/jackalope-doctrine-dbal": "<1.7.4",
+                "james-heinrich/getid3": "<1.9.21",
+                "joomla/archive": "<1.1.12|>=2,<2.0.1",
+                "joomla/filesystem": "<1.6.2|>=2,<2.0.1",
+                "joomla/filter": "<1.4.4|>=2,<2.0.1",
+                "joomla/input": ">=2,<2.0.2",
+                "joomla/session": "<1.3.1",
+                "jsdecena/laracom": "<2.0.9",
+                "jsmitty12/phpwhois": "<5.1",
+                "kazist/phpwhois": "<=4.2.6",
+                "kevinpapst/kimai2": "<1.16.7",
+                "kitodo/presentation": "<3.1.2",
+                "klaviyo/magento2-extension": ">=1,<3",
+                "krayin/laravel-crm": "<1.2.2",
+                "kreait/firebase-php": ">=3.2,<3.8.1",
+                "la-haute-societe/tcpdf": "<6.2.22",
+                "laminas/laminas-form": "<2.17.1|>=3,<3.0.2|>=3.1,<3.1.1",
+                "laminas/laminas-http": "<2.14.2",
+                "laravel/fortify": "<1.11.1",
+                "laravel/framework": "<6.20.42|>=7,<7.30.6|>=8,<8.75",
+                "laravel/laravel": "<=9.1.8",
+                "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10",
+                "latte/latte": "<2.10.8",
+                "lavalite/cms": "<=5.8",
+                "lcobucci/jwt": ">=3.4,<3.4.6|>=4,<4.0.4|>=4.1,<4.1.5",
+                "league/commonmark": "<0.18.3",
+                "league/flysystem": "<1.1.4|>=2,<2.1.1",
+                "lexik/jwt-authentication-bundle": "<2.10.7|>=2.11,<2.11.3",
+                "librenms/librenms": "<22.4",
+                "limesurvey/limesurvey": "<3.27.19",
+                "livehelperchat/livehelperchat": "<=3.91",
+                "livewire/livewire": ">2.2.4,<2.2.6",
+                "lms/routes": "<2.1.1",
+                "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2",
+                "luyadev/yii-helpers": "<1.2.1",
+                "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3",
+                "magento/magento1ce": "<1.9.4.3",
+                "magento/magento1ee": ">=1,<1.14.4.3",
+                "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2",
+                "marcwillmann/turn": "<0.3.3",
+                "matyhtf/framework": "<3.0.6",
+                "mautic/core": "<4.3|= 2.13.1",
+                "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35",
+                "microweber/microweber": "<1.3",
+                "miniorange/miniorange-saml": "<1.4.3",
+                "mittwald/typo3_forum": "<1.2.1",
+                "modx/revolution": "<= 2.8.3-pl|<2.8",
+                "mojo42/jirafeau": "<4.4",
+                "monolog/monolog": ">=1.8,<1.12",
+                "moodle/moodle": "<4.0.1",
+                "mustache/mustache": ">=2,<2.14.1",
+                "namshi/jose": "<2.2",
+                "neoan3-apps/template": "<1.1.1",
+                "neorazorx/facturascripts": "<2022.4",
+                "neos/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6",
+                "neos/form": ">=1.2,<4.3.3|>=5,<5.0.9|>=5.1,<5.1.3",
+                "neos/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.9.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<5.3.10|>=7,<7.0.9|>=7.1,<7.1.7|>=7.2,<7.2.6|>=7.3,<7.3.4|>=8,<8.0.2",
+                "neos/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5",
+                "netgen/tagsbundle": ">=3.4,<3.4.11|>=4,<4.0.15",
+                "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6",
+                "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13",
+                "nilsteampassnet/teampass": "<=2.1.27.36",
+                "noumo/easyii": "<=0.9",
+                "nukeviet/nukeviet": "<4.5.2",
+                "nystudio107/craft-seomatic": "<3.4.12",
+                "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1",
+                "october/backend": "<1.1.2",
+                "october/cms": "= 1.1.1|= 1.0.471|= 1.0.469|>=1.0.319,<1.0.469",
+                "october/october": ">=1.0.319,<1.0.466|>=2.1,<2.1.12",
+                "october/rain": "<1.0.472|>=1.1,<1.1.2",
+                "october/system": "<1.0.475|>=1.1,<1.1.11|>=2,<2.1.27",
+                "onelogin/php-saml": "<2.10.4",
+                "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5",
+                "open-web-analytics/open-web-analytics": "<1.7.4",
+                "opencart/opencart": "<=3.0.3.2",
+                "openid/php-openid": "<2.3",
+                "openmage/magento-lts": "<19.4.15|>=20,<20.0.13",
+                "orchid/platform": ">=9,<9.4.4",
+                "oro/crm": ">=1.7,<1.7.4|>=3.1,<4.1.17|>=4.2,<4.2.7",
+                "oro/platform": ">=1.7,<1.7.4|>=3.1,<3.1.29|>=4.1,<4.1.17|>=4.2,<4.2.8",
+                "padraic/humbug_get_contents": "<1.1.2",
+                "pagarme/pagarme-php": ">=0,<3",
+                "pagekit/pagekit": "<=1.0.18",
+                "paragonie/random_compat": "<2",
+                "passbolt/passbolt_api": "<2.11",
+                "paypal/merchant-sdk-php": "<3.12",
+                "pear/archive_tar": "<1.4.14",
+                "pear/crypt_gpg": "<1.6.7",
+                "pegasus/google-for-jobs": "<1.5.1|>=2,<2.1.1",
+                "personnummer/personnummer": "<3.0.2",
+                "phanan/koel": "<5.1.4",
+                "phpfastcache/phpfastcache": "<6.1.5|>=7,<7.1.2|>=8,<8.0.7",
+                "phpmailer/phpmailer": "<6.5",
+                "phpmussel/phpmussel": ">=1,<1.6",
+                "phpmyadmin/phpmyadmin": "<5.1.3",
+                "phpoffice/phpexcel": "<1.8",
+                "phpoffice/phpspreadsheet": "<1.16",
+                "phpseclib/phpseclib": "<2.0.31|>=3,<3.0.7",
+                "phpservermon/phpservermon": "<=3.5.2",
+                "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5,<5.6.3",
+                "phpwhois/phpwhois": "<=4.2.5",
+                "phpxmlrpc/extras": "<0.6.1",
+                "pimcore/data-hub": "<1.2.4",
+                "pimcore/pimcore": "<10.4.4",
+                "pocketmine/bedrock-protocol": "<8.0.2",
+                "pocketmine/pocketmine-mp": ">= 4.0.0-BETA5, < 4.4.2|<4.2.10",
+                "pressbooks/pressbooks": "<5.18",
+                "prestashop/autoupgrade": ">=4,<4.10.1",
+                "prestashop/blockwishlist": ">=2,<2.1.1",
+                "prestashop/contactform": ">1.0.1,<4.3",
+                "prestashop/gamification": "<2.3.2",
+                "prestashop/prestashop": ">=1.7,<=1.7.8.2",
+                "prestashop/productcomments": ">=4,<4.2.1",
+                "prestashop/ps_emailsubscription": "<2.6.1",
+                "prestashop/ps_facetedsearch": "<3.4.1",
+                "prestashop/ps_linklist": "<3.1",
+                "privatebin/privatebin": "<1.4",
+                "propel/propel": ">=2-alpha.1,<=2-alpha.7",
+                "propel/propel1": ">=1,<=1.7.1",
+                "pterodactyl/panel": "<1.7",
+                "ptrofimov/beanstalk_console": "<1.7.14",
+                "pusher/pusher-php-server": "<2.2.1",
+                "pwweb/laravel-core": "<=0.3.6-beta",
+                "rainlab/debugbar-plugin": "<3.1",
+                "remdex/livehelperchat": "<3.99",
+                "rmccue/requests": ">=1.6,<1.8",
+                "robrichards/xmlseclibs": "<3.0.4",
+                "rudloff/alltube": "<3.0.3",
+                "s-cart/core": "<6.9",
+                "s-cart/s-cart": "<6.9",
+                "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1",
+                "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9",
+                "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11",
+                "sensiolabs/connect": "<4.2.3",
+                "serluck/phpwhois": "<=4.2.6",
+                "shopware/core": "<=6.4.9",
+                "shopware/platform": "<=6.4.9",
+                "shopware/production": "<=6.3.5.2",
+                "shopware/shopware": "<5.7.12",
+                "shopware/storefront": "<=6.4.8.1",
+                "shopxo/shopxo": "<2.2.6",
+                "showdoc/showdoc": "<2.10.4",
+                "silverstripe/admin": ">=1,<1.8.1",
+                "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2",
+                "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4",
+                "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1",
+                "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3",
+                "silverstripe/framework": "<4.10.1",
+                "silverstripe/graphql": "<3.5.2|>=4-alpha.1,<4-alpha.2|= 4.0.0-alpha1",
+                "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1",
+                "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4",
+                "silverstripe/silverstripe-omnipay": "<2.5.2|>=3,<3.0.2|>=3.1,<3.1.4|>=3.2,<3.2.1",
+                "silverstripe/subsites": ">=2,<2.1.1",
+                "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1",
+                "silverstripe/userforms": "<3",
+                "simple-updates/phpwhois": "<=1",
+                "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4",
+                "simplesamlphp/simplesamlphp": "<1.18.6",
+                "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1",
+                "simplito/elliptic-php": "<1.0.6",
+                "slim/slim": "<2.6",
+                "smarty/smarty": "<3.1.45|>=4,<4.1.1",
+                "snipe/snipe-it": "<5.4.4|>= 6.0.0-RC-1, <= 6.0.0-RC-5",
+                "socalnick/scn-social-auth": "<1.15.2",
+                "socialiteproviders/steam": "<1.1",
+                "spipu/html2pdf": "<5.2.4",
+                "spoonity/tcpdf": "<6.2.22",
+                "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1",
+                "ssddanbrown/bookstack": "<22.2.3",
+                "statamic/cms": "<3.2.39|>=3.3,<3.3.2",
+                "stormpath/sdk": ">=0,<9.9.99",
+                "studio-42/elfinder": "<2.1.59",
+                "subrion/cms": "<=4.2.1",
+                "sulu/sulu": "= 2.4.0-RC1|<1.6.44|>=2,<2.2.18|>=2.3,<2.3.8",
+                "swiftmailer/swiftmailer": ">=4,<5.4.5",
+                "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2",
+                "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1",
+                "sylius/grid-bundle": "<1.10.1",
+                "sylius/paypal-plugin": ">=1,<1.2.4|>=1.3,<1.3.1",
+                "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4",
+                "sylius/sylius": "<1.9.10|>=1.10,<1.10.11|>=1.11,<1.11.2",
+                "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99",
+                "symbiote/silverstripe-queuedjobs": ">=3,<3.0.2|>=3.1,<3.1.4|>=4,<4.0.7|>=4.1,<4.1.2|>=4.2,<4.2.4|>=4.3,<4.3.3|>=4.4,<4.4.3|>=4.5,<4.5.1|>=4.6,<4.6.4",
+                "symbiote/silverstripe-versionedfiles": "<=2.0.3",
+                "symfont/process": ">=0,<4",
+                "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8",
+                "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
+                "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4",
+                "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
+                "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=5.3.14,<=5.3.14|>=5.4.3,<=5.4.3|>=6.0.3,<=6.0.3|= 6.0.3|= 5.4.3|= 5.3.14",
+                "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7",
+                "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5|>=5.2,<5.3.12",
+                "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13",
+                "symfony/maker-bundle": ">=1.27,<1.29.2|>=1.30,<1.31.1",
+                "symfony/mime": ">=4.3,<4.3.8",
+                "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
+                "symfony/polyfill": ">=1,<1.10",
+                "symfony/polyfill-php55": ">=1,<1.10",
+                "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
+                "symfony/routing": ">=2,<2.0.19",
+                "symfony/security": ">=2,<2.7.51|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.8",
+                "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11|>=5.3,<5.3.12",
+                "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.9",
+                "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
+                "symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8",
+                "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.3.2",
+                "symfony/serializer": ">=2,<2.0.11|>=4.1,<4.4.35|>=5,<5.3.12",
+                "symfony/symfony": ">=2,<3.4.49|>=4,<4.4.35|>=5,<5.3.12|>=5.3.14,<=5.3.14|>=5.4.3,<=5.4.3|>=6.0.3,<=6.0.3",
+                "symfony/translation": ">=2,<2.0.17",
+                "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3",
+                "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8",
+                "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4",
+                "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
+                "t3/dce": ">=2.2,<2.6.2",
+                "t3g/svg-sanitizer": "<1.0.3",
+                "tastyigniter/tastyigniter": "<3.3",
+                "tecnickcom/tcpdf": "<6.2.22",
+                "terminal42/contao-tablelookupwizard": "<3.3.5",
+                "thelia/backoffice-default-template": ">=2.1,<2.1.2",
+                "thelia/thelia": ">=2.1-beta.1,<2.1.3",
+                "theonedemon/phpwhois": "<=4.2.5",
+                "tinymce/tinymce": "<5.10",
+                "titon/framework": ">=0,<9.9.99",
+                "topthink/framework": "<6.0.12",
+                "topthink/think": "<=6.0.9",
+                "topthink/thinkphp": "<=3.2.3",
+                "tribalsystems/zenario": "<9.2.55826",
+                "truckersmp/phpwhois": "<=4.3.1",
+                "twig/twig": "<1.38|>=2,<2.14.11|>=3,<3.3.8",
+                "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.38|>=9,<9.5.29|>=10,<10.4.29|>=11,<11.5.11",
+                "typo3/cms-backend": ">=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1",
+                "typo3/cms-core": ">=6.2,<=6.2.56|>=7,<7.6.57|>=8,<8.7.47|>=9,<9.5.35|>=10,<10.4.29|>=11,<11.5.11",
+                "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1",
+                "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6",
+                "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3",
+                "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1",
+                "typo3/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5",
+                "typo3fluid/fluid": ">=2,<2.0.8|>=2.1,<2.1.7|>=2.2,<2.2.4|>=2.3,<2.3.7|>=2.4,<2.4.4|>=2.5,<2.5.11|>=2.6,<2.6.10",
+                "ua-parser/uap-php": "<3.8",
+                "unisharp/laravel-filemanager": "<=2.3",
+                "userfrosting/userfrosting": ">=0.3.1,<4.6.3",
+                "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2",
+                "vanilla/safecurl": "<0.9.2",
+                "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4",
+                "vrana/adminer": "<4.8.1",
+                "wallabag/tcpdf": "<6.2.22",
+                "wanglelecc/laracms": "<=1.0.3",
+                "web-auth/webauthn-framework": ">=3.3,<3.3.4",
+                "webcoast/deferred-image-processing": "<1.0.2",
+                "wikimedia/parsoid": "<0.12.2",
+                "willdurand/js-translation-bundle": "<2.1.1",
+                "wp-cli/wp-cli": "<2.5",
+                "wp-graphql/wp-graphql": "<0.3.5",
+                "wpanel/wpanel4-cms": "<=4.3.1",
+                "wwbn/avideo": "<=11.6",
+                "yeswiki/yeswiki": "<4.1",
+                "yetiforce/yetiforce-crm": "<6.4",
+                "yidashi/yii2cmf": "<=2",
+                "yii2mod/yii2-cms": "<1.9.2",
+                "yiisoft/yii": ">=1.1.14,<1.1.15",
+                "yiisoft/yii2": "<2.0.38",
+                "yiisoft/yii2-bootstrap": "<2.0.4",
+                "yiisoft/yii2-dev": "<2.0.43",
+                "yiisoft/yii2-elasticsearch": "<2.0.5",
+                "yiisoft/yii2-gii": "<2.0.4",
+                "yiisoft/yii2-jui": "<2.0.4",
+                "yiisoft/yii2-redis": "<2.0.8",
+                "yoast-seo-for-typo3/yoast_seo": "<7.2.3",
+                "yourls/yourls": "<=1.8.2",
+                "zendesk/zendesk_api_client_php": "<2.2.11",
+                "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3",
+                "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2",
+                "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2",
+                "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5",
+                "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3",
+                "zendframework/zend-diactoros": "<1.8.4",
+                "zendframework/zend-feed": "<2.10.3",
+                "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1",
+                "zendframework/zend-http": "<2.8.1",
+                "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6",
+                "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3",
+                "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2",
+                "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1",
+                "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4",
+                "zendframework/zend-validator": ">=2.3,<2.3.6",
+                "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1",
+                "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6",
+                "zendframework/zendframework": "<=3",
+                "zendframework/zendframework1": "<1.12.20",
+                "zendframework/zendopenid": ">=2,<2.0.2",
+                "zendframework/zendxml": ">=1,<1.0.1",
+                "zetacomponents/mail": "<1.8.2",
+                "zf-commons/zfc-user": "<1.2.2",
+                "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3",
+                "zfr/zfr-oauth2-server-module": "<0.1.2",
+                "zoujingli/thinkadmin": "<6.0.22"
+            },
+            "default-branch": true,
+            "type": "metapackage",
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Marco Pivetta",
+                    "email": "ocramius@gmail.com",
+                    "role": "maintainer"
+                },
+                {
+                    "name": "Ilya Tribusean",
+                    "email": "slash3b@gmail.com",
+                    "role": "maintainer"
+                }
+            ],
+            "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
+            "support": {
+                "issues": "https://github.com/Roave/SecurityAdvisories/issues",
+                "source": "https://github.com/Roave/SecurityAdvisories/tree/latest"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/Ocramius",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2022-06-25T08:04:47+00:00"
+        }
+    ],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": {
+        "roave/security-advisories": 20
+    },
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": {
+        "php": ">=7.4.0",
+        "ext-mysqli": "*",
+        "ext-gd": "*",
+        "ext-mbstring": "*",
+        "ext-intl": "*",
+        "ext-json": "*",
+        "ext-curl": "*",
+        "ext-simplexml": "*"
+    },
+    "platform-dev": [],
+    "plugin-api-version": "2.2.0"
+}

+ 9 - 0
controllers/404.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace App;
+
+http_response_code(404);
+
+View::include("header");
+View::include("error", ["message" => __("Page not found.")]);
+View::include("footer");

+ 13 - 0
controllers/500.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App;
+
+http_response_code(500);
+
+/**
+ * @var string $message
+ */
+
+View::include("header");
+View::include("error", ["message" => $message]);
+View::include("footer");

+ 12 - 0
controllers/companies.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/companies", __("Companies"));
+
+$companies = Company::getAll();
+
+View::include("header");
+View::include("companies", compact("companies"));
+View::include("footer");

+ 108 - 0
controllers/company_form.php

@@ -0,0 +1,108 @@
+<?php
+
+namespace App;
+
+use Exception;
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/companies", __("Companies"));
+
+$user = $core->getUser();
+
+if(isset($id)) {
+	$company = Company::get($id);
+	if(!$company) {
+		throw new RuntimeException(__("Company not found."));
+	}
+
+	$core->addBreadcrumb($company->getUrl(), $company->name);
+
+	$company->dts_updated = Database::dts();
+
+	$title = __("Update Company");
+}
+else {
+	$company = new Company();
+	$company->dts_created = Database::dts();
+
+	$title = __("Add Company");
+}
+
+$core->addBreadcrumb($_SERVER["REQUEST_URI"], $title);
+
+$address = $company->getAddress();
+
+$request = Request::fromPost();
+
+$submit = $request->int("submit");
+if($submit) {
+
+	try {
+		$user->requireValidCsrfToken();
+
+		$company->name = $request->string("name");
+		$company->phone = $request->string("phone");
+		$company->fax = $request->string("fax");
+		$company->email = $request->email("email");
+		$company->company_number = $request->string("company_number");
+		$company->vat_number = $request->string("vat_number");
+
+		$address->address_1 = $request->string("address_1");
+		$address->address_2 = $request->string("address_2");
+		$address->city = $request->string("city");
+		$address->county = $request->string("county");
+		$address->postal_code = $request->string("postal_code");
+		$address->country = $request->string("country");
+		$address->latitude = $request->float("latitude");
+		$address->longitude = $request->float("longitude");
+
+		if(!$company->name) {
+			throw new RuntimeException(__("Name is required."));
+		}
+
+		$address->commit();
+
+		$company->address_id = $address->id;
+		$company->commit();
+
+		// Currencies
+
+		$currencies = $request->string("currencies");
+		$bank_names = $request->string("bank_names");
+		$bank_addresses = $request->string("bank_addresses");
+		$bank_sort_codes = $request->string("bank_sort_codes");
+		$bank_account_names = $request->string("bank_account_names");
+		$bank_account_numbers = $request->string("bank_account_numbers");
+		$bank_account_ibans = $request->string("bank_account_ibans");
+
+		foreach($currencies as $index => $currency) {
+			$bank_details = $company->getBankDetailsForCurrency($currency);
+			$bank_details->bank_name = $bank_names[$index] ?? null;
+			$bank_details->bank_address = $bank_addresses[$index] ?? null;
+			$bank_details->bank_sort_code = $bank_sort_codes[$index] ?? null;
+			$bank_details->bank_account_name = $bank_account_names[$index] ?? null;
+			$bank_details->bank_account_number = $bank_account_numbers[$index] ?? null;
+			$bank_details->bank_account_iban = $bank_account_ibans[$index] ?? null;
+			$bank_details->commit();
+		}
+
+		Session::addAlert("success", __("Company saved successfully."));
+		Http::redirect($company->getUrl() . "/update");
+	}
+	catch(Exception $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+}
+
+View::include("header");
+View::include("entity_form", [
+	"title" => $title,
+	"model" => $company,
+	"address" => $address
+]);
+View::include("footer");

+ 25 - 0
controllers/customer.php

@@ -0,0 +1,25 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$customer = Customer::get($id);
+if(!$customer) {
+	throw new RuntimeException(__("Customer not found."));
+}
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/customers", __("Customers"));
+$core->addBreadcrumb($customer->getUrl(), $customer->name);
+
+$user = $core->getUser();
+$user->requireAdmin();
+
+View::include("header");
+View::include("customer", compact("customer"));
+View::include("footer");

+ 86 - 0
controllers/customer_form.php

@@ -0,0 +1,86 @@
+<?php
+
+namespace App;
+
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/customers", __("Customers"));
+
+$user = $core->getUser();
+
+if(isset($id)) {
+	$customer = Customer::get($id);
+	if(!$customer) {
+		throw new RuntimeException(__("Customer not found."));
+	}
+
+	$customer->dts_updated = Database::dts();
+
+	$core->addBreadcrumb($customer->getUrl(), $customer->name);
+
+	$title = __("Update Customer");
+}
+else {
+	$customer = new Customer();
+	$customer->dts_created = Database::dts();
+
+	$title = __("Add Customer");
+}
+
+$core->addBreadcrumb($_SERVER["REQUEST_URI"], $title);
+
+$address = $customer->getAddress();
+
+$request = Request::fromPost();
+
+$submit = $request->int("submit");
+if($submit) {
+
+	try {
+		$user->requireValidCsrfToken();
+
+		$customer->name = $request->string("name");
+		$customer->phone = $request->string("phone");
+		$customer->fax = $request->string("fax");
+		$customer->email = $request->email("email");
+
+		$address->address_1 = $request->string("address_1");
+		$address->address_2 = $request->string("address_2");
+		$address->city = $request->string("city");
+		$address->county = $request->string("county");
+		$address->postal_code = $request->string("postal_code");
+		$address->country = $request->string("country");
+		$address->latitude = $request->float("latitude");
+		$address->longitude = $request->float("longitude");
+
+		if(!$customer->name) {
+			throw new RuntimeException(__("Name is required."));
+		}
+
+		$address->commit();
+
+		$customer->address_id = $address->id;
+		$customer->commit();
+
+		Session::addAlert("success", __("Customer saved successfully."));
+		Http::redirect($customer->getUrl());
+	}
+	catch(RuntimeException $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+
+
+}
+
+View::include("header");
+View::include("entity_form", [
+	"title" => $title,
+	"model" => $customer,
+	"address" => $address
+]);
+View::include("footer");

+ 12 - 0
controllers/customers.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/customers", __("Customers"));
+
+$customers = Customer::query([], ["sort" => "name"]);
+
+View::include("header");
+View::include("customers", compact("customers"));
+View::include("footer");

+ 10 - 0
controllers/dashboard.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/dashboard", __("Dashboard"));
+
+View::include("header");
+View::include("dashboard");
+View::include("footer");

+ 44 - 0
controllers/home.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace App;
+
+use RuntimeException;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/home", __("Log In"));
+
+$user = $core->getUser();
+if($user) {
+	Http::redirect("/dashboard");
+}
+
+$request = Request::fromPost();
+
+$email = $request->email("email");
+$password = $request->raw("password");
+
+if($email) {
+	try {
+		$user = User::queryOne(["email" => $email]);
+		if(!$user) {
+			throw new RuntimeException(__("The credentials supplied do not match any records on the system."));
+		}
+
+		if(!$user->validatePassword($password)) {
+			throw new RuntimeException(__("The credentials supplied do not match any records on the system."));
+		}
+
+		$_SESSION["user_id"] = $user->id;
+
+		Session::addAlert("success", __("Logged in successfully."));
+		HTTP::redirect("/dashboard");
+	}
+	catch(\Exception $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+
+}
+
+View::include("header");
+View::include("home");
+View::include("footer");

+ 25 - 0
controllers/location.php

@@ -0,0 +1,25 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$location = Location::get($id);
+if(!$location) {
+	throw new RuntimeException(__("Location not found."));
+}
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/locations", __("Locations"));
+$core->addBreadcrumb($location->getUrl(), $location->name);
+
+$user = $core->getUser();
+$user->requireAdmin();
+
+View::include("header");
+View::include("location", compact("location"));
+View::include("footer");

+ 94 - 0
controllers/location_form.php

@@ -0,0 +1,94 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$request = Request::fromRequest();
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/locations", __("Locations"));
+
+$user = $core->getUser();
+
+if(isset($id)) {
+	$location = Location::get($id);
+	if(!$location) {
+		throw new RuntimeException(__("Location not found."));
+	}
+
+	$customer = $location->getCustomer();
+	$location->dts_updated = Database::dts();
+
+	$core->addBreadcrumb($location->getUrl(), $location->name);
+
+	$title = __("Update Location");
+}
+else {
+	$customer_id = $request->int("customer_id");
+
+	$customer = Customer::get($customer_id);
+	if(!$customer) {
+		throw new RuntimeException(__("Customer not found."));
+	}
+
+	$location = new Location();
+	$location->customer_id = $customer_id;
+	$location->dts_created = Database::dts();
+
+	$title = __("Add Location");
+}
+
+$core->addBreadcrumb($_SERVER["REQUEST_URI"], $title);
+
+$address = $location->getAddress();
+
+$submit = $request->int("submit");
+if($submit) {
+
+	try {
+		$user->requireValidCsrfToken();
+
+		$location->customer_id = $customer->id;
+		$location->name = $request->string("name");
+		$location->phone = $request->string("phone");
+		$location->fax = $request->string("fax");
+		$location->email = $request->email("email");
+
+		$address->address_1 = $request->string("address_1");
+		$address->address_2 = $request->string("address_2");
+		$address->city = $request->string("city");
+		$address->county = $request->string("county");
+		$address->postal_code = $request->string("postal_code");
+		$address->country = $request->string("country");
+		$address->latitude = $request->float("latitude");
+		$address->longitude = $request->float("longitude");
+
+		if(!$location->name) {
+			throw new RuntimeException(__("Name is required."));
+		}
+
+		$address->commit();
+
+		$location->address_id = $address->id;
+		$location->commit();
+
+		Session::addAlert("success", __("Location saved successfully."));
+		Http::redirect($location->getUrl() . "/update");
+	}
+	catch(RuntimeException $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+}
+
+View::include("header");
+View::include("entity_form", [
+	"title" => $title,
+	"model" => $location,
+	"address" => $address
+]);
+View::include("footer");

+ 16 - 0
controllers/locations.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/locations", __("Locations"));
+
+$user = $core->getUser();
+
+$location_count = Location::count(["dts_deleted" => null]);
+
+$locations = Location::query([], ["sort" => "name"]);
+
+View::include("header");
+View::include("locations", compact("locations"));
+View::include("footer");

+ 9 - 0
controllers/log_out.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace App;
+
+session_destroy();
+session_regenerate_id(true);
+
+Session::addAlert("success", __("Logged out successfully"));
+Http::redirect("/home");

+ 25 - 0
controllers/product.php

@@ -0,0 +1,25 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$product = Product::get($id);
+if(!$product) {
+	throw new RuntimeException(__("Product not found."));
+}
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/products", __("Products"));
+$core->addBreadcrumb($product->getUrl(), $product->name);
+
+$user = $core->getUser();
+$user->requireAdmin();
+
+View::include("header");
+View::include("product", compact("product"));
+View::include("footer");

+ 77 - 0
controllers/product_form.php

@@ -0,0 +1,77 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/products", __("Products"));
+
+$user = $core->getUser();
+
+if(isset($id)) {
+	$product = Product::get($id);
+	if(!$product) {
+		throw new RuntimeException(__("Product not found."));
+	}
+
+	$product->dts_updated = Database::dts();
+
+	$title = __("Update Product");
+}
+else {
+	$product = new Product();
+	$product->dts_created = Database::dts();
+
+	$title = __("Add Product");
+}
+
+$core->addBreadcrumb($_SERVER["REQUEST_URI"], $title);
+
+$request = Request::fromPost();
+
+$submit = $request->int("submit");
+if($submit) {
+
+	try {
+		$user->requireValidCsrfToken();
+
+		$supplier_id = $request->int("supplier_id");
+		$supplier = Supplier::get($supplier_id);
+		if(!$supplier) {
+			throw new RuntimeException(__("Invalid supplier selected."));
+		}
+
+		$product->supplier_id = $supplier_id;
+		$product->name = $request->string("name");
+		$product->type = $request->int("type");
+		$product->price = $request->decimal("price", 2);
+
+		if(!$product->name) {
+			throw new RuntimeException(__("Name is required."));
+		}
+
+		if(!$product->type) {
+			throw new RuntimeException(__("Type is required."));
+		}
+
+		$product->commit();
+
+		Session::addAlert("success", __("Product saved successfully."));
+		Http::redirect($product->getUrl());
+	}
+	catch(RuntimeException $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+}
+
+View::include("header");
+View::include("product_form", [
+	"title" => $title,
+	"product" => $product,
+]);
+View::include("footer");

+ 12 - 0
controllers/products.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/products", __("Products"));
+
+$products = Product::getAll();
+
+View::include("header");
+View::include("products", compact("products"));
+View::include("footer");

+ 10 - 0
controllers/reset_password.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/reset-password", __("Reset Password"));
+
+View::include("header");
+View::include("reset_password");
+View::include("footer");

+ 16 - 0
controllers/sales.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+
+$user = $core->getUser();
+$user->requireAdmin();
+
+$core->addBreadcrumb("/sales", __("Sales"));
+
+$sales = [];
+
+View::include("header");
+View::include("sales", compact("sales"));
+View::include("footer");

+ 41 - 0
controllers/settings.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App;
+
+use Exception;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/settings", __("Settings"));
+
+$user = $core->getUser();
+
+$request = Request::fromPost();
+
+$submit = $request->int("submit");
+if($submit) {
+	try {
+		$user->requireValidCsrfToken();
+
+		$user->title = $request->string("title");
+		$user->first_name = $request->string("first_name");
+		$user->last_name = $request->string("last_name");
+
+		$password = $request->raw("password");
+		if($password) {
+			$user->password = password_hash($password, PASSWORD_DEFAULT);
+		}
+
+		$user->dts_updated = Database::dts();
+		$user->commit();
+
+		Session::addAlert("success", __("Settings saved successfully."));
+		Http::redirect("/settings");
+	}
+	catch(Exception $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+}
+
+View::include("header");
+View::include("settings", compact("user"));
+View::include("footer");

+ 52 - 0
controllers/setup.php

@@ -0,0 +1,52 @@
+<?php
+
+namespace App;
+
+use Exception;
+use ParagonIE\AntiCSRF\AntiCSRF;
+use RuntimeException;
+
+$users = User::getAll();
+if($users) {
+	Http::redirect("/home");
+}
+
+$request = Request::fromPost();
+
+$email = $request->string("email");
+$password = $request->raw("password");
+$confirm_password = $request->raw("confirm_password");
+
+if($email) {
+	$csrf = new AntiCSRF();
+
+	try {
+		if(!$csrf->validateRequest()) {
+			throw new RuntimeException(__("CSRF validation failed."));
+		}
+
+		if($password !== $confirm_password) {
+			throw new RuntimeException(__("Passwords do not match."));
+		}
+
+		$user = new User();
+		$user->title = $request->string("title");
+		$user->first_name = $request->string("first_name");
+		$user->last_name = $request->string("last_name");
+		$user->email = $request->email("email");
+		$user->password = password_hash($password, PASSWORD_DEFAULT);
+		$user->admin = 1;
+		$user->dts_created = Database::dts();
+		$user->commit();
+
+		Session::addAlert("success", __("User created successfully."));
+		Http::redirect("/home");
+	}
+	catch(Exception $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+}
+
+View::include("header");
+View::include("setup");
+View::include("footer");

+ 25 - 0
controllers/supplier.php

@@ -0,0 +1,25 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$supplier = Supplier::get($id);
+if(!$supplier) {
+	throw new RuntimeException(__("Supplier not found."));
+}
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/suppliers", __("Suppliers"));
+$core->addBreadcrumb($supplier->getUrl(), $supplier->name);
+
+$user = $core->getUser();
+$user->requireAdmin();
+
+View::include("header");
+View::include("supplier", compact("supplier"));
+View::include("footer");

+ 85 - 0
controllers/supplier_form.php

@@ -0,0 +1,85 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use Exception;
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/suppliers", __("Suppliers"));
+
+$user = $core->getUser();
+
+if(isset($id)) {
+	$supplier = Supplier::get($id);
+	if(!$supplier) {
+		throw new RuntimeException(__("Supplier not found."));
+	}
+
+	$core->addBreadcrumb($supplier->getUrl(), $supplier->name);
+
+	$supplier->dts_updated = Database::dts();
+
+	$title = __("Update Supplier");
+}
+else {
+	$supplier = new Supplier();
+	$supplier->dts_created = Database::dts();
+
+	$title = __("Add Supplier");
+}
+
+$core->addBreadcrumb($_SERVER["REQUEST_URI"], $title);
+
+$address = $supplier->getAddress();
+
+$request = Request::fromPost();
+
+$submit = $request->int("submit");
+if($submit) {
+
+	try {
+		$user->requireValidCsrfToken();
+
+		$supplier->name = $request->string("name");
+		$supplier->phone = $request->string("phone");
+		$supplier->fax = $request->string("fax");
+		$supplier->email = $request->email("email");
+
+		$address->address_1 = $request->string("address_1");
+		$address->address_2 = $request->string("address_2");
+		$address->city = $request->string("city");
+		$address->county = $request->string("county");
+		$address->postal_code = $request->string("postal_code");
+		$address->country = $request->string("country");
+		$address->latitude = $request->float("latitude");
+		$address->longitude = $request->float("longitude");
+
+		if(!$supplier->name) {
+			throw new RuntimeException(__("Name is required."));
+		}
+
+		$address->commit();
+
+		$supplier->address_id = $address->id;
+		$supplier->commit();
+
+		Session::addAlert("success", __("Supplier saved successfully."));
+		Http::redirect($supplier->getUrl());
+	}
+	catch(Exception $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+}
+
+View::include("header");
+View::include("entity_form", [
+	"title" => $title,
+	"model" => $supplier,
+	"address" => $address
+]);
+View::include("footer");

+ 12 - 0
controllers/suppliers.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/suppliers", __("Suppliers"));
+
+$suppliers = Supplier::query([], ["sort" => "name"]);
+
+View::include("header");
+View::include("suppliers", compact("suppliers"));
+View::include("footer");

+ 10 - 0
controllers/tickets.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/tickets", __("Tickets"));
+
+View::include("header");
+View::include("tickets");
+View::include("footer");

+ 69 - 0
controllers/user_form.php

@@ -0,0 +1,69 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use Carbon\CarbonImmutable;
+use Exception;
+use RuntimeException;
+
+/**
+ * @var int $id
+ */
+
+$core = Core::getInstance();
+
+$current_user = $core->getUser();
+$current_user->requireAdmin();
+
+$core->addBreadcrumb("/users", __("Users"));
+
+$request = Request::fromRequest();
+
+if(isset($id)) {
+	$user = User::get($id);
+	if(!$user) {
+		throw new RuntimeException(__("User not found."));
+	}
+
+	$user->dts_updated = Database::dts();
+
+	$title = __("Update User");
+}
+else {
+	$user = new User();
+	$user->dts_created = Database::dts();
+
+	$title = __("Add User");
+}
+
+$core->addBreadcrumb($_SERVER["REQUEST_URI"], $title);
+
+$submit = $request->int("submit");
+if($submit) {
+	try {
+		$current_user->requireValidCsrfToken();
+
+		$user->title = $request->string("title");
+		$user->first_name = $request->string("first_name");
+		$user->last_name = $request->string("last_name");
+		$user->email = $request->string("email");
+
+		$password = $request->raw("password");
+		if($password) {
+			$user->password = password_hash($password, PASSWORD_DEFAULT);
+		}
+
+		$user->admin = (int) $request->int("admin");
+		$user->commit();
+
+		Session::addAlert("success", __("User saved successfully."));
+		Http::redirect("/users");
+	}
+	catch(Exception $e) {
+		Session::addAlert("danger", $e->getMessage());
+	}
+}
+
+View::include("header");
+View::include("user_form", compact("title", "user"));
+View::include("footer");

+ 13 - 0
controllers/users.php

@@ -0,0 +1,13 @@
+<?php
+
+
+namespace App;
+
+$core = Core::getInstance();
+$core->addBreadcrumb("/users", __("Users"));
+
+$users = User::getAll();
+
+View::include("header");
+View::include("users", compact("users"));
+View::include("footer");

+ 22 - 0
db/migrations/20220625101544_add_user_table.php

@@ -0,0 +1,22 @@
+<?php
+declare(strict_types=1);
+
+use Phinx\Migration\AbstractMigration;
+
+final class AddUserTable extends AbstractMigration {
+	public function change(): void {
+		$this->table("user", ["signed" => false, "collation" => "utf8mb4_general_ci"])
+			->addColumn("title", "string", ["limit" => 3, "null" => true])
+			->addColumn("first_name", "string", ["limit" => 100, "null" => true])
+			->addColumn("last_name", "string", ["limit" => 100, "null" => true])
+			->addColumn("email", "string")
+			->addColumn("password", "string")
+			->addColumn("admin", "boolean", ["signed" => false, "default" => 0])
+			->addColumn("csrf_token", "string", ["null" => true])
+			->addColumn("dts_last_seen", "datetime", ["null" => true])
+			->addColumn("dts_created", "datetime")
+			->addColumn("dts_updated", "datetime", ["null" => true])
+			->addColumn("dts_deleted", "datetime", ["null" => true])
+			->create();
+	}
+}

+ 20 - 0
db/migrations/20220625113254_add_address_table.php

@@ -0,0 +1,20 @@
+<?php
+declare(strict_types=1);
+
+use Phinx\Migration\AbstractMigration;
+
+final class AddAddressTable extends AbstractMigration {
+	public function change(): void {
+		$this->table("address", ["signed" => false, "collation" => "utf8mb4_general_ci"])
+			->addColumn("address_1", "string", ["null" => true])
+			->addColumn("address_2", "string", ["null" => true])
+			->addColumn("city", "string", ["null" => true])
+			->addColumn("county", "string", ["null" => true])
+			->addColumn("postal_code", "string", ["null" => true])
+			->addColumn("state", "string", ["null" => true])
+			->addColumn("country", "string", ["limit" => 2, "null" => true])
+			->addColumn("latitude", "double", ["null" => true])
+			->addColumn("longitude", "double", ["null" => true])
+			->create();
+	}
+}

+ 20 - 0
db/migrations/20220625114247_add_customer_table.php

@@ -0,0 +1,20 @@
+<?php
+declare(strict_types=1);
+
+use Phinx\Migration\AbstractMigration;
+
+final class AddCustomerTable extends AbstractMigration {
+	public function change(): void {
+		$this->table("customer", ["signed" => false, "collation" => "utf8mb4_general_ci"])
+			->addColumn("address_id", "integer", ["signed" => false, "null" => true])
+			->addColumn("name", "string")
+			->addColumn("phone", "string")
+			->addColumn("fax", "string")
+			->addColumn("email", "string")
+			->addColumn("dts_created", "datetime")
+			->addColumn("dts_updated", "datetime", ["null" => true])
+			->addColumn("dts_deleted", "datetime", ["null" => true])
+			->addForeignKey("address_id", "address", "id", ["update" => "CASCADE", "delete" => "SET NULL"])
+			->create();
+	}
+}

+ 22 - 0
db/migrations/20220625173026_add_location_table.php

@@ -0,0 +1,22 @@
+<?php
+declare(strict_types=1);
+
+use Phinx\Migration\AbstractMigration;
+
+final class AddLocationTable extends AbstractMigration {
+	public function change(): void {
+		$this->table("location", ["signed" => false, "collation" => "utf8mb4_general_ci"])
+			->addColumn("customer_id", "integer", ["signed" => false])
+			->addColumn("address_id", "integer", ["signed" => false, "null" => true])
+			->addColumn("name", "string")
+			->addColumn("phone", "string")
+			->addColumn("fax", "string")
+			->addColumn("email", "string")
+			->addColumn("dts_created", "datetime")
+			->addColumn("dts_updated", "datetime", ["null" => true])
+			->addColumn("dts_deleted", "datetime", ["null" => true])
+			->addForeignKey("customer_id", "customer", "id", ["update" => "CASCADE", "delete" => "CASCADE"])
+			->addForeignKey("address_id", "address", "id", ["update" => "CASCADE", "delete" => "SET NULL"])
+			->create();
+	}
+}

+ 20 - 0
db/migrations/20220625174431_add_supplier_table.php

@@ -0,0 +1,20 @@
+<?php
+declare(strict_types=1);
+
+use Phinx\Migration\AbstractMigration;
+
+final class AddSupplierTable extends AbstractMigration {
+	public function change(): void {
+		$this->table("supplier", ["signed" => false, "collation" => "utf8mb4_general_ci"])
+			->addColumn("address_id", "integer", ["signed" => false, "null" => true])
+			->addColumn("name", "string")
+			->addColumn("phone", "string")
+			->addColumn("fax", "string")
+			->addColumn("email", "string")
+			->addColumn("dts_created", "datetime")
+			->addColumn("dts_updated", "datetime", ["null" => true])
+			->addColumn("dts_deleted", "datetime", ["null" => true])
+			->addForeignKey("address_id", "address", "id", ["update" => "CASCADE", "delete" => "SET NULL"])
+			->create();
+	}
+}

+ 20 - 0
db/migrations/20220625181248_add_product_table.php

@@ -0,0 +1,20 @@
+<?php
+declare(strict_types=1);
+
+use Phinx\Db\Adapter\MysqlAdapter;
+use Phinx\Migration\AbstractMigration;
+
+final class AddProductTable extends AbstractMigration {
+	public function change(): void {
+		$this->table("product", ["signed" => false, "collation" => "utf8mb4_general_ci"])
+			->addColumn("supplier_id", "integer", ["signed" => false])
+			->addColumn("name", "string")
+			->addColumn("type", "integer", ["limit" => MysqlAdapter::INT_TINY, "signed" => false])
+			->addColumn("price", "decimal", ["signed" => false, "precision" => 8, "scale" => 2])
+			->addColumn("dts_created", "datetime")
+			->addColumn("dts_updated", "datetime", ["null" => true])
+			->addColumn("dts_deleted", "datetime", ["null" => true])
+			->addForeignKey("supplier_id", "supplier", "id", ["update" => "CASCADE", "delete" => "CASCADE"])
+			->create();
+	}
+}

+ 22 - 0
db/migrations/20220626135804_add_company_table.php

@@ -0,0 +1,22 @@
+<?php
+declare(strict_types=1);
+
+use Phinx\Migration\AbstractMigration;
+
+final class AddCompanyTable extends AbstractMigration {
+	public function change(): void {
+		$this->table("company", ["signed" => false, "collation" => "utf8mb4_general_ci"])
+			->addColumn("address_id", "integer", ["signed" => false])
+			->addColumn("name", "string")
+			->addColumn("phone", "string", ["null" => true])
+			->addColumn("fax", "string", ["null" => true])
+			->addColumn("email", "string", ["null" => true])
+			->addColumn("company_number", "string", ["null" => true])
+			->addColumn("vat_number", "string", ["null" => true])
+			->addColumn("dts_created", "datetime")
+			->addColumn("dts_updated", "datetime", ["null" => true])
+			->addColumn("dts_deleted", "datetime", ["null" => true])
+			->addForeignKey("address_id", "address", "id")
+			->create();
+	}
+}

+ 23 - 0
db/migrations/20220626141033_add_company_bank_details_table.php

@@ -0,0 +1,23 @@
+<?php
+declare(strict_types=1);
+
+use Phinx\Migration\AbstractMigration;
+
+final class AddCompanyBankDetailsTable extends AbstractMigration {
+	public function change(): void {
+		$this->table("company_bank_details", ["signed" => false, "collation" => "utf8mb4_general_ci"])
+			->addColumn("company_id", "integer", ["signed" => false])
+			->addColumn("currency", "string", ["limit" => 3])
+			->addColumn("bank_name", "string", ["null" => true])
+			->addColumn("bank_address", "string", ["null" => true])
+			->addColumn("bank_sort_code", "string", ["null" => true])
+			->addColumn("bank_account_name", "string", ["null" => true])
+			->addColumn("bank_account_number", "string", ["null" => true])
+			->addColumn("bank_account_iban", "string", ["null" => true])
+			->addColumn("dts_created", "datetime")
+			->addColumn("dts_updated", "datetime", ["null" => true])
+			->addIndex(["company_id", "currency"], ["unique" => true])
+			->addForeignKey("company_id", "company", "id")
+			->create();
+	}
+}

+ 43 - 0
engine/Address.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace App;
+
+/**
+ * Class Address
+ * @property int $id
+ * @property string $address_1
+ * @property string $address_2
+ * @property string $city
+ * @property string $county
+ * @property string $postal_code
+ * @property string $state
+ * @property string $country
+ * @property float $latitude
+ * @property float $longitude
+ */
+
+class Address extends Model {
+
+	protected static $table = "address";
+	protected static $idField = "id";
+	protected static $fillableFields = ["address_1", "address_2", "city", "county", "postal_code", "state", "country", "latitude", "longitude"];
+
+	// Static methods
+
+	public static function getCountryOptions(): array {
+		return [
+			"FR" => __("France"),
+			"DE" => __("Germany"),
+			"JP" => __("Japan"),
+			"ES" => __("Spain"),
+			"GB" => __("United Kingdom"),
+		];
+	}
+
+	// Object methods
+
+	public function hasGeolocation(): bool {
+		return isset($this->latitude, $this->longitude);
+	}
+
+}

+ 32 - 0
engine/Breadcrumb.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App;
+
+class Breadcrumb {
+
+	/** @var string */
+	private $name;
+
+	/** @var string */
+	private $url;
+
+	public function __construct(string $url, string $name) {
+		$this->url = $url;
+		$this->name = $name;
+	}
+
+	/**
+	 * @return string
+	 */
+	public function getName(): string {
+		return $this->name;
+	}
+
+	/**
+	 * @return string
+	 */
+	public function getUrl(): string {
+		return $this->url;
+	}
+
+}

+ 69 - 0
engine/Company.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace App;
+
+/**
+ * Class Company
+ * @property int $id
+ * @property int $address_id
+ * @property string $name
+ * @property string $phone
+ * @property string $fax
+ * @property string $email
+ * @property string $company_number
+ * @property string $vat_number
+ * @property string $dts_created
+ * @property string $dts_updated
+ * @property string $dts_deleted
+ */
+
+class Company extends Model {
+
+	protected static $table = "company";
+	protected static $idField = "id";
+	protected static $fillableFields = ["address_id", "name", "phone", "fax", "email", "company_number", "vat_number", "dts_created", "dts_updated", "dts_deleted"];
+
+	// Static methods
+
+	/**
+	 * @return Company[]
+	 */
+	public static function getAll(): array {
+		return self::query([], ["sort" => "name"]);
+	}
+
+	// Object methods
+
+	/**
+	 * @return Address
+	 * @throws \Exception
+	 */
+	public function getAddress(): Address {
+		$address = Address::get($this->address_id);
+		return $address ?: new Address();
+	}
+
+	public function getSlug(): string {
+		return Util::slug("$this->name $this->id");
+	}
+
+	public function getUrl(): string {
+		return sprintf("/companies/%s", $this->getSlug());
+	}
+
+	/**
+	 * @return CompanyBankDetails
+	 */
+	public function getBankDetailsForCurrency(string $currency): CompanyBankDetails {
+		$details = CompanyBankDetails::queryOne(["company_id" => $this->id, "currency" => $currency]);
+		if(!$details) {
+			$details = new CompanyBankDetails();
+			$details->company_id = $this->id;
+			$details->currency = $currency;
+			$details->dts_created = Database::dts();
+		}
+
+		return $details;
+	}
+
+}

+ 31 - 0
engine/CompanyBankDetails.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace App;
+
+/**
+ * Class CompanyBankDetails
+ * @property int $id
+ * @property int $company_id
+ * @property string $currency
+ * @property string $bank_name
+ * @property string $bank_address
+ * @property string $bank_sort_code
+ * @property string $bank_account_name
+ * @property string $bank_account_number
+ * @property string $bank_account_iban
+ * @property string $dts_created
+ * @property string $dts_updated
+ */
+
+class CompanyBankDetails extends Model {
+
+	protected static $table = "company_bank_details";
+	protected static $idField = "id";
+	protected static $fillableFields = [
+		"company_id", "currency",
+		"bank_name", "bank_address", "bank_sort_code",
+		"bank_account_name", "bank_account_number", "bank_account_iban",
+		"dts_created", "dts_updated"
+	];
+
+}

+ 17 - 0
engine/Constraint/BetweenConstraint.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Constraint;
+
+class BetweenConstraint extends Constraint {
+
+	public function __construct($start, $end) {
+		$values = [$start, $end];
+		parent::__construct(...$values);
+	}
+
+	public function getString(): string {
+		[$start, $end] = $this->values;
+		return sprintf("BETWEEN '%s' AND '%s'", $start, $end);
+	}
+
+}

+ 15 - 0
engine/Constraint/Constraint.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Constraint;
+
+abstract class Constraint {
+
+	protected $values = [];
+
+	public function __construct(...$values) {
+		$this->values = $values;
+	}
+
+	abstract public function getString(): string;
+
+}

+ 11 - 0
engine/Constraint/LessThanConstraint.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Constraint;
+
+class LessThanConstraint extends Constraint {
+
+	public function getString(): string {
+		return sprintf("< '%s'", $this->values[0]);
+	}
+
+}

+ 11 - 0
engine/Constraint/MoreThanOrEqualsConstraint.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Constraint;
+
+class MoreThanOrEqualsConstraint extends Constraint {
+
+	public function getString(): string {
+		return sprintf(" >= '%s'", $this->values[0]);
+	}
+
+}

+ 11 - 0
engine/Constraint/NotEqualsConstraint.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Constraint;
+
+class NotEqualsConstraint extends Constraint {
+
+	public function getString(): string {
+		return sprintf("!= '%s'", $this->values[0]);
+	}
+
+}

+ 254 - 0
engine/Core.php

@@ -0,0 +1,254 @@
+<?php
+
+namespace App;
+
+use Exception;
+use Gettext\Loader\MoLoader;
+use Gettext\Translator;
+use Gettext\TranslatorFunctions;
+use RuntimeException;
+
+class Core {
+
+	public const SCRIPT_GLOBAL = 0;
+	public const SCRIPT_PAGE = 1;
+
+	private static $instance;
+
+	/** @var User */
+	protected $user;
+
+	/** @var Breadcrumb[] */
+	protected $breadcrumbs = [];
+
+	/** @var string */
+	protected $locale;
+
+	/** @var Translator */
+	protected $translator;
+
+	/** @var string */
+	protected $controllerName = "home";
+
+	/** @var string[] Global scripts  */
+	protected $scripts = [];
+
+	/** @var string[] Page scripts  */
+	protected $pageScripts = [];
+
+	/** @var string[] CSS stylesheets */
+	protected $stylesheets = [];
+
+	// Static methods
+	public static function getInstance(): Core {
+		if(self::$instance === null) {
+			self::$instance = new Core();
+		}
+
+		return self::$instance;
+	}
+
+	public static function hasReCaptcha(): bool {
+		return !empty($_ENV["RECAPTCHA_SECRET_KEY"]);
+	}
+
+	public static function reCaptchaCheck(string $recaptcha_token): bool {
+
+		if(!self::hasReCaptcha()) {
+			return true;
+		}
+
+		$url = sprintf("https://www.google.com/recaptcha/api/siteverify?secret=%s&response=%s&remoteip=%s",
+			$_ENV["RECAPTCHA_SECRET_KEY"], $recaptcha_token, $_SERVER["REMOTE_ADDR"]
+		);
+
+		$response = file_get_contents($url);
+		$object = json_decode($response);
+		if(!$object) {
+			return false;
+		}
+
+		return $object->success && $object->score >= 0.6;
+	}
+
+	/**
+	 * Core constructor.
+	 * @throws Exception
+	 */
+	public function __construct() {
+		if(PHP_SAPI !== "cli") {
+			$this->initSession();
+		}
+
+		$this->initBreadcrumbs();
+		$this->initLocalisation();
+	}
+
+	// Object methods
+
+	/**
+	 * @return void
+	 * @throws Exception
+	 */
+	private function initSession(): void {
+		session_name($_ENV["SESSION_NAME"]);
+		session_start();
+
+		$user_id = $_SESSION["user_id"] ?? null;
+		if($user_id && $this->hasConnection()) {
+			$this->user = User::get($user_id);
+		}
+
+		if($this->isLoggedIn()) {
+			setcookie($_ENV["SESSION_NAME"], session_id(), time() + 28 * 86400, "/");
+			$this->user->touch();
+		}
+
+		register_shutdown_function(static function() {
+			if(empty($_SESSION) && session_status() === PHP_SESSION_ACTIVE) {
+				session_destroy();
+			}
+		});
+	}
+
+	private function initBreadcrumbs(): void {
+		$this->breadcrumbs[] = new Breadcrumb("/", $this->getSiteName());
+	}
+
+	private function initLocalisation(): void {
+		$this->locale = $_ENV["LOCALE"];
+
+		$this->translator = new Translator;
+		TranslatorFunctions::register($this->translator);
+
+		$mo_path = $_ENV["DIR_ROOT"] . "/i18n/$this->locale/LC_MESSAGES/$this->locale.mo";
+		if(!file_exists($mo_path)) {
+			return;
+		}
+
+		$loader = new MoLoader();
+		$translations = $loader->loadFile($mo_path);
+		$this->translator->addTranslations($translations->toArray());
+	}
+
+	/**
+	 * @param string $path
+	 * @param string $mode
+	 * @throws Exception
+	 */
+	public function addStylesheet(string $path, string $mode = "append"): void {
+		if(!file_exists($_ENV["DIR_ROOT"] . "/public/$path")) {
+			throw new RuntimeException("'$path' does not exist.");
+		}
+
+		if($mode === "prepend") {
+			array_unshift($this->stylesheets, $path);
+		}
+		else {
+			$this->stylesheets[] = $path;
+		}
+
+	}
+
+	/**
+	 * @param string $path File path relative to /public
+	 * @param int $type
+	 * @throws Exception
+	 */
+	public function addScript(string $path, int $type = self::SCRIPT_GLOBAL): void {
+		if(!file_exists($_ENV["DIR_ROOT"] . "/public/$path")) {
+			throw new RuntimeException("'$path' does not exist.");
+		}
+
+		if($type === self::SCRIPT_PAGE) {
+			$this->pageScripts[] = $path;
+		}
+		else {
+			$this->scripts[] = $path;
+		}
+	}
+
+	public function getStylesheets(): array {
+		return $this->stylesheets;
+	}
+
+	public function getGlobalScripts(): array {
+		return $this->scripts;
+	}
+
+	public function getPageScripts(): array {
+		return $this->pageScripts;
+	}
+
+	/**
+	 * @return Breadcrumb[]
+	 */
+	public function getBreadcrumbs(): array {
+		return $this->breadcrumbs;
+	}
+
+	public function getLocale(): string {
+		return $this->locale;
+	}
+
+	/**
+	 * @param string $name
+	 * @param array $params
+	 * @throws Exception
+	 */
+	public function requireController(string $name, array $params = []): void {
+		extract($params, EXTR_OVERWRITE);
+
+		$path = $_ENV["DIR_ROOT"] . "/controllers/$name.php";
+		if(!file_exists($path)) {
+			throw new RuntimeException("Controller '$name' could not be found.");
+		}
+
+		$this->controllerName = $name;
+
+		require $path;
+	}
+
+	public function getUser(): ?User {
+		return $this->user;
+	}
+
+	/**
+	 * @return bool
+	 * @throws Exception
+	 */
+	public function isLoggedIn(): bool {
+		return ($this->user !== null);
+	}
+
+	/**
+	 * @return string
+	 */
+	public function getControllerName(): string {
+		return $this->controllerName;
+	}
+
+	public function addBreadcrumb(string $url, string $name): void {
+		$this->breadcrumbs[] = new Breadcrumb($url, $name);
+	}
+
+	public function hasConnection(): bool {
+		return Database::$connection !== null;
+	}
+
+	public function getSiteName(): string {
+		return $_ENV["SITE_NAME"];
+	}
+
+	public function getTabTitle(): string {
+		$breadcrumbs = array_reverse($this->getBreadcrumbs());
+
+		$parts = [];
+		foreach($breadcrumbs as $breadcrumb) {
+			$parts[] = $breadcrumb->getName();
+		}
+
+		return implode(" | ", $parts);
+	}
+
+}

+ 14 - 0
engine/Currency.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App;
+
+class Currency {
+
+	public static function options(): array {
+		return [
+			"GBP" => "GBP - Pound Sterling",
+			"EUR" => "EUR - Euro",
+		];
+	}
+
+}

+ 59 - 0
engine/Customer.php

@@ -0,0 +1,59 @@
+<?php
+
+namespace App;
+
+/**
+ * Class Customer
+ * @property int $id
+ * @property int $address_id
+ * @property string $name
+ * @property string $phone
+ * @property string $fax
+ * @property string $email
+ * @property string $dts_created
+ * @property string $dts_updated
+ * @property string $dts_deleted
+ */
+
+class Customer extends Model {
+
+	protected static $table = "customer";
+	protected static $idField = "id";
+	protected static $fillableFields = ["address_id", "name", "phone", "fax", "email", "dts_created", "dts_updated", "dts_deleted"];
+
+	// Static methods
+
+	/**
+	 * @return Customer[]
+	 */
+	public static function getAll(): array {
+		return self::query([], ["sort" => "name"]);
+	}
+
+	// Object methods
+
+	/**
+	 * @return Address
+	 * @throws \Exception
+	 */
+	public function getAddress(): Address {
+		$address = Address::get($this->address_id);
+		return $address ?: new Address();
+	}
+
+	public function getSlug(): string {
+		return Util::slug("$this->name $this->id");
+	}
+
+	public function getUrl(): string {
+		return sprintf("/customers/%s", $this->getSlug());
+	}
+
+	/**
+	 * @return Location[]
+	 */
+	public function getLocations(): array {
+		return Location::query(["customer_id" => $this->id, "dts_deleted" => null]);
+	}
+
+}

+ 228 - 0
engine/Database.php

@@ -0,0 +1,228 @@
+<?php
+
+namespace App;
+
+use Exception;
+use mysqli;
+use mysqli_result;
+use RuntimeException;
+use App\Constraint\Constraint;
+
+class Database {
+
+	/** @var string */
+	public static $lastQuery;
+
+	/** @var string[] */
+	public static $queries = [];
+
+	/** @var int */
+	public static $queryCount = 0;
+
+	/** @var mysqli */
+	public static $connection;
+
+	public static function affectedRows(): int {
+		return mysqli_affected_rows(self::$connection);
+	}
+
+	/**
+	 * @param string $host
+	 * @param string $username
+	 * @param string $password
+	 * @param string $database
+	 * @param int $port
+	 * @return mysqli
+	 * @throws Exception
+	 */
+	public static function connect(string $host, string $username, string $password, string $database, int $port = 3306): mysqli {
+		$connection = @new mysqli($host, $username, $password, $database, $port);
+		if($connection->connect_errno !== 0) {
+			throw new RuntimeException("Connect Error: " . $connection->connect_error);
+		}
+		self::$connection = $connection;
+		self::query("SET NAMES utf8mb4");
+		self::query("SET SESSION sql_mode='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");
+		return self::$connection;
+	}
+
+	public static function dataSeek(mysqli_result $result, int $row_number): bool {
+		return mysqli_data_seek($result, $row_number);
+	}
+
+	public static function escape(?string $string): string {
+		return mysqli_real_escape_string(self::$connection, $string);
+	}
+
+	public static function error(): string {
+		return mysqli_error(self::$connection);
+	}
+
+	public static function fetchArray(mysqli_result $result): ?array {
+		return mysqli_fetch_array($result);
+	}
+
+	public static function fetchAssoc(mysqli_result $result): ?array {
+		return mysqli_fetch_assoc($result);
+	}
+
+	public static function fetchObject(mysqli_result $result): ?object {
+		return mysqli_fetch_object($result);
+	}
+
+	public static function fetchRow(mysqli_result $result): ?array {
+		return mysqli_fetch_row($result);
+	}
+
+	public static function freeResult($result): void {
+		mysqli_free_result($result);
+	}
+
+	public static function getValueString(array $pairs, bool $escape = false): string {
+
+		if($escape) {
+			$pairs = array_map("DB::escape", $pairs);
+		}
+
+		$string_array = [];
+
+		foreach($pairs as $field => $value) {
+			if($value === null) {
+				$string_array[] = "`$field`=NULL";
+			}
+			else {
+				$string_array[] = "`$field`='$value'";
+			}
+		}
+
+		return implode(", ", $string_array);
+	}
+
+	/**
+	 * @param array $pairs
+	 * @param array|bool $options
+	 * @return string
+	 */
+	public static function getWhereString(array $pairs, $options = []): string {
+
+		$escape = false;
+		$fuzzy = false;
+
+		if(is_bool($options)) { // Legacy escape
+			$escape = $options;
+		}
+
+		if(is_array($options)) {
+			$escape = $options["escape"] ?? false;
+			$fuzzy = $options["fuzzy"] ?? false;
+		}
+
+		if($escape) {
+			foreach($pairs as &$value) {
+				$value = self::escape($value);
+			}
+			unset($value);
+		}
+
+		$parts = [];
+
+		foreach($pairs as $field => $value) {
+			if($value === null) {
+				$parts[] = "`$field` IS NULL";
+			}
+			else if(is_array($value)) {
+				$values = array_map(static function(string $string) {
+					return "'$string'";
+				}, $value);
+
+				if(empty($value)) {
+					$parts[] = "0";
+				} // Empty array
+				else {
+					$parts[] = "`$field` IN (" . implode(", ", $values) . ")";
+				}
+			}
+			else if(is_a($value, Constraint::class)) {
+				/** @var Constraint $value */
+				$parts[] = "`$field` " . $value->getString();
+			}
+			else {
+				$parts[] = $fuzzy ? "`$field` LIKE '%$value%'" : "`$field`='$value'";
+			}
+		}
+		return implode(" AND ", $parts);
+	}
+
+	/**
+	 * @param string $table
+	 * @param string $name
+	 * @return bool
+	 * @throws Exception
+	 */
+	public static function hasIndex(string $table, string $name): bool {
+		$sql = "SHOW INDEX FROM `$table` WHERE `Key_name`='$name'";
+		$result = self::query($sql);
+		return self::numRows($result) > 0;
+	}
+
+	public static function insertId() {
+		return mysqli_insert_id(self::$connection);
+	}
+
+	/**
+	 * @param mysqli_result|bool $result
+	 * @return int
+	 */
+	public static function numRows($result): int {
+		if(is_bool($result)) {
+			return 0;
+		}
+
+		return mysqli_num_rows($result);
+	}
+
+	public static function objectOrNull(mysqli_result $result): ?object {
+		return mysqli_num_rows($result)>0 ? self::fetchObject($result) : null;
+	}
+
+	public static function ping(): bool {
+		return mysqli_ping(self::$connection);
+	}
+
+	/**
+	 * @param string $sql
+	 * @return bool|mysqli_result
+	 * @throws Exception
+	 */
+	public static function query(string $sql) {
+		if(self::$connection === null) {
+			return false;
+		}
+
+		$is_development = ($_ENV["ENV"] === "development");
+
+		self::$queries[] = $sql;
+		self::$lastQuery = $sql;
+		self::$queryCount++;
+
+		$result = mysqli_query(self::$connection, $sql);
+		if($result === false) {
+			if($is_development) {
+				$error = self::error();
+				throw new RuntimeException("Query failed: $error $sql");
+			}
+
+			throw new RuntimeException("A database error has occurred. Please try again later.");
+		}
+
+		return $result;
+	}
+
+	public static function selectDatabase(string $name): void {
+		mysqli_select_db(self::$connection, $name);
+	}
+
+	public static function dts(): string {
+		return gmdate("Y-m-d H:i:s");
+	}
+}

+ 17 - 0
engine/Html.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App;
+
+class Html {
+	public static function selected($value, $selected): string {
+		return ((string) $value === (string) $selected) ? "selected" : "";
+	}
+
+	public static function checked($value): string {
+		return $value ? "checked" : "";
+	}
+
+	public static function disabled($value): string {
+		return $value ? "disabled" : "";
+	}
+}

+ 17 - 0
engine/Http.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App;
+
+class Http {
+
+	public static function redirect(string $url, int $response_code = 303): void {
+		http_response_code($response_code);
+		header("Location: $url");
+		exit();
+	}
+
+	public static function referer(): ?string {
+		return $_SERVER["HTTP_REFERER"] ?? null;
+	}
+
+}

+ 56 - 0
engine/Location.php

@@ -0,0 +1,56 @@
+<?php
+
+namespace App;
+
+use Exception;
+
+/**
+ * Class Location
+ * @property int $id
+ * @property int $customer_id
+ * @property int $address_id
+ * @property string $name
+ * @property string $phone
+ * @property string $fax
+ * @property string $email
+ * @property string $dts_created
+ * @property string $dts_updated
+ * @property string $dts_deleted
+ */
+
+class Location extends Model {
+
+	protected static $table = "location";
+	protected static $idField = "id";
+	protected static $fillableFields = ["customer_id", "address_id", "name", "phone", "fax", "email", "dts_created", "dts_updated", "dts_deleted"];
+
+	/**
+	 * @return Customer
+	 * @throws Exception
+	 */
+	public function getCustomer(): Customer {
+		return Customer::get($this->customer_id);
+	}
+
+	/**
+	 * @return Address
+	 * @throws Exception
+	 */
+	public function getAddress(): Address {
+		$address = Address::get($this->address_id);
+		return $address ?: new Address();
+	}
+
+	public function getSlug(): string {
+		return Util::slug("$this->name $this->id");
+	}
+
+	/**
+	 * @return string
+	 * @throws Exception
+	 */
+	public function getUrl(): string {
+		return sprintf("/locations/%s", $this->getSlug());
+	}
+
+}

+ 658 - 0
engine/Model.php

@@ -0,0 +1,658 @@
+<?php
+
+namespace App;
+
+use Exception;
+use ReflectionClass;
+use RuntimeException;
+
+abstract class Model {
+
+	// Query Option Keys
+	public const OPTION_SORT = "sort";
+	public const OPTION_ORDER = "order";
+	public const OPTION_LIMIT = "limit";
+	public const OPTION_OFFSET = "offset";
+	public const OPTION_ID_AS_KEY = "id_as_key";
+
+	public const COMMIT_TESTING = "testing";
+	public const COMMIT_INSERT_IGNORE = "insert_ignore";
+	public const COMMIT_SUPPRESS_EXCEPTION = "suppress_exception";
+
+	protected static $table = "";
+	protected static $idField = "";
+	protected static $fillableFields = [];
+
+	protected static $enforceFieldCheck = true;
+	protected static $fieldMap = []; // Used for field name aliases
+	protected static $blobFields = [];
+	protected static $repositoriesEnabled = true;
+	protected static $repositories = [];
+
+	// Object variables
+	protected $modelData;
+	protected $modifiedFields = [];
+	protected $inDatabase;
+
+	// Magic methods
+
+	public function getMappedFieldName(string $name): string {
+		if(isset(static::$fieldMap[$name])) {
+			$name = static::$fieldMap[$name];
+		}
+		return $name;
+	}
+
+	/**
+	 * @param string $name
+	 * @return mixed|null
+	 */
+	public function __get(string $name) {
+		$name = $this->getMappedFieldName($name);
+		return $this->modelData->$name ?? null;
+	}
+
+	/**
+	 * @param string $name
+	 * @param $value
+	 * @throws Exception
+	 */
+	public function __set(string $name, $value) {
+		$name = $this->getMappedFieldName($name);
+
+		$id_field = static::$idField;
+
+		if($name === "model_data") {
+			$this->modelData = $value;
+		}
+		else if(in_array($name, static::$fillableFields, true)) {
+
+			if($value !== null) {
+				if(is_scalar($value) || is_object($value)) {
+					$value = (string) $value;
+				}
+
+				if(is_array($value)) {
+					$value = json_encode($value);
+				}
+			}
+
+			$old_value = $this->modelData->$name ?? null;
+
+			if($old_value !== $value) {
+				$this->modelData->$name = $value;
+				$this->modifiedFields[] = $name;
+			}
+		}
+		else if($name === $id_field && empty($this->modelData->$id_field)) {
+			$this->modelData->$id_field = $value;
+		}
+		else if(static::$enforceFieldCheck) {
+			throw new RuntimeException("Attempt to set an unfillable field $name");
+		}
+		else {
+			$this->modelData->$name = $value;
+		}
+	}
+
+	public function __isset($name) {
+		$name = static::$fieldMap[$name] ?? $name;
+		return isset($this->modelData->$name);
+	}
+
+	// Static methods
+
+	public static function setRepositoriesEnabled(bool $enabled): void {
+		self::$repositoriesEnabled = $enabled;
+	}
+
+	public static function clearRepositories(): void {
+		self::$repositories = [];
+	}
+
+	public static function clearRepository(string $table): void {
+		self::$repositories[$table] = [];
+	}
+
+	/**
+	 * @param $id
+	 * @return static|null
+	 * @throws Exception
+	 */
+	public static function get($id): ?object {
+
+		$table = static::$table;
+		$is_compound_key = is_array(static::$idField);
+		$repositories_enabled = static::$repositoriesEnabled;
+
+		// Check repo for item
+		if(!$is_compound_key && isset(self::$repositories[$table][$id]) && $repositories_enabled) {
+			return self::$repositories[$table][$id];
+		}
+
+		$id_field = static::$idField;
+		$class = static::class;
+
+		$nvp = [];
+
+		if($is_compound_key && is_array($id_field)) { // Compound key
+			$args = func_get_args();
+			$fields = $id_field;
+
+			if(count($args) !== count($fields)) {
+				throw new RuntimeException(__("Number of arguments in get() method call does not match with $class definition."));
+			}
+
+			foreach($fields as $index => $field) {
+				$nvp[$field] = $args[$index];
+			}
+		}
+		else {
+			$nvp[$id_field] = $id;
+		}
+
+		$where = Database::getWhereString($nvp, true);
+
+		$sql = "SELECT * FROM `$table` WHERE $where";
+		$result = Database::query($sql);
+		$object = Database::objectOrNull($result);
+
+		if($object) {
+			$object = self::instantiateRow($class, $object);
+			if(!$is_compound_key && self::$repositoriesEnabled) {
+				self::$repositories[$table][$id] = $object;
+			}
+		}
+
+		return $object;
+	}
+
+	/**
+	 * @return static[]
+	 * @throws Exception
+	 */
+	public static function getAll(): array {
+
+		$class = static::class;
+
+		$objects = [];
+
+		$table = static::$table;
+
+		$sql = "SELECT * FROM `$table`";
+		$result = Database::query($sql);
+		while($row = Database::fetchObject($result)) {
+			$objects[] = self::instantiateRow($class, $row);
+		}
+
+		return $objects;
+	}
+
+	/**
+	 * @param array ...$id_sets
+	 * @return static[]
+	 * @throws Exception
+	 */
+	public static function load(...$id_sets): array {
+
+		$table = static::$table;
+
+
+
+		$ids = [];
+
+		if($id_sets) {
+			$ids = array_merge(...$id_sets);
+		}
+
+		if(empty($ids)) {
+			return [];
+		}
+
+		$ids = array_unique($ids);
+
+		$items = static::query([static::$idField => $ids], ["id_as_key" => true]);
+
+		if(self::$repositoriesEnabled) {
+			foreach($items as $id => $item) {
+				self::$repositories[$table][$id] = $item;
+			}
+		}
+
+		return $items;
+	}
+
+	/**
+	 * @param array $nvp
+	 * @return int
+	 * @throws Exception
+	 */
+	public static function deleteMultiple(array $nvp = []): int {
+		$table = static::$table;
+
+		$vs = "1";
+		if(!empty($nvp)) {
+			$nvp = static::getRemappedNVP($nvp);
+			$vs = Database::getWhereString($nvp);
+		}
+
+		$sql = "DELETE FROM `$table` WHERE $vs";
+		$result = Database::query($sql);
+		if(!$result) {
+			return false;
+		}
+
+		return Database::affectedRows();
+	}
+
+	/**
+	 * @param array|string $nvp
+	 * @param array $options
+	 * @return static[]
+	 */
+	public static function query($nvp = [], array $options = []): array {
+		try {
+			return is_array($nvp) ? static::findByNVP($nvp, $options) : static::findByValueString($nvp, $options);
+		}
+		catch(Exception $e) {
+			return [];
+		}
+	}
+
+	/**
+	 * @param array $nvp
+	 * @param array $options
+	 * @return static[]
+	 * @throws Exception
+	 */
+	public static function queryFuzzy(array $nvp = [], array $options = []): array {
+		$options["fuzzy"] = true;
+		return static::findByNVP($nvp, $options);
+	}
+
+	/**
+	 * @param array|string $nvp
+	 * @param array $options
+	 * @return static|null
+	 * @throws Exception
+	 */
+	public static function queryOne($nvp = [], array $options = []): ?object {
+		$options = array_merge($options, ["limit" => 1]);
+
+		if(is_array($nvp)) {
+			$rows = static::findByNVP($nvp, $options);
+		}
+		else {
+			$rows = static::findByValueString($nvp, $options);
+		}
+		return $rows ? $rows[0] : null;
+	}
+
+	/**
+	 * @param array $nvp
+	 * @return array
+	 */
+	private static function getRemappedNVP(array $nvp = []): array {
+		$mapped_nvp = [];
+		foreach($nvp as $field => $value) {
+			$field = static::$fieldMap[$field] ?? $field;
+			$mapped_nvp[$field] = $value;
+		}
+		return $mapped_nvp;
+	}
+
+	/**
+	 * @param array $nvp
+	 * @return int
+	 * @throws Exception
+	 */
+	public static function count(array $nvp = []): int {
+		$table = static::$table;
+
+		if(is_array($nvp)) {
+			$vs = "1";
+			if(!empty($nvp)) {
+				$nvp = static::getRemappedNVP($nvp);
+				$vs = Database::getWhereString($nvp);
+			}
+		}
+		else {
+			$vs = $nvp;
+		}
+
+		$sql = "SELECT COUNT(*) AS `count` FROM `$table` WHERE $vs";
+		$result = Database::query($sql);
+		return Database::fetchObject($result)->count;
+	}
+
+	/**
+	 * @param $nvp
+	 * @param array $options
+	 * @return static[]
+	 * @throws Exception
+	 */
+	public static function findByNVP($nvp, array $options = []): array {
+
+		if(empty($nvp)) {
+			$vs = "1";
+		}
+		else {
+			$nvp = static::getRemappedNVP($nvp);
+			$vs = Database::getWhereString($nvp, $options);
+		}
+
+		return static::findByValueString($vs, $options);
+	}
+
+	/**
+	 * @param string $vs
+	 * @param array $opts
+	 * @return static[]
+	 * @throws Exception
+	 */
+	private static function findByValueString(string $vs, array $opts = []): array {
+
+		$class = static::class;
+		$table = static::$table;
+
+		$options = (object) $opts;
+
+		$objects = [];
+
+		$sql = "SELECT * FROM `$table` WHERE $vs";
+
+		if(isset($options->sort)) {
+
+			if(is_array($options->sort)) {
+				$sql .= " ORDER BY ";
+
+				$order_bys = [];
+
+				foreach($options->sort as $index => $field) {
+					$field = static::$fieldMap[$field] ?? $field;
+					$order = $options->order[$index] ?? "asc";
+					$order_bys[] = "`$field` $order";
+				}
+
+				$sql .= implode(", ", $order_bys);
+			}
+			else {
+				$sort = static::$fieldMap[$options->sort] ?? $options->sort;
+
+				$sql .= " ORDER BY `$sort`";
+				if(isset($options->order)) {
+					$sql .= " " . strtoupper($options->order);
+				}
+			}
+
+		}
+
+		if(isset($options->limit)) {
+			$sql .= " LIMIT";
+			if(isset($options->offset)) {
+				$sql .= " $options->offset,";
+			}
+			$sql .= " $options->limit";
+		}
+
+		$result = Database::query($sql);
+		while($row = Database::fetchObject($result)) {
+			$objects[] = self::instantiateRow($class, $row);
+		}
+
+		if(!empty($options->id_as_key)) {
+			$objects = self::arrayFlipById($objects);
+		}
+
+		return $objects;
+	}
+
+	/**
+	 * @param string $class
+	 * @param object $row
+	 * @return object
+	 * @throws Exception
+	 */
+	protected static function instantiateRow(string $class, object $row): object {
+		$reflection = new ReflectionClass($class);
+		$is_instantiable = $reflection->isInstantiable();
+
+		if($is_instantiable) {
+			return new $class($row);
+		}
+
+		if($reflection->hasMethod("instantiate")) {
+			/** @noinspection PhpUndefinedMethodInspection */
+			return $class::instantiate($row);
+		}
+
+		throw new RuntimeException(__("$class is not instantiable and no instantiate() function exists."));
+
+	}
+
+	/**
+	 * @param Model[] $objects
+	 * @return array
+	 */
+	public static function arrayFlipById(array $objects): array {
+		$array = [];
+		foreach($objects as $object) {
+			$id = $object->getId();
+			$array[$id] = $object;
+		}
+		return $array;
+	}
+
+	// Constructor
+	public function __construct($model_data = null) {
+
+		if($model_data === null) {
+			$model_data = (object) [];
+		}
+		if(is_array($model_data)) {
+			$model_data = (object) $model_data;
+		}
+
+		$this->modelData = $model_data;
+		$this->inDatabase = $this->getId() !== null;
+	}
+
+	// Object methods
+	final public function isNew(): bool {
+		return empty($this->inDatabase);
+	}
+
+	final public function isModified(): bool {
+		return !empty($this->modifiedFields);
+	}
+
+	final public function getModifiedFields(): array {
+		return $this->modifiedFields;
+	}
+
+	private function getIdWhere(): string {
+
+		$id_field = static::$idField;
+		$id = $this->getId();
+
+		$nvp = [];
+		if(is_array($id)) {
+			/**
+			 * @var array $id_field
+			 */
+			$nvp = array_combine($id_field, $id);
+		}
+		else {
+			$nvp[$id_field] = $id;
+		}
+
+		return Database::getWhereString($nvp, true);
+	}
+
+	/**
+	 * Commits changes to a model to the database
+	 *
+	 * @param array $options Optional array containing one or more of the following keys:
+	 * <ul>
+	 * <li><b>testing</b>: If <i>true</i>, the changes will not be written to the database. If the object is not in the database, it will be assigned a random ID will be generated in the range of 1-32768</li>
+	 * <li><b>suppress_exception</b>: If <i>true</i>, an exception will not be thrown if the query fails</li>
+	 * </ul>
+	 * @return bool
+	 * @throws Exception Thrown on query failure
+	 */
+	public function commit(array $options = []) : bool {
+
+		// Options
+		$testing = $options[self::COMMIT_TESTING] ?? false;
+		$insert_ignore = $options[self::COMMIT_INSERT_IGNORE] ?? false;
+		$suppress_exception = $options[self::COMMIT_SUPPRESS_EXCEPTION] ?? false;
+
+		$id_field = static::$idField;
+		$table = static::$table;
+		$blob_fields = static::$blobFields;
+
+		$nvp = [];
+
+		foreach($this->modifiedFields as $field) {
+			if(in_array($field, $blob_fields, true)) {
+				$nvp[$field] = "x'" . bin2hex($this->modelData->$field) . "'";
+			}
+			// NULL
+			else if($this->modelData->$field === null) {
+				$nvp[$field] = null;
+			}
+			// Value
+			else {
+				$nvp[$field] = Database::escape($this->modelData->$field);
+			}
+		}
+
+		if(empty($nvp)) {
+			return true;
+		}
+
+		$value_string = Database::getValueString($nvp);
+
+		if($this->inDatabase) {
+			// Update
+			$where = $this->getIdWhere();
+			$sql = "UPDATE `$table` SET $value_string WHERE $where";
+		}
+		else if($insert_ignore) {
+			$sql = "INSERT IGNORE INTO `$table` SET $value_string";
+		}
+		else {
+			$sql = "INSERT INTO `$table` SET $value_string";
+		}
+
+		if($testing === false) {
+			$result = Database::query($sql);
+
+			if(empty($this->inDatabase) && $result) {
+				// Set ID
+				$insert_id = Database::insertId();
+				if(!empty($insert_id)) {
+					$this->$id_field = $insert_id;
+				}
+				$this->inDatabase = true;
+			}
+		}
+		else {
+			Database::$lastQuery = $sql;
+
+			$result = true;
+			if(empty($this->inDatabase) && !is_array(static::$idField)) {
+				$this->$id_field = random_int(1, 32768);
+			}
+			$this->inDatabase = true;
+		}
+
+		if(!$result && !$suppress_exception) {
+			throw new RuntimeException("An unexpected error has occurred. Please try again.");
+		}
+
+		return !empty($result);
+	}
+
+	/**
+	 * Deletes a model from the database
+	 *
+	 * @param array $options Optional array containing the following key:
+	 * * `suppress_exception`: If `true`, an exception will not be thrown if the query fails
+	 *
+	 * @return bool
+	 * @throws Exception Thrown on query failure
+	 */
+	public function delete(array $options = []): bool {
+
+		// Options
+		$suppress_exception = $options[self::COMMIT_SUPPRESS_EXCEPTION] ?? false;
+
+		$table = static::$table;
+
+		$id = $this->getId();
+
+		if($id === null) {
+			return false;
+		}
+
+		$where = $this->getIdWhere();
+
+		$sql = "DELETE FROM `$table` WHERE $where";
+		$result = Database::query($sql);
+
+		if(!$result && !$suppress_exception) {
+			throw new RuntimeException("An unexpected error has occurred. Please try again.");
+		}
+
+		if(!$result) {
+			return false;
+		}
+
+		return (bool) Database::affectedRows();
+	}
+
+	/**
+	 * @return array|int|null
+	 */
+	final public function getId() {
+		$id_field = static::$idField;
+		if(is_array($id_field)) {
+			$values = [];
+			$fields = $id_field;
+			foreach($fields as $field) {
+				$value = $this->modelData->$field ?? null;
+				if($value === null) {
+					return null;
+				}
+				$values[] = $this->modelData->$field;
+			}
+			return $values;
+		}
+
+		return $this->modelData->$id_field ?? null;
+	}
+
+	final public function getIdString(): string {
+		$id = $this->getId();
+		return is_array($id) ? implode("-", $id) : (string) $id;
+	}
+
+	final public function getModelData(): ?object {
+		return clone $this->modelData;
+	}
+
+	/**
+	 * @param Model|string $id_or_obj
+	 * @return bool
+	 */
+	final public function is($id_or_obj): bool {
+		$id_string = $this->getIdString();
+		if(is_string($id_or_obj)) {
+			return $id_string === $id_or_obj;
+		}
+
+		return ($id_string === $id_or_obj->getIdString());
+	}
+
+}

+ 65 - 0
engine/Product.php

@@ -0,0 +1,65 @@
+<?php
+
+namespace App;
+
+use Exception;
+
+/**
+ * Class Product
+ * @property int $id
+ * @property int $supplier_id
+ * @property string $name
+ * @property int $type
+ * @property string $price
+ * @property string $dts_created
+ * @property string $dts_updated
+ * @property string $dts_deleted
+ */
+
+class Product extends Model {
+
+	protected static $table = "product";
+	protected static $idField = "id";
+	protected static $fillableFields = ["supplier_id", "name", "type", "price", "dts_created", "dts_updated", "dts_deleted"];
+
+	public const TYPE_MACHINE = 1;
+	public const TYPE_SPARE_PART = 2;
+	public const TYPE_CONSUMABLE = 3;
+
+	// Static methods
+
+	public static function getTypeOptions(): array {
+		return [
+			self::TYPE_MACHINE => __("Machine"),
+			self::TYPE_SPARE_PART => __("Spare Part"),
+			self::TYPE_CONSUMABLE => __("Consumable"),
+		];
+	}
+
+	// Object methods
+
+	/**
+	 * @return Supplier
+	 * @throws Exception
+	 */
+	public function getSupplier(): Supplier {
+		return Supplier::get($this->supplier_id);
+	}
+
+	public function getSlug(): string {
+		return Util::slug("$this->name $this->id");
+	}
+
+	public function getUrl(): string {
+		return sprintf("/products/%s", $this->getSlug());
+	}
+
+	public function getDisplayType(): string {
+		return self::getTypeOptions()[$this->type] ?? "";
+	}
+
+	public function getDisplayPrice(): string {
+		return number_format($this->price, 2);
+	}
+
+}

+ 143 - 0
engine/Request.php

@@ -0,0 +1,143 @@
+<?php
+
+namespace App;
+
+class Request {
+
+	private $data;
+
+	// Static method
+
+	public static function fromRequest(): self {
+		$request = new self();
+		$request->data = $_REQUEST;
+		return $request;
+	}
+
+	public static function fromGet(): self {
+		$request = new self();
+		$request->data = $_GET;
+		return $request;
+	}
+
+	public static function fromPost(): self {
+		$request = new self();
+		$request->data = $_POST;
+		return $request;
+	}
+
+	// Object methods
+
+	public function hasData(): bool {
+		return !empty($this->data);
+	}
+
+	/**
+	 * @param string $name
+	 * @return int|int[]|null
+	 */
+	public function int(string $name) {
+		$value = $this->data[$name] ?? null;
+
+		if(is_array($value)) {
+			$values = $value;
+
+			$output = [];
+			foreach($values as $value) {
+				$output[] = ($value !== "") ? (int) $value : null;
+			}
+			return $output;
+		}
+
+		return ($value !== "" && $value !== null) ? (int) $value : null;
+	}
+
+	/**
+	 * @param string $name
+	 * @param int $decimals
+	 * @return string|string[]|null
+	 */
+	public function decimal(string $name, int $decimals) {
+		$value = $this->data[$name] ?? null;
+
+		if(is_array($value)) {
+			$values = $value;
+
+			$output = [];
+			foreach($values as $value) {
+				$output[] = ($value !== "") ? number_format($value, $decimals, ".", "") : null;
+			}
+			return $output;
+		}
+
+		return ($value !== "" && $value !== null) ? number_format($value, $decimals, ".", "") : null;
+	}
+
+	/**
+	 * @param string $name
+	 * @return float|float[]|null
+	 */
+	public function float(string $name) {
+		$value = $this->data[$name] ?? null;
+
+		if(is_array($value)) {
+			$values = $value;
+
+			$output = [];
+			foreach($values as $value) {
+				$output[] = ($value !== "") ? (float) $value : null;
+			}
+			return $output;
+		}
+
+		return ($value !== "" && $value !== null) ? (float) $value : null;
+	}
+
+	/**
+	 * @param string $name
+	 * @return mixed
+	 */
+	public function raw(string $name) {
+		return $this->data[$name] ?? null;
+	}
+
+	/**
+	 * @param string $name
+	 * @return string|string[]|null
+	 */
+	public function string(string $name) {
+		$value = $this->data[$name] ?? null;
+
+		if(is_array($value)) {
+			$values = $value;
+
+			$output = [];
+			foreach($values as $value) {
+				$output[] = ($value !== "") ? trim($value) : null;
+			}
+			return $output;
+		}
+
+		return ($value !== "" && $value !== null) ? trim($value) : null;
+	}
+
+	public function email(string $name) {
+		$value = $this->data[$name] ?? null;
+
+		if(is_array($value)) {
+			$values = $value;
+
+			$output = [];
+			foreach($values as $value) {
+				$value = filter_var($value, FILTER_VALIDATE_EMAIL);
+				$output[] = ($value !== false) ? $value : null;
+			}
+			return $output;
+		}
+
+		$value = filter_var($value, FILTER_VALIDATE_EMAIL);
+		return ($value !== false) ? $value : null;
+	}
+
+
+}

+ 21 - 0
engine/Role.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace App;
+
+/**
+ * @property int $id
+ * @property string $title
+ * @property string $description
+ */
+
+class Role extends Model {
+
+	protected static $table = "role";
+	protected static $idField = "id";
+	protected static $fillableFields = [
+		"title", "description",
+	];
+
+	// Object methods
+
+}

+ 48 - 0
engine/Router.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace App;
+
+use Generator;
+use RuntimeException;
+
+class Router {
+
+	private $routes = [];
+
+	public function loadRoutes(): void {
+		$iterator = glob($_ENV["DIR_ROOT"] . "/routes/*.php");
+		foreach($iterator as $route_file) {
+			require $route_file;
+		}
+	}
+
+	/**
+	 * @param string $pattern
+	 * @param string $controller
+	 * @param array $parameters
+	 * @param array $options
+	 * @return void
+	 */
+	public function addRoute(string $pattern, string $controller, array $parameters = [], array $options = []): void {
+		if(isset($routes[$pattern])) {
+			throw new RuntimeException(__("Route '%s' already exists.", $pattern));
+		}
+
+		$this->routes[$pattern] = [
+			"pattern" => $pattern,
+			"controller" => $controller,
+			"parameters" => $parameters,
+			"options" => $options
+		];
+	}
+
+	/**
+	 * @return Generator|array
+	 */
+	public function getRoutes(): Generator {
+		foreach($this->routes as $route) {
+			yield $route;
+		}
+	}
+
+}

+ 27 - 0
engine/Session.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App;
+
+class Session {
+
+	public const ALERT_TYPE_INFO = "info";
+	public const ALERT_TYPE_SUCCESS = "success";
+	public const ALERT_TYPE_WARNING = "warning";
+	public const ALERT_TYPE_DANGER = "danger";
+
+	public static function addAlert(string $type, string $message): void {
+		$alerts = $_SESSION["alerts"] ?? [];
+		$alerts[] = [
+			"type" => $type,
+			"message" => $message
+		];
+		$_SESSION["alerts"] = $alerts;
+	}
+
+	public static function getAlerts(): array {
+		$alerts = $_SESSION["alerts"] ?? [];
+		unset($_SESSION["alerts"]);
+		return $alerts;
+	}
+
+}

+ 62 - 0
engine/Supplier.php

@@ -0,0 +1,62 @@
+<?php
+
+namespace App;
+
+/**
+ * Class Supplier
+ * @property int $id
+ * @property int $address_id
+ * @property string $name
+ * @property string $phone
+ * @property string $fax
+ * @property string $email
+ * @property string $dts_created
+ * @property string $dts_updated
+ * @property string $dts_deleted
+ */
+
+class Supplier extends Model {
+
+	protected static $table = "supplier";
+	protected static $idField = "id";
+	protected static $fillableFields = ["address_id", "name", "phone", "fax", "email", "dts_created", "dts_updated", "dts_deleted"];
+
+	// Static methods
+
+	/**
+	 * @return Supplier[]
+	 */
+	public static function getAll(): array {
+		return self::query([], ["sort" => "name"]);
+	}
+
+	// Object methods
+
+	/**
+	 * @return Address
+	 * @throws \Exception
+	 */
+	public function getAddress(): Address {
+		$address = Address::get($this->address_id);
+		return $address ?: new Address();
+	}
+
+	public function getSlug(): string {
+		return Util::slug("$this->name $this->id");
+	}
+
+	public function getUrl(): string {
+		return sprintf("/suppliers/%s", $this->getSlug());
+	}
+
+	/**
+	 * @return Product[]
+	 */
+	public function getProducts(): array {
+		return Product::query([
+			"supplier_id" => $this->id,
+			"dts_deleted" => null
+		], ["sort" => "name"]);
+	}
+
+}

+ 126 - 0
engine/User.php

@@ -0,0 +1,126 @@
+<?php
+
+namespace App;
+
+use Carbon\CarbonImmutable;
+use Exception;
+use RuntimeException;
+
+/**
+ * Class User
+ * @property int $id
+ * @property int $role_id
+ * @property string $title
+ * @property string $first_name
+ * @property string $last_name
+ * @property string $email
+ * @property string $password
+ * @property bool $admin
+ * @property string $csrf_token
+ * @property string $dts_last_seen
+ * @property string $dts_created
+ * @property string $dts_updated
+ * @property string $dts_deleted
+ */
+
+class User extends Model {
+
+	protected static $table = "user";
+	protected static $idField = "id";
+	protected static $fillableFields = [
+		"role_id",
+		"title", "first_name", "last_name", "email", "password",
+		"csrf_token",
+		"admin",
+		"dts_last_seen",
+
+		"dts_created",
+		"dts_updated",
+		"dts_deleted",
+	];
+
+	// Static methods
+
+	public static function getTitleOptions(): array {
+		return ["Mr", "Mrs", "Ms"];
+	}
+
+	// Object methods
+
+	/**
+	 * @return Role
+	 * @throws Exception
+	 */
+	public function getRole(): Role {
+		return Role::get($this->role_id);
+	}
+
+	/**
+	 * @param string|null $password
+	 * @return bool
+	 * @throws Exception
+	 */
+	public function validatePassword(?string $password): bool {
+		return password_verify($password, $this->password);
+	}
+
+	/**
+	 * @return void
+	 * @throws Exception
+	 */
+	public function refreshCsrfToken(): void {
+		$this->csrf_token = bin2hex(random_bytes(16));
+		$this->commit();
+	}
+
+	/**
+	 * @return void
+	 * @throws Exception
+	 */
+	public function insertCsrfToken(): void {
+		if(!$this->csrf_token) {
+			$this->refreshCsrfToken();
+		}
+		?>
+		<input type="hidden" name="csrf_token" value="<?=htmlspecialchars($this->csrf_token)?>" />
+		<?php
+	}
+
+	public function validateCsrfToken(): bool {
+		$request = Request::fromRequest();
+		return $request->raw("csrf_token") === $this->csrf_token;
+	}
+
+	public function requireValidCsrfToken(): void {
+		if(!$this->validateCsrfToken()) {
+			throw new RuntimeException(__("CSRF validation failed."));
+		}
+	}
+
+	public function getDateTimeCreated(): CarbonImmutable {
+		return CarbonImmutable::parse($this->dts_created, "UTC");
+	}
+
+	/**
+	 * @return bool
+	 * @throws Exception
+	 */
+	public function touch(): bool {
+		$this->dts_last_seen = Database::dts();
+		return $this->commit();
+	}
+
+	public function isAdmin(): bool {
+		return (bool) $this->admin;
+	}
+
+	public function getUrl(): string {
+		return sprintf("/users/%d", $this->id);
+	}
+
+	public function requireAdmin(): void {
+		if(!$this->isAdmin()) {
+			throw new RuntimeException(__("You do not have permission to access this page."));
+		}
+	}
+}

+ 12 - 0
engine/Util.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App;
+
+class Util {
+
+	public static function slug(string $string, string $glue = "-"): string {
+		$string = strtolower($string);
+		return preg_replace("/[^a-z\d]+/i", $glue, $string);
+	}
+
+}

+ 32 - 0
engine/View.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App;
+
+use Exception;
+use RuntimeException;
+
+class View {
+
+	public static function include(string $name, array $parameters = []): void {
+
+		try {
+			$path = sprintf("%s/views/%s.php", $_ENV["DIR_ROOT"], $name);
+			if(!file_exists($path)) {
+				throw new RuntimeException("View '{$name}' not found.");
+			}
+
+			extract($parameters, EXTR_OVERWRITE);
+			require $path;
+		}
+		catch(Exception $e) {
+			?>
+			<div class="alert alert-danger mb-2">
+				<i class="fa fa-fw fa-exclamation-circle"></i>
+				<?=htmlspecialchars($e->getMessage())?>
+			</div>
+			<?php
+		}
+
+	}
+
+}

+ 1 - 0
phinx.bat

@@ -0,0 +1 @@
+vendor\bin\phinx %*

+ 6 - 0
public/.htaccess

@@ -0,0 +1,6 @@
+Options -Indexes -MultiViews
+
+RewriteEngine on
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ index.php?path=$1&%{QUERY_STRING} [B]

+ 4 - 0
public/index.php

@@ -0,0 +1,4 @@
+<?php
+
+require "../boot.php";
+require "../router.php";

+ 79 - 0
public/js/app.js

@@ -0,0 +1,79 @@
+class AddressMap {
+	constructor(map) {
+		this.element = map;
+
+		this.$latitude = $("input[name=latitude]");
+		this.$longitude = $("input[name=longitude]");
+
+		this.map = new google.maps.Map(this.element, {
+			center: this.latLng,
+			zoom: 17
+		});
+
+		this.marker = new google.maps.Marker({
+			map: this.map,
+			position: this.latLng,
+			draggable: true
+		});
+
+		this.marker.addListener("dragend", () => {
+			const latLng = this.marker.getPosition();
+
+			this.$latitude.val(latLng.lat());
+			this.$longitude.val(latLng.lng());
+		});
+
+		this.geocoder = new google.maps.Geocoder();
+
+		$("#plot-button").on("click", () => this.plot());
+
+	}
+
+	get latLng() {
+		const latitude = this.$latitude.val() * 1;
+		const longitude = this.$longitude.val() * 1;
+
+		return {
+			lat: latitude,
+			lng: longitude
+		};
+	}
+
+	plot() {
+		const addressParts = [
+			$("#address-1").val(),
+			$("#address-2").val(),
+			$("#city").val(),
+			$("#county").val(),
+			$("#postal-code").val(),
+			$("#country").val(),
+		];
+
+		const address = addressParts.filter(value => value.length > 0).join(", ");
+
+		this.geocoder.geocode({
+			address
+		}, (results, status) => {
+			if(status === "OK") {
+				const { location } = results[0].geometry;
+
+				this.map.setCenter(location);
+				this.marker.setPosition(location);
+				this.$latitude.val(location.lat);
+				this.$longitude.val(location.lng);
+			}
+			else {
+				alert("Could not plot for address: " + address);
+			}
+		});
+
+	}
+}
+
+
+$(() => {
+	const addressMap = document.querySelector("#address-map");
+	if(addressMap) {
+		new AddressMap(addressMap);
+	}
+});

+ 56 - 0
router.php

@@ -0,0 +1,56 @@
+<?php
+
+namespace App;
+
+use Exception;
+use RuntimeException;
+
+$router = new Router();
+$router->loadRoutes();
+
+/**
+ * @var array $routes
+ */
+
+$core = Core::getInstance();
+$user = $core->getUser();
+
+$path = $_REQUEST["path"] ?? "";
+unset($_REQUEST["path"], $_GET["path"]);
+
+$uri = trim($path, "/") ?: "home";
+
+foreach($router->getRoutes() as $route) {
+
+	$pattern = $route["pattern"];
+
+	if(!preg_match($pattern, $uri, $matches)) {
+		continue;
+	}
+
+	$controller = $route["controller"];
+	$parameter_names = $route["parameters"] ?? [];
+	$options = $route["options"] ?? [];
+
+	$require_user = $options["requireUser"] ?? false;
+
+	try {
+		if($require_user && !$user) {
+			throw new RuntimeException(__("You must be logged in to access this page."));
+		}
+
+		$parameters = [];
+		foreach($parameter_names as $index => $parameter_name) {
+			$parameters[$parameter_name] = $matches[$index + 1];
+		}
+
+		$core->requireController($controller, $parameters);
+	}
+	catch(Exception $e) {
+		$core->requireController("500", ["message" => $e->getMessage()]);
+	}
+
+	exit();
+}
+
+$core->requireController("404");

+ 51 - 0
routes/default.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Router $this
+ */
+
+$id_pattern = "(\d+)";
+$slug_pattern = "[\w-]+-(\d+)";
+
+$this->addRoute("/^setup$/", "setup");
+
+$this->addRoute("/^home$/", "home");
+
+$this->addRoute("/^dashboard$/", "dashboard", [], ["requireUser" => true]);
+
+$this->addRoute("/^customers$/", "customers", [], ["requireUser" => true]);
+$this->addRoute("/^customers\/add$/", "customer_form", [], ["requireUser" => true]);
+$this->addRoute("/^customers\/$slug_pattern$/", "customer", ["id"], ["requireUser" => true]);
+$this->addRoute("/^customers\/$slug_pattern\/update$/", "customer_form", ["id"], ["requireUser" => true]);
+
+$this->addRoute("/^companies$/", "companies", [], ["requireUser" => true]);
+$this->addRoute("/^companies\/add$/", "company_form", [], ["requireUser" => true]);
+$this->addRoute("/^companies\/$slug_pattern\/update$/", "company_form", ["id"], ["requireUser" => true]);
+
+$this->addRoute("/^locations$/", "locations", [], ["requireUser" => true]);
+$this->addRoute("/^locations\/add$/", "location_form", [], ["requireUser" => true]);
+$this->addRoute("/^locations\/$slug_pattern\/update$/", "location_form", ["id"], ["requireUser" => true]);
+
+$this->addRoute("/^suppliers$/", "suppliers", [], ["requireUser" => true]);
+$this->addRoute("/^suppliers\/add$/", "supplier_form", [], ["requireUser" => true]);
+$this->addRoute("/^suppliers\/$slug_pattern$/", "supplier", ["id"], ["requireUser" => true]);
+$this->addRoute("/^suppliers\/$slug_pattern\/update$/", "supplier_form", ["id"], ["requireUser" => true]);
+
+$this->addRoute("/^products$/", "products", [], ["requireUser" => true]);
+$this->addRoute("/^products\/add$/", "product_form", [], ["requireUser" => true]);
+$this->addRoute("/^products\/$slug_pattern$/", "product", ["id"], ["requireUser" => true]);
+$this->addRoute("/^products\/$slug_pattern\/update$/", "product_form", ["id"], ["requireUser" => true]);
+
+$this->addRoute("/^users$/", "users", [], ["requireUser" => true]);
+$this->addRoute("/^users\/add$/", "user_form", [], ["requireUser" => true]);
+$this->addRoute("/^users\/$id_pattern\/update$/", "user_form", ["id"], ["requireUser" => true]);
+
+$this->addRoute("/^sales$/", "sales", [], ["requireUser" => true]);
+$this->addRoute("/^tickets$/", "tickets", [], ["requireUser" => true]);
+
+$this->addRoute("/^reset-password$/", "reset_password");
+$this->addRoute("/^settings$/", "settings", [], ["requireUser" => true]);
+$this->addRoute("/^log-out$/", "log_out");
+

+ 63 - 0
views/companies.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Company[] $companies
+ */
+
+?>
+<div class="row mb-3">
+	<div class="col">
+		<h3><?=htmlspecialchars(__("Companies"))?></h3>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="/companies/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($companies)) {
+	?>
+	<div class="alert alert-info">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No companies to display."))?>
+	</div>
+	<?php
+}
+else {
+	?>
+	<table class="table table-bordered">
+		<thead>
+		<tr>
+			<th><?=htmlspecialchars(__("ID"))?></th>
+			<th><?=htmlspecialchars(__("Name"))?></th>
+			<th><?=htmlspecialchars(__("Actions"))?></th>
+		</tr>
+		</thead>
+		<tbody>
+		<?php
+		foreach($companies as $company) {
+			?>
+			<tr>
+				<td class="text-end"><?=htmlspecialchars($company->id)?></td>
+				<td>
+					<?=htmlspecialchars($company->name)?>
+				</td>
+				<td class="p-1">
+					<a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($company->getUrl())?>/update">
+						<?=htmlspecialchars(__("Update"))?>
+					</a>
+				</td>
+			</tr>
+			<?php
+		}
+		?>
+		</tbody>
+	</table>
+	<?php
+}
+

+ 78 - 0
views/components/address_fields.php

@@ -0,0 +1,78 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Address $address
+ */
+
+if(!$address->hasGeolocation()) {
+	$latitude = 51.5342116;
+	$longitude = -0.2917105;
+}
+else {
+	$latitude = $address->latitude;
+	$longitude = $address->longitude;
+}
+
+?>
+<div class="mb-3" id="address-map" style="height: 320px; background: #eee;" data-latitude="<?=htmlspecialchars($latitude)?>" data-longitude="<?=htmlspecialchars($longitude)?>">
+
+</div>
+
+<input type="hidden" name="latitude" value="<?=htmlspecialchars($latitude)?>" />
+<input type="hidden" name="longitude" value="<?=htmlspecialchars($longitude)?>" />
+
+<div class="mb-3">
+	<label for="address-1"><?=htmlspecialchars(__("Address Line 1"))?></label>
+	<input class="form-control" type="text" id="address-1" name="address_1" placeholder="<?=htmlspecialchars(__("Type address line 1"))?>" value="<?=htmlspecialchars($address->address_1)?>" />
+</div>
+<div class="mb-3">
+	<label for="address-2"><?=htmlspecialchars(__("Address Line 2"))?></label>
+	<input class="form-control" type="text" id="address-2" name="address_2" placeholder="<?=htmlspecialchars(__("Type address line 2"))?>" value="<?=htmlspecialchars($address->address_2)?>" />
+</div>
+<div class="mb-3">
+	<label for="city"><?=htmlspecialchars(__("Town/City"))?></label>
+	<input class="form-control" type="text" id="city" name="city" placeholder="<?=htmlspecialchars(__("Type town/city"))?>" value="<?=htmlspecialchars($address->city)?>" />
+</div>
+<div class="row">
+	<div class="col-6">
+		<div class="mb-3">
+			<label for="county"><?=htmlspecialchars(__("County"))?></label>
+			<input class="form-control" type="text" id="county" name="county" placeholder="<?=htmlspecialchars(__("Type county"))?>" value="<?=htmlspecialchars($address->county)?>" />
+		</div>
+	</div>
+	<div class="col-6">
+		<div class="mb-3">
+			<label for="postal-code"><?=htmlspecialchars(__("Postcode"))?></label>
+			<input class="form-control" type="text" id="postal-code" name="postal_code" placeholder="<?=htmlspecialchars(__("Type postcode"))?>" value="<?=htmlspecialchars($address->postal_code)?>" />
+		</div>
+	</div>
+</div>
+<div class="row">
+	<div class="col-6">
+		<div class="mb-3">
+			<label for="country"><?=htmlspecialchars(__("Country"))?></label>
+			<select class="form-select" name="country" id="country">
+				<option value=""><?=htmlspecialchars(__("Select Country"))?></option>
+				<?php
+				foreach(Address::getCountryOptions() as $value => $display) {
+					?>
+					<option value="<?=$value?>" <?=Html::selected($value, $address->country)?>>
+						<?=htmlspecialchars($display)?>
+					</option>
+					<?php
+				}
+				?>
+			</select>
+		</div>
+	</div>
+	<div class="col-6 align-self-end">
+		<div class="mb-3">
+			<button id="plot-button" class="btn btn-primary" type="button">
+				<i class="fa fa-fw fa-crosshairs"></i>
+				<?=htmlspecialchars(__("Plot on Map"))?>
+			</button>
+		</div>
+	</div>
+</div>

+ 37 - 0
views/components/alerts.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace App;
+
+$alerts = Session::getAlerts();
+foreach($alerts as $alert) {
+	switch($alert["type"]) {
+		case Session::ALERT_TYPE_INFO:
+		default:
+			$icon = "fa-info-circle";
+			$class = "alert-info";
+			break;
+
+		case Session::ALERT_TYPE_SUCCESS:
+			$icon = "fa-check";
+			$class = "alert-success";
+			break;
+
+		case Session::ALERT_TYPE_DANGER:
+			$icon = "fa-exclamation-circle";
+			$class = "alert-danger";
+			break;
+
+		case Session::ALERT_TYPE_WARNING:
+			$icon = "fa-exclamation-triangle";
+			$class = "alert-warning";
+			break;
+	}
+	?>
+	<div class="alert <?=$class?> alert-dismissible fade show mb-2">
+		<i class="fa fa-fw <?=$icon?>"></i>
+		<?=htmlspecialchars($alert["message"])?>
+		<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
+	</div>
+	<?php
+}
+

+ 38 - 0
views/components/breadcrumbs.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App;
+
+$core = Core::getInstance();
+$breadcrumbs = $core->getBreadcrumbs();
+$breadcrumb_count = count($breadcrumbs);
+
+?>
+<nav aria-label="breadcrumb">
+	<ol class="breadcrumb p-2 rounded bg-light">
+		<?php
+		foreach($breadcrumbs as $index => $breadcrumb) {
+			$number = $index + 1;
+			$is_last = ($number === $breadcrumb_count);
+			$active = $is_last ? "active" : "";
+			?>
+			<li class="breadcrumb-item <?=$active?>">
+				<?php
+				if($is_last) {
+					?>
+					<?=htmlspecialchars($breadcrumb->getName())?>
+					<?php
+				}
+				else {
+					?>
+					<a href="<?=htmlspecialchars($breadcrumb->getUrl())?>">
+						<?=htmlspecialchars($breadcrumb->getName())?>
+					</a>
+					<?php
+				}
+				?>
+			</li>
+			<?php
+		}
+		?>
+	</ol>
+</nav>

+ 98 - 0
views/customer.php

@@ -0,0 +1,98 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Customer $customer
+ */
+
+$locations = $customer->getLocations();
+$sales = [];
+$tickets = [];
+
+?>
+
+<div class="row mb-2">
+	<div class="col">
+		<h3><?=htmlspecialchars($customer->name)?></h3>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-primary" href="<?=htmlspecialchars($customer->getUrl())?>/update">
+			<i class="fa fa-fw fa-pencil"></i>
+			<?=htmlspecialchars(__("Update"))?>
+		</a>
+	</div>
+</div>
+
+
+<div class="row mb-2">
+	<div class="col">
+		<h4><?=htmlspecialchars(__("Locations"))?></h4>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="/locations/add?customer_id=<?=$customer->id?>">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add Location"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($locations)) {
+	?>
+	<div class="alert alert-info mb-3">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No locations to display."))?>
+	</div>
+	<?php
+}
+else {
+	View::include("locations_table", compact("locations"));
+}
+?>
+
+<div class="row mb-2">
+	<div class="col">
+		<h4><?=htmlspecialchars(__("Sales"))?></h4>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="<?=htmlspecialchars($customer->getUrl())?>/sales/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add Sale"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($sales)) {
+	?>
+	<div class="alert alert-info mb-3">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No sales to display."))?>
+	</div>
+	<?php
+}
+?>
+
+<div class="row mb-2">
+	<div class="col">
+		<h4><?=htmlspecialchars(__("Tickets"))?></h4>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="<?=htmlspecialchars($customer->getUrl())?>/tickets/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add Ticket"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($tickets)) {
+	?>
+	<div class="alert alert-info mb-3">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No tickets to display."))?>
+	</div>
+	<?php
+}
+?>

+ 66 - 0
views/customers.php

@@ -0,0 +1,66 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Customer[] $customers
+ */
+
+?>
+<div class="row mb-3">
+	<div class="col">
+		<h3><?=htmlspecialchars(__("Customers"))?></h3>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="/customers/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($customers)) {
+	?>
+	<div class="alert alert-info">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No customers to display."))?>
+	</div>
+	<?php
+}
+else {
+	?>
+	<table class="table table-bordered">
+		<thead>
+		<tr>
+			<th><?=htmlspecialchars(__("ID"))?></th>
+			<th><?=htmlspecialchars(__("Name"))?></th>
+			<th><?=htmlspecialchars(__("Actions"))?></th>
+		</tr>
+		</thead>
+		<tbody>
+		<?php
+		foreach($customers as $customer) {
+			?>
+			<tr>
+				<td class="text-end"><?=htmlspecialchars($customer->id)?></td>
+				<td>
+					<?=htmlspecialchars($customer->name)?>
+				</td>
+				<td class="p-1">
+					<a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($customer->getUrl())?>">
+						<?=htmlspecialchars(__("View"))?>
+					</a>
+					<a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($customer->getUrl())?>/update">
+						<?=htmlspecialchars(__("Update"))?>
+					</a>
+				</td>
+			</tr>
+			<?php
+		}
+		?>
+		</tbody>
+	</table>
+	<?php
+}
+

+ 6 - 0
views/dashboard.php

@@ -0,0 +1,6 @@
+<h3><?=htmlspecialchars(__("Dashboard"))?></h3>
+
+<div class="alert alert-warning">
+	<i class="fa fa-fw fa-info-circle"></i>
+	<?=htmlspecialchars(__("Coming soon..."))?>
+</div>

+ 170 - 0
views/entity_form.php

@@ -0,0 +1,170 @@
+<?php
+
+namespace App;
+
+/**
+ * @var string $title
+ * @var Company|Customer|Location|Supplier $model
+ * @var Address $address
+ */
+
+$core = Core::getInstance();
+$user = $core->getUser();
+
+$is_company = $model instanceof Company;
+$is_location = $model instanceof Location;
+
+?>
+<h3><?=htmlspecialchars($title)?></h3>
+
+<form method="post">
+
+	<?php
+	$user->insertCsrfToken();
+	?>
+
+	<div class="row">
+		<div class="col-lg">
+
+			<?php
+			if($is_location) {
+				$customers = Customer::getAll();
+				?>
+				<div class="mb-3">
+					<label for="customer-id"><?=htmlspecialchars(__("Customer"))?></label>
+					<select class="form-select" name="customer_id" id="customer-id" required>
+						<option value=""><?=htmlspecialchars(__("Select Customer"))?></option>
+						<?php
+						foreach($customers as $customer) {
+							?>
+							<option value="<?=$customer->id?>" <?=Html::selected($customer->id, $model->customer_id)?>>
+								<?=htmlspecialchars($customer->name)?>
+							</option>
+							<?php
+						}
+						?>
+					</select>
+				</div>
+				<?php
+			}
+			?>
+
+			<div class="mb-3">
+				<label for="name"><?=htmlspecialchars(__("Name"))?></label>
+				<input class="form-control" type="text" id="name" name="name" placeholder="<?=htmlspecialchars(__("Type name"))?>" value="<?=htmlspecialchars($model->name)?>" required />
+			</div>
+
+			<div class="row">
+				<div class="col-6">
+					<div class="mb-3">
+						<label for="phone"><?=htmlspecialchars(__("Phone"))?></label>
+						<input class="form-control" type="tel" id="phone" name="phone" placeholder="<?=htmlspecialchars(__("Type phone"))?>" value="<?=htmlspecialchars($model->phone)?>" />
+					</div>
+				</div>
+				<div class="col-6">
+					<div class="mb-3">
+						<label for="fax"><?=htmlspecialchars(__("Fax"))?></label>
+						<input class="form-control" type="tel" id="fax" name="fax" placeholder="<?=htmlspecialchars(__("Type fax"))?>" value="<?=htmlspecialchars($model->fax)?>" />
+					</div>
+				</div>
+			</div>
+
+			<div class="mb-3">
+				<label for="email"><?=htmlspecialchars(__("Email"))?></label>
+				<input class="form-control" type="email" id="email" name="email" placeholder="<?=htmlspecialchars(__("Type email"))?>" value="<?=htmlspecialchars($model->email)?>" />
+			</div>
+
+			<?php
+			if($is_company) {
+				?>
+				<div class="row">
+					<div class="col-6">
+						<div class="mb-3">
+							<label for="company-number"><?=htmlspecialchars(__("Company Number"))?></label>
+							<input class="form-control" type="text" id="company-number" name="company_number" placeholder="<?=htmlspecialchars(__("Type company number"))?>" value="<?=htmlspecialchars($model->company_number)?>" />
+						</div>
+					</div>
+					<div class="col-6">
+						<div class="mb-3">
+							<label for="vat-number"><?=htmlspecialchars(__("VAT Number"))?></label>
+							<input class="form-control" type="tel" id="vat-number" name="vat_number" placeholder="<?=htmlspecialchars(__("Type VAT number"))?>" value="<?=htmlspecialchars($model->vat_number)?>" />
+						</div>
+					</div>
+				</div>
+				<?php
+			}
+			?>
+
+		</div>
+		<div class="col-lg">
+			<?php
+			View::include("components/address_fields", ["address" => $address]);
+			?>
+		</div>
+	</div>
+
+	<?php
+	if($is_company) {
+		?>
+		<hr />
+
+		<div class="row">
+			<?php
+			foreach(Currency::options() as $value => $display) {
+				$bank_details = $model->getBankDetailsForCurrency($value);
+				?>
+				<div class="col-lg">
+					<input type="hidden" name="currencies[]" value="<?=$value?>" />
+					<h4><?=htmlspecialchars(__("%s Bank Details", $value))?></h4>
+
+					<div class="mb-3">
+						<label for="<?=$value?>-bank-name"><?=htmlspecialchars(__("Bank Name"))?></label>
+						<input class="form-control" type="text" id="<?=$value?>-bank-name" name="bank_names[]" value="<?=htmlspecialchars($bank_details->bank_name)?>" placeholder="<?=htmlspecialchars(__("Type bank name"))?>" />
+					</div>
+					<div class="mb-3">
+						<label for="<?=$value?>-bank-address"><?=htmlspecialchars(__("Bank Address"))?></label>
+						<input class="form-control" type="text" id="<?=$value?>-bank-address" name="bank_addresses[]" value="<?=htmlspecialchars($bank_details->bank_address)?>" placeholder="<?=htmlspecialchars(__("Type bank address"))?>" />
+					</div>
+
+					<div class="row">
+						<div class="col-6">
+							<div class="mb-3">
+								<label for="<?=$value?>-bank-sort-code"><?=htmlspecialchars(__("Sort Code"))?></label>
+								<input class="form-control" type="text" id="<?=$value?>-bank-sort-code" name="bank_sort_codes[]" value="<?=htmlspecialchars($bank_details->bank_sort_code)?>" placeholder="<?=htmlspecialchars(__("Type sort code"))?>" />
+							</div>
+						</div>
+						<div class="col-6">
+							<div class="mb-3">
+								<label for="<?=$value?>-bank-account-name"><?=htmlspecialchars(__("Account Name"))?></label>
+								<input class="form-control" type="text" id="<?=$value?>-bank-account-name" name="bank_account_names[]" value="<?=htmlspecialchars($bank_details->bank_account_name)?>" placeholder="<?=htmlspecialchars(__("Type account name"))?>" />
+							</div>
+						</div>
+						<div class="col-6">
+							<div class="mb-3">
+								<label for="<?=$value?>-bank-account-number"><?=htmlspecialchars(__("Account Number"))?></label>
+								<input class="form-control" type="text" id="<?=$value?>-bank-account-number" name="bank_account_numbers[]" value="<?=htmlspecialchars($bank_details->bank_account_number)?>" placeholder="<?=htmlspecialchars(__("Type account number"))?>" />
+							</div>
+						</div>
+						<div class="col-6">
+							<div class="mb-3">
+								<label for="<?=$value?>-bank-account-iban"><?=htmlspecialchars(__("IBAN"))?></label>
+								<input class="form-control" type="text" id="<?=$value?>-bank-account-iban" name="bank_account_ibans[]" value="<?=htmlspecialchars($bank_details->bank_account_iban)?>" placeholder="<?=htmlspecialchars(__("Type IBAN"))?>" />
+							</div>
+						</div>
+					</div>
+				</div>
+				<?php
+			}
+			?>
+		</div>
+		<?php
+	}
+	?>
+
+	<div class="mb-3">
+		<button class="btn btn-primary" type="submit" name="submit" value="1">
+			<?=htmlspecialchars(__("Submit"))?>
+		</button>
+	</div>
+
+</form>

+ 9 - 0
views/error.php

@@ -0,0 +1,9 @@
+<?php
+/**
+ * @var string $message
+ */
+?>
+<div class="alert alert-danger">
+	<i class="fa fa-fw fa-exclamation-circle"></i>
+	<?=htmlspecialchars($message)?>
+</div>

+ 13 - 0
views/footer.php

@@ -0,0 +1,13 @@
+			</div>
+		</div>
+		<footer>
+			<?php
+			if(!empty($_ENV["GOOGLE_API_KEY"])) {
+				?>
+				<input type="hidden" id="google-api-key" value="<?=htmlspecialchars($_ENV["GOOGLE_API_KEY"])?>" />
+				<?php
+			}
+			?>
+		</footer>
+	</body>
+</html>

+ 108 - 0
views/header.php

@@ -0,0 +1,108 @@
+<?php
+namespace App;
+
+$core = Core::getInstance();
+$user = $core->getUser();
+
+$google_api_key = $_ENV["GOOGLE_API_KEY"] ?? null;
+
+?>
+<!doctype html>
+<html lang="en">
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport"
+		  content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+	<meta http-equiv="X-UA-Compatible" content="ie=edge">
+	<title><?=htmlspecialchars($core->getSiteName())?></title>
+
+	<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
+	<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
+	<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
+	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
+	<?php
+	if($google_api_key) {
+		?>
+		<script src="https://maps.googleapis.com/maps/api/js?key=<?=htmlspecialchars($google_api_key)?>"></script>
+		<?php
+	}
+	?>
+
+	<script src="/js/app.js"></script>
+
+	<style>
+		input:invalid, select:invalid {
+			border: 1px solid red;
+		}
+		:root {
+            --bs-body-font-size: 0.8rem;
+		}
+	</style>
+
+</head>
+<body>
+
+	<div class="p-3">
+		<h3><?=htmlspecialchars($core->getSiteName())?></h3>
+	</div>
+
+
+	<div class="row mx-2">
+		<div class="col-sm-3 col-lg-2 order-2 order-sm-1" id="left-menu">
+
+			<?php
+			if(!$user) {
+				?>
+				<section class="mb-3 bg-light rounded p-2">
+					<h6><?=htmlspecialchars(__("CRM"))?></h6>
+
+					<div><a href="/home"><?=htmlspecialchars(__("Log In"))?></a></div>
+				</section>
+				<?php
+			}
+			else {
+				?>
+				<div class="card mb-3">
+					<div class="card-header">
+						<?=htmlspecialchars(__("CRM"))?>
+					</div>
+					<div class="list-group list-group-flush">
+						<a class="list-group-item list-group-item-action" href="/dashboard"><?=htmlspecialchars(__("Dashboard"))?></a>
+						<a class="list-group-item list-group-item-action" href="/customers"><?=htmlspecialchars(__("Customers"))?></a>
+						<a class="list-group-item list-group-item-action" href="/locations"><?=htmlspecialchars(__("Locations"))?></a>
+
+						<a class="list-group-item list-group-item-action" href="/suppliers"><?=htmlspecialchars(__("Suppliers"))?></a>
+						<a class="list-group-item list-group-item-action" href="/products"><?=htmlspecialchars(__("Products"))?></a>
+						<a class="list-group-item list-group-item-action" href="/sales"><?=htmlspecialchars(__("Sales"))?></a>
+						<a class="list-group-item list-group-item-action" href="/tickets"><?=htmlspecialchars(__("Tickets"))?></a>
+
+						<a class="list-group-item list-group-item-action" href="/companies"><?=htmlspecialchars(__("Companies"))?></a>
+					</div>
+				</div>
+
+				<div class="card mb-3">
+					<div class="card-header">
+						<?=htmlspecialchars(__("Admin"))?>
+					</div>
+					<div class="list-group list-group-flush">
+						<a class="list-group-item list-group-item-action" href="/users"><?=htmlspecialchars(__("Users"))?></a>
+					</div>
+				</div>
+
+				<div class="card mb-3">
+					<div class="card-header">
+						<?=htmlspecialchars(__("User"))?>
+					</div>
+					<div class="list-group list-group-flush">
+						<a class="list-group-item list-group-item-action" href="/settings"><?=htmlspecialchars(__("Settings"))?></a>
+						<a class="list-group-item list-group-item-action" href="/log-out"><?=htmlspecialchars(__("Log Out"))?></a>
+					</div>
+				</div>
+				<?php
+			}
+			?>
+		</div>
+		<div class="col-sm order-1 order-sm-2">
+			<?php
+			View::include("components/breadcrumbs");
+			View::include("components/alerts");

+ 25 - 0
views/home.php

@@ -0,0 +1,25 @@
+<h2><?=htmlspecialchars(__("Log In"))?></h2>
+
+<form method="post">
+
+	<div class="mb-3">
+		<label for="email"><?=htmlspecialchars(__("Email address"))?></label>
+		<input class="form-control" type="email" id="email" name="email" placeholder="<?=htmlspecialchars(__("Type email address"))?>" required />
+	</div>
+
+	<div class="mb-3">
+		<label for="password"><?=htmlspecialchars(__("Password"))?></label>
+		<input class="form-control" type="password" id="password" name="password" placeholder="<?=htmlspecialchars(__("Type password"))?>" required />
+	</div>
+
+	<div class="mb-3">
+		<button class="btn btn-primary" type="submit">
+			<?=htmlspecialchars(__("Log In"))?>
+		</button>
+
+		<a class="btn btn-secondary" href="/reset-password">
+			<?=htmlspecialchars(__("Forgot Password"))?>
+		</a>
+	</div>
+
+</form>

+ 33 - 0
views/locations.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Location[] $locations
+ */
+
+?>
+<div class="row mb-2">
+	<div class="col">
+		<h3><?=htmlspecialchars(__("Locations"))?></h3>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="/locations/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($locations)) {
+	?>
+	<div class="alert alert-info">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No locations to display."))?>
+	</div>
+	<?php
+}
+else {
+	View::include("locations_table", compact("locations"));
+}

+ 44 - 0
views/locations_table.php

@@ -0,0 +1,44 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+/**
+ * @var Location[] $locations
+ */
+
+?>
+<table class="table table-bordered">
+	<thead>
+	<tr>
+		<th><?=htmlspecialchars(__("ID"))?></th>
+		<th><?=htmlspecialchars(__("Customer"))?></th>
+		<th><?=htmlspecialchars(__("Name"))?></th>
+		<th><?=htmlspecialchars(__("Actions"))?></th>
+	</tr>
+	</thead>
+	<tbody>
+	<?php
+	foreach($locations as $location) {
+		$customer = $location->getCustomer();
+		?>
+		<tr>
+			<td class="text-end"><?=$location->id?></td>
+			<td>
+				<a href="<?=htmlspecialchars($customer->getUrl())?>">
+					<?=htmlspecialchars($customer->name)?>
+				</a>
+			</td>
+			<td>
+				<?=htmlspecialchars($location->name)?>
+			</td>
+			<td class="p-1">
+				<a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($location->getUrl())?>/update">
+					<?=htmlspecialchars(__("Update"))?>
+				</a>
+			</td>
+		</tr>
+		<?php
+	}
+	?>
+	</tbody>
+</table>

+ 43 - 0
views/product.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Product $product
+ */
+
+$supplier = $product->getSupplier();
+
+?>
+<div class="row mb-2">
+	<div class="col">
+		<h3>
+			<?=htmlspecialchars($product->name)?>
+		</h3>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-primary" href="<?=htmlspecialchars($product->getUrl())?>/update">
+			<i class="fa fa-fw fa-pencil"></i>
+			<?=htmlspecialchars(__("Update"))?>
+		</a>
+	</div>
+</div>
+
+<h4><?=htmlspecialchars(__("Details"))?></h4>
+
+<div class="list-group">
+	<div class="list-group-item d-flex justify-content-between">
+		<strong><?=htmlspecialchars(__("Supplier"))?></strong>
+		<a href="<?=htmlspecialchars($supplier->getUrl())?>">
+			<?=htmlspecialchars($supplier->name)?>
+		</a>
+	</div>
+	<div class="list-group-item d-flex justify-content-between">
+		<strong><?=htmlspecialchars(__("Type"))?></strong>
+		<?=htmlspecialchars($product->getDisplayType())?>
+	</div>
+	<div class="list-group-item d-flex justify-content-between">
+		<strong><?=htmlspecialchars(__("Price"))?></strong>
+		<?=htmlspecialchars($product->getDisplayPrice())?>
+	</div>
+</div>

+ 76 - 0
views/product_form.php

@@ -0,0 +1,76 @@
+<?php
+
+namespace App;
+
+/**
+ * @var string $title
+ * @var Product $product
+ */
+
+$core = Core::getInstance();
+$user = $core->getUser();
+
+$suppliers = Supplier::getAll();
+
+?>
+<h3><?=htmlspecialchars($title)?></h3>
+
+<form method="post">
+	<?php
+	$user->insertCsrfToken();
+	?>
+
+	<div class="mb-3">
+		<label for="supplier-id"><?=htmlspecialchars(__("Supplier"))?></label>
+		<select class="form-select" name="supplier_id" id="supplier-id">
+			<option value=""><?=htmlspecialchars(__("Select Supplier"))?></option>
+			<?php
+			foreach($suppliers as $supplier) {
+				?>
+				<option value="<?=$supplier->id?>" <?=Html::selected($supplier->id, $product->supplier_id)?>>
+					<?=htmlspecialchars($supplier->name)?>
+				</option>
+				<?php
+			}
+			?>
+		</select>
+	</div>
+
+	<div class="mb-3">
+		<label for="name"><?=htmlspecialchars(__("Name"))?></label>
+		<input class="form-control" type="text" id="name" name="name" placeholder="<?=htmlspecialchars(__("Type name"))?>" value="<?=htmlspecialchars($product->name)?>" maxlength="255" required />
+	</div>
+
+	<div class="row">
+		<div class="col-6">
+			<div class="mb-3">
+				<label for="type"><?=htmlspecialchars(__("Type"))?></label>
+				<select class="form-select" name="type" id="type" required>
+					<?php
+					foreach(Product::getTypeOptions() as $value => $display) {
+						?>
+						<option value="<?=$value?>" <?=Html::selected($value, $product->type)?>>
+							<?=htmlspecialchars($display)?>
+						</option>
+						<?php
+					}
+					?>
+				</select>
+			</div>
+		</div>
+		<div class="col-6">
+			<div class="mb-3">
+				<label for="price"><?=htmlspecialchars(__("Price"))?></label>
+				<input class="form-control" type="number" id="price" name="price" placeholder="<?=htmlspecialchars(__("Type price"))?>" value="<?=htmlspecialchars($product->price)?>" min="0" max="999999.99" step="any" required />
+			</div>
+		</div>
+	</div>
+
+	<div class="mb-3">
+		<button class="btn btn-primary" type="submit" name="submit" value="1">
+			<?=htmlspecialchars(__("Submit"))?>
+		</button>
+	</div>
+
+</form>
+

+ 79 - 0
views/products.php

@@ -0,0 +1,79 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Product[] $products
+ */
+
+?>
+<div class="row mb-2">
+	<div class="col">
+		<h3><?=htmlspecialchars(__("Products"))?></h3>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="/products/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($products)) {
+	?>
+	<div class="alert alert-info">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No products to display."))?>
+	</div>
+	<?php
+}
+else {
+	?>
+	<table class="table table-bordered">
+		<thead>
+		<tr>
+			<th><?=htmlspecialchars(__("ID"))?></th>
+			<th><?=htmlspecialchars(__("Supplier"))?></th>
+			<th><?=htmlspecialchars(__("Name"))?></th>
+			<th><?=htmlspecialchars(__("Type"))?></th>
+			<th><?=htmlspecialchars(__("Price"))?></th>
+			<th><?=htmlspecialchars(__("Actions"))?></th>
+		</tr>
+		</thead>
+		<tbody>
+		<?php
+		foreach($products as $product) {
+			$supplier = $product->getSupplier();
+			?>
+			<tr>
+				<td class="text-end">
+					<?=$product->id?>
+				</td>
+				<td>
+					<a href="<?=htmlspecialchars($supplier->getUrl())?>">
+						<?=htmlspecialchars($supplier->name)?>
+					</a>
+				</td>
+				<td>
+					<?=htmlspecialchars($product->name)?>
+				</td>
+				<td>
+					<?=htmlspecialchars($product->getDisplayType())?>
+				</td>
+				<td class="text-end">
+					<?=htmlspecialchars($product->getDisplayPrice())?>
+				</td>
+				<td class="p-1">
+					<a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($product->getUrl())?>/update">
+						<?=htmlspecialchars(__("Update"))?>
+					</a>
+				</td>
+			</tr>
+			<?php
+		}
+		?>
+		</tbody>
+	</table>
+	<?php
+}

+ 9 - 0
views/reset_password.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace App;
+
+?>
+<div class="alert alert-warning">
+	<i class="fa fa-fw fa-info-circle"></i>
+	<?=htmlspecialchars(__("Coming soon..."))?>
+</div>

+ 9 - 0
views/sales.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace App;
+
+?>
+<div class="alert alert-warning">
+	<i class="fa fa-fw fa-info-circle"></i>
+	<?=htmlspecialchars(__("Coming soon..."))?>
+</div>

+ 63 - 0
views/settings.php

@@ -0,0 +1,63 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+/**
+ * @var string $title
+ * @var User $user
+ */
+
+$core = Core::getInstance();
+
+?>
+
+<form method="post">
+	<?php
+	$core->getUser()->insertCsrfToken();
+	?>
+	<div class="row">
+		<div class="col-6 col-sm-3">
+			<div class="mb-3">
+				<label for="title"><?=htmlspecialchars(__("Title"))?></label>
+				<select class="form-select" name="title" id="title">
+					<?php
+					foreach(User::getTitleOptions() as $value) {
+						?>
+						<option value="<?=htmlspecialchars($value)?>" <?=Html::selected($value, $user->title)?>>
+							<?=htmlspecialchars($value)?>
+						</option>
+						<?php
+					}
+					?>
+				</select>
+			</div>
+		</div>
+	</div>
+
+	<div class="row">
+		<div class="col-6">
+			<div class="mb-3">
+				<label for="first-name"><?=htmlspecialchars(__("First Name"))?></label>
+				<input class="form-control" type="text" id="first-name" name="first_name" placeholder="<?=htmlspecialchars(__("Type first name"))?>" value="<?=htmlspecialchars($user->first_name)?>" required />
+			</div>
+		</div>
+		<div class="col-6">
+			<div class="mb-3">
+				<label for="last-name"><?=htmlspecialchars(__("Last Name"))?></label>
+				<input class="form-control" type="text" id="last-name" name="last_name" placeholder="<?=htmlspecialchars(__("Type last name"))?>" value="<?=htmlspecialchars($user->last_name)?>" required />
+			</div>
+		</div>
+	</div>
+
+	<div class="mb-3">
+		<label for="email"><?=htmlspecialchars(__("Email Address"))?></label>
+		<input class="form-control" type="email" id="email" name="email" placeholder="<?=htmlspecialchars(__("Type email address"))?>" value="<?=htmlspecialchars($user->email)?>" required />
+	</div>
+	<div class="mb-3">
+		<label for="password"><?=htmlspecialchars(__("Password"))?></label>
+		<input class="form-control" type="password" id="password" name="password" placeholder="<?=htmlspecialchars(__("Type password"))?>" autocomplete="new-password" />
+	</div>
+	<button class="btn btn-primary" type="submit" name="submit" value="1">
+		<?=htmlspecialchars(__("Submit"))?>
+	</button>
+</form>

+ 68 - 0
views/setup.php

@@ -0,0 +1,68 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+use ParagonIE\AntiCSRF\AntiCSRF;
+
+$csrf = new AntiCSRF();
+
+?>
+<div style="max-width: 640px; margin: 0 auto;">
+
+	<h3><?=htmlspecialchars(__("Setup"))?></h3>
+
+	<form method="post">
+		<?php
+		$csrf->insertToken();
+		?>
+		<div class="row">
+			<div class="col-6 col-sm-3">
+				<div class="mb-3">
+					<label for="title"><?=htmlspecialchars(__("Title"))?></label>
+					<select class="form-select" name="title" id="title">
+						<?php
+						foreach(User::getTitleOptions() as $value) {
+							?>
+							<option value="<?=htmlspecialchars($value)?>">
+								<?=htmlspecialchars($value)?>
+							</option>
+							<?php
+						}
+						?>
+					</select>
+				</div>
+			</div>
+		</div>
+
+		<div class="row">
+			<div class="col-6">
+				<div class="mb-3">
+					<label for="first-name"><?=htmlspecialchars(__("First Name"))?></label>
+					<input class="form-control" type="text" id="first-name" name="first_name" placeholder="<?=htmlspecialchars(__("Type first name"))?>" required />
+				</div>
+			</div>
+			<div class="col-6">
+				<div class="mb-3">
+					<label for="last-name"><?=htmlspecialchars(__("Last Name"))?></label>
+					<input class="form-control" type="text" id="last-name" name="last_name" placeholder="<?=htmlspecialchars(__("Type last name"))?>" required />
+				</div>
+			</div>
+		</div>
+
+		<div class="mb-3">
+			<label for="email"><?=htmlspecialchars(__("Email Address"))?></label>
+			<input class="form-control" type="email" id="email" name="email" placeholder="<?=htmlspecialchars(__("Type email address"))?>" required />
+		</div>
+		<div class="mb-3">
+			<label for="password"><?=htmlspecialchars(__("Password"))?></label>
+			<input class="form-control" type="password" id="password" name="password" placeholder="<?=htmlspecialchars(__("Type password"))?>" autocomplete="new-password" required />
+		</div>
+		<div class="mb-3">
+			<label for="confirm-password"><?=htmlspecialchars(__("Confirm Password"))?></label>
+			<input class="form-control" type="password" id="confirm-password" name="confirm_password" placeholder="<?=htmlspecialchars(__("Confirm password"))?>" autocomplete="new-password" required />
+		</div>
+		<button class="btn btn-primary" type="submit">
+			<?=htmlspecialchars(__("Setup"))?>
+		</button>
+	</form>
+</div>

+ 35 - 0
views/supplier.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Supplier $supplier
+ */
+
+$products = [];
+
+?>
+
+<h3><?=htmlspecialchars($supplier->name)?></h3>
+
+<div class="row mb-2">
+	<div class="col">
+		<h4><?=htmlspecialchars(__("Products"))?></h4>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-primary" href="<?=htmlspecialchars($supplier->getUrl())?>/products/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($products)) {
+	?>
+	<div class="alert alert-info mb-3">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No products to display."))?>
+	</div>
+	<?php
+}

+ 66 - 0
views/suppliers.php

@@ -0,0 +1,66 @@
+<?php
+
+namespace App;
+
+/**
+ * @var Supplier[] $suppliers
+ */
+
+?>
+<div class="row mb-3">
+	<div class="col">
+		<h3><?=htmlspecialchars(__("Suppliers"))?></h3>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="/suppliers/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($suppliers)) {
+	?>
+	<div class="alert alert-info">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No suppliers to display."))?>
+	</div>
+	<?php
+}
+else {
+	?>
+	<table class="table table-bordered">
+		<thead>
+		<tr>
+			<th><?=htmlspecialchars(__("ID"))?></th>
+			<th><?=htmlspecialchars(__("Name"))?></th>
+			<th><?=htmlspecialchars(__("Actions"))?></th>
+		</tr>
+		</thead>
+		<tbody>
+		<?php
+		foreach($suppliers as $supplier) {
+			?>
+			<tr>
+				<td class="text-end"><?=htmlspecialchars($supplier->id)?></td>
+				<td>
+					<?=htmlspecialchars($supplier->name)?>
+				</td>
+				<td class="p-1">
+					<a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($supplier->getUrl())?>">
+						<?=htmlspecialchars(__("View"))?>
+					</a>
+					<a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($supplier->getUrl())?>/update">
+						<?=htmlspecialchars(__("Update"))?>
+					</a>
+				</td>
+			</tr>
+			<?php
+		}
+		?>
+		</tbody>
+	</table>
+	<?php
+}
+

+ 9 - 0
views/tickets.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace App;
+
+?>
+<div class="alert alert-warning">
+	<i class="fa fa-fw fa-info-circle"></i>
+	<?=htmlspecialchars(__("Coming soon..."))?>
+</div>

+ 69 - 0
views/user_form.php

@@ -0,0 +1,69 @@
+<?php /** @noinspection PhpUnhandledExceptionInspection */
+
+namespace App;
+
+/**
+ * @var string $title
+ * @var User $user
+ */
+
+$core = Core::getInstance();
+
+?>
+
+<form method="post">
+	<?php
+	$core->getUser()->insertCsrfToken();
+	?>
+	<div class="row">
+		<div class="col-6 col-sm-3">
+			<div class="mb-3">
+				<label for="title"><?=htmlspecialchars(__("Title"))?></label>
+				<select class="form-select" name="title" id="title">
+					<?php
+					foreach(User::getTitleOptions() as $value) {
+						?>
+						<option value="<?=htmlspecialchars($value)?>" <?=Html::selected($value, $user->title)?>>
+							<?=htmlspecialchars($value)?>
+						</option>
+						<?php
+					}
+					?>
+				</select>
+			</div>
+		</div>
+	</div>
+
+	<div class="row">
+		<div class="col-6">
+			<div class="mb-3">
+				<label for="first-name"><?=htmlspecialchars(__("First Name"))?></label>
+				<input class="form-control" type="text" id="first-name" name="first_name" placeholder="<?=htmlspecialchars(__("Type first name"))?>" value="<?=htmlspecialchars($user->first_name)?>" required />
+			</div>
+		</div>
+		<div class="col-6">
+			<div class="mb-3">
+				<label for="last-name"><?=htmlspecialchars(__("Last Name"))?></label>
+				<input class="form-control" type="text" id="last-name" name="last_name" placeholder="<?=htmlspecialchars(__("Type last name"))?>" value="<?=htmlspecialchars($user->last_name)?>" required />
+			</div>
+		</div>
+	</div>
+
+	<div class="mb-3">
+		<label for="email"><?=htmlspecialchars(__("Email Address"))?></label>
+		<input class="form-control" type="email" id="email" name="email" placeholder="<?=htmlspecialchars(__("Type email address"))?>" value="<?=htmlspecialchars($user->email)?>" required />
+	</div>
+	<div class="mb-3">
+		<label for="password"><?=htmlspecialchars(__("Password"))?></label>
+		<input class="form-control" type="password" id="password" name="password" placeholder="<?=htmlspecialchars(__("Type password"))?>" autocomplete="new-password" />
+	</div>
+	<div class="mb-3">
+		<div class="form-check form-switch">
+			<input class="form-check-input" type="checkbox" role="switch" id="admin" name="admin" value="1" <?=Html::checked($user->admin)?> />
+			<label class="form-check-label" for="admin"><?=htmlspecialchars(__("Super-Admin"))?></label>
+		</div>
+	</div>
+	<button class="btn btn-primary" type="submit" name="submit" value="1">
+		<?=htmlspecialchars(__("Submit"))?>
+	</button>
+</form>

+ 64 - 0
views/users.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace App;
+
+/**
+ * @var User[] $users
+ */
+
+?>
+<div class="row mb-2">
+	<div class="col">
+		<h3><?=htmlspecialchars(__("Users"))?></h3>
+	</div>
+	<div class="col-auto">
+		<a class="btn btn-success" href="/users/add">
+			<i class="fa fa-fw fa-plus"></i>
+			<?=htmlspecialchars(__("Add"))?>
+		</a>
+	</div>
+</div>
+
+<?php
+if(empty($users)) {
+	?>
+	<div class="alert alert-info">
+		<i class="fa fa-fw fa-info-circle"></i>
+		<?=htmlspecialchars(__("No users to display."))?>
+	</div>
+	<?php
+}
+else {
+	?>
+	<table class="table table-bordered">
+		<thead>
+		<tr>
+			<th><?=htmlspecialchars(__("ID"))?></th>
+			<th><?=htmlspecialchars(__("Email"))?></th>
+			<th><?=htmlspecialchars(__("Actions"))?></th>
+		</tr>
+		</thead>
+		<tbody>
+		<?php
+		foreach($users as $user) {
+			?>
+			<tr>
+				<td class="text-end">
+					<?=$user->id?>
+				</td>
+				<td>
+					<?=htmlspecialchars($user->email)?>
+				</td>
+				<td class="p-1">
+					<a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($user->getUrl())?>/update">
+						<?=htmlspecialchars(__("Update"))?>
+					</a>
+				</td>
+			</tr>
+			<?php
+		}
+		?>
+		</tbody>
+	</table>
+	<?php
+}