diff --git a/html/Admin.php b/html/Admin.php index 15e34dd..e3b95c3 100644 --- a/html/Admin.php +++ b/html/Admin.php @@ -1,4 +1,7 @@ diff --git a/html/MeineSchichten.php b/html/MeineSchichten.php index 146ba44..5184d16 100644 --- a/html/MeineSchichten.php +++ b/html/MeineSchichten.php @@ -1,4 +1,7 @@ page = $step['page']; - } - if (isset($step['redirects'])) { - $this->redirects = $step['redirects']; - } - } - public function setCurrentStep() - { - if (!empty($this->redirects)) { - foreach ($this->redirects as $redirect) { - if (isset($redirect['==']) && isset($redirect['id'])) { - foreach ($redirect['=='] as $key => $value) { - if (isset($_POST[$key]) && $_POST[$key] == $value) { - $_POST['step'] = $redirect['id']; - if (isset($redirect['warning'])) { - $this->warning = $redirect['warning']; - } - return; - } - } - } - if (isset($redirect['!=']) && isset($redirect['id'])) { - foreach ($redirect['!='] as $key => $value) { - if (isset($_POST[$key]) && $_POST[$key] != $value) { - $_POST['step'] = $redirect['id']; - if (isset($redirect['warning'])) { - $this->warning = $redirect['warning']; - } - return; - } - } - } - if (isset($redirect['>']) && isset($redirect['id'])) { - foreach ($redirect['>'] as $key => $value) { - if (isset($_POST[$key]) && $_POST[$key] > $value) { - $_POST['step'] = $redirect['id']; - if (isset($redirect['warning'])) { - $this->warning = $redirect['warning']; - } - return; - } - } - } - if (isset($redirect['<']) && isset($redirect['id'])) { - foreach ($redirect['<'] as $key => $value) { - if (isset($_POST[$key]) && $_POST[$key] < $value) { - $_POST['step'] = $redirect['id']; - if (isset($redirect['warning'])) { - $this->warning = $redirect['warning']; - } - return; - } - } - } - if (isset($redirect['>=']) && isset($redirect['id'])) { - foreach ($redirect['>='] as $key => $value) { - if (isset($_POST[$key]) && $_POST[$key] >= $value) { - $_POST['step'] = $redirect['id']; - if (isset($redirect['warning'])) { - $this->warning = $redirect['warning']; - } - return; - } - } - } - if (isset($redirect['<=']) && isset($redirect['id'])) { - foreach ($redirect['<='] as $key => $value) { - if (isset($_POST[$key]) && $_POST[$key] <= $value) { - $_POST['step'] = $redirect['id']; - if (isset($redirect['warning'])) { - $this->warning = $redirect['warning']; - } - return; - } - } - } - } - } - } - public function setCode(callable $function) - { - $this->code = $function; - } -} +namespace Bengelsytem; + +require_once 'WizardStep.php'; class Wizard { diff --git a/html/WizardStep.php b/html/WizardStep.php new file mode 100644 index 0000000..d8dd487 --- /dev/null +++ b/html/WizardStep.php @@ -0,0 +1,97 @@ +page = $step['page']; + } + if (isset($step['redirects'])) { + $this->redirects = $step['redirects']; + } + } + public function setCurrentStep() + { + if (!empty($this->redirects)) { + foreach ($this->redirects as $redirect) { + if (isset($redirect['==']) && isset($redirect['id'])) { + foreach ($redirect['=='] as $key => $value) { + if (isset($_POST[$key]) && $_POST[$key] == $value) { + $_POST['step'] = $redirect['id']; + if (isset($redirect['warning'])) { + $this->warning = $redirect['warning']; + } + return; + } + } + } + if (isset($redirect['!=']) && isset($redirect['id'])) { + foreach ($redirect['!='] as $key => $value) { + if (isset($_POST[$key]) && $_POST[$key] != $value) { + $_POST['step'] = $redirect['id']; + if (isset($redirect['warning'])) { + $this->warning = $redirect['warning']; + } + return; + } + } + } + if (isset($redirect['>']) && isset($redirect['id'])) { + foreach ($redirect['>'] as $key => $value) { + if (isset($_POST[$key]) && $_POST[$key] > $value) { + $_POST['step'] = $redirect['id']; + if (isset($redirect['warning'])) { + $this->warning = $redirect['warning']; + } + return; + } + } + } + if (isset($redirect['<']) && isset($redirect['id'])) { + foreach ($redirect['<'] as $key => $value) { + if (isset($_POST[$key]) && $_POST[$key] < $value) { + $_POST['step'] = $redirect['id']; + if (isset($redirect['warning'])) { + $this->warning = $redirect['warning']; + } + return; + } + } + } + if (isset($redirect['>=']) && isset($redirect['id'])) { + foreach ($redirect['>='] as $key => $value) { + if (isset($_POST[$key]) && $_POST[$key] >= $value) { + $_POST['step'] = $redirect['id']; + if (isset($redirect['warning'])) { + $this->warning = $redirect['warning']; + } + return; + } + } + } + if (isset($redirect['<=']) && isset($redirect['id'])) { + foreach ($redirect['<='] as $key => $value) { + if (isset($_POST[$key]) && $_POST[$key] <= $value) { + $_POST['step'] = $redirect['id']; + if (isset($redirect['warning'])) { + $this->warning = $redirect['warning']; + } + return; + } + } + } + } + } + } + public function setCode(callable $function) + { + $this->code = $function; + } +} diff --git a/html/_crypt.php b/html/_crypt.php index dcb2ef3..ef33313 100644 --- a/html/_crypt.php +++ b/html/_crypt.php @@ -1,5 +1,7 @@