handle undert twelve

This commit is contained in:
Julian
2022-02-18 12:51:32 +01:00
parent b754ad3075
commit 3facf06568
11 changed files with 83 additions and 39 deletions

View File

@@ -6,6 +6,11 @@
npx http-server npx http-server
# Run php.exe test server:
C:\Users\gulum\OneDrive\Desktop\php\php.exe -S localhost:8000
Thanks for downloading this theme! Thanks for downloading this theme!
## Other Useful Links ## Other Useful Links

View File

@@ -1,7 +1,6 @@
<?php <?php
if (isset($_POST['submit'])) {
$name = $_REQUEST['fname']; $name = $_REQUEST['fname'];
$email = $_REQUEST['email']; $email = "test@test.de"; //$_REQUEST['email'];
$message = $_REQUEST['message']; $message = $_REQUEST['message'];
// Set your email address where you want to receive emails. // Set your email address where you want to receive emails.
@@ -11,4 +10,4 @@
$send_email = mail($to,$subject,$message,$headers); $send_email = mail($to,$subject,$message,$headers);
echo ($send_email) ? 'success' : 'error'; echo ($send_email) ? 'success' : 'error';
}?> ?>

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:8b36505be866c271ca1c559b3bcb4b739bfb6d9ba55d92267a439ae7f64007cc oid sha256:21005fed52833c74bc205a1612a927a2f67cea0d0b6435084ab472432eaa4bc9
size 166777 size 30135

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:27cf963c9543c1029ea236adffa1127389ef6c4067a8d3869396d12b02a1402a oid sha256:f5fda47e0ccf211d96b6f6dbdd8d8ef4d784df45881d6c544e33e9565ff08d43
size 2750814 size 84998

Binary file not shown.

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:e5ac99afd944feca3ad4e0afe44aa37ada74cb195346a97c3cb742c3d1445778 oid sha256:0e0cc51b6328260f5d07ff5a5b19902026c9f62ff7cf3e5c360d1730b60de7cd
size 4955034 size 88128

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:c9a0093d36ccb374f6b6623149b010431aa665102301c86aa4a24f25fdc6d84d oid sha256:da0e37f88022403babab49047d8c3de3d27ab71b957b5d078fdded1cbede8e0f
size 22588999 size 90542

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:bc0c8d49ba678d4e612a13982fa25784e072ccf19d2ba0400e5909b53903eb06 oid sha256:026c5f7c9a42e7f39ce6da62961ad2fb3643947ad1ad955486cf17b824087dd9
size 3779484 size 120736

Binary file not shown.

View File

@@ -105,20 +105,20 @@
<div class="couple-wrap animate-box"> <div class="couple-wrap animate-box">
<div class="couple-half"> <div class="couple-half">
<div class="groom"> <div class="groom">
<img src="images/Julian.png" alt="groom" class="img-responsive"> <img src="images/Draga.png" alt="groom" class="img-responsive">
</div> </div>
<div class="desc-groom"> <div class="desc-groom">
<h3>Julian Nießner</h3> <h3>Drazena Rimac</h3>
<p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove</p> <p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove</p>
</div> </div>
</div> </div>
<p class="heart text-center"><i class="icon-heart2"></i></p> <p class="heart text-center"><i class="icon-heart2"></i></p>
<div class="couple-half"> <div class="couple-half">
<div class="bride"> <div class="bride">
<img src="images/Draga.png" alt="groom" class="img-responsive"> <img src="images/Julian.png" alt="groom" class="img-responsive">
</div> </div>
<div class="desc-bride"> <div class="desc-bride">
<h3>Drazena Rimac</h3> <h3>Julian Nießner</h3>
<p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove</p> <p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove</p>
</div> </div>
</div> </div>
@@ -135,18 +135,18 @@
<div class="row form-group"> <div class="row form-group">
<div class="col-md-12"> <div class="col-md-12">
<label for="fname">Familienname</label> <label for="fname">Familienname</label>
<input type="text" id="fname" name="fname" class="form-control" placeholder="Your firstname"> <input type="text" id="fname" name="fname" class="form-control js-form-input" placeholder="Your firstname">
</div> </div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-md-12"> <div class="col-md-12">
<label for="message">Nachricht</label> <label for="message">Nachricht</label>
<textarea name="message" id="message" cols="30" rows="10" class="form-control" placeholder="Write us something"></textarea> <textarea name="message" id="message" cols="30" rows="10" class="form-control js-form-input" placeholder="Write us something"></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="submit" id="finalSubmit" value="Absenden" class="btn btn-primary"> <input type="submit" id="js-submitbtn" value="Absenden" class="btn btn-primary">
</div> </div>
</form> </form>
</div> </div>

View File

@@ -371,17 +371,59 @@
}()); }());
document.getElementById("finalSubmit").addEventListener("click", async function () { document.getElementById("js-submitbtn").addEventListener("click", async function () {
var form = document.getElementById("attendForm"); event.preventDefault();
const formattedFormData = new FormData(form);
//formattedFormData.append('property', 'value'); let inputs = document.querySelectorAll('.js-form-input');
const response = await fetch('email.php',{
method: 'POST', console.log(inputs);
body: formattedFormData let from = inputs[0].value;
}); let message = inputs[1].value;
const data = await response.text();
//This should later print out the values submitted through the form if(StringLengthLT2(from))
console.log(data); {
SubmitError("Name too short!");
return;
}
if(StringLengthLT2(message))
{
SubmitError("message too short!");
return;
}
let contact = {
from: from,
email: "none",
message: message,
};
const response = await fetch("https://rismer.de:9999/contact", {
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
//credentials: 'same-origin', // include, *same-origin, omit
headers: {
'Content-Type': 'application/json'
// 'Content-Type': 'application/x-www-form-urlencoded',
},
redirect: 'follow', // manual, *follow, error
referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
body: JSON.stringify(contact) // body data type must match "Content-Type" header
}).catch(function (timeout) { SubmitError("API error. Call the phone number."); });
console.log("Request: " + JSON.stringify(contact));
if(response.ok)
{
let jsonResponse = await response.json();
console.log("Response: " + jsonResponse);
SubmitSuccess();
}
else
{
SubmitError();
}
}); });
// document.getElementById("js-submitbtn").addEventListener("click", async function () { // document.getElementById("js-submitbtn").addEventListener("click", async function () {
@@ -527,8 +569,8 @@ document.getElementById("finalSubmit").addEventListener("click", async function
} }
async function SubmitSuccess() { async function SubmitSuccess() {
let title = 'Teilgenommen'; let title = 'Rückgemeldet';
let text = "Wir freuen uns auf euch!"; let text = "Nun gibt es kein zurück mehr!";
title = await translator.getTranslationByKey(document.documentElement.lang,"success_title"); title = await translator.getTranslationByKey(document.documentElement.lang,"success_title");
text = await translator.getTranslationByKey(document.documentElement.lang,"success_text"); text = await translator.getTranslationByKey(document.documentElement.lang,"success_text");
@@ -543,8 +585,6 @@ document.getElementById("finalSubmit").addEventListener("click", async function
//document.querySelector('#myfrm').submit(); // manully submit //document.querySelector('#myfrm').submit(); // manully submit
}).catch(function (timeout) { }); }).catch(function (timeout) { });
document.getElementById("attentant-container").remove();
document.getElementById("overnight-div").remove();
document.getElementById("js-submitbtn").disabled = 'true'; document.getElementById("js-submitbtn").disabled = 'true';
document.getElementById("js-submitbtn").textContent = await translator.getTranslationByKey(document.documentElement.lang,"already_participating"); document.getElementById("js-submitbtn").textContent = await translator.getTranslationByKey(document.documentElement.lang,"already_participating");
return; return;