From 876e0e5ef7cf6da1948319a221463485e6b51e8d Mon Sep 17 00:00:00 2001 From: Banana Date: Sun, 18 Sep 2022 19:06:37 +0200 Subject: [PATCH] item creation --- webroot/lib/item.class.php | 14 +++++++--- webroot/view/_menu.php | 2 +- .../view/{entry/entry.html => item/item.html} | 26 +++++++++---------- .../view/{entry/entry.php => item/item.php} | 2 ++ 4 files changed, 27 insertions(+), 17 deletions(-) rename webroot/view/{entry/entry.html => item/item.html} (78%) rename webroot/view/{entry/entry.php => item/item.php} (97%) diff --git a/webroot/lib/item.class.php b/webroot/lib/item.class.php index 4838cbe..fc06771 100644 --- a/webroot/lib/item.class.php +++ b/webroot/lib/item.class.php @@ -24,14 +24,14 @@ class Item { * * @var mysqli */ - private $_DB; + private mysqli $_DB; /** * The data for this item * * @var array */ - private $_data; + private array $_data; /** * @param mysqli $databaseConnectionObject @@ -39,4 +39,12 @@ class Item { public function __construct(mysqli $databaseConnectionObject) { $this->_DB = $databaseConnectionObject; } -} \ No newline at end of file + + public function create(array $data): string { + $ret = ""; + + + + return $ret; + } +} diff --git a/webroot/view/_menu.php b/webroot/view/_menu.php index d356180..d491c4b 100644 --- a/webroot/view/_menu.php +++ b/webroot/view/_menu.php @@ -1,5 +1,5 @@ diff --git a/webroot/view/entry/entry.html b/webroot/view/item/item.html similarity index 78% rename from webroot/view/entry/entry.html rename to webroot/view/item/item.html index ac61228..729a382 100644 --- a/webroot/view/entry/entry.html +++ b/webroot/view/item/item.html @@ -1,35 +1,35 @@ -
+
- - Receipt* Just leave it blank to create a new based on data and market name. + - - Date and time* + - - Market* + - - Product* + - - Manufacturer* + @@ -44,8 +44,8 @@ - - Price* + diff --git a/webroot/view/entry/entry.php b/webroot/view/item/item.php similarity index 97% rename from webroot/view/entry/entry.php rename to webroot/view/item/item.php index 0cf5b3b..930332f 100644 --- a/webroot/view/entry/entry.php +++ b/webroot/view/item/item.php @@ -22,6 +22,8 @@ if(isset($_POST['fdata']) && !empty($_POST['fdata']) && isset($_POST['submitForm $fdata = $_POST['fdata']; if (!empty($fdata)) { + var_dump($fdata); + } else { $TemplateData['message']['content'] = "Collection could not be loaded."; $TemplateData['message']['status'] = "error"; -- 2.39.5