From aef1114c62923bb586ee05c0167f73dc8137b9ee Mon Sep 17 00:00:00 2001 From: Tom Rust <48125478+tomrusteze@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:30:37 +0100 Subject: [PATCH] Add Foreign Key awareness and much more (#64) * Add columns comments * Add tooltips with comments * Change to local css * Update README.md * Update Readme * Update readme * Use the SQL COUNT(*) function to count records * Fix deprecated warning * Order by first column ASC on default * Add view, edit and delete buttons * Fix update and insert statement and show errors * add error function * Allow empty values for columns * Display nullable columns * Fix booleans and support null * Show columns and null to the user * Format date and datetime * Link to foreign key parent * Handle SQL errors * Allow null for FK * Show references to the current item * Fix SQL injections * Rework references to current read * Remove unused error handling * Add back button and rework ordering * update readme * Add PHP formatter * Use safe variable names in SQL/PHP * Add new TODOs * More todos * Move domain name to config * Update readme * Generate enum select at generation * Show bools as True/False * Allow selecting columns for previewing records * Generate JOIN queries * Check for key uniqueness or redirect to the index * update helpers * Make read/edit/create layout easily adaptable * Add new layout * Move JS/CSS to the generator * Move JS to local storage * Make external columns searchable * Make header and footer sticky * Use textarea properly * Fix empty dates * Prepare for PR * Minor changes to improve usability --- .gitignore | 2 +- README.md | 2 +- core/columns.php | 63 +++++- core/generate.php | 494 +++++++++++++++++++++++++++++++++------------ core/helpers.php | 75 +++++-- core/relations.php | 2 + core/templates.php | 353 ++++++++++++++++---------------- 7 files changed, 664 insertions(+), 327 deletions(-) diff --git a/.gitignore b/.gitignore index d8517bd..6bd94b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -core/app/ +core/app/ \ No newline at end of file diff --git a/README.md b/README.md index 1cdbb4d..65ea872 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,4 @@ This is the startpage. For every selected table, Cruddiy has created 5 pages: In [![N|Cruddiy](https://j11g.com/cruddiy/bs4-cruddiy-app-index.png)](https://cruddiy.com) -You can rename or move the generated 'app' folder anywhere. It is completely self-contained. And you can delete Cruddiy, it is not needed anymore. Or you can can run it many more times (use the back button in the browser), until you get your pages just the way you like them. Each time it will overwrite your existing app. +You can rename or move the generated 'app' folder anywhere. It is completely self-contained. And you can delete Cruddiy, it is not needed anymore. Or you can can run it many more times (use the back button in the browser), until you get your pages just the way you like them. Each time it will overwrite your existing app. \ No newline at end of file diff --git a/core/columns.php b/core/columns.php index 624d305..23489c6 100644 --- a/core/columns.php +++ b/core/columns.php @@ -16,10 +16,15 @@