PATH:
root
/
wulkantemplates
<?php $class = "page"; include_once "begin.php"; $messages = [ "ready" => "", "sending" => "Wysyłanie", "send-success" => "Wiadomość została wysłana", "send-error" => "Błąd wysyłania", "verification-error" => "Błąd weryfikacji", "not-send" => "Problem z rozpoczęciem wysłania" ]; $_SESSION['form'] = array_merge([ "name" => false, "phone" => false, "mail" => false, "security" => false, "message" => false, "check" => false, "submit" => false, "state" => "ready" ], isset($_SESSION['form']) ? $_SESSION['form'] : []); if (isset($_POST['form']) && $_SESSION['form']['state'] == "ready") { $_SESSION['form'] = array_merge($_SESSION['form'], [ "name" => isset($_POST["form"]["name"]) ? $_POST["form"]["name"] : false, "phone" => isset($_POST["form"]["phone"]) ? $_POST["form"]["phone"] : false, "mail" => isset($_POST["form"]["mail"]) ? $_POST["form"]["mail"] : false, "security" => isset($_POST["form"]["security"]) ? $_POST["form"]["security"] : false, "message" => isset($_POST["form"]["message"]) ? $_POST["form"]["message"] : false, "check" => isset($_POST["form"]["check"]) ? $_POST["form"]["check"] : false, "submit" => isset($_POST["form"]["submit"]) ? $_POST["form"]["submit"] : false, "state" => "sending" ]); header("Location: {$_SERVER['REQUEST_URI']}"); } ?> <main class="main main--<?php echo $class . ($id_menu == 9 ? " main--contact" : ""); ?>"> <div class="page-padding"> <section class="container-margin container"> <?php if ($id_menu == 9) { ?> <div class="main__left"> <?php } if ($currentPageInfo['tekst'] > 0) { echo $teksty[$currentPageInfo['tekst']]; } if ($id_menu == 9) { $a = isset($_POST['form']['a']) ? intval($_POST['form']['a']) % 10 : rand(0, 5); $b = isset($_POST['form']['b']) ? intval($_POST['form']['b']) % 10 : rand(0, 4); $formReadOnly = ""; if ($_SESSION['form']['state'] != "ready" && $_SESSION['form']['state'] != "verification-error" && $_SESSION['form']['state'] != "send-error" && $_SESSION['form']['state'] != "not-send") $formReadOnly = " readonly=\"readonly\" disabled=\"disabled\""; else $_SESSION['security'] = ["a" => $a, "b" => $b]; ?> </div> <div class="two-form__form"> <h2><?php echo CONTACT_FORM; ?></h2> <form class="form__contact" name="contact-form" method="POST" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> <input type="hidden" name="form[a]" value="<?php echo $a; ?>"> <input type="hidden" name="form[b]" value="<?php echo $b; ?>"> <label> <?php echo FORM_FULL_NAME; ?></label> <input name="form[name]" type="text" required="required"<?php echo $formReadOnly . ($_SESSION['form']['name'] ? " value=\"{$_SESSION['form']['name']}\"" : ""); ?>> <label> <?php echo FORM_PHONE; ?></label> <input name="form[phone]" type="text" <?php echo $formReadOnly . ($_SESSION['form']['phone'] ? " value=\"{$_SESSION['form']['phone']}\"" : ""); ?>> <label> <?php echo FORM_MAIL; ?></label> <input name="form[mail]" type="text" required="required"<?php echo $formReadOnly . ($_SESSION['form']['mail'] ? " value=\"{$_SESSION['form']['mail']}\"" : ""); ?>> <label><?php echo FORM_MESSAGE_CONTENT; ?></label> <textarea name="form[message]" required="required"<?php echo $formReadOnly; ?>><?php if ($_SESSION['form']['message']) echo $_SESSION['form']['message']; ?></textarea> <label><?php echo FORM_SECURITY; ?></label> <input name="form[security]" type="text" placeholder="<?php printf(FORM_SECURITY_QUESTION, $a, $b); ?>" required="required" autocomplete="off"<?php echo $formReadOnly . ($_SESSION['form']['security'] && $_SESSION['form']['state'] == "send-success" ? " value=\"{$_SESSION['form']['security']}\"" : ""); ?>> <input class="btn-send" name="form[submit]" type="submit" value="<?php echo FORM_SUBMIT; ?>"<?php echo $formReadOnly; ?>> </br> <div class="container-checkbox"> <label class="label-c"> <input type="checkbox" name="form[check]" required="required" value="zgoda"> <?php echo FORM_ZGODA; ?> <span class="checkmark"></span></label> </div> </form><?php if ($_SESSION['form']['state'] == "sending") { require_once "form-send.php"; } ?> <p class="form__message message-<?php echo $_SESSION['form']['state']; ?>"><?php echo isset($messages[$_SESSION['form']['state']]) ? $messages[$_SESSION['form']['state']] : ""; ?></p> </div> <?php ?> <?php } ?> </section> </div> </main><?php if ($id_menu == 9) { ?> <section> </section><?php } include_once "footer.php"; if ($_SESSION['form']['state'] != "ready" && !isset($_POST['form'])) unset($_SESSION['form']); ?> <script src="https://www.google.com/recaptcha/api.js" async defer></script> </body> </html>
[-] gallery.php
[edit]
[-] form-send2.php
[edit]
[-] paginator.php
[edit]
[+]
..
[-] form.php
[edit]
[-] page-multi.php
[edit]
[-] header.php
[edit]
[-] produkty.php
[edit]
[-] top.php
[edit]
[-] form-send.php
[edit]
[-] category.php
[edit]
[-] home.php
[edit]
[-] footer.php
[edit]
[-] page-m.php
[edit]
[-] page.php
[edit]
[-] jakosc.php
[edit]
[-] news.php
[edit]
[-] page-m2.php
[edit]
[-] page-work.php
[edit]
[-] ajax_more.php
[edit]
[-] begin.php
[edit]
[-] realizations.php
[edit]