From f9b93c4bbb23b452551bd46ce86cc6e3602fd594 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Fri, 26 Apr 2024 10:06:03 +0200 Subject: Begin web app frontend in PHP. While I'd like a command line client for retreiving information and scripting stuff based on the db contents, a web app is convenient for the less common stuff like adding and editing data. The web app could also have been done in rust, however, I feel php is so convenient for simple web stuff that I think it makes more sense this way. --- .ddev/config.yaml | 2 +- .editorconfig | 3 +++ web/client/index.php | 43 +++++++++++++++++++++++++++++++++++++++++++ web/clients/index.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ web/faktura.php | 11 +++++++++++ web/include/api.php | 31 +++++++++++++++++++++++++++++++ web/include/misc.php | 36 ++++++++++++++++++++++++++++++++++++ web/index.php | 2 ++ 8 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 web/client/index.php create mode 100644 web/clients/index.php create mode 100644 web/faktura.php create mode 100644 web/include/api.php create mode 100644 web/include/misc.php create mode 100644 web/index.php diff --git a/.ddev/config.yaml b/.ddev/config.yaml index 20b7d2f..84dd754 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -5,7 +5,7 @@ name: faktura type: php -docroot: "" +docroot: "web" php_version: "8.1" webserver_type: nginx-fpm xdebug_enabled: false diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7198dbf --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*.php] +indent_style=tab +indent_size=4 diff --git a/web/client/index.php b/web/client/index.php new file mode 100644 index 0000000..c89bde1 --- /dev/null +++ b/web/client/index.php @@ -0,0 +1,43 @@ + + + + faktura: client + + +

name); ?>

+ + + + + + + + + + + + + + + + + + + + + + diff --git a/web/clients/index.php b/web/clients/index.php new file mode 100644 index 0000000..4725b17 --- /dev/null +++ b/web/clients/index.php @@ -0,0 +1,45 @@ + + + + faktura: clients + + +

Clients

+
Contact:contact); ?>
Email:email); ?>
phone: + phone); ?>
Address:address); ?>
VAT:vat ? 'Yes' : 'No'; ?>
+ + + + + + + + + + + + + + + + + + +
#NameContactEmailPhoneVAT
id); ?> + + name); ?> + + contact); ?>email); ?>phone); ?>vat ? 'X' : ''); ?>
+ diff --git a/web/faktura.php b/web/faktura.php new file mode 100644 index 0000000..455f5f9 --- /dev/null +++ b/web/faktura.php @@ -0,0 +1,11 @@ +