コード例 #1
0
            } else {
                $action = 'create';
            }
        } else {
            header("Location: ./fiscalyear.php");
            exit;
        }
    } else {
        if ($action == 'update') {
            if (!GETPOST('cancel', 'alpha')) {
                $result = $object->fetch($id);
                $object->date_start = empty($_POST["fiscalyear"]) ? '' : $date_start;
                $object->date_end = empty($_POST["fiscalyearend"]) ? '' : $date_end;
                $object->label = GETPOST('label', 'alpha');
                $object->statut = GETPOST('statut', 'int');
                $result = $object->update($user);
                if ($result > 0) {
                    header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
                    exit;
                } else {
                    setEventMessage($object->error, 'errors');
                }
            } else {
                header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
                exit;
            }
        }
    }
}
/*
 * View