]> 91.132.146.200 Git - emere.git/commitdiff
tab cleanup
authorJohannes Keßler <johannes.kessler@bechtle.com>
Mon, 26 Sep 2022 11:38:21 +0000 (13:38 +0200)
committerJohannes Keßler <johannes.kessler@bechtle.com>
Mon, 26 Sep 2022 11:38:21 +0000 (13:38 +0200)
webroot/config/config.php.default
webroot/index.php
webroot/lib/item.class.php
webroot/lib/summoner.class.php
webroot/view/_foot.php
webroot/view/_head.php
webroot/view/_menu.php
webroot/view/_message.php
webroot/view/item/item.html
webroot/view/item/item.php

index f0247abc2fd1e8242e2d37bc56c24a36f0fcbe89..b0872a3b03bdb33f5c99d26bbe919700e960aff4 100644 (file)
@@ -34,7 +34,7 @@ const FE_LANG = "en";
 # path settings
 const PATH_ABSOLUTE = '/home/some/path/emere/';
 const PATH_LOGDIRECTORY = PATH_ABSOLUTE . '/log';
-const PATH_WEBROOT = '/';
+const PATH_WEBROOT = '/'; # please add a / at the end
 
 # database config
 const DB_HOST = '127.0.0.1';
index febe12b87eb21dbf8f67f9fb34b4762acf6367b2..6bef2018c851336f8ce597718ee4ed6f4c91662a 100644 (file)
@@ -60,14 +60,14 @@ $TemplateData = array();
 $_view = 'home';
 
 if(isset($_GET['p']) && Summoner::validate($_GET['p'], 'nospace')) {
-    $_view = trim($_GET['p']);
+       $_view = trim($_GET['p']);
 }
 
 require_once 'view/'.$_view.'/'.$_view.'.php';
 
 if(isset($TemplateData['refresh']) && !empty($TemplateData['refresh'])) {
-    header('Location: '.PATH_WEBROOT.$TemplateData['refresh']);
-    exit();
+       header('Location: '.PATH_WEBROOT.$TemplateData['refresh']);
+       exit();
 }
 
 # header information
index a71e42645e2f5bd744743bc2325e4b3b9eb2a1be..d9caebc1f2f02bcf389865a72cf6201d59d698d9 100644 (file)
 class Item {
 
        /**
-     * The DB object
-     *
-     * @var mysqli
-     */
-    private mysqli $_DB;
-
-    /**
-     * The data for this item
-     *
-     * @var array
-     */
-    private array $_data;
-
-    /**
-     * @param mysqli $databaseConnectionObject
-     */
-    public function __construct(mysqli $databaseConnectionObject) {
-        $this->_DB = $databaseConnectionObject;
-    }
+        * The DB object
+        *
+        * @var mysqli
+        */
+       private mysqli $_DB;
+
+       /**
+        * The data for this item
+        *
+        * @var array
+        */
+       private array $_data;
+
+       /**
+        * @param mysqli $databaseConnectionObject
+        */
+       public function __construct(mysqli $databaseConnectionObject) {
+               $this->_DB = $databaseConnectionObject;
+       }
 
        public function create(array $data): string {
                $ret = "";
index 4b23730cf4244c7e8d41ac2db61dd10e7212e686..deeba4c0b9bbc94e5e8507a9807c03bffd20a871 100644 (file)
  * A static helper class
  */
 class Summoner {
-    /**
-     * validate the given string with the given type. Optional check the string
-     * length
-     *
-     * @param string $input The string to check
-     * @param string $mode How the string should be checked
-     * @param string $limit If int given the string is checked for length
-     *
-     * @return bool
-     *
-     * @see http://de.php.net/manual/en/regexp.reference.unicode.php
-     * http://www.sql-und-xml.de/unicode-database/#pc
-     *
-     * the pattern replaces all that is allowed. the correct result after
-     * the replace should be empty, otherwise are there chars which are not
-     * allowed
-     */
-    static function validate(string $input, string $mode = 'text', string $limit = "0"): bool {
-        // check if we have input
-        $input = trim($input);
-
-        if($input == "") return false;
-
-        $ret = false;
-
-        switch ($mode) {
-            case 'mail':
-                if(filter_var($input,FILTER_VALIDATE_EMAIL) === $input) {
-                    return true;
-                }
-                else {
-                    return false;
-                }
-                break;
-
-            case 'url':
-                if(filter_var($input,FILTER_VALIDATE_URL) === $input) {
-                    return true;
-                }
-                else {
-                    return false;
-                }
+       /**
+        * validate the given string with the given type. Optional check the string
+        * length
+        *
+        * @param string $input The string to check
+        * @param string $mode How the string should be checked
+        * @param string $limit If int given the string is checked for length
+        *
+        * @return bool
+        *
+        * @see http://de.php.net/manual/en/regexp.reference.unicode.php
+        * http://www.sql-und-xml.de/unicode-database/#pc
+        *
+        * the pattern replaces all that is allowed. the correct result after
+        * the replace should be empty, otherwise are there chars which are not
+        * allowed
+        */
+       static function validate(string $input, string $mode = 'text', string $limit = "0"): bool {
+               // check if we have input
+               $input = trim($input);
+
+               if($input == "") return false;
+
+               $ret = false;
+
+               switch ($mode) {
+                       case 'mail':
+                               if(filter_var($input,FILTER_VALIDATE_EMAIL) === $input) {
+                                       return true;
+                               }
+                               else {
+                                       return false;
+                               }
+                               break;
+
+                       case 'url':
+                               if(filter_var($input,FILTER_VALIDATE_URL) === $input) {
+                                       return true;
+                               }
+                               else {
+                                       return false;
+                               }
                        break;
 
-            case 'nospace':
-                // text without any whitespace and special chars
-                $pattern = '/[\p{L}\p{N}]/u';
-                break;
-
-            case 'nospaceP':
-                // text without any whitespace and special chars
-                // but with Punctuation other
-                # http://www.sql-und-xml.de/unicode-database/po.html
-                $pattern = '/[\p{L}\p{N}\p{Po}\-]/u';
-                break;
-
-            case 'digit':
-                // only numbers and digit
-                // warning with negative numbers...
-                $pattern = '/[\p{N}\-]/';
-                break;
-
-            case 'pageTitle':
-                // text with whitespace and without special chars
-                // but with Punctuation
-                $pattern = '/[\p{L}\p{N}\p{Po}\p{Z}\s-]/u';
-                break;
-
-            # strange. the \p{M} is needed.. don't know why..
-            case 'filename':
-                $pattern = '/[\p{L}\p{N}\p{M}\-_\.\p{Zs}]/u';
-                break;
-
-            case 'shortlink':
-                // special char string based on https://www.jwz.org/base64-shortlinks/
-                $pattern = '/[\p{L}\p{N}\-_]/u';
-                break;
+                       case 'nospace':
+                               // text without any whitespace and special chars
+                               $pattern = '/[\p{L}\p{N}]/u';
+                               break;
+
+                       case 'nospaceP':
+                               // text without any whitespace and special chars
+                               // but with Punctuation other
+                               # http://www.sql-und-xml.de/unicode-database/po.html
+                               $pattern = '/[\p{L}\p{N}\p{Po}\-]/u';
+                               break;
+
+                       case 'digit':
+                               // only numbers and digit
+                               // warning with negative numbers...
+                               $pattern = '/[\p{N}\-]/';
+                               break;
+
+                       case 'pageTitle':
+                               // text with whitespace and without special chars
+                               // but with Punctuation
+                               $pattern = '/[\p{L}\p{N}\p{Po}\p{Z}\s-]/u';
+                               break;
+
+                       # strange. the \p{M} is needed.. don't know why..
+                       case 'filename':
+                               $pattern = '/[\p{L}\p{N}\p{M}\-_\.\p{Zs}]/u';
+                               break;
+
+                       case 'shortlink':
+                               // special char string based on https://www.jwz.org/base64-shortlinks/
+                               $pattern = '/[\p{L}\p{N}\-_]/u';
+                               break;
 
                        case 'datetime':
                                // based on the format eg. 2022-09-25T22:00
@@ -112,101 +112,101 @@ class Summoner {
 
 
                        case 'text':
-            default:
-                $pattern = '/[\p{L}\p{N}\p{P}\p{S}\p{Z}\p{M}\s]/u';
-        }
-
-        $value = preg_replace($pattern, '', $input);
-
-        if($value === "") {
-            $ret = true;
-        }
-
-        if(!empty($limit) && is_numeric($limit)) {
-            # isset starts with 0
-            if(isset($input[$limit])) {
-                # too long
-                $ret = false;
-            }
-        }
-
-        return $ret;
-    }
-
-    /**
-     * check if a string starts with a given string
-     *
-     * @param string $haystack
-     * @param string $needle
-     * @return boolean
-     */
-    static function startsWith(string $haystack, string $needle): bool {
-        $length = strlen($needle);
-        return (substr($haystack, 0, $length) === $needle);
-    }
-
-    /**
-     * check if a string ends with a given string
-     *
-     * @param string $haystack
-     * @param string $needle
-     * @return boolean
-     */
-    static function endsWith(string $haystack, string $needle): bool {
-        $length = strlen($needle);
-        if ($length == 0) {
-            return true;
-        }
-
-        return (substr($haystack, -$length) === $needle);
-    }
-
-
-    /**
-     * create a short string based on a integer
-     *
-     * @see https://www.jwz.org/base64-shortlinks/
-     * @param string $id
-     * @return string
-     */
-    static function b64sl_pack_id(string $id): string {
-        $id = intval($id);
-        $ida = ($id > 0xFFFFFFFF ? $id >> 32 : 0);     // 32 bit big endian, top
-        $idb = ($id & 0xFFFFFFFF);                     // 32 bit big endian, bottom
-        $id = pack ('N', $ida) . pack ('N', $idb);
-        $id = preg_replace('/^\000+/', '', "$id");     // omit high-order NUL bytes
-        $id = base64_encode ($id);
-        $id = str_replace ('+', '-', $id);             // encode URL-unsafe "+" "/"
-        $id = str_replace ('/', '_', $id);
-        $id = preg_replace ('/=+$/', '', $id); // omit trailing padding bytes
-        return $id;
-    }
-
-    /**
-     * Decode a base64-encoded big-endian integer of up to 64 bits.
-     *
-     * @see https://www.jwz.org/base64-shortlinks/
-     * @param string $id
-     * @return string
-     */
-    static function b64sl_unpack_id(string $id): string {
-        $id = str_replace ('-', '+', $id);             // decode URL-unsafe "+" "/"
-        $id = str_replace ('_', '/', $id);
-        $id = base64_decode ($id);
-        while (strlen($id) < 8) { $id = "\000$id"; }   // pad with leading NULs
-        $a = unpack ('N*', $id);                       // 32 bit big endian
-        $id = ($a[1] << 32) | $a[2];                   // pack top and bottom word
-        return $id;
-    }
-
-    /**
-     * this only works with arrays and checking if the key is there and echo/return it.
-     *
-     * @param $array array
-     * @param $key string
-     * @return mixed
-     */
-    static function ifset(array $array, string $key) {
-        return $array[$key] ?? '';
-    }
+                       default:
+                               $pattern = '/[\p{L}\p{N}\p{P}\p{S}\p{Z}\p{M}\s]/u';
+               }
+
+               $value = preg_replace($pattern, '', $input);
+
+               if($value === "") {
+                       $ret = true;
+               }
+
+               if(!empty($limit) && is_numeric($limit)) {
+                       # isset starts with 0
+                       if(isset($input[$limit])) {
+                               # too long
+                               $ret = false;
+                       }
+               }
+
+               return $ret;
+       }
+
+       /**
+        * check if a string starts with a given string
+        *
+        * @param string $haystack
+        * @param string $needle
+        * @return boolean
+        */
+       static function startsWith(string $haystack, string $needle): bool {
+               $length = strlen($needle);
+               return (substr($haystack, 0, $length) === $needle);
+       }
+
+       /**
+        * check if a string ends with a given string
+        *
+        * @param string $haystack
+        * @param string $needle
+        * @return boolean
+        */
+       static function endsWith(string $haystack, string $needle): bool {
+               $length = strlen($needle);
+               if ($length == 0) {
+                       return true;
+               }
+
+               return (substr($haystack, -$length) === $needle);
+       }
+
+
+       /**
+        * create a short string based on a integer
+        *
+        * @see https://www.jwz.org/base64-shortlinks/
+        * @param string $id
+        * @return string
+        */
+       static function b64sl_pack_id(string $id): string {
+               $id = intval($id);
+               $ida = ($id > 0xFFFFFFFF ? $id >> 32 : 0);      // 32 bit big endian, top
+               $idb = ($id & 0xFFFFFFFF);                      // 32 bit big endian, bottom
+               $id = pack ('N', $ida) . pack ('N', $idb);
+               $id = preg_replace('/^\000+/', '', "$id");      // omit high-order NUL bytes
+               $id = base64_encode ($id);
+               $id = str_replace ('+', '-', $id);              // encode URL-unsafe "+" "/"
+               $id = str_replace ('/', '_', $id);
+               $id = preg_replace ('/=+$/', '', $id);  // omit trailing padding bytes
+               return $id;
+       }
+
+       /**
+        * Decode a base64-encoded big-endian integer of up to 64 bits.
+        *
+        * @see https://www.jwz.org/base64-shortlinks/
+        * @param string $id
+        * @return string
+        */
+       static function b64sl_unpack_id(string $id): string {
+               $id = str_replace ('-', '+', $id);              // decode URL-unsafe "+" "/"
+               $id = str_replace ('_', '/', $id);
+               $id = base64_decode ($id);
+               while (strlen($id) < 8) { $id = "\000$id"; }    // pad with leading NULs
+               $a = unpack ('N*', $id);                        // 32 bit big endian
+               $id = ($a[1] << 32) | $a[2];                    // pack top and bottom word
+               return $id;
+       }
+
+       /**
+        * this only works with arrays and checking if the key is there and echo/return it.
+        *
+        * @param $array array
+        * @param $key string
+        * @return mixed
+        */
+       static function ifset(array $array, string $key) {
+               return $array[$key] ?? '';
+       }
 }
index d5f6fbcfdae1a85c84442718926674009dc54067..eda863585de377e70ad9f4e5e56c84c005e26f9f 100644 (file)
@@ -1,3 +1,3 @@
-    </div>
+       </div>
 </body>
 </html>
index ee70071705c05f39364d2ca15a870ea377d9717e..1ac6045ea2d9e50300dd4c86d4b3ee1ee98ba9e0 100644 (file)
@@ -1,15 +1,14 @@
 <!DOCTYPE html>
 <html lang="<?php echo FE_LANG; ?>">
 <head>
-    <meta charset="utf-8">
-    <title><?php echo Summoner::ifset($TemplateData,'pageTitle').' - '; ?>emere</title>
-    <link rel="stylesheet" href="<?php echo PATH_WEBROOT; ?>/view/asset/milligram.min.css"/>
-    <link rel="stylesheet" href="<?php echo PATH_WEBROOT; ?>/view/asset/style.css"/>
+       <meta charset="utf-8">
+       <title><?php echo Summoner::ifset($TemplateData,'pageTitle').' - '; ?>emere</title>
+       <link rel="stylesheet" href="<?php echo PATH_WEBROOT; ?>view/asset/milligram.min.css"/>
+       <link rel="stylesheet" href="<?php echo PATH_WEBROOT; ?>view/asset/style.css"/>
 </head>
 <body>
        <div class="container">
+               <?php require_once 'view/_menu.php'; ?>
 
-            <?php require_once 'view/_menu.php'; ?>
-
-            <h1><?php echo Summoner::ifset($TemplateData,'pageTitle'); ?></h1>
-                       <?php require_once 'view/_message.php'; ?>
+               <h1><?php echo Summoner::ifset($TemplateData,'pageTitle'); ?></h1>
+               <?php require_once 'view/_message.php'; ?>
index d491c4bec356131b5adc38ce9e71d499c24533a3..f2dda0714e3f6929aaf4263d90ba0608979d88d6 100644 (file)
@@ -1,5 +1,5 @@
 <?php
 ?>
 <nav>
-    <a href="index.php">Home</a> | <a href="index.php?p=item">New</a> | <a href="index.php?p=list">Search</a>
+       <a href="index.php">Home</a> | <a href="index.php?p=item">New</a> | <a href="index.php?p=list">Search</a>
 </nav>
index 0ad66e08b294888f36658105cbbe0c6cf5efe109..08fbe1e89c14adbd72ccd608a60c00a4bd203427 100644 (file)
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 if(isset($TemplateData['message']['content']) && !empty($TemplateData['message']['content'])) {
-    $cssClass = 'blue-168';
-    $headline = 'Info';
-    if(isset($TemplateData['message']['status'])) {
-        switch($TemplateData['message']['status']) {
-            case 'error':
-                $cssClass = 'red-168';
-                $headline = 'Error';
-                break;
-            case 'warning':
-                $cssClass = 'yellow-168';
-                $headline = 'Warning';
-                break;
-            case 'success':
-                $cssClass = 'green-168';
-                $headline = 'Success';
-                break;
+       $cssClass = 'blue-168';
+       $headline = 'Info';
+       if(isset($TemplateData['message']['status'])) {
+               switch($TemplateData['message']['status']) {
+                       case 'error':
+                               $cssClass = 'red-168';
+                               $headline = 'Error';
+                               break;
+                       case 'warning':
+                               $cssClass = 'yellow-168';
+                               $headline = 'Warning';
+                               break;
+                       case 'success':
+                               $cssClass = 'green-168';
+                               $headline = 'Success';
+                               break;
 
-            case 'info':
-            default:
+                       case 'info':
+                       default:
 
-        }
-    }
-    ?>
-    <div class="<?php echo $cssClass; ?>">
-        <h3><?php echo $headline; ?></h3>
-        <p><?php echo $TemplateData['message']['content']; ?></p>
-    </div>
+               }
+       }
+       ?>
+       <div class="<?php echo $cssClass; ?>">
+               <h3><?php echo $headline; ?></h3>
+               <p><?php echo $TemplateData['message']['content']; ?></p>
+       </div>
 <?php } ?>
index 986385b3181a7637ff753b790328cbcbf4099d1e..290173366cf9df3688907d50413dd3833d6e47c3 100644 (file)
@@ -1,62 +1,62 @@
 <form method="post">
-    <fieldset>
-        <label for="receipt">Receipt <small>Just leave it blank to create a new based on date and market name.</small></label>
-        <input name="fdata[receipt]" id="receipt" type="text" list="receiptList" autocomplete="off"
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'receipt'); ?>" />
-        <datalist id="receiptList">
-            <option>Rewe</option>
-            <option>Lidl</option>
-        </datalist>
-
-        <label for="receiptdate">Date and time*</label>
-        <input name="fdata[receiptdate]" id="receiptdate" type="datetime-local" autocomplete="off" required
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'receiptdate'); ?>" />
-
-        <label for="market">Market*</label>
-        <input name="fdata[market]" id="market" type="text" list="marketList" autocomplete="off" required
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'market'); ?>" />
-        <datalist id="marketList">
-            <option>Rewe</option>
-            <option>Lidl</option>
-        </datalist>
-
-        <label for="product">Product*</label>
-        <input name="fdata[product]" id="product" type="text" list="productList" autocomplete="off" required
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'product'); ?>"/>
-        <datalist id="productList">
-            <option>Rewe</option>
-            <option>Lidl</option>
-        </datalist>
-
-        <label for="manufacturer">Manufacturer*</label>
-        <input name="fdata[manufacturer]" id="manufacturer" type="text" list="manufacturerList" autocomplete="off" required
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'manufacturer'); ?>"/>
-        <datalist id="manufacturerList">
-            <option>Rewe</option>
-            <option>Lidl</option>
-        </datalist>
-
-        <label for="weight">Weight(g)</label>
-        <input name="fdata[weight]" id="weight" type="number" autocomplete="off" lang="<?php echo NUMBER_INPUT_LANG; ?>"
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'weight'); ?>"/>
-
-        <label for="itemcount">Itemcount</label>
-        <input name="fdata[itemcount]" id="itemcount" type="number" autocomplete="off" lang="<?php echo NUMBER_INPUT_LANG; ?>"
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'itemcount'); ?>"/>
-
-        <label for="price">Price*</label>
-        <input name="fdata[price]" id="price" type="number" autocomplete="off" required
-               lang="<?php echo NUMBER_INPUT_LANG; ?>" step="0.01"
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'price'); ?>"/>
-
-        <label for="catalog">Catalog</label>
-        <input name="fdata[catalog]" id="catalog" type="text" list="catalogList" autocomplete="off"
-               value="<?php echo Summoner::ifset($TemplateData['editData'], 'catalog'); ?>"/>
-        <datalist id="catalogList">
-            <option>Rewe</option>
-            <option>Lidl</option>
-        </datalist>
-
-        <input type="submit" class="tui-button" value="Save" name="submitForm" />
-    </fieldset>
+       <fieldset>
+               <label for="receipt">Receipt <small>Just leave it blank to create a new based on date and market name.</small></label>
+               <input name="fdata[receipt]" id="receipt" type="text" list="receiptList" autocomplete="off"
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'receipt'); ?>" />
+               <datalist id="receiptList">
+                       <option>Rewe</option>
+                       <option>Lidl</option>
+               </datalist>
+
+               <label for="receiptdate">Date and time*</label>
+               <input name="fdata[receiptdate]" id="receiptdate" type="datetime-local" autocomplete="off" required
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'receiptdate'); ?>" />
+
+               <label for="market">Market*</label>
+               <input name="fdata[market]" id="market" type="text" list="marketList" autocomplete="off" required
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'market'); ?>" />
+               <datalist id="marketList">
+                       <option>Rewe</option>
+                       <option>Lidl</option>
+               </datalist>
+
+               <label for="product">Product*</label>
+               <input name="fdata[product]" id="product" type="text" list="productList" autocomplete="off" required
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'product'); ?>"/>
+               <datalist id="productList">
+                       <option>Rewe</option>
+                       <option>Lidl</option>
+               </datalist>
+
+               <label for="manufacturer">Manufacturer*</label>
+               <input name="fdata[manufacturer]" id="manufacturer" type="text" list="manufacturerList" autocomplete="off" required
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'manufacturer'); ?>"/>
+               <datalist id="manufacturerList">
+                       <option>Rewe</option>
+                       <option>Lidl</option>
+               </datalist>
+
+               <label for="weight">Weight(g)</label>
+               <input name="fdata[weight]" id="weight" type="number" autocomplete="off" lang="<?php echo NUMBER_INPUT_LANG; ?>"
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'weight'); ?>"/>
+
+               <label for="itemcount">Itemcount</label>
+               <input name="fdata[itemcount]" id="itemcount" type="number" autocomplete="off" lang="<?php echo NUMBER_INPUT_LANG; ?>"
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'itemcount'); ?>"/>
+
+               <label for="price">Price*</label>
+               <input name="fdata[price]" id="price" type="number" autocomplete="off" required
+                          lang="<?php echo NUMBER_INPUT_LANG; ?>" step="0.01"
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'price'); ?>"/>
+
+               <label for="catalog">Catalog</label>
+               <input name="fdata[catalog]" id="catalog" type="text" list="catalogList" autocomplete="off"
+                          value="<?php echo Summoner::ifset($TemplateData['editData'], 'catalog'); ?>"/>
+               <datalist id="catalogList">
+                       <option>Rewe</option>
+                       <option>Lidl</option>
+               </datalist>
+
+               <input type="submit" class="tui-button" value="Save" name="submitForm" />
+       </fieldset>
 </form>
index 82d64c814638244fbc59b1d0eee45f9eb7dafab1..e0d6b87cf53e9387142a98e6e1c9bcbaf56563d2 100644 (file)
@@ -4,13 +4,13 @@ $ItemInput = new ItemInput($DB);
 
 $_id = false;
 if(isset($_GET['id']) && !empty($_GET['id'])) {
-    $_id = trim($_GET['id']);
-    $_id = Summoner::validate($_id,'nospace') ? $_id : false;
+       $_id = trim($_GET['id']);
+       $_id = Summoner::validate($_id,'nospace') ? $_id : false;
 }
 
 $TemplateData['pageTitle'] = 'New item';
 if(!empty($_id)) {
-    $TemplateData['pageTitle'] = 'Edit item';
+       $TemplateData['pageTitle'] = 'Edit item';
 }
 
 $TemplateData['editData'] = array();
@@ -19,15 +19,17 @@ $TemplateData['message']['content'] = "";
 $TemplateData['message']['status'] = "";
 
 if(isset($_POST['fdata']) && !empty($_POST['fdata']) && isset($_POST['submitForm'])) {
-    $fdata = $_POST['fdata'];
-    if (!empty($fdata)) {
+       $fdata = $_POST['fdata'];
+       if (!empty($fdata)) {
+
+
 
                var_dump($fdata);
 
                $ItemInput->validateAndPrepare($fdata);
 
-    } else {
-        $TemplateData['message']['content'] = "Collection could not be loaded.";
-        $TemplateData['message']['status'] = "error";
-    }
+       } else {
+               $TemplateData['message']['content'] = "Collection could not be loaded.";
+               $TemplateData['message']['status'] = "error";
+       }
 }