/**
* This page can have several kinds of modes:
* case 1: mode is not set -> New item for the database (just for entering first time)
* case 2: mode is set to insert -> Item description is availabe, just checking the values before database entry
* case 3: mode is set to update -> update the items of this form, but check at first before database entry
* case 4: mode is set to erase -> delete a specific item out of the database
* case 5: mode is set to show -> just show the data, but no possibility to change it
* case 6: mode is set to edit -> likely the same like update but show at first the data just with update functionallity
* case 7: mode is set to erase -> same like delete, but from external call
*/
// Check form values if variable mode is set to "insert"
//------------------------------------------------------------------------------
if (!empty($mode)) {
    if ($mode != "show" && $mode != "edit" && $mode != "erase" && !$GO_BACK_TO_SEARCH) {
        // show or edit are external calls of this site
        if ($product_obj->check_form_variable($selian_item_number)) {
            if ($debug) {
                echo "ERROR: <b>Selian item Number is empty</b>";
            }
            $ERROR = TRUE;
            print_r($_GET);
            $ERROR_SELIAN_ITEM_NUMBER = TRUE;
        }
        if ($mode == "insert") {
            if ($product_obj->check_form_variable($selians_item_description)) {
                $ERROR = TRUE;
                $ERROR_SELIANS_ITEM_DESCRIPTION = TRUE;
            }
        }
        if ($ERROR) {
            $ERROR_MSG .= "THERE ARE SOME IMPORTANT FIELDS MISSING! MISSING FIELDS ARE MARKED<br>";